35 #include "DetectorConstruction.hh"
36 #include "PrimaryGeneratorAction.hh"
49 fParticle(0), fEkin(0.),
50 fNbOfTraks0(0), fNbOfTraks1(0),
51 fNbOfSteps0(0), fNbOfSteps1(0),
53 fTrueRange(0.), fTrueRange2(0.),
54 fProjRange(0.), fProjRange2(0.),
55 fTransvDev(0.), fTransvDev2(0.)
83 G4cout <<
"\n ======================== run summary ======================\n";
84 G4cout <<
"\n The run was: " << nbOfEvents <<
" " << partName <<
" of "
87 << material->
GetName() <<
" (density: "
89 G4cout <<
"\n ============================================================\n";
99 G4int prec = 5, wid = prec + 2;
103 G4cout <<
"\n total energy deposit: "
108 G4cout <<
"\n nb tracks/event"
109 <<
" neutral: " << std::setw(wid) << fNbOfTraks0/dNbOfEvents
110 <<
" charged: " << std::setw(wid) << fNbOfTraks1/dNbOfEvents
111 <<
"\n nb steps/event"
112 <<
" neutral: " << std::setw(wid) << fNbOfSteps0/dNbOfEvents
113 <<
" charged: " << std::setw(wid) << fNbOfSteps1/dNbOfEvents
117 std::map<G4String,G4int>::iterator it;
118 G4cout <<
"\n nb of process calls per event: \n ";
119 for (it = fProcCounter.begin(); it != fProcCounter.end(); it++)
120 G4cout << std::setw(12) << it->first;
123 for (it = fProcCounter.begin(); it != fProcCounter.end(); it++)
124 G4cout << std::setw(12) << (it->second)/dNbOfEvents;
130 G4double trueRms = fTrueRange2 - fTrueRange*fTrueRange;
131 if (trueRms>0.) trueRms = std::sqrt(trueRms);
else trueRms = 0.;
134 G4double projRms = fProjRange2 - fProjRange*fProjRange;
135 if (projRms>0.) projRms = std::sqrt(projRms);
else projRms = 0.;
138 G4double trvsRms = fTransvDev2 - fTransvDev*fTransvDev;
139 if (trvsRms>0.) trvsRms = std::sqrt(trvsRms);
else trvsRms = 0.;
149 rangeTable = emCalculator.
GetCSDARange(fEkin,fParticle,material);
151 G4cout <<
"\n---------------------------------------------------------\n";
152 G4cout <<
" Primary particle : " ;
154 <<
" rms = " <<
G4BestUnit(trueRms,
"Length");
157 <<
" rms = " <<
G4BestUnit(projRms,
"Length");
159 G4cout <<
"\n proj/true = " << fProjRange/fTrueRange;
161 G4cout <<
"\n transverse dispersion at end = "
164 G4cout <<
"\n mass true Range from simulation = "
165 <<
G4BestUnit(fTrueRange*density,
"Mass/Surface")
166 <<
"\n from PhysicsTable (csda range) = "
167 <<
G4BestUnit(rangeTable*density,
"Mass/Surface");
168 G4cout <<
"\n---------------------------------------------------------\n";
175 fProcCounter.clear();
182 const Run* localRun =
static_cast<const Run*
>(run);
185 fParticle = localRun->fParticle;
186 fEkin = localRun->fEkin;
190 fNbOfTraks0 += localRun->fNbOfTraks0;
191 fNbOfTraks1 += localRun->fNbOfTraks1;
192 fNbOfSteps0 += localRun->fNbOfSteps0;
193 fNbOfSteps1 += localRun->fNbOfSteps1;
194 fEdep += localRun->fEdep;
195 fTrueRange += localRun->fTrueRange;
196 fTrueRange2 += localRun->fTrueRange2;
197 fProjRange += localRun->fProjRange;
198 fProjRange2 += localRun->fProjRange2;
199 fTransvDev += localRun->fTransvDev;
200 fTransvDev2 += localRun->fTransvDev2;
203 std::map<G4String,G4int>::const_iterator it;
204 for (it = localRun->fProcCounter.begin();
205 it !=localRun->fProcCounter.end(); ++it) {
206 fProcCounter[it->first] += it->second;
virtual void Merge(const G4Run *)
const G4String & GetName() const
G4double GetDensity() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
const G4String & GetParticleName() const
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
G4GLOB_DLL std::ostream G4cout
void PrintSummary() const
G4int GetNumberOfEvent() const
G4Material * GetMaterial()
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
G4double GetPDGCharge() const
virtual void Merge(const G4Run *)
Run(DetectorConstruction *)