31 #include "EventAction.hh"
34 #include "PrimaryGeneratorAction.hh"
35 #include "HistoManager.hh"
44 :detector(det), primary(prim)
88 kFiber = 1000*kLayer + iFiber;
99 Run* run =
static_cast<Run*
>(
115 std::map<G4int,G4double>::iterator 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";
139 std::ofstream File(fileName, std::ios::app);
140 std::ios::fmtflags mode = File.flags();
141 File.setf( std::ios::scientific, std::ios::floatfield );
154 File << ekin <<
" " << direction <<
" " << position <<
G4endl;
160 std::map<G4int,G4double>::iterator 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);
static G4RunManager * GetRunManager()
void EndOfEventAction(const G4Event *)
DetectorConstruction * detector
std::map< G4int, G4double > EvisFiber
void BeginOfEventAction(const G4Event *)
G4ParticleGun * GetParticleGun()
void SumDeStep(G4int, G4int, G4int, G4double)
void SumEvents_2(G4double, G4double, G4double)
void SumEvents_1(G4int, G4double, G4double)
The primary generator action class with particle gun.
G4CsvAnalysisManager G4AnalysisManager
G4Run * GetNonConstCurrentRun() const
G4ThreeVector GetParticlePosition()
G4double GetParticleEnergy() const
void WriteFibers(const G4Event *)
PrimaryGeneratorAction * primary
G4ParticleMomentum GetParticleMomentumDirection() const
std::vector< G4double > EtotLayer
Simple detector construction with a box volume placed in a world.
std::vector< G4double > EvisLayer