34 #include "B4Analysis.hh"
39 #include "G4HCofThisEvent.hh"
61 B4cEventAction::GetHitsCollection(
G4int hcID,
66 event->GetHCofThisEvent()->GetHC(hcID));
68 if ( ! hitsCollection ) {
70 msg <<
"Cannot access hitsCollection ID " << hcID;
75 return hitsCollection;
80 void B4cEventAction::PrintEventStatistics(
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")
108 if ( fAbsHCID == -1 ) {
125 G4int eventID =
event->GetEventID();
127 if ( ( printModulo > 0 ) && ( eventID % printModulo == 0 ) ) {
130 PrintEventStatistics(
142 analysisManager->FillH1(1, absoHit->
GetEdep());
143 analysisManager->FillH1(2, gapHit->
GetEdep());
148 analysisManager->FillNtupleDColumn(0, absoHit->
GetEdep());
149 analysisManager->FillNtupleDColumn(1, gapHit->
GetEdep());
152 analysisManager->AddNtupleRow();
G4int GetCollectionID(G4String colName)
G4double GetTrackLength() const
std::ostringstream G4ExceptionDescription
virtual void BeginOfEventAction(const G4Event *event)
virtual void EndOfEventAction(const G4Event *event)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
Definition of the B4cCalorimeterSD class.
G4GLOB_DLL std::ostream G4cout
ExG4HbookAnalysisManager G4AnalysisManager
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4RunManager * GetRunManager()
static G4SDManager * GetSDMpointer()
Definition of the B4cEventAction class.
virtual ~B4cEventAction()
Definition of the B4cCalorHit class.