00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef TStandard_Analysis_hh
00027 #define TStandard_Analysis_hh
00028
00029 extern bool gMyDebug ;
00030
00031
00032 class TStandard_Analysis_Messenger ;
00033
00034 #include "G4UserRunAction.hh"
00035 #include "G4Run.hh"
00036 #include "G4UserEventAction.hh"
00037 #include "G4EventManager.hh"
00038 #include "G4Event.hh"
00039 #include "G4Step.hh"
00040 #include "G4Track.hh"
00041
00042 #include "G4SDManager.hh"
00043 #include "G4HCofThisEvent.hh"
00044 #include "G4VHitsCollection.hh"
00045
00046 #include "G4VUserPhysicsList.hh"
00047 #include "G4UnitsTable.hh"
00048 #include "G4ParticleTable.hh"
00049
00050 #include "G4VVisManager.hh"
00051 #include "G4TrajectoryContainer.hh"
00052 #include "G4Trajectory.hh"
00053
00054 #include "G4Timer.hh"
00055
00056 #include "TTree.h"
00057 #include "TFile.h"
00058 #include "TString.h"
00059 #include "TParameter.h"
00060 #include "TSystem.h"
00061 #include <vector>
00062
00063 #include "TAlphaRad_DetectorConstruction.hh"
00064 #include "TGPS_PrimaryGeneratorAction.hh"
00065 #include "TStandard_Hit.hh"
00066
00067 #include "TMyRootEvent.hpp"
00068
00069
00070 class TStandard_Analysis
00071 {
00072
00073 private :
00074
00075 TAlphaRad_DetectorConstruction* fTAlphaRad_DetectorConstruction ;
00076 TGPS_PrimaryGeneratorAction* fTGPS_PrimaryGeneratorAction ;
00077
00078 TStandard_Analysis_Messenger* fTStandard_Analysis_msg ;
00079
00080 TMyRootEvent* fTMyRootEvent ;
00081 TFile* fRootFout ; TString fRootFoutName ;
00082 TTree* fRootTree ;
00083 G4int fNCells ;
00084 TParameter<long> *fNInitialParticles ;
00085
00086
00087
00088 G4int fRunNumber ;
00089 G4long fNEvents ;
00090 G4long fEventNumber ;
00091 G4Timer *fTimer_run, *fTimer_tot ;
00092
00093
00094
00095 G4HCofThisEvent *fHCE ;
00096 G4int fNHits ;
00097 TStandard_Hit* fHit ;
00098
00099 G4SDManager *fSDManager ;
00100 G4int* fCell_HC_ID ;
00101 THitsCollection** fCell_HC ;
00102
00103 G4int fTrackID ;
00104 std::vector<G4int> *fTrackIDarray ;
00105
00106 G4int fNHitsPerParticlePerCell ;
00107 G4double fEdep, fDose, fRangeTot, fRangeProj, fRangeProjZ ;
00108 G4double fEdep_cumul, fDose_cumul, fRangeTot_cumul, fRangeProj_cumul, fRangeProjZ_cumul ;
00109 G4ThreeVector fDirection_ref, fDirection_z ;
00110
00111
00112
00113 G4bool fHasEnteredTheDetector ;
00114 G4String fParticleName ;
00115 G4String fVolumeName ;
00116
00117
00118 public :
00119
00120 TStandard_Analysis ( TAlphaRad_DetectorConstruction* theTAlphaRad_DetectorConstruction , TGPS_PrimaryGeneratorAction* theTGPS_PrimaryGeneratorAction ) ;
00121 ~TStandard_Analysis () ;
00122
00123 void BeginOfRun ( const G4Run* aRun ) ;
00124 void EndOfRun ( const G4Run* aRun ) ;
00125 void BeginOfEvent ( const G4Event* aEvent ) ;
00126 void EndOfEvent ( const G4Event* aEvent ) ;
00127 void Stepping ( const G4Step* aStep ) ;
00128
00129 void SetRootFileName ( G4String aFileName ) ;
00130
00131 } ;
00132
00133
00134 #endif