45 #include "G4HCofThisEvent.hh"
62 fSteppingAction(sa),SDnames(nullptr),numberOfSD(0)
70 G4cout <<
"end of instantiation of EndofEventAction" <<
G4endl;
90 <<
" calorimeter-like SD" <<
G4endl;
100 G4cout <<
"CCalEndOfEventAction: found SD " << i <<
" name "
128 G4cout <<
"CCalEndOfEventAction: No Hit Collection in this event"
139 float hcalE[28], ecalE[49], fullE=0., edec=0, edhc=0;
141 for (i = 0; i < 28; i++) {hcalE[i]=0.;}
142 for (i = 0; i < 49; i++) {ecalE[i]=0.;}
162 G4cout <<
" There are " << nentries <<
" hits in " <<
SDnames[i]
177 if (unitID > 0 && unitID < 29) {
181 int i0 = unitID/4096;
182 int i1 = (unitID/64)%64;
184 if (i0 == 1 && i1 < 8 && i2 < 8) {
190 G4cout <<
" with Energy = " << En/
MeV <<
" MeV in Unit " << unitID
198 G4cout <<
" ===> Total Energy Deposit in this Calorimeter = "
199 << edep[i]*1000.0 <<
" MeV " <<
G4endl;
204 if (
SDnames[i] ==
"HadronCalorimeter") {
206 }
else if (
SDnames[i] ==
"CrystalMatrix") {
215 float x = pos.
x()/
mm;
216 float y = pos.
y()/
mm;
217 float z = pos.
z()/
mm;
222 static G4int IDenergy = -1;
224 IDenergy = man->
GetH1Id(
"h4000");
225 man->
FillH1(IDenergy,fullE);
227 G4double totalFilledEnergyHcal = 0.0;
228 static G4int IDhcalE = -1;
230 IDhcalE = man->
GetH1Id(
"h100");
231 for (
int j=0; j<28; j++) {
232 man->
FillH1(IDhcalE+j,hcalE[j]);
234 G4cout <<
"Fill Hcal histo " << j <<
" with " << hCalE[j] <<
G4endl;
236 totalFilledEnergyHcal += hcalE[j];
240 "CCalAnalysis::InsertEnergyHcal: Total filled Energy Hcal histo "
241 << totalFilledEnergyHcal <<
G4endl;
245 static G4int IDecalE = -1;
247 IDecalE = man->
GetH1Id(
"h200");
248 G4double totalFilledEnergyEcal = 0.0;
249 for (
int j=0; j<49; j++) {
250 man->
FillH1(IDecalE+j,ecalE[j]);
252 G4cout <<
"Fill Ecal histo " << j <<
" with " << ecalE[j] <<
G4endl;
254 totalFilledEnergyEcal += ecalE[j];
258 "CCalAnalysis::InsertEnergyEal: Total filled Energy Ecal histo "
259 << totalFilledEnergyEcal <<
G4endl;
263 for (
int j=0; j<28; j++)
268 for (
int j=0; j<49; j++)
287 static G4int IDtimeProfile = -1;
288 if (IDtimeProfile < 0)
289 IDtimeProfile = man->
GetH1Id(
"h901");
303 G4cout <<
"CCalAnalysis:: Fill Time Profile with Hit " << k
304 <<
" Edeposit " << edep <<
" Gev at " << time <<
" ns" <<
G4endl;
G4int GetCollectionID(G4String colName)
unsigned int getUnitID() const
static const G4double pos
static constexpr double MeV
virtual void StartOfEventAction(const G4Event *evt)
static constexpr double mm
G4int GetH1Id(const G4String &name, G4bool warn=true) const
double getTimeSlice() const
G4HCofThisEvent * GetHCofThisEvent() const
virtual void EndOfEventAction(const G4Event *evt)
CCalPrimaryGeneratorAction * fPrimaryGenerator
G4double GetParticleEnergy()
CCalSteppingAction * fSteppingAction
CCalEventAction(CCalPrimaryGeneratorAction *, CCalSteppingAction *)
G4VHitsCollection * GetHC(G4int i)
double getEnergyDeposit() const
static G4SDManager * GetSDMpointer()
CCaloOrganization * theOrg
G4bool FillNtupleFColumn(G4int id, G4float value)
G4GLOB_DLL std::ostream G4cout
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
static constexpr double GeV
G4ThreeVector GetParticlePosition()
static CCalSDList * getInstance()