44 #include "HistoManager.hh"
52 #include "EmAcceptance.hh"
84 fMaxEnergy = 50.0*
MeV;
86 fMaxEnergyAbs = 10.*
MeV;
111 fHisto->Add1D(
"10",
"Evis/E0 in central crystal",fBinsED,0.0,1,1.0);
112 fHisto->Add1D(
"11",
"Evis/E0 in 3x3",fBinsED,0.0,1.0,1.0);
113 fHisto->Add1D(
"12",
"Evis/E0 in 5x5",fBinsED,0.0,1.0,1.0);
114 fHisto->Add1D(
"13",
"Energy (MeV) of delta-electrons",
115 fBinsE,0.0,fMaxEnergy,
MeV);
116 fHisto->Add1D(
"14",
"Energy (MeV) of gammas",fBinsE,0.0,fMaxEnergy,
MeV);
117 fHisto->Add1D(
"15",
"Energy (MeV) in abs1",fBinsEA,0.0,fMaxEnergyAbs,
MeV);
118 fHisto->Add1D(
"16",
"Energy (MeV) in abs2",fBinsEA,0.0,fMaxEnergyAbs,
MeV);
119 fHisto->Add1D(
"17",
"Energy (MeV) in abs3",fBinsEA,0.0,fMaxEnergyAbs,
MeV);
120 fHisto->Add1D(
"18",
"Energy (MeV) in abs4",fBinsEA,0.0,fMaxEnergyAbs,
MeV);
121 fHisto->Add1D(
"19",
"Number of vertex hits",20,-0.5,19.5,1.0);
122 fHisto->Add1D(
"20",
"E1/E9 Ratio",fBinsED,0.0,1,1.0);
123 fHisto->Add1D(
"21",
"E1/E25 Ratio",fBinsED,0.0,1.0,1.0);
124 fHisto->Add1D(
"22",
"E9/E25 Ratio",fBinsED,0.0,1.0,1.0);
139 for(
G4int i=0; i<6; i++) {
150 fBrem.resize(93,0.0);
151 fPhot.resize(93,0.0);
152 fComp.resize(93,0.0);
153 fConv.resize(93,0.0);
156 for(
G4int i=0; i<fNmax; i++) {
162 if(fHisto->IsActive()) {
163 for(
G4int i=0; i<fNHisto; ++i) {fHisto->Activate(i,
true); }
167 G4cout <<
"HistoManager: Histograms are booked and run has been started"
178 G4cout <<
"HistoManager: End of run actions are started RunID# "
180 G4String nam[6] = {
"1x1",
"3x3",
"5x5",
"E1/E9 ",
"E1/E25",
"E9/E25"};
184 G4cout<<
"================================================================="
187 if(fEvt > 0) x = 1.0/
x;
189 for(j=0; j<fNmax; j++) {
193 G4double y = fErms[j]*x - fEdep[j]*fEdep[j];
195 fErms[j] = std::sqrt(y);
199 if(xx > 0.0) xx = 1.0/xx;
201 y = fErmstr[j]*xx - fEdeptr[j]*fEdeptr[j];
203 fErmstr[j] = std::sqrt(y);
213 G4cout << std::setprecision(4) <<
"Average number of e- " << xe <<
G4endl;
214 G4cout << std::setprecision(4) <<
"Average number of gamma " << xg <<
G4endl;
215 G4cout << std::setprecision(4) <<
"Average number of e+ " << xp <<
G4endl;
216 G4cout << std::setprecision(4) <<
"Average number of steps " << xs <<
G4endl;
222 if(xx > 0.0) xx = 1.0/xx;
224 G4cout << std::setprecision(4) <<
"Edep " << nam[j]
227 if(ex > 0.1)
G4cout <<
" res= " << f*sx/ex <<
" % " << fStat[j];
230 if(fLimittrue[0] < 10. || fLimittrue[1] < 10. || fLimittrue[2] < 10.) {
231 G4cout<<
"=========== Mean values without trancating ====================="<<
G4endl;
232 for(j=0; j<fNmax; j++) {
236 G4cout << std::setprecision(4) <<
"Edep " << nam[j]
239 if(ex > 0.0)
G4cout <<
" res= " << f*sx/ex <<
" %";
243 G4cout<<
"=========== Ratios without trancating ==========================="<<
G4endl;
247 if(xx > 0.0) xx = 1.0/xx;
251 if(y > 0.0) r = std::sqrt(y*xx);
252 G4cout <<
" " << nam[j] <<
" = " << e
256 G4cout << std::setprecision(4) <<
"Beam Energy " << fBeamEnergy/
GeV
258 if(fLowe > 0)
G4cout <<
"Number of events E/E0<0.8 " << fLowe <<
G4endl;
259 G4cout<<
"=================================================================="<<
G4endl;
263 if(fHisto->IsActive()) {
264 for(
G4int i=0; i<fNHisto; i++) {
265 fHisto->ScaleH1(i,x);
269 if(0 < runID) {
return; }
274 for (j=0; j<fNmax; j++) {
291 G4cout <<
" Z bremsstrahlung photoeffect compton conversion" <<
G4endl;
292 for(j=1; j<93; ++j) {
297 if(n1 + n2 + n3 + n4 > 0) {
298 G4cout << std::setw(4) << j << std::setw(12) << n1 << std::setw(12) << n2
299 << std::setw(12) << n3 << std::setw(12) << n4 <<
G4endl;
316 for (
G4int i=0; i<25; i++) {
327 for (
G4int i=0; i<25; i++) {
328 fE[i] /= fBeamEnergy;
330 if( ( 6<=i && 8>=i) || (11<=i && 13>=i) || (16<=i && 18>=i)) e9 += fE[i];
333 if(1 < fVerbose && e25 < 0.8) {
335 G4cout <<
"### in the event# " << fEvt <<
" E25= " << e25 <<
G4endl;
350 fErms[4] += e125*e125;
352 fErms[5] += e925*e925;
359 fHisto->Fill(0,e0,1.0);
360 fHisto->Fill(1,e9,1.0);
361 fHisto->Fill(2,e25,1.0);
362 fHisto->Fill(5,fEabs1,1.0);
363 fHisto->Fill(6,fEabs2,1.0);
364 fHisto->Fill(7,fEabs3,1.0);
365 fHisto->Fill(8,fEabs4,1.0);
366 fHisto->Fill(9,
G4double(fNvertex.size()),1.0);
367 fHisto->Fill(10,e19,1.0);
368 fHisto->Fill(11,e125,1.0);
369 fHisto->Fill(12,e925,1.0);
380 if(std::abs(e0-fEdeptrue[0])<fRmstrue[0]*fLimittrue[0]) {
385 if(std::abs(e9-fEdeptrue[1])<fRmstrue[1]*fLimittrue[1]) {
390 if(std::abs(e25-fEdeptrue[2])<fRmstrue[2]*fLimittrue[2]) {
393 fErmstr[2] += e25*e25;
420 G4cout <<
"TrackingAction: Primary kinE(MeV)= " << kinE/
MeV
421 <<
"; m(MeV)= " << mass/
MeV
422 <<
"; pos= " << pos <<
"; dir= " << dir <<
G4endl;
434 if(Z > 0 && Z < 93) { fBrem[Z] += 1.0; }
438 static_cast<const G4VEmProcess*
>(proc)->GetCurrentElement();
441 if(Z > 0 && Z < 93) { fPhot[Z] += 1.0; }
445 static_cast<const G4VEmProcess*
>(proc)->GetCurrentElement();
448 if(Z > 0 && Z < 93) { fConv[Z] += 1.0; }
452 static_cast<const G4VEmProcess*
>(proc)->GetCurrentElement();
455 if(Z > 0 && Z < 93) { fComp[Z] += 1.0; }
460 if (particle == fElectron) {
462 G4cout <<
"TrackingAction: Secondary electron " <<
G4endl;
466 }
else if (particle == fPositron) {
468 G4cout <<
"TrackingAction: Secondary positron " <<
G4endl;
472 }
else if (particle == fGamma) {
474 G4cout <<
"TrackingAction: Secondary gamma; parentID= " << pid
475 <<
" E= " << kinE <<
G4endl;
487 G4cout <<
"HistoManager::AddEnergy: e(keV)= " << edep/
keV
488 <<
"; volIdx= " << volIndex
489 <<
"; copyNo= " << copyNo
494 }
else if (1 == volIndex) {
496 }
else if (2 == volIndex) {
498 }
else if (3 == volIndex) {
500 }
else if (4 == volIndex) {
502 }
else if (5 == volIndex) {
503 G4int n = fNvertex.size();
506 for(
G4int i=0; i<
n; i++) {
507 if (copyNo == fNvertex[i]) {
515 fNvertex.push_back(copyNo);
516 fEvertex.push_back(edep);
527 fHisto->Fill(3,e,1.0);
536 fHisto->Fill(4,e,1.0);
543 if(i<fNmax && i>=0) {
544 if(val[0] > 0.0) fEdeptrue[i] = val[0];
545 if(val[1] > 0.0) fRmstrue[i] = val[1];
546 if(val[2] > 0.0) fLimittrue[i] = val[2];
void AddPositron(const G4DynamicParticle *)
G4ParticleDefinition * GetDefinition() const
G4int GetParentID() const
void AddPhoton(const G4DynamicParticle *)
G4double GetKineticEnergy() const
const G4DynamicParticle * GetDynamicParticle() const
void EmAcceptanceGauss(const G4String &title, G4int stat, G4double avr, G4double avr0, G4double rms, G4double limit)
void SetEdepAndRMS(G4int, G4ThreeVector)
void BeginOfAcceptance(const G4String &title, G4int stat)
void AddEnergy(G4double edep, const G4Step *)
const G4VProcess * GetCreatorProcess() const
G4GLOB_DLL std::ostream G4cout
void AddDeltaElectron(const G4DynamicParticle *)
const G4ThreeVector & GetMomentumDirection() const
const G4ThreeVector & GetVertexPosition() const
static G4Positron * Positron()
G4double GetPDGMass() const
void ScoreNewTrack(const G4Track *aTrack)
static G4Electron * Electron()
static HistoManager * GetPointer()
G4int GetProcessSubType() const