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);
137 G4cout <<
"HistoManager: Histograms are booked and run has been started"
139 G4cout <<
" BinsCluster= " << fBinsCluster <<
" BinsE= " << fBinsE
140 <<
" Emax(keV)= " << fMaxEnergy/
keV <<
G4endl;
149 if(fEvt > 0.0) { norm = 1.0/norm; }
153 fMeanCluster *= norm;
162 G4cout <<
" ================== run summary =====================" <<
G4endl;
164 G4cout <<
" End of Run TotNbofEvents = "
166 G4cout <<
" Energy(keV) per ADC channel = "
167 << 1.0/(
keV*fFactorALICE) << G4endl;
176 G4cout <<
" Mean energy deposit in absorber = " <<
177 y1/
keV <<
" +- " << y2*std::sqrt(norm)/
keV <<
" keV; ";
178 if(y1 > 0.0) {
G4cout <<
" RMS/Emean = " << y2/y1; }
180 G4cout <<
" Mean number of steps in absorber= "
181 << fTotStepGas <<
"; mean number of ion-clusters = "
182 << fTotCluster <<
" MeanCluster= " << fMeanCluster
186 G4cout <<
" ====== Energy deposit distribution Noverflows= " << fOverflow
190 std::ofstream fileOut(
"distribution.out", std::ios::out );
191 fileOut.setf( std::ios::scientific, std::ios::floatfield );
195 fileOut << fBinsE <<
G4endl;
197 for(
G4int j=0; j<fBinsE; ++j)
199 G4cout << std::setw(5) << j << std::setw(10) << x1/
keV
200 << std::setw(12) << fEgas[j] << std::setw(12) << fEgas[j]*norm
202 fileOut << x1/
keV <<
"\t" << fEgas[j] <<
G4endl;
208 if(fHisto->IsActive() && !fHistoBooked) {
209 fHisto->ScaleH1(0,norm);
210 fHisto->ScaleH1(1,norm);
212 fHisto->ScaleH1(2,0.1);
215 G4cout <<
" ================== run end ==========================" <<
G4endl;
232 fTotStepGas += fStepGas;
233 fTotCluster += fCluster;
235 G4int idx =
G4int(fTotEdep*fBinsE/fMaxEnergy);
236 if(idx < 0) { idx = 0; }
237 if(idx >= fBinsE) { fOverflow += 1.0; }
238 else { fEgas[idx] += 1.0; }
241 fHisto->Fill(0,fTotEdep/
keV,1.0);
242 fHisto->Fill(1,fCluster,1.0);
243 fHisto->Fill(2,fTotEdep*fFactorALICE/
keV,1.0);
245 fEdep.
fill(fTotEdep, 1.0);
253 G4cout <<
"HistoManager::AddEnergy: e(keV)= " << edep/
keV
G4double MeanNumberOfIonsAlongStep(const G4ParticleDefinition *, const G4Material *, G4double edepTotal, G4double edepNIEL=0.0)
static G4LossTableManager * Instance()
void fill(G4double x, G4double weight=1.)
void AddEnergy(G4double edep, const G4Step *)
G4GLOB_DLL std::ostream G4cout
G4int SampleNumberOfIonsAlongStep(const G4Step *)
G4ElectronIonPair * ElectronIonPair()
static HistoManager * GetPointer()
G4Track * GetTrack() const