Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Run Class Reference

#include <Run.hh>

Inheritance diagram for Run:
Collaboration diagram for Run:

Public Member Functions

 Run (DetectorConstruction *)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void SumEvents_1 (G4int, G4double, G4double)
 
void SumEvents_2 (G4double, G4double, G4double)
 
void DetailedLeakage (G4int, G4double)
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run (DetectorConstruction *)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void CountTraks0 (G4int nt)
 
void CountTraks1 (G4int nt)
 
void CountSteps0 (G4int ns)
 
void CountSteps1 (G4int ns)
 
void CountProcesses (G4String procName)
 
void AddEdep (G4double val)
 
void AddTrueRange (G4double l)
 
void AddProjRange (G4double x)
 
void AddTransvDev (G4double y)
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run (DetectorConstruction *detector)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void AddEdep (G4int i, G4double e)
 
void AddTotEdep (G4double e)
 
void AddTrackLength (G4double t)
 
void AddProjRange (G4double x)
 
void AddStepSize (G4int nb, G4double st)
 
void AddTrackStatus (G4int i)
 
void SetCsdaRange (G4int i, G4double value)
 
void SetXfrontNorm (G4int i, G4double value)
 
G4double GetCsdaRange (G4int i)
 
G4double GetXfrontNorm (G4int i)
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run (DetectorConstruction *detector)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void AddEdep (G4double e)
 
void AddTrackLength (G4double t)
 
void AddProjRange (G4double x)
 
void AddStepSize (G4int nb, G4double st)
 
void SetCsdaRange (G4double value)
 
G4double GetCsdaRange ()
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run (DetectorConstruction *)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void CountProcesses (G4String procName)
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run (DetectorConstruction *)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void CountProcesses (G4String procName)
 
void SumTrack (G4double track)
 
void SumeTransf (G4double energy)
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run ()
 
 ~Run ()
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run (DetectorConstruction *, PrimaryGeneratorAction *)
 
virtual ~Run ()
 
virtual void Merge (const G4Run *)
 
void InitializePerEvent ()
 
void FillPerEvent ()
 
void FillPerTrack (G4double, G4double)
 
void FillPerStep (G4double, G4int, G4int)
 
void AddStep (G4double q)
 
void EndOfRun (G4double edep, G4double rms, G4double &limit)
 
void SetVerbose (G4int val)
 
 Run (DetectorConstruction *)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void FillPerEvent (G4int, G4double, G4double)
 
void SumEnergyFlow (G4int plane, G4double Eflow)
 
void SumLateralEleak (G4int cell, G4double Eflow)
 
void AddChargedStep ()
 
void AddNeutralStep ()
 
void AddSecondaryTrack (const G4Track *)
 
void SetEdepAndRMS (G4int, G4double, G4double, G4double)
 
void SetApplyLimit (G4bool)
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run (DetectorConstruction *)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void AddEnergy (G4double edep)
 
void AddTrakLenCharg (G4double length)
 
void AddTrakLenNeutr (G4double length)
 
void AddMscProjTheta (G4double theta)
 
void CountStepsCharg (G4int nSteps)
 
void CountStepsNeutr (G4int nSteps)
 
void CountParticles (G4ParticleDefinition *part)
 
void CountTransmit (G4int flag)
 
void CountReflect (G4int flag)
 
void AddEnergyLeak (G4double eleak, G4int index)
 
G4double ComputeMscHighland ()
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run ()
 
virtual ~Run ()
 
virtual void Merge (const G4Run *)
 
void BeginOfRun ()
 
void EndOfRun ()
 
void BeginOfEvent ()
 
void EndOfEvent ()
 
void AddEnergy (G4double edep, const G4Step *)
 
void SetVerbose (G4int value)
 
G4int GetVerbose () const
 
G4double GetTotStepGas () const
 
G4double GetTotCluster () const
 
G4double GetMeanCluster () const
 
const G4StatDoubleGetStat () const
 
 Run (DetectorConstruction *)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void SetTargetXXX (G4bool)
 
void CountProcesses (G4VProcess *process)
 
void SumTrack (G4double)
 
void CountNuclearChannel (G4String, G4double)
 
void ParticleCount (G4String, G4double)
 
void Balance (G4double)
 
void CountGamma (G4int)
 
virtual void Merge (const G4Run *)
 
void EndOfRun (G4bool)
 
 Run (DetectorConstruction *)
 
 ~Run ()
 
void CountProcesses (const G4VProcess *process)
 
void ParticleCount (G4String, G4double)
 
void SumTrackLength (G4int, G4int, G4double, G4double, G4double, G4double)
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void EndOfRun ()
 
virtual void Merge (const G4Run *)
 
 Run (DetectorConstruction *)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void CountProcesses (const G4VProcess *process)
 
void ParticleCount (G4String, G4double)
 
void AddEdep (G4double edep)
 
void AddEflow (G4double eflow)
 
void ParticleFlux (G4String, G4double)
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run (DetectorConstruction *detector)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void CountProcesses (const G4VProcess *process)
 
void ParticleCount (G4int, G4String, G4double)
 
void AddEdep (G4int i, G4double e)
 
void AddTotEdep (G4double e)
 
void AddTrackStatus (G4int i)
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run (DetectorConstruction *)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void CountProcesses (const G4VProcess *process)
 
void ParticleCount (G4String, G4double)
 
void AddEdep (G4double edep)
 
void AddEflow (G4double eflow)
 
void ParticleFlux (G4String, G4double)
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run ()
 
virtual ~Run ()
 
virtual void RecordEvent (const G4Event *)
 
virtual void Merge (const G4Run *)
 
G4double GetSumDose () const
 
G4VPrimitiveScorerGetPrimitiveScorer () const
 
 Run (const DetectorConstruction *detector)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void AddEdep (G4double e)
 
void AddTrackLength (G4double t)
 
void AddProjRange (G4double x)
 
void AddPenetration (G4double x)
 
void AddStepSize (G4int nb, G4double st)
 
G4double GetEdep () const
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run (const DetectorConstruction *detector)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void AddEdep (G4double e)
 
void AddTrackLength (G4double t)
 
void AddProjRange (G4double x)
 
void AddStepSize (G4int nb, G4double st)
 
G4double GetEdep () const
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run (const DetectorConstruction *detector)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void AddInelastic (G4int nb)
 
void AddEdep (G4double e)
 
void AddTrackLength (G4double t)
 
void AddProjRange (G4double x)
 
void AddStepSize (G4int nb, G4double st)
 
G4double GetEdep () const
 
G4double GetInelastic () const
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run (DetectorConstruction *)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle)
 
void EndOfRun ()
 
void SumFluence (G4double, G4double)
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
virtual void Merge (const G4Run *)
 
 Run (DetectorConstruction *, PrimaryGeneratorAction *)
 
 ~Run ()
 
virtual void Merge (const G4Run *)
 
void SurveyConvergence (G4int)
 
void EndOfRun ()
 
void CountProcesses (G4String)
 
void SumEsecond (G4double e)
 
void FlowInCavity (G4int k, G4double e)
 
void AddEdepCavity (G4double de)
 
void AddTrakCavity (G4double dt)
 
void StepInWall (G4double s)
 
void StepInCavity (G4double s)
 
 Run (DetectorConstruction *det, PrimaryGeneratorAction *, bool isMaster)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void CountProcesses (G4String)
 
void SurveyConvergence (G4int)
 
void FlowInCavity (G4int k, G4double e)
 
void AddEdepCavity (G4double de)
 
void AddTrakCavity (G4double dt)
 
void StepInWall (G4double s)
 
void StepInCavity (G4double s)
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
 Run ()
 
virtual ~Run ()
 
void Merge (const G4Run *)
 
G4int GetCounter () const
 
 Run ()
 
 ~Run ()
 
void ParticleCount (G4String, G4double)
 
void Balance (G4double, G4double)
 
void EventTiming (G4double)
 
void PrimaryTiming (G4double)
 
void EvisEvent (G4double)
 
void SetTimeWindow (G4double, G4double)
 
void CountInTimeWindow (G4String, G4bool, G4bool, G4bool)
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void EndOfRun ()
 
virtual void Merge (const G4Run *)
 
 Run (DetectorConstruction *)
 
 ~Run ()
 
void SetPrimary (G4ParticleDefinition *particle, G4double energy)
 
void CountProcesses (const G4VProcess *process, G4int iVol)
 
void ParticleCount (G4String, G4double, G4int)
 
void AddEdep (G4double edep1, G4double edep2)
 
virtual void Merge (const G4Run *)
 
void EndOfRun ()
 
void WriteActivity (G4int)
 
- Public Member Functions inherited from G4Run
 G4Run ()
 
virtual ~G4Run ()
 
G4int GetRunID () const
 
G4int GetNumberOfEvent () const
 
G4int GetNumberOfEventToBeProcessed () const
 
const G4HCtableGetHCtable () const
 
const G4DCtableGetDCtable () const
 
const G4StringGetRandomNumberStatus () const
 
void SetRunID (G4int id)
 
void SetNumberOfEventToBeProcessed (G4int n_ev)
 
void SetHCtable (G4HCtable *HCtbl)
 
void SetDCtable (G4DCtable *DCtbl)
 
void SetRandomNumberStatus (G4String &st)
 
void StoreEvent (G4Event *evt)
 
const std::vector< const
G4Event * > * 
GetEventVector () const
 

Public Attributes

G4int f_n_gam_sync
 
G4double f_e_gam_sync
 
G4double f_e_gam_sync2
 
G4double f_e_gam_sync_max
 
G4double f_lam_gam_sync
 

Friends

class RunMerger
 

Additional Inherited Members

- Protected Attributes inherited from G4Run
G4int runID
 
G4int numberOfEvent
 
G4int numberOfEventToBeProcessed
 
G4HCtableHCtable
 
G4DCtableDCtable
 
G4String randomNumberStatus
 
std::vector< const G4Event * > * eventVector
 

Detailed Description

Definition at line 46 of file Run.hh.

Constructor & Destructor Documentation

Run::Run ( DetectorConstruction det)

Definition at line 46 of file Run.cc.

47 : G4Run(),
48  fDetector(det),
49  fParticle(0), fEkin(0.),
50  nbOfModules(0), nbOfLayers(0), kLayerMax(0),
51  EtotCalor(0.), Etot2Calor(0.), EvisCalor(0.), Evis2Calor(0.),
52  Eleak(0.), Eleak2(0.)
53 {
54  nbOfModules = fDetector->GetNbModules();
55  nbOfLayers = fDetector->GetNbLayers();
56  kLayerMax = nbOfModules*nbOfLayers + 1;
57 
58  //initialize vectors
59  //
60  EtotLayer.resize(kLayerMax); Etot2Layer.resize(kLayerMax);
61  EvisLayer.resize(kLayerMax); Evis2Layer.resize(kLayerMax);
62  for (G4int k=0; k<kLayerMax; k++) {
63  EtotLayer[k] = Etot2Layer[k] = EvisLayer[k] = Evis2Layer[k] = 0.0;
64  }
65 
66  EtotCalor = Etot2Calor = EvisCalor = Evis2Calor = Eleak = Eleak2 = 0.;
67  EdLeak[0] = EdLeak[1] = EdLeak[2] = 0.;
68 }
int G4int
Definition: G4Types.hh:78
G4Run()
Definition: G4Run.cc:34

Here is the call graph for this function:

Run::~Run ( )

Definition at line 72 of file Run.cc.

73 { }
Run::Run ( DetectorConstruction )
Run::~Run ( )
Run::Run ( DetectorConstruction detector)
Run::~Run ( )
Run::Run ( DetectorConstruction detector)
Run::~Run ( )
Run::Run ( DetectorConstruction )
Run::~Run ( )
Run::Run ( DetectorConstruction )
Run::~Run ( )
Run::Run ( )

Definition at line 43 of file Run.cc.

44 : G4Run(),
45  f_n_gam_sync(0),
46  f_e_gam_sync(0.),
47  f_e_gam_sync2(0.),
48  f_e_gam_sync_max(0.),
49  f_lam_gam_sync(0.)
50 { }
G4Run()
Definition: G4Run.cc:34
G4double f_e_gam_sync_max
Definition: Run.hh:57
G4double f_e_gam_sync2
Definition: Run.hh:56
G4double f_e_gam_sync
Definition: Run.hh:56
G4int f_n_gam_sync
Definition: Run.hh:55
G4double f_lam_gam_sync
Definition: Run.hh:58
Run::~Run ( )
Run::Run ( DetectorConstruction det,
PrimaryGeneratorAction kin 
)

Definition at line 47 of file Run.cc.

48  :G4Run(),fDet(det),fKin(kin),
49  f_nLbin(kMaxBin),f_nRbin(kMaxBin)
50 {
51  Reset();
52 }
G4Run()
Definition: G4Run.cc:34
const G4int kMaxBin
virtual Run::~Run ( )
virtual
Run::Run ( DetectorConstruction )
Run::~Run ( )
Run::Run ( DetectorConstruction )
Run::~Run ( )
Run::Run ( )
virtual Run::~Run ( )
virtual
Run::Run ( DetectorConstruction )
Run::~Run ( )
Run::Run ( DetectorConstruction )
Run::~Run ( )
Run::Run ( DetectorConstruction )
Run::~Run ( )
Run::Run ( DetectorConstruction detector)
Run::~Run ( )
Run::Run ( DetectorConstruction )
Run::~Run ( )
Run::Run ( )
virtual Run::~Run ( )
virtual
Run::Run ( const DetectorConstruction detector)

Definition at line 46 of file Run.cc.

47 : G4Run(),
48  fDetector(detector),
49  fParticle(0), fEkin(0.),
50  fEdeposit(0.), fEdeposit2(0.),
51  fTrackLen(0.), fTrackLen2(0.),
52  fProjRange(0.), fProjRange2(0.),
53  fPenetration(0.), fPenetration2(0.),
54  fNbOfSteps(0), fNbOfSteps2(0),
55  fStepSize(0.), fStepSize2(0.)
56 { }
G4Run()
Definition: G4Run.cc:34
Run::~Run ( )
Run::Run ( const DetectorConstruction detector)
Run::~Run ( )
Run::Run ( const DetectorConstruction detector)
Run::~Run ( )
Run::Run ( DetectorConstruction )
Run::~Run ( )
Run::Run ( DetectorConstruction ,
PrimaryGeneratorAction  
)
Run::~Run ( )
Run::Run ( DetectorConstruction det,
PrimaryGeneratorAction kin,
bool  isMaster 
)

Definition at line 51 of file Run.cc.

52 :G4Run(),fDetector(det), fKinematic(kin), fProcCounter(0),
53  fEdepCavity(0.), fEdepCavity2(0.),
54  fTrkSegmCavity(0.), fNbEventCavity(0),
55  fStepWall(0.), fStepWall2(0.),
56  fStepCavity(0.), fStepCavity2(0.),
57  fNbStepWall(0), fNbStepCavity(0),
58  fEnergyGun(0.), fMassWall(0.),
59  fMassCavity(0.),fIsMaster(isMaster)
60 {
61 
62  //run conditions
63  //
64  G4ParticleDefinition* particleGun
65  = fKinematic->GetParticleGun()->GetParticleDefinition();
66  G4String partName = particleGun->GetParticleName();
67  fEnergyGun = fKinematic->GetParticleGun()->GetParticleEnergy();
68 
69  //geometry : effective wall volume
70  //
71  G4double cavityThickness = fDetector->GetCavityThickness();
72  G4Material* mateCavity = fDetector->GetCavityMaterial();
73  G4double densityCavity = mateCavity->GetDensity();
74  fMassCavity = cavityThickness*densityCavity;
75 
76  G4double wallThickness = fDetector->GetWallThickness();
77  G4Material* mateWall = fDetector->GetWallMaterial();
78  G4double densityWall = mateWall->GetDensity();
79 
80  G4EmCalculator emCal;
81  G4double RangeWall = emCal.GetCSDARange(fEnergyGun,particleGun,mateWall);
82  G4double factor = 1.2;
83  G4double effWallThick = factor*RangeWall;
84  if ((effWallThick > wallThickness)||(effWallThick <= 0.))
85  effWallThick = wallThickness;
86  fMassWall = 2*effWallThick*densityWall;
87 
88  G4double massTotal = fMassWall + fMassCavity;
89  G4double fMassWallRatio = fMassWall/massTotal;
90  fKinematic->RunInitialisation(effWallThick, fMassWallRatio );
91 
92  G4double massRatio = fMassCavity/fMassWall;
93 
94  //check radius
95  //
96  G4double worldRadius =fDetector->GetWorldRadius();
97  G4double RangeCavity =emCal.GetCSDARange(fEnergyGun,particleGun,mateCavity);
98 
99  //G4String partName = particleGun->GetParticleName();
100 
101 
102  std::ios::fmtflags mode = G4cout.flags();
103  G4cout.setf(std::ios::fixed,std::ios::floatfield);
104  G4int prec = G4cout.precision(3);
105 
106  G4cout << "\n ===================== run conditions =====================\n";
107 
108  G4cout << "\n The run will be " << numberOfEvent << " "<< partName << " of "
109  << G4BestUnit(fEnergyGun,"Energy") << " through 2*"
110  << G4BestUnit(effWallThick,"Length") << " of "
111  << mateWall->GetName() << " (density: "
112  << G4BestUnit(densityWall,"Volumic Mass") << "); Mass/cm2 = "
113  << G4BestUnit(fMassWall*cm2,"Mass")
114  << "\n csdaRange: " << G4BestUnit(RangeWall,"Length") << G4endl;
115 
116  G4cout << "\n the cavity is "
117  << G4BestUnit(cavityThickness,"Length") << " of "
118  << mateCavity->GetName() << " (density: "
119  << G4BestUnit(densityCavity,"Volumic Mass") << "); Mass/cm2 = "
120  << G4BestUnit(fMassCavity*cm2,"Mass")
121  << " --> massRatio = "<< std::setprecision(6) << massRatio << G4endl;
122 
123  G4cout.precision(3);
124  G4cout << " World radius: " << G4BestUnit(worldRadius,"Length")
125  << "; range in cavity: " << G4BestUnit(RangeCavity,"Length")
126  << G4endl;
127 
128  G4cout << "\n ==========================================================\n";
129 
130  //stopping power from EmCalculator
131  //
132  G4double dedxWall =
133  emCal.GetDEDX(fEnergyGun,G4Electron::Electron(),mateWall);
134  dedxWall /= densityWall;
135  G4double dedxCavity =
136  emCal.GetDEDX(fEnergyGun,G4Electron::Electron(),mateCavity);
137  dedxCavity /= densityCavity;
138 
139  G4cout << std::setprecision(4)
140  << "\n StoppingPower in wall = "
141  << G4BestUnit(dedxWall,"Energy*Surface/Mass")
142  << "\n in cavity = "
143  << G4BestUnit(dedxCavity,"Energy*Surface/Mass")
144  << G4endl;
145 
146  //process counter
147  //
148  fProcCounter = new ProcessesCount;
149 
150  //charged particles and energy flow in cavity
151  //
152  fPartFlowCavity[0] = fPartFlowCavity[1] = 0;
153  fEnerFlowCavity[0] = fEnerFlowCavity[1] = 0.;
154 
155  //total energy deposit and charged track segment in cavity
156  //
157  fEdepCavity = fEdepCavity2 = fTrkSegmCavity = 0.;
158  fNbEventCavity = 0;
159 
160  //stepLenth of charged particles
161  //
162  fStepWall = fStepWall2 = fStepCavity = fStepCavity2 =0.;
163  fNbStepWall = fNbStepCavity = 0;
164 
165 
166  // reset default formats
167  G4cout.setf(mode,std::ios::floatfield);
168  G4cout.precision(prec);
169 
170  //histograms
171  //
172  G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
173  if ( analysisManager->IsActive() ) {
174  analysisManager->OpenFile();
175  }
176 
177 }
std::vector< OneProcessCount * > ProcessesCount
G4int numberOfEvent
Definition: G4Run.hh:59
G4Material * GetCavityMaterial()
static constexpr double cm2
Definition: G4SIunits.hh:120
G4Material * GetWallMaterial()
const G4String & GetName() const
Definition: G4Material.hh:178
G4double GetDensity() const
Definition: G4Material.hh:180
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4Run()
Definition: G4Run.cc:34
static const double prec
Definition: RanecuEngine.cc:58
G4GLOB_DLL std::ostream G4cout
G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
G4ParticleGun * GetParticleGun()
void RunInitialisation(G4double, G4double)
G4ParticleDefinition * GetParticleDefinition() const
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4CsvAnalysisManager G4AnalysisManager
Definition: g4csv_defs.hh:77
G4double GetParticleEnergy() const

Here is the call graph for this function:

Run::~Run ( )
Run::Run ( )
virtual Run::~Run ( )
inlinevirtual

Definition at line 38 of file Run.hh.

38 {}
Run::Run ( )
Run::~Run ( )
Run::Run ( DetectorConstruction )
Run::~Run ( )

Member Function Documentation

void Run::AddChargedStep ( )

Definition at line 119 of file Run.cc.

120 {
121  fChargedStep += 1.0;
122 }
void Run::AddEdep ( G4int  i,
G4double  e 
)

Definition at line 81 of file Run.cc.

82 {
83  if (e > 0.) {
84  fEdeposit[i] += e;
85  if (e < fEmin[i]) fEmin[i] = e;
86  if (e > fEmax[i]) fEmax[i] = e;
87  }
88 }
void Run::AddEdep ( G4double  e)
void Run::AddEdep ( G4double  e)
void Run::AddEdep ( G4double  e)
void Run::AddEdep ( G4double  e)
void Run::AddEdep ( G4double  edep)
void Run::AddEdep ( G4double  edep)
void Run::AddEdep ( G4double  edep1,
G4double  edep2 
)

Definition at line 138 of file Run.cc.

139 {
140  fEdepTarget += edep1;
141  fEdepTarget2 += edep1*edep1;
142  fEdepDetect += edep2;
143  fEdepDetect2 += edep2*edep2;
144 }
void Run::AddEdep ( G4int  i,
G4double  e 
)
void Run::AddEdep ( G4double  val)
inline

Definition at line 61 of file Run.hh.

61 { fEdep += val;}
void Run::AddEdepCavity ( G4double  de)
inline

Definition at line 68 of file Run.hh.

68  { fEdepCavity += de; fEdepCavity2 += de*de;
69  fNbEventCavity++;};
void Run::AddEdepCavity ( G4double  de)
inline

Definition at line 69 of file Run.hh.

69  { fEdepCavity += de; fEdepCavity2 += de*de;
70  fNbEventCavity++;};
void Run::AddEflow ( G4double  eflow)
void Run::AddEflow ( G4double  eflow)

Definition at line 109 of file Run.cc.

110 {
111  fEnergyFlow += eflow;
112  fEnergyFlow2 += eflow*eflow;
113 }
void Run::AddEnergy ( G4double  edep)
inline

Definition at line 60 of file Run.hh.

61  {fEnergyDeposit += edep; fEnergyDeposit2 += edep*edep;};

Here is the caller graph for this function:

void Run::AddEnergy ( G4double  edep,
const G4Step step 
)

Definition at line 230 of file Run.cc.

231 {
232  if(1 < fVerbose) {
233  G4cout << "Run::AddEnergy: e(keV)= " << edep/keV
234  << G4endl;
235  }
236  fTotEdep += edep;
237  if(step) {
238  if(1 == step->GetTrack()->GetTrackID()) { fStepGas += 1.0; }
239 
240  fMeanCluster += fElIonPair->MeanNumberOfIonsAlongStep(step);
241  fCluster += fElIonPair->SampleNumberOfIonsAlongStep(step);
242  }
243 }
G4double MeanNumberOfIonsAlongStep(const G4ParticleDefinition *, const G4Material *, G4double edepTotal, G4double edepNIEL=0.0)
G4GLOB_DLL std::ostream G4cout
G4int SampleNumberOfIonsAlongStep(const G4Step *)
G4int GetTrackID() const
#define G4endl
Definition: G4ios.hh:61
G4Track * GetTrack() const
static constexpr double keV
Definition: G4SIunits.hh:216

Here is the call graph for this function:

void Run::AddEnergyLeak ( G4double  eleak,
G4int  index 
)
inline

Definition at line 93 of file Run.hh.

94  {fEnergyLeak[index] += eleak; fEnergyLeak2[index] += eleak*eleak;};
void Run::AddInelastic ( G4int  nb)

Definition at line 73 of file Run.cc.

74 {
75  fNbInelastic += nb;
76  fNbInelastic2 += nb*nb;
77 }
void Run::AddMscProjTheta ( G4double  theta)
inline

Definition at line 69 of file Run.hh.

70  {if (std::abs(theta) <= fMscThetaCentral) { fMscEntryCentral++;
71  fMscProjecTheta += theta; fMscProjecTheta2 += theta*theta;}
72  };
void Run::AddNeutralStep ( )

Definition at line 126 of file Run.cc.

127 {
128  fNeutralStep += 1.0;
129 }
void Run::AddPenetration ( G4double  x)

Definition at line 97 of file Run.cc.

98 {
99  fPenetration += x;
100  fPenetration2 += x*x;
101 }
tuple x
Definition: test.py:50
void Run::AddProjRange ( G4double  x)
void Run::AddProjRange ( G4double  x)
void Run::AddProjRange ( G4double  x)
void Run::AddProjRange ( G4double  x)
void Run::AddProjRange ( G4double  x)
void Run::AddProjRange ( G4double  x)
inline

Definition at line 63 of file Run.hh.

63 { fProjRange += x; fProjRange2 += x*x;}
tuple x
Definition: test.py:50
void Run::AddSecondaryTrack ( const G4Track track)

Definition at line 133 of file Run.cc.

134 {
135  const G4ParticleDefinition* d = track->GetDefinition();
136  if(d == G4Gamma::Gamma()) { ++fN_gamma; }
137  else if (d == G4Electron::Electron()) { ++fN_elec; }
138  else if (d == G4Positron::Positron()) { ++fN_pos; }
139 }
G4ParticleDefinition * GetDefinition() const
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
static G4Positron * Positron()
Definition: G4Positron.cc:94
static G4Electron * Electron()
Definition: G4Electron.cc:94

Here is the call graph for this function:

void Run::AddStep ( G4double  q)
inline

Definition at line 125 of file Run.hh.

126 {
127  if (q == 0.0) { fNeutralStep += 1.0; }
128  else { fChargedStep += 1.0; }
129 }
void Run::AddStepSize ( G4int  nb,
G4double  st 
)
void Run::AddStepSize ( G4int  nb,
G4double  st 
)
void Run::AddStepSize ( G4int  nb,
G4double  st 
)
void Run::AddStepSize ( G4int  nb,
G4double  st 
)
void Run::AddStepSize ( G4int  nb,
G4double  st 
)

Definition at line 118 of file Run.cc.

119 {
120  fNbOfSteps += nb;
121  fNbOfSteps2 += nb*nb;
122  fStepSize += st ;
123  fStepSize2 += st*st;
124 }
void Run::AddTotEdep ( G4double  e)

Definition at line 92 of file Run.cc.

93 {
94  if (e > 0.) {
95  fTotEdep[0] += e;
96  if (e < fTotEdep[1]) fTotEdep[1] = e;
97  if (e > fTotEdep[2]) fTotEdep[2] = e;
98  }
99 }
void Run::AddTotEdep ( G4double  e)
void Run::AddTrackLength ( G4double  t)
void Run::AddTrackLength ( G4double  t)
void Run::AddTrackLength ( G4double  t)
void Run::AddTrackLength ( G4double  t)
void Run::AddTrackLength ( G4double  t)

Definition at line 102 of file Run.cc.

103 {
104  fTrackLen += t;
105  fTrackLen2 += t*t;
106 }
void Run::AddTrackStatus ( G4int  i)

Definition at line 128 of file Run.cc.

129 {
130  fStatus[i]++ ;
131 }
void Run::AddTrackStatus ( G4int  i)
void Run::AddTrakCavity ( G4double  dt)
inline

Definition at line 70 of file Run.hh.

70 { fTrkSegmCavity += dt;};
void Run::AddTrakCavity ( G4double  dt)
inline

Definition at line 71 of file Run.hh.

71 { fTrkSegmCavity += dt;};
void Run::AddTrakLenCharg ( G4double  length)
inline

Definition at line 63 of file Run.hh.

64  {fTrakLenCharged += length; fTrakLenCharged2 += length*length;};
void Run::AddTrakLenNeutr ( G4double  length)
inline

Definition at line 66 of file Run.hh.

67  {fTrakLenNeutral += length; fTrakLenNeutral2 += length*length;};
void Run::AddTransvDev ( G4double  y)
inline

Definition at line 64 of file Run.hh.

64 { fTransvDev += y; fTransvDev2 += y*y;}
void Run::AddTrueRange ( G4double  l)
inline

Definition at line 62 of file Run.hh.

62 { fTrueRange += l; fTrueRange2 += l*l;}
void Run::Balance ( G4double  Ekin,
G4double  Pbal 
)

Definition at line 118 of file Run.cc.

119 {
120  fDecayCount++;
121  fEkinTot[0] += Ekin;
122  //update min max
123  if (fDecayCount == 1) fEkinTot[1] = fEkinTot[2] = Ekin;
124  if (Ekin < fEkinTot[1]) fEkinTot[1] = Ekin;
125  if (Ekin > fEkinTot[2]) fEkinTot[2] = Ekin;
126 
127  fPbalance[0] += Pbal;
128  //update min max
129  if (fDecayCount == 1) fPbalance[1] = fPbalance[2] = Pbal;
130  if (Pbal < fPbalance[1]) fPbalance[1] = Pbal;
131  if (Pbal > fPbalance[2]) fPbalance[2] = Pbal;
132 }
void Run::Balance ( G4double  Pbal)

Definition at line 133 of file Run.cc.

134 {
135  fPbalance[0] += Pbal;
136  //update min max
137  if (fTotalCount == 1) fPbalance[1] = fPbalance[2] = Pbal;
138  if (Pbal < fPbalance[1]) fPbalance[1] = Pbal;
139  if (Pbal > fPbalance[2]) fPbalance[2] = Pbal;
140 }
void Run::BeginOfEvent ( )

Definition at line 170 of file Run.cc.

171 {
172  fTotEdep = 0.0;
173  fStepGas = 0;
174  fCluster = 0;
175  ++fEvt;
176 }
void Run::BeginOfRun ( )

Definition at line 64 of file Run.cc.

65 {
66  // initilise scoring
67  fTotStepGas = fTotCluster = fMeanCluster = fOverflow = fTotEdep
68  = fStepGas = fCluster = 0.0;
69  fEvt = 0;
70 
71  fFactorALICE = fParam->GetFactorALICE();
72  fWidthALICE = fParam->GetEnergySmear();
73 
74  SetVerbose(1);
75 
76  fNbins = fParam->GetNumberBins();
77  fMaxEnergy = fParam->GetMaxEnergy();
78 
79  fEgas.resize(fNbins,0.0);
80  fEdep.reset();
81 
82  if(fVerbose > 0) {
83  G4int binsCluster = fParam->GetNumberBinsCluster();
84  G4cout << " BinsCluster= " << binsCluster << " BinsE= " << fNbins
85  << " Emax(keV)= " << fMaxEnergy/keV << G4endl;
86  G4cout << " WidthALICE(keV)= " << fWidthALICE/keV
87  << " FactorALICE= " << fFactorALICE << G4endl;
88 
89  }
90 }
G4double GetMaxEnergy() const
G4int GetNumberBins() const
G4int GetNumberBinsCluster() const
G4double GetFactorALICE() const
void SetVerbose(G4int val)
Definition: Run.hh:70
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4double GetEnergySmear() const
#define G4endl
Definition: G4ios.hh:61
static constexpr double keV
Definition: G4SIunits.hh:216

Here is the call graph for this function:

G4double Run::ComputeMscHighland ( )

Definition at line 333 of file Run.cc.

334 {
335  //compute the width of the Gaussian central part of the MultipleScattering
336  //projected angular distribution.
337  //Eur. Phys. Jour. C15 (2000) page 166, formule 23.9
338 
339  G4double t = (fDetector->GetAbsorberThickness())
340  /(fDetector->GetAbsorberMaterial()->GetRadlen());
341  if (t < DBL_MIN) return 0.;
342 
343  G4double T = fEkin;
344  G4double M = fParticle->GetPDGMass();
345  G4double z = std::abs(fParticle->GetPDGCharge()/eplus);
346 
347  G4double bpc = T*(T+2*M)/(T+M);
348  G4double teta0 = 13.6*MeV*z*std::sqrt(t)*(1.+0.038*std::log(t))/bpc;
349  return teta0;
350 }
G4Material * GetAbsorberMaterial()
static constexpr double eplus
Definition: G4SIunits.hh:199
G4double GetRadlen() const
Definition: G4Material.hh:220
G4double GetPDGMass() const
#define DBL_MIN
Definition: templates.hh:75
tuple z
Definition: test.py:28
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const

Here is the call graph for this function:

void Run::CountGamma ( G4int  nGamma)

Definition at line 144 of file Run.cc.

145 {
146  fGammaCount++;
147  fNbGamma[0] += nGamma;
148  //update min max
149  if (fGammaCount == 1) fNbGamma[1] = fNbGamma[2] = nGamma;
150  if (nGamma < fNbGamma[1]) fNbGamma[1] = nGamma;
151  if (nGamma > fNbGamma[2]) fNbGamma[2] = nGamma;
152 }
void Run::CountInTimeWindow ( G4String  name,
G4bool  life1,
G4bool  life2,
G4bool  decay 
)

Definition at line 97 of file Run.cc.

99 {
100  std::map<G4String, ActivityData>::iterator it = fActivityMap.find(name);
101  if ( it == fActivityMap.end()) {
102  G4int n1(0), n2(0), nd(0);
103  if(life1) n1 = 1;
104  if(life2) n2 = 1;
105  if(decay) nd = 1;
106  fActivityMap[name] = ActivityData(n1, n2, nd);
107  }
108  else {
109  ActivityData& data = it->second;
110  if(life1) data.fNlife_t1++;
111  if(life2) data.fNlife_t2++;
112  if(decay) data.fNdecay_t1t2++;
113  }
114 }
const XML_Char * name
Definition: expat.h:151
int G4int
Definition: G4Types.hh:78
const XML_Char const XML_Char * data
Definition: expat.h:268
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
void Run::CountNuclearChannel ( G4String  name,
G4double  Q 
)

Definition at line 99 of file Run.cc.

100 {
101  std::map<G4String, NuclChannel>::iterator it = fNuclChannelMap.find(name);
102  if ( it == fNuclChannelMap.end()) {
103  fNuclChannelMap[name] = NuclChannel(1, Q);
104  }
105  else {
106  NuclChannel& data = it->second;
107  data.fCount++;
108  data.fQ += Q;
109  }
110 }
const XML_Char * name
Definition: expat.h:151
static double Q[]
const XML_Char const XML_Char * data
Definition: expat.h:268
void Run::CountParticles ( G4ParticleDefinition part)
inline

Definition at line 80 of file Run.hh.

81  { if (part == G4Gamma::Gamma()) fNbGamma++ ;
82  else if (part == G4Electron::Electron()) fNbElect++ ;
83  else if (part == G4Positron::Positron()) fNbPosit++ ; };
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
static G4Positron * Positron()
Definition: G4Positron.cc:94
static G4Electron * Electron()
Definition: G4Electron.cc:94

Here is the call graph for this function:

void Run::CountProcesses ( G4String  procName)
void Run::CountProcesses ( G4String  procName)
void Run::CountProcesses ( const G4VProcess process)

Definition at line 66 of file Run.cc.

67 {
68  G4String procName = process->GetProcessName();
69  std::map<G4String,G4int>::iterator it = fProcCounter.find(procName);
70  if ( it == fProcCounter.end()) {
71  fProcCounter[procName] = 1;
72  }
73  else {
74  fProcCounter[procName]++;
75  }
76 }
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408

Here is the call graph for this function:

void Run::CountProcesses ( const G4VProcess process)
void Run::CountProcesses ( const G4VProcess process,
G4int  iVol 
)

Definition at line 72 of file Run.cc.

73 {
74  G4String procName = process->GetProcessName();
75 
76  if (iVol == 1) {
77  std::map<G4String,G4int>::iterator it1 = fProcCounter1.find(procName);
78  if ( it1 == fProcCounter1.end()) {
79  fProcCounter1[procName] = 1;
80  }
81  else {
82  fProcCounter1[procName]++;
83  }
84  }
85 
86  if (iVol == 2) {
87  std::map<G4String,G4int>::iterator it2 = fProcCounter2.find(procName);
88  if ( it2 == fProcCounter2.end()) {
89  fProcCounter2[procName] = 1;
90  }
91  else {
92  fProcCounter2[procName]++;
93  }
94  }
95 }
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408

Here is the call graph for this function:

void Run::CountProcesses ( const G4VProcess process)
void Run::CountProcesses ( G4VProcess process)

Definition at line 78 of file Run.cc.

79 {
80  G4String procName = process->GetProcessName();
81  std::map<G4String,G4int>::iterator it = fProcCounter.find(procName);
82  if ( it == fProcCounter.end()) {
83  fProcCounter[procName] = 1;
84  }
85  else {
86  fProcCounter[procName]++;
87  }
88 }
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408

Here is the call graph for this function:

void Run::CountProcesses ( const G4VProcess process)
void Run::CountProcesses ( G4String  procName)

Definition at line 72 of file Run.cc.

73 {
74  std::map<G4String,G4int>::iterator it = fProcCounter.find(procName);
75  if ( it == fProcCounter.end()) {
76  fProcCounter[procName] = 1;
77  }
78  else {
79  fProcCounter[procName]++;
80  }
81 }
void Run::CountProcesses ( G4String  )
void Run::CountProcesses ( G4String  )
void Run::CountReflect ( G4int  flag)
inline

Definition at line 89 of file Run.hh.

90  { if (flag == 1) fReflect[0]++;
91  else if (flag == 2) {fReflect[0]++; fReflect[1]++; }};
void Run::CountSteps0 ( G4int  ns)
inline

Definition at line 57 of file Run.hh.

57 { fNbOfSteps0 += ns;}
#define ns
Definition: xmlparse.cc:614
void Run::CountSteps1 ( G4int  ns)
inline

Definition at line 58 of file Run.hh.

58 { fNbOfSteps1 += ns;}
#define ns
Definition: xmlparse.cc:614
void Run::CountStepsCharg ( G4int  nSteps)
inline

Definition at line 74 of file Run.hh.

75  {fNbStepsCharged += nSteps; fNbStepsCharged2 += nSteps*nSteps;};
void Run::CountStepsNeutr ( G4int  nSteps)
inline

Definition at line 77 of file Run.hh.

78  {fNbStepsNeutral += nSteps; fNbStepsNeutral2 += nSteps*nSteps;};
void Run::CountTraks0 ( G4int  nt)
inline

Definition at line 55 of file Run.hh.

55 { fNbOfTraks0 += nt;}
void Run::CountTraks1 ( G4int  nt)
inline

Definition at line 56 of file Run.hh.

56 { fNbOfTraks1 += nt;}
void Run::CountTransmit ( G4int  flag)
inline

Definition at line 85 of file Run.hh.

86  { if (flag == 1) fTransmit[0]++;
87  else if (flag == 2) {fTransmit[0]++; fTransmit[1]++; }};
void Run::DetailedLeakage ( G4int  icase,
G4double  energy 
)

Definition at line 106 of file Run.cc.

107 {
108  //forward, backward, lateral leakage
109  //
110  EdLeak[icase] += energy;
111 }
G4double energy(const ThreeVector &p, const G4double m)

Here is the call graph for this function:

Here is the caller graph for this function:

void Run::EndOfEvent ( )

Definition at line 180 of file Run.cc.

181 {
182  fTotStepGas += fStepGas;
183  fTotCluster += fCluster;
184 
185  if(fWidthALICE > 0.0) {
186  G4double x = G4RandGauss::shoot(0.,fWidthALICE);
187  fTotEdep += x;
188  fTotEdep = std::max(fTotEdep, 0.0);
189  }
190 
191  G4int idx = G4int(fTotEdep*fNbins/fMaxEnergy);
192 
193  if(idx < 0) { fEgas[0] += 1.0; }
194  if(idx >= fNbins) { fOverflow += 1.0; }
195  else { fEgas[idx] += 1.0; }
196 
197  G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
198  // fill histo
199  analysisManager->FillH1(1,fTotEdep/keV,1.0);
200  analysisManager->FillH1(2,fCluster,1.0);
201  analysisManager->FillH1(3,fTotEdep*fFactorALICE,1.0);
202  fEdep.fill(fTotEdep, 1.0);
203 }
ThreeVector shoot(const G4int Ap, const G4int Af)
tuple x
Definition: test.py:50
int G4int
Definition: G4Types.hh:78
T max(const T t1, const T t2)
brief Return the largest of the two arguments
double G4double
Definition: G4Types.hh:76
static constexpr double keV
Definition: G4SIunits.hh:216
G4CsvAnalysisManager G4AnalysisManager
Definition: g4csv_defs.hh:77

Here is the call graph for this function:

void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( )

G4double fac = unit/(numberOfEvent*binWidth);

Definition at line 147 of file Run.cc.

148 {
149  //calorimeter
150  //
151  fDetector->PrintCalorParameters();
152 
153  //run conditions
154  //
155  G4String partName = fParticle->GetParticleName();
156  G4int nbEvents = numberOfEvent;
157 
158  G4int prec = G4cout.precision(3);
159 
160  G4cout << " The run was " << nbEvents << " " << partName << " of "
161  << G4BestUnit(fEkin,"Energy") << " through the calorimeter" << G4endl;
162 
163  G4cout << "------------------------------------------------------------"
164  << G4endl;
165 
166  //if no events, return
167  //
168  if (nbEvents == 0) return;
169 
170  //compute and print statistic
171  //
172  std::ios::fmtflags mode = G4cout.flags();
173 
174  // energy in layers
175  //
176  G4cout.precision(prec);
177  G4cout << "\n "
178  << "total Energy (rms/mean) "
179  << "visible Energy (rms/mean)" << G4endl;
180 
181  G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
182 
183  G4double meanEtot,meanEtot2,varianceEtot,rmsEtot,resEtot;
184  G4double meanEvis,meanEvis2,varianceEvis,rmsEvis,resEvis;
185 
186  for (G4int i1=1; i1<kLayerMax; i1++) {
187  //total energy
188  meanEtot = EtotLayer[i1] /nbEvents;
189  meanEtot2 = Etot2Layer[i1]/nbEvents;
190  varianceEtot = meanEtot2 - meanEtot*meanEtot;
191  resEtot = rmsEtot = 0.;
192  if (varianceEtot > 0.) rmsEtot = std::sqrt(varianceEtot);
193  if (meanEtot > 0.) resEtot = 100*rmsEtot/meanEtot;
194  analysisManager->FillH1(3, i1+0.5, meanEtot);
195 
196  //visible energy
197  meanEvis = EvisLayer[i1] /nbEvents;
198  meanEvis2 = Evis2Layer[i1]/nbEvents;
199  varianceEvis = meanEvis2 - meanEvis*meanEvis;
200  resEvis = rmsEvis = 0.;
201  if (varianceEvis > 0.) rmsEvis = std::sqrt(varianceEvis);
202  if (meanEvis > 0.) resEvis = 100*rmsEvis/meanEvis;
203  analysisManager->FillH1(4, i1+0.5, meanEvis);
204 
205  //print
206  //
207  G4cout
208  << "\n layer " << i1 << ": "
209  << std::setprecision(5)
210  << std::setw(6) << G4BestUnit(meanEtot,"Energy") << " +- "
211  << std::setprecision(4)
212  << std::setw(5) << G4BestUnit( rmsEtot,"Energy") << " ("
213  << std::setprecision(2)
214  << std::setw(3) << resEtot << " %)"
215  << " "
216  << std::setprecision(5)
217  << std::setw(6) << G4BestUnit(meanEvis,"Energy") << " +- "
218  << std::setprecision(4)
219  << std::setw(5) << G4BestUnit( rmsEvis,"Energy") << " ("
220  << std::setprecision(2)
221  << std::setw(3) << resEvis << " %)";
222  }
223  G4cout << G4endl;
224 
225  //calorimeter: total energy
226  meanEtot = EtotCalor /nbEvents;
227  meanEtot2 = Etot2Calor/nbEvents;
228  varianceEtot = meanEtot2 - meanEtot*meanEtot;
229  resEtot = rmsEtot = 0.;
230  if (varianceEtot > 0.) rmsEtot = std::sqrt(varianceEtot);
231  if (meanEtot > 0.) resEtot = 100*rmsEtot/meanEtot;
232 
233  //calorimeter: visible energy
234  meanEvis = EvisCalor /nbEvents;
235  meanEvis2 = Evis2Calor/nbEvents;
236  varianceEvis = meanEvis2 - meanEvis*meanEvis;
237  resEvis = rmsEvis = 0.;
238  if (varianceEvis > 0.) rmsEvis = std::sqrt(varianceEvis);
239  if (meanEvis > 0.) resEvis = 100*rmsEvis/meanEvis;
240 
241  //print
242  //
243  G4cout
244  << "\n total calor : "
245  << std::setprecision(5)
246  << std::setw(6) << G4BestUnit(meanEtot,"Energy") << " +- "
247  << std::setprecision(4)
248  << std::setw(5) << G4BestUnit( rmsEtot,"Energy") << " ("
249  << std::setprecision(2)
250  << std::setw(3) << resEtot << " %)"
251  << " "
252  << std::setprecision(5)
253  << std::setw(6) << G4BestUnit(meanEvis,"Energy") << " +- "
254  << std::setprecision(4)
255  << std::setw(5) << G4BestUnit( rmsEvis,"Energy") << " ("
256  << std::setprecision(2)
257  << std::setw(3) << resEvis << " %)";
258 
259  G4cout << "\n------------------------------------------------------------"
260  << G4endl;
261 
262  //leakage
263  G4double meanEleak,meanEleak2,varianceEleak,rmsEleak,ratio;
264  meanEleak = Eleak /nbEvents;
265  meanEleak2 = Eleak2/nbEvents;
266  varianceEleak = meanEleak2 - meanEleak*meanEleak;
267  rmsEleak = 0.;
268  if (varianceEleak > 0.) rmsEleak = std::sqrt(varianceEleak);
269  ratio = 100*meanEleak/fEkin;
270 
271  G4double forward = 100*EdLeak[0]/(nbEvents*fEkin);
272  G4double bakward = 100*EdLeak[1]/(nbEvents*fEkin);
273  G4double lateral = 100*EdLeak[2]/(nbEvents*fEkin);
274 
275  //print
276  //
277  G4cout
278  << "\n Leakage : "
279  << std::setprecision(5)
280  << std::setw(6) << G4BestUnit(meanEleak,"Energy") << " +- "
281  << std::setprecision(4)
282  << std::setw(5) << G4BestUnit( rmsEleak,"Energy")
283  << "\n Eleak/Ebeam ="
284  << std::setprecision(3)
285  << std::setw(4) << ratio << " % ( forward ="
286  << std::setw(4) << forward << " %; backward ="
287  << std::setw(4) << bakward << " %; lateral ="
288  << std::setw(4) << lateral << " %)"
289  << G4endl;
290 
291  G4cout.setf(mode,std::ios::floatfield);
292  G4cout.precision(prec);
293 
294  //normalize histograms
295  G4double factor = 1./nbEvents;
296  analysisManager->ScaleH1(5,factor);
297 }
G4int numberOfEvent
Definition: G4Run.hh:59
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
static const double prec
Definition: RanecuEngine.cc:58
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4CsvAnalysisManager G4AnalysisManager
Definition: g4csv_defs.hh:77

Here is the call graph for this function:

void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( G4bool  print)

Definition at line 236 of file Run.cc.

237 {
238  G4int prec = 5, wid = prec + 2;
239  G4int dfprec = G4cout.precision(prec);
240 
241  //run condition
242  //
243  G4Material* material = fDetector->GetMaterial();
244  G4double density = material->GetDensity();
245 
246  G4String Particle = fParticle->GetParticleName();
247  G4cout << "\n The run is " << numberOfEvent << " "<< Particle << " of "
248  << G4BestUnit(fEkin,"Energy") << " through "
249  << G4BestUnit(fDetector->GetSize(),"Length") << " of "
250  << material->GetName() << " (density: "
251  << G4BestUnit(density,"Volumic Mass") << ")" << G4endl;
252 
253  if (numberOfEvent == 0) { G4cout.precision(dfprec); return;}
254 
255  //frequency of processes
256  //
257  G4cout << "\n Process calls frequency:" << G4endl;
258  G4int survive = 0;
259  std::map<G4String,G4int>::iterator it;
260  for (it = fProcCounter.begin(); it != fProcCounter.end(); it++) {
261  G4String procName = it->first;
262  G4int count = it->second;
263  G4cout << "\t" << procName << "= " << count;
264  if (procName == "Transportation") survive = count;
265  }
266  G4cout << G4endl;
267 
268  if (survive > 0) {
269  G4cout << "\n Nb of incident particles surviving after "
270  << G4BestUnit(fDetector->GetSize(),"Length") << " of "
271  << material->GetName() << " : " << survive << G4endl;
272  }
273 
274  if (fTotalCount == 0) fTotalCount = 1; //force printing anyway
275 
276  //compute mean free path and related quantities
277  //
278  G4double MeanFreePath = fSumTrack /fTotalCount;
279  G4double MeanTrack2 = fSumTrack2/fTotalCount;
280  G4double rms = std::sqrt(std::fabs(MeanTrack2 - MeanFreePath*MeanFreePath));
281  G4double CrossSection = 0.0;
282  if(MeanFreePath > 0.0) { CrossSection = 1./MeanFreePath; }
283  G4double massicMFP = MeanFreePath*density;
284  G4double massicCS = 0.0;
285  if(massicMFP > 0.0) { massicCS = 1./massicMFP; }
286 
287  G4cout << "\n\n MeanFreePath:\t" << G4BestUnit(MeanFreePath,"Length")
288  << " +- " << G4BestUnit( rms,"Length")
289  << "\tmassic: " << G4BestUnit(massicMFP, "Mass/Surface")
290  << "\n CrossSection:\t" << CrossSection*cm << " cm^-1 "
291  << "\t\tmassic: " << G4BestUnit(massicCS, "Surface/Mass")
292  << G4endl;
293 
294  //cross section per atom (only for single material)
295  //
296  if (material->GetNumberOfElements() == 1) {
297  G4double nbAtoms = material->GetTotNbOfAtomsPerVolume();
298  G4double crossSection = CrossSection/nbAtoms;
299  G4cout << " crossSection per atom:\t"
300  << G4BestUnit(crossSection,"Surface") << G4endl;
301  }
302  //check cross section from G4HadronicProcessStore
303  //
304  G4cout << "\n Verification: "
305  << "crossSections from G4HadronicProcessStore:";
306 
309  G4double sumc1 = 0.0, sumc2 = 0.0;
310  if (material->GetNumberOfElements() == 1) {
311  const G4Element* element = material->GetElement(0);
312  for (it = fProcCounter.begin(); it != fProcCounter.end(); it++) {
313  G4String procName = it->first;
314  G4VProcess* process = processTable->FindProcess(procName, fParticle);
315  G4double xs1 =
316  store->GetCrossSectionPerVolume(fParticle,fEkin,process,material);
317  G4double massSigma = xs1/density;
318  sumc1 += massSigma;
319  G4double xs2 =
320  store->GetCrossSectionPerAtom(fParticle,fEkin,process,element,material);
321  sumc2 += xs2;
322  G4cout << "\n" << std::setw(20) << procName << "= "
323  << G4BestUnit(massSigma, "Surface/Mass") << "\t"
324  << G4BestUnit(xs2, "Surface");
325 
326  }
327  G4cout << "\n" << std::setw(20) << "total" << "= "
328  << G4BestUnit(sumc1, "Surface/Mass") << "\t"
329  << G4BestUnit(sumc2, "Surface") << G4endl;
330  } else {
331  for (it = fProcCounter.begin(); it != fProcCounter.end(); it++) {
332  G4String procName = it->first;
333  G4VProcess* process = processTable->FindProcess(procName, fParticle);
334  G4double xs =
335  store->GetCrossSectionPerVolume(fParticle,fEkin,process,material);
336  G4double massSigma = xs/density;
337  sumc1 += massSigma;
338  G4cout << "\n" << std::setw(20) << procName << "= "
339  << G4BestUnit(massSigma, "Surface/Mass");
340  }
341  G4cout << "\n" << std::setw(20) << "total" << "= "
342  << G4BestUnit(sumc1, "Surface/Mass") << G4endl;
343  }
344 
345  //nuclear channel count
346  //
347  G4cout << "\n List of nuclear reactions: \n" << G4endl;
348  std::map<G4String,NuclChannel>::iterator ic;
349  for (ic = fNuclChannelMap.begin(); ic != fNuclChannelMap.end(); ic++) {
350  G4String name = ic->first;
351  NuclChannel data = ic->second;
352  G4int count = data.fCount;
353  G4double Q = data.fQ/count;
354  if (print)
355  G4cout << " " << std::setw(50) << name << ": " << std::setw(7) << count
356  << " Q = " << std::setw(wid) << G4BestUnit(Q, "Energy")
357  << G4endl;
358  }
359 
360  //Gamma count
361  //
362  if (print && (fGammaCount > 0)) {
363  G4cout << "\n" << std::setw(58) << "Number of gamma: N = "
364  << fNbGamma[1] << " --> " << fNbGamma[2] << G4endl;
365  }
366 
367  if (print && fTargetXXX) {
368  G4cout
369  << "\n --> NOTE: XXXX because neutronHP is unable to return target nucleus"
370  << G4endl;
371  }
372 
373  //particles count
374  //
375  G4cout << "\n List of generated particles:" << G4endl;
376 
377  std::map<G4String,ParticleData>::iterator itn;
378  for (itn = fParticleDataMap.begin(); itn != fParticleDataMap.end(); itn++) {
379  G4String name = itn->first;
380  ParticleData data = itn->second;
381  G4int count = data.fCount;
382  G4double eMean = data.fEmean/count;
383  G4double eMin = data.fEmin;
384  G4double eMax = data.fEmax;
385  if (print)
386  G4cout << " " << std::setw(13) << name << ": " << std::setw(7) << count
387  << " Emean = " << std::setw(wid) << G4BestUnit(eMean, "Energy")
388  << "\t( " << G4BestUnit(eMin, "Energy")
389  << " --> " << G4BestUnit(eMax, "Energy")
390  << ")" << G4endl;
391  }
392 
393  //energy momentum balance
394  //
395  if (fTotalCount > 1) {
396  G4double Pbmean = fPbalance[0]/fTotalCount;
397  G4cout << "\n Momentum balance: Pmean = "
398  << std::setw(wid) << G4BestUnit(Pbmean, "Energy")
399  << "\t( " << G4BestUnit(fPbalance[1], "Energy")
400  << " --> " << G4BestUnit(fPbalance[2], "Energy")
401  << ") \n" << G4endl;
402  }
403 
404  //normalize histograms
408 
409  //remove all contents in fProcCounter, fCount
410  fProcCounter.clear();
411  fNuclChannelMap.clear();
412  fParticleDataMap.clear();
413 
414  //restore default format
415  G4cout.precision(dfprec);
416 }
const XML_Char * name
Definition: expat.h:151
G4int numberOfEvent
Definition: G4Run.hh:59
static G4HadronicProcessStore * Instance()
G4int first(char) const
const G4String & GetName() const
Definition: G4Material.hh:178
G4double GetDensity() const
Definition: G4Material.hh:180
static double Q[]
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
const G4Element * GetElement(G4int iel) const
Definition: G4Material.hh:202
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
const XML_Char const XML_Char * data
Definition: expat.h:268
string material
Definition: eplot.py:19
static const double prec
Definition: RanecuEngine.cc:58
G4GLOB_DLL std::ostream G4cout
static constexpr double cm
Definition: G4SIunits.hh:119
void print(G4double elem)
G4double GetTotNbOfAtomsPerVolume() const
Definition: G4Material.hh:209
G4double GetCrossSectionPerVolume(const G4ParticleDefinition *particle, G4double kineticEnergy, const G4VProcess *process, const G4Material *material)
#define G4endl
Definition: G4ios.hh:61
size_t GetNumberOfElements() const
Definition: G4Material.hh:186
double G4double
Definition: G4Types.hh:76
static G4ProcessTable * GetProcessTable()
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const
G4double GetCrossSectionPerAtom(const G4ParticleDefinition *particle, G4double kineticEnergy, const G4VProcess *process, const G4Element *element, const G4Material *material=0)

Here is the call graph for this function:

void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( G4double  edep,
G4double  rms,
G4double limit 
)

Definition at line 200 of file Run.cc.

201 {
202  G4int NbOfEvents = GetNumberOfEvent();
203 
204  G4double kinEnergy = fKin->GetParticleGun()->GetParticleEnergy();
205  assert(NbOfEvents*kinEnergy > 0);
206 
207  fChargedStep /= G4double(NbOfEvents);
208  fNeutralStep /= G4double(NbOfEvents);
209 
211  G4double norme = 100./(NbOfEvents*(kinEnergy+mass));
212 
213  //longitudinal
214  //
215  G4double dLradl = fDet->GetdLradl();
216 
217  MyVector MeanELongit(f_nLbin), rmsELongit(f_nLbin);
218  MyVector MeanELongitCumul(f_nLbin), rmsELongitCumul(f_nLbin);
219 
220  G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
221 
222  G4int i;
223  for (i=0; i<f_nLbin; i++) {
224  MeanELongit[i] = norme*fSumELongit[i];
225  rmsELongit[i] =
226  norme*std::sqrt(std::abs(NbOfEvents*fSumE2Longit[i]
227  - fSumELongit[i]*fSumELongit[i]));
228 
229  MeanELongitCumul[i] = norme*fSumELongitCumul[i];
230  rmsELongitCumul[i] = norme*std::sqrt(std::abs(NbOfEvents*
231  fSumE2LongitCumul[i] - fSumELongitCumul[i]*fSumELongitCumul[i]));
232  G4double bin = (i+0.5)*dLradl;
233  analysisManager->FillH1(4, bin,MeanELongit[i]/dLradl);
234  analysisManager->FillH1(5, bin, rmsELongit[i]/dLradl);
235  bin = (i+1)*dLradl;
236  analysisManager->FillH1(6, bin,MeanELongitCumul[i]);
237  analysisManager->FillH1(7, bin, rmsELongitCumul[i]);
238  }
239 
240  //radial
241  //
242  G4double dRradl = fDet->GetdRradl();
243 
244  MyVector MeanERadial(f_nRbin), rmsERadial(f_nRbin);
245  MyVector MeanERadialCumul(f_nRbin), rmsERadialCumul(f_nRbin);
246 
247  for (i=0; i<f_nRbin; i++) {
248  MeanERadial[i] = norme*fSumERadial[i];
249  rmsERadial[i] = norme*std::sqrt(std::abs(NbOfEvents*fSumE2Radial[i]
250  - fSumERadial[i]*fSumERadial[i]));
251 
252  MeanERadialCumul[i] = norme*fSumERadialCumul[i];
253  rmsERadialCumul[i] =
254  norme*std::sqrt(std::abs(NbOfEvents*fSumE2RadialCumul[i]
255  - fSumERadialCumul[i]*fSumERadialCumul[i]));
256 
257  G4double bin = (i+0.5)*dRradl;
258  analysisManager->FillH1(8, bin,MeanERadial[i]/dRradl);
259  analysisManager->FillH1(9, bin, rmsERadial[i]/dRradl);
260  bin = (i+1)*dRradl;
261  analysisManager->FillH1(10, bin,MeanERadialCumul[i]);
262  analysisManager->FillH1(11, bin, rmsERadialCumul[i]);
263  }
264 
265  //find Moliere confinement
266  //
267  const G4double EMoliere = 90.;
268  G4double iMoliere = 0.;
269  if ((MeanERadialCumul[0] <= EMoliere) &&
270  (MeanERadialCumul[f_nRbin-1] >= EMoliere)) {
271  G4int imin = 0;
272  while( (imin < f_nRbin-1) && (MeanERadialCumul[imin] < EMoliere) )
273  { ++imin; }
274  G4double ratio = (EMoliere - MeanERadialCumul[imin]) /
275  (MeanERadialCumul[imin+1] - MeanERadialCumul[imin]);
276  iMoliere = 1. + imin + ratio;
277  }
278 
279  //track length
280  //
281  norme = 1./(NbOfEvents*(fDet->GetMaterial()->GetRadlen()));
282  G4double MeanChargTrLength = norme*fSumChargTrLength;
283  G4double rmsChargTrLength =
284  norme*std::sqrt(std::fabs(NbOfEvents*fSum2ChargTrLength
285  - fSumChargTrLength*fSumChargTrLength));
286 
287  G4double MeanNeutrTrLength = norme*fSumNeutrTrLength;
288  G4double rmsNeutrTrLength =
289  norme*std::sqrt(std::fabs(NbOfEvents*fSum2NeutrTrLength
290  - fSumNeutrTrLength*fSumNeutrTrLength));
291 
292  //print
293  std::ios::fmtflags mode = G4cout.flags();
294  G4cout.setf(std::ios::fixed,std::ios::floatfield);
295  G4int prec = G4cout.precision(2);
296 
297  if (fVerbose) {
298 
299  G4cout << " LOGITUDINAL PROFILE "
300  << " CUMULATIVE LOGITUDINAL PROFILE" << G4endl << G4endl;
301 
302  G4cout << " bin " << " Mean rms "
303  << " bin " << " Mean rms \n" << G4endl;
304 
305  for (i=0; i<f_nLbin; i++) {
306  G4double inf=i*dLradl, sup=inf+dLradl;
307 
308  G4cout << std::setw(8) << inf << "->"
309  << std::setw(5) << sup << " radl: "
310  << std::setw(7) << MeanELongit[i] << "% "
311  << std::setw(9) << rmsELongit[i] << "% "
312  << " 0->" << std::setw(5) << sup << " radl: "
313  << std::setw(7) << MeanELongitCumul[i] << "% "
314  << std::setw(7) << rmsELongitCumul[i] << "% "
315  <<G4endl;
316  }
317 
318  G4cout << G4endl << G4endl << G4endl;
319 
320  G4cout << " RADIAL PROFILE "
321  << " CUMULATIVE RADIAL PROFILE" << G4endl << G4endl;
322 
323  G4cout << " bin " << " Mean rms "
324  << " bin " << " Mean rms \n" << G4endl;
325 
326  for (i=0; i<f_nRbin; i++) {
327  G4double inf=i*dRradl, sup=inf+dRradl;
328 
329  G4cout << std::setw(8) << inf << "->"
330  << std::setw(5) << sup << " radl: "
331  << std::setw(7) << MeanERadial[i] << "% "
332  << std::setw(9) << rmsERadial[i] << "% "
333  << " 0->" << std::setw(5) << sup << " radl: "
334  << std::setw(7) << MeanERadialCumul[i] << "% "
335  << std::setw(7) << rmsERadialCumul[i] << "% "
336  <<G4endl;
337  }
338  }
339 
340  G4cout << "\n ===== SUMMARY ===== \n" << G4endl;
341 
342  G4cout << " Total number of events: " << NbOfEvents << "\n"
343  << " Mean number of charged steps: " << fChargedStep << G4endl;
344  G4cout << " Mean number of neutral steps: " << fNeutralStep
345  << "\n" << G4endl;
346 
347  G4cout << " energy deposit : "
348  << std::setw(7) << MeanELongitCumul[f_nLbin-1] << " % E0 +- "
349  << std::setw(7) << rmsELongitCumul[f_nLbin-1] << " % E0" << G4endl;
350  G4cout << " charged traklen: "
351  << std::setw(7) << MeanChargTrLength << " radl +- "
352  << std::setw(7) << rmsChargTrLength << " radl" << G4endl;
353  G4cout << " neutral traklen: "
354  << std::setw(7) << MeanNeutrTrLength << " radl +- "
355  << std::setw(7) << rmsNeutrTrLength << " radl" << G4endl;
356 
357  if (iMoliere > 0. ) {
358  G4double RMoliere1 = iMoliere*fDet->GetdRradl();
359  G4double RMoliere2 = iMoliere*fDet->GetdRlength();
360  G4cout << "\n " << EMoliere << " % confinement: radius = "
361  << RMoliere1 << " radl ("
362  << G4BestUnit( RMoliere2, "Length") << ")" << "\n" << G4endl;
363  }
364 
365  G4cout.setf(mode,std::ios::floatfield);
366  G4cout.precision(prec);
367 
368  // Acceptance
369 
370  G4int nLbin = fDet->GetnLtot();
371  if (limit < DBL_MAX) {
372  EmAcceptance acc;
373  acc.BeginOfAcceptance("Total Energy in Absorber",NbOfEvents);
374  G4double e = MeanELongitCumul[nLbin-1]/100.;
375  G4double r = rmsELongitCumul[nLbin-1]/100.;
376  acc.EmAcceptanceGauss("Edep",NbOfEvents,e,edep,rms,limit);
377  acc.EmAcceptanceGauss("Erms",NbOfEvents,r,rms,rms,2.0*limit);
378  acc.EndOfAcceptance();
379  }
380  limit = DBL_MAX;
381 }
tuple bin
Definition: plottest35.py:22
void EmAcceptanceGauss(const G4String &title, G4int stat, G4double avr, G4double avr0, G4double rms, G4double limit)
Definition: EmAcceptance.cc:68
void BeginOfAcceptance(const G4String &title, G4int stat)
Definition: EmAcceptance.cc:49
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
int G4int
Definition: G4Types.hh:78
static const double prec
Definition: RanecuEngine.cc:58
G4GLOB_DLL std::ostream G4cout
void EndOfAcceptance()
Definition: EmAcceptance.cc:58
G4int GetNumberOfEvent() const
Definition: G4Run.hh:79
std::vector< G4double > MyVector
Definition: Run.hh:42
G4double GetRadlen() const
Definition: G4Material.hh:220
G4double GetPDGMass() const
G4ParticleGun * GetParticleGun()
G4ParticleDefinition * GetParticleDefinition() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
G4CsvAnalysisManager G4AnalysisManager
Definition: g4csv_defs.hh:77
G4double GetParticleEnergy() const

Here is the call graph for this function:

void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EndOfRun ( )
void Run::EventTiming ( G4double  time)

Definition at line 136 of file Run.cc.

137 {
138  fTimeCount++;
139  fEventTime[0] += time;
140  if (fTimeCount == 1) fEventTime[1] = fEventTime[2] = time;
141  if (time < fEventTime[1]) fEventTime[1] = time;
142  if (time > fEventTime[2]) fEventTime[2] = time;
143 }
void Run::EvisEvent ( G4double  Evis)

Definition at line 154 of file Run.cc.

155 {
156  fEvisEvent[0] += Evis;
157  if (fTimeCount == 1) fEvisEvent[1] = fEvisEvent[2] = Evis;
158  if (Evis < fEvisEvent[1]) fEvisEvent[1] = Evis;
159  if (Evis > fEvisEvent[2]) fEvisEvent[2] = Evis;
160 }
void Run::FillPerEvent ( G4int  kAbs,
G4double  EAbs,
G4double  LAbs 
)

Definition at line 94 of file Run.cc.

95 {
96  //accumulate statistic with restriction
97  //
98  if(fApplyLimit) fEnergyDeposit[kAbs].push_back(EAbs);
99  fSumEAbs[kAbs] += EAbs; fSum2EAbs[kAbs] += EAbs*EAbs;
100  fSumLAbs[kAbs] += LAbs; fSum2LAbs[kAbs] += LAbs*LAbs;
101 }
const G4int kAbs
Definition: B4bRunData.hh:41
void Run::FillPerEvent ( )

Definition at line 112 of file Run.cc.

113 {
114  //accumulate statistic
115  //
116  G4double dLCumul = 0.;
117  for (G4int i=0; i<f_nLbin; i++)
118  {
119  fSumELongit[i] += f_dEdL[i];
120  fSumE2Longit[i] += f_dEdL[i]*f_dEdL[i];
121  dLCumul += f_dEdL[i];
122  fSumELongitCumul[i] += dLCumul;
123  fSumE2LongitCumul[i] += dLCumul*dLCumul;
124  }
125 
126  G4double dRCumul = 0.;
127  for (G4int j=0; j<f_nRbin; j++)
128  {
129  fSumERadial[j] += f_dEdR[j];
130  fSumE2Radial[j] += f_dEdR[j]*f_dEdR[j];
131  dRCumul += f_dEdR[j];
132  fSumERadialCumul[j] += dRCumul;
133  fSumE2RadialCumul[j] += dRCumul*dRCumul;
134  }
135 
136  fSumChargTrLength += fChargTrLength;
137  fSum2ChargTrLength += fChargTrLength*fChargTrLength;
138  fSumNeutrTrLength += fNeutrTrLength;
139  fSum2NeutrTrLength += fNeutrTrLength*fNeutrTrLength;
140 
141  //fill histograms
142  //
143 
144  G4double Ekin=fKin->GetParticleGun()->GetParticleEnergy();
146  G4double radl=fDet->GetMaterial()->GetRadlen();
147 
148  G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
149  analysisManager->FillH1(1, 100.*dLCumul/(Ekin+mass));
150  analysisManager->FillH1(2, fChargTrLength/radl);
151  analysisManager->FillH1(3, fNeutrTrLength/radl);
152 
153  //profiles
154  G4double norm = 100./(Ekin+mass);
155  G4double dLradl = fDet->GetdLradl();
156  for (G4int i=0; i<f_nLbin; i++) {
157  G4double bin = (i+0.5)*dLradl;
158  analysisManager->FillP1(0, bin, norm*f_dEdL[i]/dLradl);
159  }
160  G4double dRradl = fDet->GetdRradl();
161  for (G4int j=0; j<f_nRbin; j++) {
162  G4double bin = (j+0.5)*dRradl;
163  analysisManager->FillP1(1, bin, norm*f_dEdR[j]/dRradl);
164  }
165 }
tuple bin
Definition: plottest35.py:22
int G4int
Definition: G4Types.hh:78
G4double GetRadlen() const
Definition: G4Material.hh:220
G4double GetPDGMass() const
G4ParticleGun * GetParticleGun()
G4ParticleDefinition * GetParticleDefinition() const
double G4double
Definition: G4Types.hh:76
G4CsvAnalysisManager G4AnalysisManager
Definition: g4csv_defs.hh:77
G4double GetParticleEnergy() const

Here is the call graph for this function:

void Run::FillPerStep ( G4double  dEstep,
G4int  Lbin,
G4int  Rbin 
)
inline

Definition at line 118 of file Run.hh.

119 {
120  f_dEdL[Lbin] += dEstep; f_dEdR[Rbin] += dEstep;
121 }
void Run::FillPerTrack ( G4double  charge,
G4double  trkLength 
)
inline

Definition at line 109 of file Run.hh.

110 {
111  if (charge != 0.) fChargTrLength += trkLength;
112  else fNeutrTrLength += trkLength;
113 }
void Run::FlowInCavity ( G4int  k,
G4double  e 
)
inline

Definition at line 65 of file Run.hh.

65  { fEnerFlowCavity[k] += e;
66  fPartFlowCavity[k]++;};
void Run::FlowInCavity ( G4int  k,
G4double  e 
)
inline

Definition at line 66 of file Run.hh.

66  { fEnerFlowCavity[k] += e;
67  fPartFlowCavity[k]++;};
G4int Run::GetCounter ( ) const
inline

Definition at line 40 of file Run.hh.

40 { return fDummyCounter; }
G4double Run::GetCsdaRange ( )

Definition at line 114 of file Run.cc.

115 {
116  return fCsdaRange;
117 }
G4double Run::GetCsdaRange ( G4int  i)

Definition at line 149 of file Run.cc.

150 {
151  return fCsdaRange[i];
152 }
G4double Run::GetEdep ( ) const
inline

Definition at line 60 of file Run.hh.

60 {return fEdeposit;};
G4double Run::GetEdep ( ) const
inline

Definition at line 61 of file Run.hh.

61 {return fEdeposit;};
G4double Run::GetEdep ( ) const
inline

Definition at line 61 of file Run.hh.

61 {return fEdeposit;};
G4double Run::GetInelastic ( ) const
inline

Definition at line 62 of file Run.hh.

62 {return fNbInelastic;};
G4double Run::GetMeanCluster ( ) const
inline

Definition at line 125 of file Run.hh.

126 {
127  return fMeanCluster;
128 }
G4VPrimitiveScorer* Run::GetPrimitiveScorer ( ) const
inline

Definition at line 63 of file Run.hh.

63 { return fScorerRun;}
const G4StatDouble * Run::GetStat ( ) const
inline

Definition at line 130 of file Run.hh.

131 {
132  return &fEdep;
133 }
G4double Run::GetSumDose ( ) const
inline

Definition at line 62 of file Run.hh.

62 { return fSumEne; }
G4double Run::GetTotCluster ( ) const
inline

Definition at line 120 of file Run.hh.

121 {
122  return fTotCluster;
123 }
G4double Run::GetTotStepGas ( ) const
inline

Definition at line 115 of file Run.hh.

116 {
117  return fTotStepGas;
118 }
G4int Run::GetVerbose ( ) const
inline

Definition at line 110 of file Run.hh.

111 {
112  return fVerbose;
113 }
G4double Run::GetXfrontNorm ( G4int  i)

Definition at line 156 of file Run.cc.

157 {
158  return fXfrontNorm[i];
159 }
void Run::InitializePerEvent ( )

Definition at line 97 of file Run.cc.

98 {
99  //initialize arrays of energy deposit per bin
100  for (G4int i=0; i<f_nLbin; i++)
101  { f_dEdL[i] = 0.; }
102 
103  for (G4int j=0; j<f_nRbin; j++)
104  { f_dEdR[j] = 0.; }
105 
106  //initialize tracklength
107  fChargTrLength = fNeutrTrLength = 0.;
108 }
int G4int
Definition: G4Types.hh:78
void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

void Run::Merge ( const G4Run run)
virtual

Reimplemented from G4Run.

Definition at line 115 of file Run.cc.

116 {
117  const Run* localRun = static_cast<const Run*>(run);
118 
119  // pass information about primary particle
120  fParticle = localRun->fParticle;
121  fEkin = localRun->fEkin;
122 
123  // accumulate sums
124  //
125  for (G4int k=0; k<kLayerMax; k++) {
126  EtotLayer[k] += localRun->EtotLayer[k];
127  Etot2Layer[k] += localRun->Etot2Layer[k];
128  EvisLayer[k] += localRun->EvisLayer[k];
129  Evis2Layer[k] += localRun->Evis2Layer[k];
130  }
131 
132  EtotCalor += localRun->EtotCalor;
133  Etot2Calor += localRun->Etot2Calor;
134  EvisCalor += localRun->EvisCalor;
135  Evis2Calor += localRun->Evis2Calor;
136  Eleak += localRun->Eleak;
137  Eleak2 += localRun->Eleak2;
138  EdLeak[0] += localRun->EdLeak[0];
139  EdLeak[1] += localRun->EdLeak[1];
140  EdLeak[2] += localRun->EdLeak[2];
141 
142  G4Run::Merge(run);
143 }
virtual void Merge(const G4Run *)
Definition: G4Run.cc:54
int G4int
Definition: G4Types.hh:78
Definition: Run.hh:46

Here is the call graph for this function:

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

virtual void Run::Merge ( const G4Run )
virtual

Reimplemented from G4Run.

void Run::ParticleCount ( G4String  ,
G4double   
)
void Run::ParticleCount ( G4String  ,
G4double   
)
void Run::ParticleCount ( G4String  ,
G4double   
)
void Run::ParticleCount ( G4String  ,
G4double   
)
void Run::ParticleCount ( G4String  name,
G4double  Ekin,
G4int  iVol 
)

Definition at line 99 of file Run.cc.

100 {
101  if (iVol == 1) {
102  std::map<G4String, ParticleData>::iterator it = fParticleDataMap1.find(name);
103  if ( it == fParticleDataMap1.end()) {
104  fParticleDataMap1[name] = ParticleData(1, Ekin, Ekin, Ekin);
105  }
106  else {
107  ParticleData& data = it->second;
108  data.fCount++;
109  data.fEmean += Ekin;
110  //update min max
111  G4double emin = data.fEmin;
112  if (Ekin < emin) data.fEmin = Ekin;
113  G4double emax = data.fEmax;
114  if (Ekin > emax) data.fEmax = Ekin;
115  }
116  }
117 
118  if (iVol == 2) {
119  std::map<G4String, ParticleData>::iterator it = fParticleDataMap2.find(name);
120  if ( it == fParticleDataMap2.end()) {
121  fParticleDataMap2[name] = ParticleData(1, Ekin, Ekin, Ekin);
122  }
123  else {
124  ParticleData& data = it->second;
125  data.fCount++;
126  data.fEmean += Ekin;
127  //update min max
128  G4double emin = data.fEmin;
129  if (Ekin < emin) data.fEmin = Ekin;
130  G4double emax = data.fEmax;
131  if (Ekin > emax) data.fEmax = Ekin;
132  }
133  }
134 }
const XML_Char * name
Definition: expat.h:151
const XML_Char const XML_Char * data
Definition: expat.h:268
static const G4double emax
double G4double
Definition: G4Types.hh:76
void Run::ParticleCount ( G4int  k,
G4String  name,
G4double  Ekin 
)

Definition at line 90 of file Run.cc.

91 {
92  std::map<G4String, ParticleData>::iterator it = fParticleDataMap[k].find(name);
93  if ( it == fParticleDataMap[k].end()) {
94  (fParticleDataMap[k])[name] = ParticleData(1, Ekin, Ekin, Ekin);
95  }
96  else {
97  ParticleData& data = it->second;
98  data.fCount++;
99  data.fEmean += Ekin;
100  //update min max
101  G4double emin = data.fEmin;
102  if (Ekin < emin) data.fEmin = Ekin;
103  G4double emax = data.fEmax;
104  if (Ekin > emax) data.fEmax = Ekin;
105  }
106 }
const XML_Char const XML_Char * data
Definition: expat.h:268
static const G4double emax
double G4double
Definition: G4Types.hh:76
void Run::ParticleCount ( G4String  name,
G4double  Ekin 
)

Definition at line 114 of file Run.cc.

115 {
116  std::map<G4String, ParticleData>::iterator it = fParticleDataMap.find(name);
117  if ( it == fParticleDataMap.end()) {
118  fParticleDataMap[name] = ParticleData(1, Ekin, Ekin, Ekin);
119  }
120  else {
121  ParticleData& data = it->second;
122  data.fCount++;
123  data.fEmean += Ekin;
124  //update min max
125  G4double emin = data.fEmin;
126  if (Ekin < emin) data.fEmin = Ekin;
127  G4double emax = data.fEmax;
128  if (Ekin > emax) data.fEmax = Ekin;
129  }
130 }
const XML_Char * name
Definition: expat.h:151
const XML_Char const XML_Char * data
Definition: expat.h:268
static const G4double emax
double G4double
Definition: G4Types.hh:76
void Run::ParticleFlux ( G4String  name,
G4double  Ekin 
)

Definition at line 116 of file Run.cc.

117 {
118  std::map<G4String, ParticleData>::iterator it = fParticleDataMap2.find(name);
119  if ( it == fParticleDataMap2.end()) {
120  fParticleDataMap2[name] = ParticleData(1, Ekin, Ekin, Ekin);
121  }
122  else {
123  ParticleData& data = it->second;
124  data.fCount++;
125  data.fEmean += Ekin;
126  //update min max
127  G4double emin = data.fEmin;
128  if (Ekin < emin) data.fEmin = Ekin;
129  G4double emax = data.fEmax;
130  if (Ekin > emax) data.fEmax = Ekin;
131  }
132 }
const XML_Char * name
Definition: expat.h:151
const XML_Char const XML_Char * data
Definition: expat.h:268
static const G4double emax
double G4double
Definition: G4Types.hh:76
void Run::ParticleFlux ( G4String  ,
G4double   
)
void Run::PrimaryTiming ( G4double  ptime)

Definition at line 147 of file Run.cc.

148 {
149  fPrimaryTime += ptime;
150 }
void Run::RecordEvent ( const G4Event event)
virtual

Reimplemented from G4Run.

Definition at line 74 of file Run.cc.

75 {
76  if(event->IsAborted()) return;
77 
78  G4int CollectionID =
79  G4SDManager::GetSDMpointer()->GetCollectionID("mfDetector/Species");
80  // G4int evtNb = event->GetEventID();
81 
82  // G4cout << G4endl << "---> end of event: " << evtNb << G4endl;
83  //Hits collections
84  //
85  G4HCofThisEvent* HCE = event->GetHCofThisEvent();
86  if(!HCE) return;
87 
88  G4THitsMap<G4double>* evtMap =
89  static_cast<G4THitsMap<G4double>*>(HCE->GetHC(CollectionID));
90 
91  std::map<G4int,G4double*>::iterator itr;
92  for (itr = evtMap->GetMap()->begin(); itr != evtMap->GetMap()->end(); itr++){
93  G4double edep = *(itr->second);
94  fSumEne+=edep;
95  // G4cout<<"Energy for this event: "<<edep/eV<<" eV"<<G4endl;
96  }
97 
98  G4Run::RecordEvent(event);
99 }
G4VHitsCollection * GetHC(G4int i)
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
int G4int
Definition: G4Types.hh:78
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
virtual void RecordEvent(const G4Event *)
Definition: G4Run.cc:51
std::map< G4int, T * > * GetMap() const
Definition: G4THitsMap.hh:99
double G4double
Definition: G4Types.hh:76
G4bool IsAborted() const
Definition: G4Event.hh:195

Here is the call graph for this function:

void Run::SetApplyLimit ( G4bool  val)

Definition at line 357 of file Run.cc.

358 {
359  fApplyLimit = val;
360 }

Here is the caller graph for this function:

void Run::SetCsdaRange ( G4double  value)

Definition at line 107 of file Run.cc.

108 {
109  fCsdaRange = value;
110 }
const XML_Char int const XML_Char * value
Definition: expat.h:331
void Run::SetCsdaRange ( G4int  i,
G4double  value 
)

Definition at line 135 of file Run.cc.

136 {
137  fCsdaRange[i] = value;
138 }
const XML_Char int const XML_Char * value
Definition: expat.h:331
void Run::SetEdepAndRMS ( G4int  i,
G4double  edep,
G4double  rms,
G4double  lim 
)

Definition at line 346 of file Run.cc.

347 {
348  if (i>=0 && i<kMaxAbsor) {
349  fEdeptrue [i] = edep;
350  fRmstrue [i] = rms;
351  fLimittrue[i] = lim;
352  }
353 }
const G4int kMaxAbsor

Here is the caller graph for this function:

void Run::SetPrimary ( G4ParticleDefinition particle)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)

Definition at line 77 of file Run.cc.

78 {
79  fParticle = particle;
80  fEkin = energy;
81 }
G4double energy(const ThreeVector &p, const G4double m)

Here is the call graph for this function:

void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetPrimary ( G4ParticleDefinition particle,
G4double  energy 
)
void Run::SetTargetXXX ( G4bool  flag)

Definition at line 71 of file Run.cc.

72 {
73  fTargetXXX = flag;
74 }
void Run::SetTimeWindow ( G4double  t1,
G4double  t2 
)

Definition at line 89 of file Run.cc.

90 {
91  fTimeWindow1 = t1;
92  fTimeWindow2 = t2;
93 }
tuple t1
Definition: plottest35.py:33
void Run::SetVerbose ( G4int  value)
inline
void Run::SetVerbose ( G4int  val)
inline

Definition at line 70 of file Run.hh.

70 {fVerbose = val;};

Here is the caller graph for this function:

void Run::SetXfrontNorm ( G4int  i,
G4double  value 
)

Definition at line 142 of file Run.cc.

143 {
144  fXfrontNorm[i] = value;
145 }
const XML_Char int const XML_Char * value
Definition: expat.h:331
void Run::StepInCavity ( G4double  s)
inline

Definition at line 74 of file Run.hh.

74  { fStepCavity += s; fStepCavity2 += s*s;
75  fNbStepCavity++;};
const XML_Char * s
Definition: expat.h:262
void Run::StepInCavity ( G4double  s)
inline

Definition at line 75 of file Run.hh.

75  { fStepCavity += s; fStepCavity2 += s*s;
76  fNbStepCavity++;};
const XML_Char * s
Definition: expat.h:262
void Run::StepInWall ( G4double  s)
inline

Definition at line 72 of file Run.hh.

72  { fStepWall += s; fStepWall2 += s*s;
73  fNbStepWall++;};
const XML_Char * s
Definition: expat.h:262
void Run::StepInWall ( G4double  s)
inline

Definition at line 73 of file Run.hh.

73  { fStepWall += s; fStepWall2 += s*s;
74  fNbStepWall++;};
const XML_Char * s
Definition: expat.h:262
void Run::SumEnergyFlow ( G4int  plane,
G4double  Eflow 
)

Definition at line 105 of file Run.cc.

106 {
107  fEnergyFlow[plane] += Eflow;
108 }
void Run::SumEsecond ( G4double  e)
inline

Definition at line 62 of file Run.hh.

62  { fEsecondary += e; fEsecondary2 += e*e;
63  fNbSec++;};
void Run::SumeTransf ( G4double  energy)

Definition at line 90 of file Run.cc.

91 {
92  fEnTransfer += energy;
93 }
G4double energy(const ThreeVector &p, const G4double m)

Here is the call graph for this function:

void Run::SumEvents_1 ( G4int  layer,
G4double  Etot,
G4double  Evis 
)

Definition at line 85 of file Run.cc.

86 {
87  //accumulate statistic per layer
88  //
89  EtotLayer[layer] += Etot; Etot2Layer[layer] += Etot*Etot;
90  EvisLayer[layer] += Evis; Evis2Layer[layer] += Evis*Evis;
91 }

Here is the caller graph for this function:

void Run::SumEvents_2 ( G4double  etot,
G4double  evis,
G4double  eleak 
)

Definition at line 95 of file Run.cc.

96 {
97  //accumulate statistic for full calorimeter
98  //
99  EtotCalor += etot; Etot2Calor += etot*etot;
100  EvisCalor += evis; Evis2Calor += evis*evis;
101  Eleak += eleak; Eleak2 += eleak*eleak;
102 }

Here is the caller graph for this function:

void Run::SumFluence ( G4double  r,
G4double  fl 
)

Definition at line 186 of file Run.cc.

187 {
188  G4int ibin = (int)(r/fDr);
189  if (ibin >= fNbBins) return;
190  fNbEntries[ibin]++;
191  fluence[ibin] += fl;
192  fluence2[ibin] += fl*fl;
193 }
int G4int
Definition: G4Types.hh:78
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)

Here is the call graph for this function:

void Run::SumLateralEleak ( G4int  cell,
G4double  Eflow 
)

Definition at line 112 of file Run.cc.

113 {
114  fLateralEleak[cell] += Eflow;
115 }
void Run::SumTrack ( G4double  track)

Definition at line 81 of file Run.cc.

82 {
83  fTotalCount++;
84  fSumTrack += track;
85  fSumTrack2 += track*track;
86 }
void Run::SumTrack ( G4double  )
void Run::SumTrackLength ( G4int  nstep1,
G4int  nstep2,
G4double  trackl1,
G4double  trackl2,
G4double  time1,
G4double  time2 
)

Definition at line 100 of file Run.cc.

103 {
104  fNbStep1 += nstep1; fNbStep2 += nstep2;
105  fTrackLen1 += trackl1; fTrackLen2 += trackl2;
106  fTime1 += time1; fTime2 += time2;
107 }
void Run::SurveyConvergence ( G4int  NbofEvents)

Definition at line 310 of file Run.cc.

311 {
312  if (NbofEvents == 0) return;
313 
314  //mean kinetic energy of secondary electrons
315  //
316  G4double meanEsecond = 0.;
317  if (fNbSec > 0) meanEsecond = fEsecondary/fNbSec;
318  G4double rateEmean = 0.;
319  // compute variation rate (%), iteration to iteration
320  if (fOldEmean > 0.) rateEmean = 100*(meanEsecond/fOldEmean - 1.);
321  fOldEmean = meanEsecond;
322 
323  //beam energy fluence
324  //
325  G4double rBeam = fWallRadius*(fKinematic->GetBeamRadius());
326  G4double surfaceBeam = CLHEP::pi*rBeam*rBeam;
327  G4double beamEnergy = fKinematic->GetParticleGun()->GetParticleEnergy();
328 
329  //total dose in cavity
330  //
331  G4double doseCavity = fEdepCavity/fMassCavity;
332  G4double doseOverBeam = doseCavity*surfaceBeam/(NbofEvents*beamEnergy);
333  G4double rateDose = 0.;
334  // compute variation rate (%), iteration to iteration
335  if (fOldDose > 0.) rateDose = 100*(doseOverBeam/fOldDose - 1.);
336  fOldDose = doseOverBeam;
337 
338  std::ios::fmtflags mode = G4cout.flags();
339  G4cout.setf(std::ios::fixed,std::ios::floatfield);
340  G4int prec = G4cout.precision(3);
341 
342  G4cout << "\n ---> NbofEvents= " << NbofEvents
343  << " NbOfelectr= " << fNbSec
344  << " Tkin= " << G4BestUnit(meanEsecond,"Energy")
345  << " (" << rateEmean << " %)"
346  << " NbOfelec in cav= " << fPartFlowCavity[0]
347  << " Dose/EnFluence= " << G4BestUnit(doseOverBeam,"Surface/Mass")
348  << " (" << rateDose << " %)"
349  << G4endl;
350 
351  // reset default formats
352  G4cout.setf(mode,std::ios::floatfield);
353  G4cout.precision(prec);
354 }
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
int G4int
Definition: G4Types.hh:78
static const double prec
Definition: RanecuEngine.cc:58
G4GLOB_DLL std::ostream G4cout
G4ParticleGun * GetParticleGun()
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static constexpr double pi
Definition: SystemOfUnits.h:54
G4double GetParticleEnergy() const

Here is the call graph for this function:

void Run::SurveyConvergence ( G4int  )
void Run::WriteActivity ( G4int  nevent)

Definition at line 386 of file Run.cc.

387 {
390  pTable->FindProcess("RadioactiveDecay", "GenericIon");
391 
392  // output the induced radioactivities (in VR mode only)
393  //
394  if ((rDecay == 0) || (rDecay->IsAnalogueMonteCarlo())) return;
395 
396  G4String fileName = G4AnalysisManager::Instance()->GetFileName() + ".activity";
397  std::ofstream outfile (fileName, std::ios::out );
398 
399  std::vector<G4RadioactivityTable*> theTables =
400  rDecay->GetTheRadioactivityTables();
401 
402  for (size_t i = 0 ; i < theTables.size(); i++) {
403  G4double rate, error;
404  outfile << "Radioactivities in decay window no. " << i << G4endl;
405  outfile << "Z \tA \tE \tActivity (decays/window) \tError (decays/window) "
406  << G4endl;
407 
408  map<G4ThreeVector,G4TwoVector> *aMap = theTables[i]->GetTheMap();
409  map<G4ThreeVector,G4TwoVector>::iterator iter;
410  for (iter=aMap->begin(); iter != aMap->end(); iter++) {
411  rate = iter->second.x()/nevent;
412  error = std::sqrt(iter->second.y())/nevent;
413  if (rate < 0.) rate = 0.; // statically it can be < 0.
414  outfile << iter->first.x() <<"\t"<< iter->first.y() <<"\t"
415  << iter->first.z() << "\t" << rate <<"\t" << error << G4endl;
416  }
417  outfile << G4endl;
418  }
419  outfile.close();
420 }
std::vector< G4RadioactivityTable * > GetTheRadioactivityTables()
#define G4endl
Definition: G4ios.hh:61
static PROLOG_HANDLER error
Definition: xmlrole.cc:112
double G4double
Definition: G4Types.hh:76
static G4ProcessTable * GetProcessTable()
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const

Here is the call graph for this function:

Friends And Related Function Documentation

friend class RunMerger
friend

Definition at line 35 of file Run.hh.

Member Data Documentation

G4double Run::f_e_gam_sync

Definition at line 56 of file Run.hh.

G4double Run::f_e_gam_sync2

Definition at line 56 of file Run.hh.

G4double Run::f_e_gam_sync_max

Definition at line 57 of file Run.hh.

G4double Run::f_lam_gam_sync

Definition at line 58 of file Run.hh.

G4int Run::f_n_gam_sync

Definition at line 55 of file Run.hh.


The documentation for this class was generated from the following files: