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

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 ( B3aRunAction runAction)

Definition at line 45 of file B3aEventAction.cc.

46  : G4UserEventAction(),
47  fRunAction(runAction),
48  fCollID_cryst(-1),
49  fCollID_patient(-1)
50 {}
B3aEventAction::~B3aEventAction ( )
virtual

Definition at line 54 of file B3aEventAction.cc.

55 { }

Member Function Documentation

void B3aEventAction::BeginOfEventAction ( const G4Event )
virtual

Reimplemented from G4UserEventAction.

Definition at line 59 of file B3aEventAction.cc.

60 { }
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 =
84  (G4THitsMap<G4double>*)(HCE->GetHC(fCollID_cryst));
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 }
G4VHitsCollection * GetHC(G4int i)
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
int G4int
Definition: G4Types.hh:78
void SumDose(G4double dose)
Definition: B3aRunAction.hh:50
void CountEvent()
Definition: B3aRunAction.hh:49
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
std::map< G4int, T * > * GetMap() const
Definition: G4THitsMap.hh:99
G4HCofThisEvent * GetHCofThisEvent() const
Definition: G4Event.hh:185
double G4double
Definition: G4Types.hh:76
static constexpr double keV
Definition: G4SIunits.hh:216

Here is the call graph for this function:


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