43 #include "HistoManager.hh"
74 fMaxEnergy = 100.*
keV;
118 if(fHisto->IsActive() && !fHistoBooked) {
120 fHisto->Add1D(
"10",
"Energy deposition in detector (keV)",
121 fBinsE,0.0,fMaxEnergy/
keV,1.0);
122 fHisto->Add1D(
"11",
"Number of primary clusters",
123 fBinsCluster,-0.5,fBinsCluster-0.5,1.0);
124 fHisto->Add1D(
"12",
"Energy deposition in detector (ADC)",
127 fHisto->Activate(0,
true);
128 fHisto->Activate(1,
true);
129 fHisto->Activate(2,
true);
133 fEgas.resize(fBinsE,0.0);
136 G4cout <<
"HistoManager: Histograms are booked and run has been started"
138 G4cout <<
" BinsCluster= " << fBinsCluster <<
" BinsE= " << fBinsE
139 <<
" Emax(keV)= " << fMaxEnergy/
keV <<
G4endl;
148 if(fEvt > 0.0) { norm = 1.0/
norm; }
152 fMeanCluster *=
norm;
161 for(
G4int j=0; j<fBinsE; ++j) {
168 if(norm1 > 0.0) { norm1 = 1.0/norm1; }
172 if(y2 >= 0.0) { y2 = std::sqrt(y2); }
174 G4cout <<
" ================== run summary =====================" <<
G4endl;
176 G4cout <<
" End of Run TotNbofEvents = "
178 G4cout <<
" Energy(keV) per ADC channel = "
179 << 1.0/(
keV*fFactorALICE) << G4endl;
188 G4cout <<
" Mean energy deposit in absorber = " <<
189 y1/
keV <<
" +- " << y2*std::sqrt(norm)/
keV <<
" keV; ";
190 if(y1 > 0.0) {
G4cout <<
" RMS/Emean = " << y2/
y1; }
192 G4cout <<
" Mean number of steps in absorber= "
193 << fTotStepGas <<
"; mean number of ion-clusters = "
195 <<
" MeanCluster= " << fMeanCluster
199 G4cout <<
" ====== Energy deposit distribution Noverflows= " << fOverflow
203 std::ofstream fileOut(
"distribution.out", std::ios::out );
204 fileOut.setf( std::ios::scientific, std::ios::floatfield );
208 fileOut << fBinsE <<
G4endl;
210 for(
G4int j=0; j<fBinsE; ++j)
212 G4cout << std::setw(5) << j << std::setw(10) << x1/
keV
213 << std::setw(12) << fEgas[j] << std::setw(12) << fEgas[j]*norm
215 fileOut << x1/
keV <<
"\t" << fEgas[j] <<
G4endl;
221 if(fHisto->IsActive() && !fHistoBooked) {
222 fHisto->ScaleH1(0,norm);
223 fHisto->ScaleH1(1,norm);
225 fHisto->ScaleH1(2,0.1);
228 G4cout <<
" ================== run end ==========================" <<
G4endl;
245 fTotStepGas += fStepGas;
246 fTotCluster += fCluster;
248 G4int idx =
G4int(fTotEdep*fBinsE/fMaxEnergy);
249 if(idx < 0) { idx = 0; }
250 if(idx >= fBinsE) { fOverflow += 1.0; }
251 else { fEgas[idx] += 1.0; }
254 fHisto->Fill(0,fTotEdep/
keV,1.0);
255 fHisto->Fill(1,fCluster,1.0);
256 fHisto->Fill(2,fTotEdep*fFactorALICE/
keV,1.0);
264 G4cout <<
"HistoManager::AddEnergy: e(keV)= " << edep/
keV
G4double MeanNumberOfIonsAlongStep(const G4ParticleDefinition *, const G4Material *, G4double edepTotal, G4double edepNIEL=0.0)
static G4LossTableManager * Instance()
void AddEnergy(G4double edep, const G4Step *)
G4GLOB_DLL std::ostream G4cout
G4int SampleNumberOfIonsAlongStep(const G4Step *)
G4ElectronIonPair * ElectronIonPair()
static HistoManager * GetPointer()
G4Track * GetTrack() const