Geant4  10.02.p03
B3aEventAction Class Reference

#include <B3aEventAction.hh>

Inheritance diagram for B3aEventAction:
Collaboration diagram for B3aEventAction:

Public Member Functions

 B3aEventAction (B3aRunAction *runAction)
 
virtual ~B3aEventAction ()
 
virtual void BeginOfEventAction (const G4Event *)
 
virtual void EndOfEventAction (const G4Event *)
 
- Public Member Functions inherited from G4UserEventAction
 G4UserEventAction ()
 
virtual ~G4UserEventAction ()
 
virtual void SetEventManager (G4EventManager *value)
 

Private Attributes

B3aRunActionfRunAction
 
G4int fCollID_cryst
 
G4int fCollID_patient
 

Additional Inherited Members

- Protected Attributes inherited from G4UserEventAction
G4EventManagerfpEventManager
 

Detailed Description

Event action class

In EndOfEventAction() there is collected information event per event from Hits Collections, and accumulated statistic for B3RunAction::EndOfRunAction().

Definition at line 45 of file B3aEventAction.hh.

Constructor & Destructor Documentation

◆ B3aEventAction()

B3aEventAction::B3aEventAction ( B3aRunAction runAction)

Definition at line 45 of file B3aEventAction.cc.

46  : G4UserEventAction(),
47  fRunAction(runAction),
48  fCollID_cryst(-1),
49  fCollID_patient(-1)
50 {}
B3aRunAction * fRunAction

◆ ~B3aEventAction()

B3aEventAction::~B3aEventAction ( )
virtual

Definition at line 54 of file B3aEventAction.cc.

55 { }

Member Function Documentation

◆ BeginOfEventAction()

void B3aEventAction::BeginOfEventAction ( const G4Event )
virtual

Reimplemented from G4UserEventAction.

Definition at line 59 of file B3aEventAction.cc.

60 { }

◆ EndOfEventAction()

void B3aEventAction::EndOfEventAction ( const G4Event evt)
virtual

G4int copyNb = (itr->first);

G4cout << "\n cryst" << copyNb << ": " << edep/keV << " keV ";

G4int copyNb = (itr->first);

Reimplemented from G4UserEventAction.

Definition at line 64 of file B3aEventAction.cc.

65 {
66  //Hits collections
67  //
68  G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
69  if(!HCE) return;
70 
71  // Get hits collections IDs
72  if (fCollID_cryst < 0) {
74  fCollID_cryst = SDMan->GetCollectionID("crystal/edep");
75  fCollID_patient = SDMan->GetCollectionID("patient/dose");
76  }
77 
78  //Energy in crystals : identify 'good events'
79  //
80  const G4double eThreshold = 500*keV;
81  G4int nbOfFired = 0;
82 
83  G4THitsMap<G4double>* evtMap =
85 
86  std::map<G4int,G4double*>::iterator itr;
87  for (itr = evtMap->GetMap()->begin(); itr != evtMap->GetMap()->end(); itr++) {
89  G4double edep = *(itr->second);
90  if (edep > eThreshold) nbOfFired++;
92  }
93  if (nbOfFired == 2) fRunAction->CountEvent();
94 
95  //Dose deposit in patient
96  //
97  G4double dose = 0.;
98 
99  evtMap = (G4THitsMap<G4double>*)(HCE->GetHC(fCollID_patient));
100 
101  for (itr = evtMap->GetMap()->begin(); itr != evtMap->GetMap()->end(); itr++) {
103  dose = *(itr->second);
104  }
105  if (dose > 0.) fRunAction->SumDose(dose);
106 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
std::map< G4int, T * > * GetMap() const
Definition: G4THitsMap.hh:68
Float_t dose
int G4int
Definition: G4Types.hh:78
Double_t edep
void SumDose(G4double dose)
Definition: B3aRunAction.hh:50
void CountEvent()
Definition: B3aRunAction.hh:49
B3aRunAction * fRunAction
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4HCofThisEvent * GetHCofThisEvent() const
Definition: G4Event.hh:185
static const double keV
Definition: G4SIunits.hh:213
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

Member Data Documentation

◆ fCollID_cryst

G4int B3aEventAction::fCollID_cryst
private

Definition at line 56 of file B3aEventAction.hh.

◆ fCollID_patient

G4int B3aEventAction::fCollID_patient
private

Definition at line 57 of file B3aEventAction.hh.

◆ fRunAction

B3aRunAction* B3aEventAction::fRunAction
private

Definition at line 55 of file B3aEventAction.hh.


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