34 #include "B4Analysis.hh"
39 #include "G4HCofThisEvent.hh"
66 event->GetHCofThisEvent()->GetHC(hcID));
68 if ( ! hitsCollection ) {
70 msg <<
"Cannot access hitsCollection ID " << hcID;
75 return hitsCollection;
86 <<
" Absorber: total energy: "
87 << std::setw(7) <<
G4BestUnit(absoEdep,
"Energy")
88 <<
" total track length: "
89 << std::setw(7) <<
G4BestUnit(absoTrackLength,
"Length")
91 <<
" Gap: total energy: "
92 << std::setw(7) <<
G4BestUnit(gapEdep,
"Energy")
93 <<
" total track length: "
94 << std::setw(7) <<
G4BestUnit(gapTrackLength,
"Length")
120 auto absoHit = (*absoHC)[absoHC->entries()-1];
121 auto gapHit = (*gapHC)[gapHC->entries()-1];
125 auto eventID =
event->GetEventID();
127 if ( ( printModulo > 0 ) && (
eventID % printModulo == 0 ) ) {
131 absoHit->GetEdep(), absoHit->GetTrackLength(),
132 gapHit->GetEdep(), gapHit->GetTrackLength());
139 auto analysisManager = G4AnalysisManager::Instance();
142 analysisManager->FillH1(0, absoHit->GetEdep());
143 analysisManager->FillH1(1, gapHit->GetEdep());
144 analysisManager->FillH1(2, absoHit->GetTrackLength());
145 analysisManager->FillH1(3, gapHit->GetTrackLength());
148 analysisManager->FillNtupleDColumn(0, absoHit->GetEdep());
149 analysisManager->FillNtupleDColumn(1, gapHit->GetEdep());
150 analysisManager->FillNtupleDColumn(2, absoHit->GetTrackLength());
151 analysisManager->FillNtupleDColumn(3, gapHit->GetTrackLength());
152 analysisManager->AddNtupleRow();
G4int GetCollectionID(G4String colName)
static G4RunManager * GetRunManager()
virtual void BeginOfEventAction(const G4Event *event)
std::ostringstream G4ExceptionDescription
B4cCalorHitsCollection * GetHitsCollection(G4int hcID, const G4Event *event) const
Definition of the B4cCalorimeterSD class.
Definition of the B4cEventAction class.
void PrintEventStatistics(G4double absoEdep, G4double absoTrackLength, G4double gapEdep, G4double gapTrackLength) const
virtual ~B4cEventAction()
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
virtual void EndOfEventAction(const G4Event *event)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
static G4SDManager * GetSDMpointer()
Definition of the B4cCalorHit class.
G4GLOB_DLL std::ostream G4cout