Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ExN04EventAction Class Reference

#include <Doxymodules_eventgenerator.h>

Inheritance diagram for ExN04EventAction:
G4UserEventAction

Public Member Functions

 ExN04EventAction ()
 
 ~ExN04EventAction ()
 
virtual void BeginOfEventAction (const G4Event *)
 
virtual void EndOfEventAction (const G4Event *)
 

Private Attributes

G4int ftrackerCollID
 
G4int fcalorimeterCollID
 
G4int fmuonCollID
 

Detailed Description

Definition at line 41 of file Doxymodules_eventgenerator.h.

Constructor & Destructor Documentation

◆ ExN04EventAction()

ExN04EventAction::ExN04EventAction ( )

◆ ~ExN04EventAction()

ExN04EventAction::~ExN04EventAction ( )

Definition at line 54 of file ExN04EventAction.cc.

55{
56}

Member Function Documentation

◆ BeginOfEventAction()

void ExN04EventAction::BeginOfEventAction ( const G4Event )
virtual

Definition at line 59 of file ExN04EventAction.cc.

60{
61 G4SDManager* SDman = G4SDManager::GetSDMpointer();
63 G4String colNam;
64 ftrackerCollID = SDman-> GetCollectionID(colNam="trackerCollection");
65 fcalorimeterCollID = SDman-> GetCollectionID(colNam="calCollection");
66 fmuonCollID = SDman-> GetCollectionID(colNam="muonCollection");
67 }
68}

◆ EndOfEventAction()

void ExN04EventAction::EndOfEventAction ( const G4Event evt)
virtual

Definition at line 71 of file ExN04EventAction.cc.

72{
73 G4cout << ">>> Event " << evt->GetEventID() << G4endl;
74
75 if( ftrackerCollID<0 || fcalorimeterCollID<0 || fmuonCollID<0) return;
76
77 G4HCofThisEvent* HCE = evt-> GetHCofThisEvent();
80 ExN04MuonHitsCollection* MHC = NULL;
81
82 if( HCE ) {
83 THC = (ExN04TrackerHitsCollection*)(HCE->GetHC(ftrackerCollID));
85 MHC = (ExN04MuonHitsCollection*)(HCE->GetHC(fmuonCollID));
86 }
87
88 if( THC ) {
89 G4int n_hit = THC-> entries();
90 G4cout << " " << n_hit
91 << " hits are stored in ExN04TrackerHitsCollection." << G4endl;
92 }
93
94 if( CHC ) {
95 G4int n_hit = CHC-> entries();
96 G4cout << " " << n_hit
97 << " hits are stored in ExN04CalorimeterHitsCollection." << G4endl;
98 G4double totE = 0;
99 for( int i = 0; i < n_hit; i++ ) {
100 totE += (*CHC)[i]-> GetEdep();
101 }
102 G4cout << " Total energy deposition in calorimeter : "
103 << totE / GeV << " (GeV)" << G4endl;
104 }
105
106 if( MHC ) {
107 G4int n_hit = MHC-> entries();
108 G4cout << " " << n_hit
109 << " hits are stored in ExN04MuonHitsCollection." << G4endl;
110 }
111}
G4THitsCollection< ExN04CalorimeterHit > ExN04CalorimeterHitsCollection
G4THitsCollection< ExN04MuonHit > ExN04MuonHitsCollection
G4THitsCollection< ExN04TrackerHit > ExN04TrackerHitsCollection

Member Data Documentation

◆ ftrackerCollID

G4int ExN04EventAction::ftrackerCollID
private

Definition at line 46 of file ExN04EventAction.hh.

◆ fcalorimeterCollID

G4int ExN04EventAction::fcalorimeterCollID
private

Definition at line 47 of file ExN04EventAction.hh.

◆ fmuonCollID

G4int ExN04EventAction::fmuonCollID
private

Definition at line 48 of file ExN04EventAction.hh.


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

Applications | User Support | Publications | Collaboration