35 #include "DetectorConstruction.hh"
36 #include "PrimaryGeneratorAction.hh"
37 #include "HistoManager.hh"
134 const Run* localRun =
static_cast<const Run*
>(run);
162 G4cout <<
"Histo: End of run actions are started" <<
G4endl;
165 G4cout<<
"========================================================"<<
G4endl;
167 if(
fNevt > 0) { x = 1.0/
x; }
178 G4cout <<
"Number of events "
181 << std::setprecision(4) <<
"Average number of e- "
184 << std::setprecision(4) <<
"Average number of gamma "
187 << std::setprecision(4) <<
"Average number of e+ "
190 << std::setprecision(4) <<
"Average number of steps in the phantom "
193 << std::setprecision(4) <<
"Average number of e- steps in the target "
196 << std::setprecision(4) <<
"Average number of g produced in the target "
199 << std::setprecision(4) <<
"Average number of e- produced in the target "
202 << std::setprecision(4) <<
"Average number of g produced in the phantom "
205 << std::setprecision(4) <<
"Average number of e- produced in the phantom "
208 << std::setprecision(4) <<
"Total fGamma fluence in front of the phantom "
210 G4cout<<
"========================================================"<<
G4endl;
230 if(nr > 0.0) { nr = 1./nr; }
234 if(nr > 0.0) { nr = 1./nr; }
245 "Cannot write ROOT file.");
247 G4cout <<
"### Histo::Save: Histograms are saved" <<
G4endl;
317 G4cout <<
"TrackingAction: Primary "
321 <<
"; pos= " << pos <<
"; dir= " << dir <<
G4endl;
325 else if (0 < pid && particle ==
fElectron)
328 G4cout <<
"TrackingAction: Secondary electron " <<
G4endl;
336 else if (0 < pid && particle ==
fPositron) {
338 G4cout <<
"TrackingAction: Secondary positron " <<
G4endl;
344 else if (0 < pid && particle ==
fGamma) {
346 G4cout <<
"TrackingAction: Secondary gamma; parentID= " << pid
366 if(bin1 >= fNBinsR) { bin1 = fNBinsR-1; }
368 G4AnalysisManager::Instance()->FillH1(
fHistoId[6],e,1.0);
382 G4cout <<
"Histo: edep(MeV)= " << edep/
MeV <<
" at binz= " << nzbin
383 <<
" r1= " << r1 <<
" z1= " << z1
384 <<
" r2= " << r2 <<
" z2= " << z2
385 <<
" r0= " << r0 <<
" z0= " << z0
390 if(bin >= fNBinsR) { bin = fNBinsR-1; }
395 G4AnalysisManager::Instance()->FillH1(
fHistoId[0],r0,w);
396 G4AnalysisManager::Instance()->FillH1(
fHistoId[1],r0,w);
397 G4AnalysisManager::Instance()->FillH1(
fHistoId[2],r0,w);
406 G4AnalysisManager::Instance()->FillH1(
fHistoId[3],z0,edep);
409 if(r2 > fStepR) { w *= (fStepR - r1)/(r2 - r1); }
410 G4AnalysisManager::Instance()->FillH1(
fHistoId[4],z0,w);
429 G4double rr2 = r1 + dr*(zz2-zz1)/dz;
430 for(bin=bin1; bin<=bin2; bin++) {
434 { G4AnalysisManager::Instance()->FillH1(
fHistoId[3],zf,de); }
437 if(rr2 > fStepR) w *= (fStepR - rr1)/(rr2 - rr1);
438 { G4AnalysisManager::Instance()->FillH1(
fHistoId[4],zf,w); }
444 rr2 = rr1 + dr*(zz2 - zz1)/dz;
const G4ThreeVector & GetVertexPosition() const
G4double GetKineticEnergy() const
void ScoreNewTrack(const G4Track *aTrack)
const G4VPhysicalVolume * fTarget2
static const G4double pos
DetectorConstruction * fDetector
static constexpr double MeV
void AddPhantomGamma(G4double e, G4double r)
std::vector< G4int > fHistoId
const G4VPhysicalVolume * GetTarget2() const
static constexpr double mm
G4AnalysisManager * fAnalysisManager
const G4String & GetParticleName() const
const G4ParticleDefinition * GetParticleDefinition() const
G4double GetMaxEnergy() const
std::vector< G4int > GetHistoIdentifiers() const
const G4VPhysicalVolume * fTarget1
void AddTargetPhoton(const G4DynamicParticle *)
const G4VPhysicalVolume * GetCheckVolume() const
void AddPhantomElectron(const G4DynamicParticle *)
const G4VPhysicalVolume * GetPhantom() const
const G4VPhysicalVolume * fPhantom
G4double GetScoreZ() const
const G4VPhysicalVolume * fCheckVolume
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
virtual void Merge(const G4Run *)
static G4Positron * Positron()
The primary generator action class with particle gun.
const G4VPhysicalVolume * GetGasVolume() const
void AddPhantomStep(G4double e, G4double r1, G4double z1, G4double r2, G4double z2, G4double r0, G4double z0)
static G4Electron * Electron()
const G4VPhysicalVolume * fGasVolume
const G4VPhysicalVolume * GetTarget1() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4int GetNumberDivZ() const
G4double GetAbsorberZ() const
G4double GetAbsorberR() const
G4double GetKineticEnergy() const
G4int GetNumberDivE() const
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
void AddTargetElectron(const G4DynamicParticle *)
const G4ParticleDefinition * fElectron
void Update(DetectorConstruction *det, bool bForceActivation=false)
virtual void Merge(const G4Run *)
void AddPhantomPhoton(const G4DynamicParticle *)
const G4ThreeVector & GetMomentumDirection() const
G4int GetNumberDivR() const
const G4ParticleDefinition * fGamma
static constexpr double cm3
const G4DynamicParticle * GetDynamicParticle() const
Simple detector construction with a box volume placed in a world.
static constexpr double pi
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4VPhysicalVolume * GetVolume() const
G4bool GetVerbose() const
G4int GetParentID() const
const G4ParticleDefinition * fPositron