Geant4  10.02.p03
RE05EventAction Class Reference

#include <RE05EventAction.hh>

Inheritance diagram for RE05EventAction:
Collaboration diagram for RE05EventAction:

Public Member Functions

 RE05EventAction ()
 
virtual ~RE05EventAction ()
 
virtual void BeginOfEventAction (const G4Event *)
 
virtual void EndOfEventAction (const G4Event *)
 
- Public Member Functions inherited from G4UserEventAction
 G4UserEventAction ()
 
virtual ~G4UserEventAction ()
 
virtual void SetEventManager (G4EventManager *value)
 

Private Attributes

G4int trackerCollID
 
G4int calorimeterCollID
 
G4int muonCollID
 

Additional Inherited Members

- Protected Attributes inherited from G4UserEventAction
G4EventManagerfpEventManager
 

Detailed Description

Definition at line 38 of file RE05EventAction.hh.

Constructor & Destructor Documentation

◆ RE05EventAction()

RE05EventAction::RE05EventAction ( )

Definition at line 50 of file RE05EventAction.cc.

51 {
52  trackerCollID = -1;
53  calorimeterCollID = -1;
54  muonCollID = -1;
55 }

◆ ~RE05EventAction()

RE05EventAction::~RE05EventAction ( )
virtual

Definition at line 57 of file RE05EventAction.cc.

58 {;}

Member Function Documentation

◆ BeginOfEventAction()

void RE05EventAction::BeginOfEventAction ( const G4Event )
virtual

Reimplemented from G4UserEventAction.

Definition at line 60 of file RE05EventAction.cc.

61 {
64  {
65  G4String colNam;
66  trackerCollID = SDman->GetCollectionID(colNam="trackerCollection");
67  calorimeterCollID = SDman->GetCollectionID(colNam="calCollection");
68  muonCollID = SDman->GetCollectionID(colNam="muonCollection");
69  }
70 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
Here is the call graph for this function:

◆ EndOfEventAction()

void RE05EventAction::EndOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 72 of file RE05EventAction.cc.

73 {
74  G4cout << ">>> Event " << evt->GetEventID() << G4endl;
75 
76  if(trackerCollID<0||calorimeterCollID<0||muonCollID<0) return;
77 
78  G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
81  RE05MuonHitsCollection* MHC = 0;
82  if(HCE)
83  {
86  MHC = (RE05MuonHitsCollection*)(HCE->GetHC(muonCollID));
87  }
88 
89  if(THC)
90  {
91  int n_hit = THC->entries();
92  G4cout << " " << n_hit
93  << " hits are stored in RE05TrackerHitsCollection." << G4endl;
94  }
95  if(CHC)
96  {
97  int n_hit = CHC->entries();
98  G4cout << " " << n_hit
99  << " hits are stored in RE05CalorimeterHitsCollection." << G4endl;
100  G4double totE = 0;
101  for(int i=0;i<n_hit;i++)
102  { totE += (*CHC)[i]->GetEdep(); }
103  G4cout << " Total energy deposition in calorimeter : "
104  << totE / GeV << " (GeV)" << G4endl;
105  }
106  if(MHC)
107  {
108  int n_hit = MHC->entries();
109  G4cout << " " << n_hit
110  << " hits are stored in RE05MuonHitsCollection." << G4endl;
111  }
112 }
G4GLOB_DLL std::ostream G4cout
static const double GeV
Definition: G4SIunits.hh:214
G4int GetEventID() const
Definition: G4Event.hh:151
G4HCofThisEvent * GetHCofThisEvent() const
Definition: G4Event.hh:185
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

Member Data Documentation

◆ calorimeterCollID

G4int RE05EventAction::calorimeterCollID
private

Definition at line 50 of file RE05EventAction.hh.

◆ muonCollID

G4int RE05EventAction::muonCollID
private

Definition at line 51 of file RE05EventAction.hh.

◆ trackerCollID

G4int RE05EventAction::trackerCollID
private

Definition at line 49 of file RE05EventAction.hh.


The documentation for this class was generated from the following files: