34 #include "RunAction.hh"
35 #include "DetectorConstruction.hh"
36 #include "PrimaryGeneratorAction.hh"
37 #include "RunActionMessenger.hh"
51 :fDetector(det), fKinematic(kin)
54 fProjRange = fProjRange2 = fBinLength = fOffsetX = 0.;
66 delete fRunActionMessenger;
78 fProjRange = fProjRange2 = 0.;
81 if(0.0 == fBinLength) { fBinLength = 5 *
mm; }
85 fOffsetX = -0.5 * length;
91 fHisto->
Add1D(
"1",
"Edep (MeV/mm) along absorber (mm)", nbBins, 0, length,
mm);
92 fHisto->
Add1D(
"2",
"DEDX (MeV/mm) of proton", 100, -3., 7.);
93 fHisto->
Add1D(
"3",
"DEDX (MeV/mm) of monopole", 100, -3., 7.);
94 fHisto->
Add1D(
"4",
"Range(mm) of proton", 100, -3., 7.,
mm);
95 fHisto->
Add1D(
"5",
"Range(mm) of monopole", 100, -3., 7.,
mm);
105 if (nEvents == 0) {
return; }
118 G4cout <<
"\n The run consists of " << nEvents <<
" "<< particle <<
" of "
121 << matName <<
" (density: "
127 fProjRange /= nEvents; fProjRange2 /= nEvents;
128 G4double rms = fProjRange2 - fProjRange*fProjRange;
129 if (rms>0.) { rms = std::sqrt(rms); }
139 G4double ekin[100], dedxproton[100], dedxmp[100];
143 for(i = 0; i < 100; ++i) {
153 for(i=0; i<100; i++) {
154 G4cout <<
" E(MeV)= " << ekin[i] <<
" dedxp= " << dedxproton[i]
155 <<
" dedxmp= " << dedxmp[i]
169 for(i=0; i<100; ++i) {
171 fHisto->
Fill(1, e, dedxproton[i]);
172 fHisto->
Fill(2, e, dedxmp[i]);
173 fHisto->
Fill(3, e, std::log10(calc.
GetRange(ekin[i],
"proton",matName)/
mm));
174 fHisto->
Fill(4, e, std::log10(calc.
GetRange(ekin[i],
"monopole",matName)/
mm));
188 G4cout <<
"FillHisto " << ih <<
" x=" << x <<
" weight= " << weight
191 fHisto->
Fill(ih, x, weight);