45 #include "G4HCofThisEvent.hh"
63 fSteppingAction(sa),SDnames(nullptr),numberOfSD(0)
84 <<
" calorimeter-like SD" <<
G4endl;
94 G4cout <<
"CCalEndOfEventAction: found SD " << i <<
" name "
121 G4cout <<
"CCalEndOfEventAction: No Hit Collection in this event"
132 G4float hcalE[28], ecalE[49], fullE=0., edec=0, edhc=0;
134 for (i = 0; i < 28; i++) {hcalE[i]=0.;}
135 for (i = 0; i < 49; i++) {ecalE[i]=0.;}
155 G4cout <<
" There are " << nentries <<
" hits in " <<
SDnames[i]
170 if (unitID > 0 && unitID < 29) {
174 G4int i0 = unitID/4096;
175 G4int i1 = (unitID/64)%64;
176 G4int i2 = unitID%64;
177 if (i0 == 1 && i1 < 8 && i2 < 8) {
183 G4cout <<
" with Energy = " << En/
MeV <<
" MeV in Unit " << unitID
191 G4cout <<
" ===> Total Energy Deposit in this Calorimeter = "
192 << edep[i]*1000.0 <<
" MeV " <<
G4endl;
197 if (
SDnames[i] ==
"HadronCalorimeter") {
199 }
else if (
SDnames[i] ==
"CrystalMatrix") {
215 static G4int IDenergy = -1;
217 IDenergy = man->
GetH1Id(
"h4000");
218 man->
FillH1(IDenergy,fullE);
220 G4double totalFilledEnergyHcal = 0.0;
221 static G4int IDhcalE = -1;
223 IDhcalE = man->
GetH1Id(
"h100");
224 for (
G4int j=0; j<28; j++) {
225 man->
FillH1(IDhcalE+j,hcalE[j]);
227 G4cout <<
"Fill Hcal histo " << j <<
" with " << hcalE[j] <<
G4endl;
229 totalFilledEnergyHcal += hcalE[j];
233 "CCalAnalysis::InsertEnergyHcal: Total filled Energy Hcal histo "
234 << totalFilledEnergyHcal <<
G4endl;
238 static G4int IDecalE = -1;
240 IDecalE = man->
GetH1Id(
"h200");
241 G4double totalFilledEnergyEcal = 0.0;
242 for (
G4int j=0; j<49; j++) {
243 man->
FillH1(IDecalE+j,ecalE[j]);
245 G4cout <<
"Fill Ecal histo " << j <<
" with " << ecalE[j] <<
G4endl;
247 totalFilledEnergyEcal += ecalE[j];
251 "CCalAnalysis::InsertEnergyEal: Total filled Energy Ecal histo "
252 << totalFilledEnergyEcal <<
G4endl;
256 for (
G4int j=0; j<28; j++)
261 for (
G4int j=0; j<49; j++)
279 static G4int IDtimeProfile = -1;
280 if (IDtimeProfile < 0)
281 IDtimeProfile = man->
GetH1Id(
"h901");
295 G4cout <<
"CCalAnalysis:: Fill Time Profile with Hit " <<
k
296 <<
" Edeposit " << edep <<
" Gev" <<
G4endl;