// Geant4 simulation for MuSR // AUTHOR: Toni SHIROKA, Paul Scherrer Institut, PSI // DATE : 2008-05 // //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... #ifndef lem4RootOutput_h #define lem4RootOutput_h 1 //#include "G4UserRunAction.hh" #include "globals.hh" #include "G4ThreeVector.hh" // ROOT #include "TFile.h" #include "TTree.h" #include "TH1.h" #include "TH2.h" #include "TVectorD.h" // #include //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... class lem4RootOutput { public: lem4RootOutput(); ~lem4RootOutput(); static lem4RootOutput* GetRootInstance(); public: void BeginOfRunAction(); void EndOfRunAction(); void FillEvent(); void ClearAllRootVariables(); // void SetSensitiveDetectorMapping(std::string logivol, int volumeID); void SetVolumeIDMapping(std::string logivol, int volumeID); G4int ConvertVolumeToID(std::string logivol); void SetSpecialSaveVolumeDefined() {boolIsAnySpecialSaveVolumeDefined=true;}; // Getting variables (just for debugging) G4double GetDecayPositionZ() {return muDecayPosZ_t;}; G4double GetDecayTime() {return muDecayTime_t*microsecond;}; G4double GetTimeInTarget() {return muTargetTime_t*microsecond;}; // Setting variables common to the whole event: void SetRunID (G4int id) {runID_t = id;}; void SetEventID (G4int id) {eventID_t = id;}; void SetDecayDetectorID (std::string detectorName) {muDecayDetID_t = SensDetectorMapping[detectorName];}; void SetBField (G4double F[6]) {B_t[0]=F[0]/tesla; B_t[1]=F[1]/tesla; B_t[2]=F[2]/tesla; B_t[3]=F[3]/tesla; B_t[4]=F[4]/tesla; B_t[5]=F[5]/tesla;}; void SetDecayPolarisation (G4ThreeVector pol) {muDecayPolX_t=pol.x(); muDecayPolY_t=pol.y(); muDecayPolZ_t=pol.z();}; void SetDecayPosition (G4ThreeVector pos) {muDecayPosX_t=pos.x()/mm; muDecayPosY_t=pos.y()/mm; muDecayPosZ_t=pos.z()/mm;}; void SetGlobTime (G4double gt) {globalTime_t = gt/microsecond;}; void SetDetectorInfo (G4int nDetectors, G4int ID, G4double edep, G4double edep_el, G4double edep_pos, G4double edep_gam, G4double edep_mup,G4int nsteps, G4double length, G4double t1, G4double t2, G4double x, G4double y, G4double z) { if ((nDetectors<0)||(nDetectors>=(det_nMax-1))) { G4cout<<"SERIOUS ERROR! lem4RootOutput.hh: nDetectors="< SensDetectorMapping; }; //G4int lem4RootOutput::maxNSubTracks=30; //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... #endif