Geant4  10.02.p03
HadrontherapyEventAction Class Reference

#include <HadrontherapyEventAction.hh>

Inheritance diagram for HadrontherapyEventAction:
Collaboration diagram for HadrontherapyEventAction:

Public Member Functions

 HadrontherapyEventAction ()
 
 ~HadrontherapyEventAction ()
 
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)
 

Private Attributes

G4String drawFlag
 
G4int hitsCollectionID
 
G4int printModulo
 
HadrontherapyEventActionMessengerpointerEventMessenger
 

Additional Inherited Members

- Protected Attributes inherited from G4UserEventAction
G4EventManagerfpEventManager
 

Detailed Description

Definition at line 38 of file HadrontherapyEventAction.hh.

Constructor & Destructor Documentation

◆ HadrontherapyEventAction()

HadrontherapyEventAction::HadrontherapyEventAction ( )

◆ ~HadrontherapyEventAction()

HadrontherapyEventAction::~HadrontherapyEventAction ( )

Definition at line 53 of file HadrontherapyEventAction.cc.

54 {
55  delete pointerEventMessenger;
56 }
HadrontherapyEventActionMessenger * pointerEventMessenger

Member Function Documentation

◆ BeginOfEventAction()

void HadrontherapyEventAction::BeginOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 59 of file HadrontherapyEventAction.cc.

60 {
61  G4int evtNb = evt->GetEventID();
62 
63  //printing survey
64  if (evtNb%printModulo == 0)
65  G4cout << "\n---> Begin of Event: " << evtNb << G4endl;
66 
68  if(hitsCollectionID == -1)
69  hitsCollectionID = pSDManager -> GetCollectionID("HadrontherapyDetectorHitsCollection");
70 
71 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4int GetEventID() const
Definition: G4Event.hh:151
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:

◆ EndOfEventAction()

void HadrontherapyEventAction::EndOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 74 of file HadrontherapyEventAction.cc.

75 {
76  if(hitsCollectionID < 0)
77  return;
78  G4HCofThisEvent* HCE = evt -> GetHCofThisEvent();
79 
80  // Clear voxels hit list
82  if (matrix) matrix -> ClearHitTrack();
83 
84  if(HCE)
85  {
87  if(CHC)
88  {
89  if(matrix)
90  {
91  // Fill the matrix with the information: voxel and associated energy deposit
92  // in the detector at the end of the event
93 
94  G4int HitCount = CHC -> entries();
95  for (G4int h=0; h<HitCount; h++)
96  {
97  G4int i = ((*CHC)[h]) -> GetXID();
98  G4int j = ((*CHC)[h]) -> GetYID();
99  G4int k = ((*CHC)[h]) -> GetZID();
100  G4double energyDeposit = ((*CHC)[h]) -> GetEdep();
101  matrix -> Fill(i, j, k, energyDeposit/MeV);
102  }
103  }
104  }
105  }
106 }
static const double MeV
Definition: G4SIunits.hh:211
int G4int
Definition: G4Types.hh:78
static HadrontherapyMatrix * GetInstance()
TNtupleSim Fill(f1, f2, f3, f4)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ SetDrawFlag()

void HadrontherapyEventAction::SetDrawFlag ( G4String  val)
inline

Definition at line 53 of file HadrontherapyEventAction.hh.

54  {
55  drawFlag = val;
56  };
Here is the caller graph for this function:

◆ SetPrintModulo()

void HadrontherapyEventAction::SetPrintModulo ( G4int  val)
inline

Definition at line 48 of file HadrontherapyEventAction.hh.

49  {
50  printModulo = val;
51  };
Here is the caller graph for this function:

Member Data Documentation

◆ drawFlag

G4String HadrontherapyEventAction::drawFlag
private

Definition at line 56 of file HadrontherapyEventAction.hh.

◆ hitsCollectionID

G4int HadrontherapyEventAction::hitsCollectionID
private

Definition at line 60 of file HadrontherapyEventAction.hh.

◆ pointerEventMessenger

HadrontherapyEventActionMessenger* HadrontherapyEventAction::pointerEventMessenger
private

Definition at line 63 of file HadrontherapyEventAction.hh.

◆ printModulo

G4int HadrontherapyEventAction::printModulo
private

Definition at line 62 of file HadrontherapyEventAction.hh.


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