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

Additional Inherited Members

- Protected Attributes inherited from G4UserEventAction
G4EventManagerfpEventManager
 

Detailed Description

Definition at line 38 of file HadrontherapyEventAction.hh.

Constructor & Destructor Documentation

HadrontherapyEventAction::HadrontherapyEventAction ( )

Definition at line 45 of file HadrontherapyEventAction.cc.

45  :
46  drawFlag("all" ),printModulo(10), pointerEventMessenger(0)
47 {
48  hitsCollectionID = -1;
49  pointerEventMessenger = new HadrontherapyEventActionMessenger(this);
50 }
HadrontherapyEventAction::~HadrontherapyEventAction ( )

Definition at line 53 of file HadrontherapyEventAction.cc.

54 {
55  delete pointerEventMessenger;
56 }

Member Function Documentation

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  //printing survey
63  if (evtNb%printModulo == 0)
64  G4cout << "\n---> Begin of Event: " << evtNb << G4endl;
65 
67  if(hitsCollectionID == -1)
68  hitsCollectionID = pSDManager -> GetCollectionID("HadrontherapyDetectorHitsCollection");
69 
70 }
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 HadrontherapyEventAction::EndOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 73 of file HadrontherapyEventAction.cc.

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

Here is the call graph for this function:

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:

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:


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