34 #include "B4Analysis.hh"
39 #include "G4HCofThisEvent.hh"
60 "Print events modulo n");
74 B4cEventAction::GetHitsCollection(
const G4String& hcName,
81 event->GetHCofThisEvent()->GetHC(hcID));
83 if ( ! hitsCollection ) {
84 G4cerr <<
"Cannot access hitsCollection " << hcName <<
G4endl;
88 return hitsCollection;
93 void B4cEventAction::PrintEventStatistics(
99 <<
" Absorber: total energy: "
100 << std::setw(7) <<
G4BestUnit(absoEdep,
"Energy")
101 <<
" total track length: "
102 << std::setw(7) <<
G4BestUnit(absoTrackLength,
"Length")
104 <<
" Gap: total energy: "
105 << std::setw(7) <<
G4BestUnit(gapEdep,
"Energy")
106 <<
" total track length: "
107 << std::setw(7) <<
G4BestUnit(gapTrackLength,
"Length")
116 G4int eventID =
event->GetEventID();
117 if ( eventID % fPrintModulo == 0 ) {
118 G4cout <<
"\n---> Begin of event: " << eventID <<
G4endl;
129 = GetHitsCollection(
"AbsorberHitsCollection", event);
131 = GetHitsCollection(
"GapHitsCollection", event);
139 G4int eventID =
event->GetEventID();
140 if ( eventID % fPrintModulo == 0) {
143 PrintEventStatistics(
155 analysisManager->FillH1(1, absoHit->
GetEdep());
156 analysisManager->FillH1(2, gapHit->
GetEdep());
161 analysisManager->FillNtupleDColumn(0, absoHit->
GetEdep());
162 analysisManager->FillNtupleDColumn(1, gapHit->
GetEdep());
165 analysisManager->AddNtupleRow();