Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
RE05EventAction Class Reference

#include <RE05EventAction.hh>

Inheritance diagram for RE05EventAction:
G4UserEventAction

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 ()
 
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 50 of file RE05EventAction.cc.

51 {
52  trackerCollID = -1;
53  calorimeterCollID = -1;
54  muonCollID = -1;
55 }
RE05EventAction::~RE05EventAction ( )
virtual

Definition at line 57 of file RE05EventAction.cc.

58 {;}

Member Function Documentation

void RE05EventAction::BeginOfEventAction ( const G4Event )
virtual

Reimplemented from G4UserEventAction.

Definition at line 60 of file RE05EventAction.cc.

References G4SDManager::GetCollectionID(), and G4SDManager::GetSDMpointer().

61 {
63  if(trackerCollID<0||calorimeterCollID<0||muonCollID<0)
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:131
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
void RE05EventAction::EndOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 72 of file RE05EventAction.cc.

References G4THitsCollection< T >::entries(), G4cout, G4endl, G4Event::GetEventID(), G4HCofThisEvent::GetHC(), G4Event::GetHCofThisEvent(), and python.hepunit::GeV.

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  {
84  THC = (RE05TrackerHitsCollection*)(HCE->GetHC(trackerCollID));
85  CHC = (RE05CalorimeterHitsCollection*)(HCE->GetHC(calorimeterCollID));
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 }
G4int GetEventID() const
Definition: G4Event.hh:140
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4HCofThisEvent * GetHCofThisEvent() const
Definition: G4Event.hh:174
double G4double
Definition: G4Types.hh:76

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