31 #include "EventAction.hh"
34 #include "PrimaryGeneratorAction.hh"
35 #include "HistoManager.hh"
44 :detector(det), primary(prim)
48 kLayerMax = nbOfModules*nbOfLayers + 1;
50 EtotCalor = EvisCalor = 0.;
63 EtotLayer.resize(kLayerMax);
64 EvisLayer.resize(kLayerMax);
65 for (
G4int k=0; k<kLayerMax; k++) {
66 EtotLayer[k] = EvisLayer[k] = 0.0;
68 EtotCalor = EvisCalor = 0.;
77 if (iModule > 0) EtotCalor += deStep;
81 kLayer = (iModule-1)*nbOfLayers + iLayer;
82 EtotLayer[kLayer] += deStep;
86 EvisLayer[kLayer] += deStep;
88 kFiber = 1000*kLayer + iFiber;
89 EvisFiber[kFiber] += deStep;
99 Run* run =
static_cast<Run*
>(
102 for (
G4int k=0; k<kLayerMax; k++) {
107 analysisManager->FillH1(1,EtotCalor);
108 analysisManager->FillH1(2,EvisCalor);
115 std::map<G4int,G4double>::iterator it;
116 for (it = EvisFiber.begin(); it != EvisFiber.end(); it++) {
117 G4int kFiber = it->first;
118 G4int iFiber = kFiber%1000;
120 analysisManager->FillH1(5,iFiber+0.5,Evis);
136 G4String name = G4AnalysisManager::Instance()->GetFileName();
137 G4String fileName = name +
".fibers.ascii";
140 std::ios::fmtflags mode = File.flags();
141 File.setf( std::ios::scientific, std::ios::floatfield );
154 File << ekin <<
" " << direction <<
" " << position <<
G4endl;
158 File << EvisFiber.size() <<
G4endl;
160 std::map<G4int,G4double>::iterator it;
161 for (it = EvisFiber.begin(); it != EvisFiber.end(); it++) {
162 G4int kFiber = it->first;
164 File <<
" " << std::setw(7) << kFiber <<
" "<< std::setw(10) << Evis
171 File.setf(mode,std::ios::floatfield);
172 File.precision(prec);
The primary generator action class with particle gun.
void BeginOfEventAction(const G4Event *)
void SumEvents_2(G4double, G4double, G4double)
void WriteFibers(const G4Event *)
void SumDeStep(G4int, G4int, G4int, G4double)
G4ThreeVector GetParticlePosition()
void EndOfEventAction(const G4Event *)
G4ParticleMomentum GetParticleMomentumDirection() const
static G4RunManager * GetRunManager()
void SumEvents_1(G4int, G4double, G4double)
G4ParticleGun * GetParticleGun()
Detector construction class to define materials and geometry.
G4CsvAnalysisManager G4AnalysisManager
G4Run * GetNonConstCurrentRun() const
G4double GetParticleEnergy() const