Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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)
 

Additional Inherited Members

- Protected Attributes inherited from G4UserEventAction
G4EventManagerfpEventManager
 

Detailed Description

Definition at line 38 of file RE05EventAction.hh.

Constructor & Destructor Documentation

RE05EventAction::RE05EventAction ( )

Definition at line 52 of file RE05EventAction.cc.

54  fTrackerCollID(-1),
55  fCalorimeterCollID(-1),
56  fMuonCollID(-1)
57 {}
RE05EventAction::~RE05EventAction ( )
virtual

Definition at line 61 of file RE05EventAction.cc.

62 {}

Member Function Documentation

void RE05EventAction::BeginOfEventAction ( const G4Event )
virtual

Reimplemented from G4UserEventAction.

Definition at line 66 of file RE05EventAction.cc.

67 {
69  if(fTrackerCollID<0||fCalorimeterCollID<0||fMuonCollID<0)
70  {
71  G4String colNam;
72  fTrackerCollID = SDman->GetCollectionID(colNam="trackerCollection");
73  fCalorimeterCollID = SDman->GetCollectionID(colNam="calCollection");
74  fMuonCollID = SDman->GetCollectionID(colNam="muonCollection");
75  }
76 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40

Here is the call graph for this function:

void RE05EventAction::EndOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 80 of file RE05EventAction.cc.

81 {
82  G4cout << ">>> Event " << evt->GetEventID() << G4endl;
83 
84  if(fTrackerCollID<0||fCalorimeterCollID<0||fMuonCollID<0) return;
85 
86  G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
89  RE05MuonHitsCollection* MHC = 0;
90  if(HCE)
91  {
92  THC = (RE05TrackerHitsCollection*)(HCE->GetHC(fTrackerCollID));
93  CHC = (RE05CalorimeterHitsCollection*)(HCE->GetHC(fCalorimeterCollID));
94  MHC = (RE05MuonHitsCollection*)(HCE->GetHC(fMuonCollID));
95  }
96 
97  if(THC)
98  {
99  int n_hit = THC->entries();
100  G4cout << " " << n_hit
101  << " hits are stored in RE05TrackerHitsCollection." << G4endl;
102  }
103  if(CHC)
104  {
105  int n_hit = CHC->entries();
106  G4cout << " " << n_hit
107  << " hits are stored in RE05CalorimeterHitsCollection." << G4endl;
108  G4double totE = 0;
109  for(int i=0;i<n_hit;i++)
110  { totE += (*CHC)[i]->GetEdep(); }
111  G4cout << " Total energy deposition in calorimeter : "
112  << totE / GeV << " (GeV)" << G4endl;
113  }
114  if(MHC)
115  {
116  int n_hit = MHC->entries();
117  G4cout << " " << n_hit
118  << " hits are stored in RE05MuonHitsCollection." << G4endl;
119  }
120 }
G4VHitsCollection * GetHC(G4int i)
G4int entries() const
G4int GetEventID() const
Definition: G4Event.hh:151
G4GLOB_DLL std::ostream G4cout
static constexpr double GeV
Definition: G4SIunits.hh:217
#define G4endl
Definition: G4ios.hh:61
G4HCofThisEvent * GetHCofThisEvent() const
Definition: G4Event.hh:185
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:


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