Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IORTEventAction Class Reference

#include <IORTEventAction.hh>

Inheritance diagram for IORTEventAction:
Collaboration diagram for IORTEventAction:

Public Member Functions

 IORTEventAction ()
 
 ~IORTEventAction ()
 
void BeginOfEventAction (const G4Event *)
 
void EndOfEventAction (const G4Event *)
 
void SetPrintModulo (G4int val)
 
void SetDrawFlag (G4String val)
 
- 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 49 of file IORTEventAction.hh.

Constructor & Destructor Documentation

IORTEventAction::IORTEventAction ( )

Definition at line 57 of file IORTEventAction.cc.

57  :
58  drawFlag("all" ),printModulo(1000), pointerEventMessenger(0)
59 {
60  hitsCollectionID = -1;
61  pointerEventMessenger = new IORTEventActionMessenger(this);
62 }
IORTEventAction::~IORTEventAction ( )

Definition at line 65 of file IORTEventAction.cc.

66 {
67  delete pointerEventMessenger;
68 }

Member Function Documentation

void IORTEventAction::BeginOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 71 of file IORTEventAction.cc.

72 {
73  G4int evtNb = evt->GetEventID();
74 
75  //printing survey
76  if (evtNb%printModulo == 0)
77  G4cout << "\n---> Begin of Event: " << evtNb << G4endl;
78 
80  if(hitsCollectionID == -1)
81  hitsCollectionID = pSDManager -> GetCollectionID("IORTDetectorHitsCollection");
82 
83 }
int G4int
Definition: G4Types.hh:78
G4int GetEventID() const
Definition: G4Event.hh:151
G4GLOB_DLL std::ostream G4cout
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void IORTEventAction::EndOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 86 of file IORTEventAction.cc.

87 {
88  if(hitsCollectionID < 0)
89  return;
90  G4HCofThisEvent* HCE = evt -> GetHCofThisEvent();
91 
92  // Clear voxels hit list
94  if (matrix) matrix -> ClearHitTrack();
95 
96  if(HCE)
97  {
98  IORTDetectorHitsCollection* CHC = (IORTDetectorHitsCollection*)(HCE -> GetHC(hitsCollectionID));
99  if(CHC)
100  {
101  if(matrix)
102  {
103  // Fill the matrix with the information: voxel and associated energy deposit
104  // in the detector at the end of the event
105 
106  G4int HitCount = CHC -> entries();
107  for (G4int h=0; h<HitCount; h++)
108  {
109  G4int i = ((*CHC)[h]) -> GetXID();
110  G4int j = ((*CHC)[h]) -> GetYID();
111  G4int k = ((*CHC)[h]) -> GetZID();
112  G4double energyDeposit = ((*CHC)[h]) -> GetEdep();
113  matrix -> Fill(i, j, k, energyDeposit/MeV);
114  }
115  }
116  }
117  }
118 }
int G4int
Definition: G4Types.hh:78
static constexpr double MeV
Definition: G4SIunits.hh:214
static IORTMatrix * GetInstance()
Definition: IORTMatrix.cc:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void IORTEventAction::SetDrawFlag ( G4String  val)
inline

Definition at line 64 of file IORTEventAction.hh.

65  {
66  drawFlag = val;
67  };

Here is the caller graph for this function:

void IORTEventAction::SetPrintModulo ( G4int  val)
inline

Definition at line 59 of file IORTEventAction.hh.

60  {
61  printModulo = val;
62  };

Here is the caller graph for this function:


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