Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
B3a::EventAction Class Reference
basic » B3 » B3a

Event action class. More...

#include <Doxymodules_basic.h>

Inheritance diagram for B3a::EventAction:
G4UserEventAction

Public Member Functions

 EventAction (RunAction *runAction)
 
 ~EventAction () override=default
 
void BeginOfEventAction (const G4Event *) override
 
void EndOfEventAction (const G4Event *) override
 

Private Attributes

RunActionfRunAction = nullptr
 
G4int fCollID_cryst = -1
 
G4int fCollID_patient = -1
 

Detailed Description

Event action class.

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

Definition at line 89 of file Doxymodules_basic.h.

Constructor & Destructor Documentation

◆ EventAction()

B3a::EventAction::EventAction ( RunAction runAction)

Definition at line 47 of file EventAction.cc.

48 : fRunAction(runAction)
49{}
RunAction * fRunAction

◆ ~EventAction()

B3a::EventAction::~EventAction ( )
overridedefault

Member Function Documentation

◆ BeginOfEventAction()

void B3a::EventAction::BeginOfEventAction ( const G4Event )
override

Definition at line 53 of file EventAction.cc.

54{ }

◆ EndOfEventAction()

void B3a::EventAction::EndOfEventAction ( const G4Event evt)
override

G4int copyNb = (itr->first);

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

G4int copyNb = (itr->first);

Definition at line 58 of file EventAction.cc.

59{
60 //Hits collections
61 //
62 G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
63 if(!HCE) return;
64
65 // Get hits collections IDs
66 if (fCollID_cryst < 0) {
67 G4SDManager* SDMan = G4SDManager::GetSDMpointer();
68 fCollID_cryst = SDMan->GetCollectionID("crystal/edep");
69 fCollID_patient = SDMan->GetCollectionID("patient/dose");
70 }
71
72 //Energy in crystals : identify 'good events'
73 //
74 const G4double eThreshold = 500*keV;
75 G4int nbOfFired = 0;
76
77 auto evtMap = (G4THitsMap<G4double>*)(HCE->GetHC(fCollID_cryst));
78
79 std::map<G4int,G4double*>::iterator itr;
80 for (itr = evtMap->GetMap()->begin(); itr != evtMap->GetMap()->end(); itr++) {
81 ///G4int copyNb = (itr->first);
82 G4double edep = *(itr->second);
83 if (edep > eThreshold) nbOfFired++;
84 ///G4cout << "\n cryst" << copyNb << ": " << edep/keV << " keV ";
85 }
86 if (nbOfFired == 2) fRunAction->CountEvent();
87
88 //Dose deposit in patient
89 //
90 G4double dose = 0.;
91
92 evtMap = (G4THitsMap<G4double>*)(HCE->GetHC(fCollID_patient));
93
94 for (itr = evtMap->GetMap()->begin(); itr != evtMap->GetMap()->end(); itr++) {
95 ///G4int copyNb = (itr->first);
96 dose = *(itr->second);
97 }
98 if (dose > 0.) fRunAction->SumDose(dose);
99}
void CountEvent()
Definition RunAction.hh:51
void SumDose(G4double dose)
Definition RunAction.hh:52

Member Data Documentation

◆ fRunAction

RunAction* B3a::EventAction::fRunAction = nullptr
private

Definition at line 57 of file EventAction.hh.

◆ fCollID_cryst

G4int B3a::EventAction::fCollID_cryst = -1
private

Definition at line 58 of file EventAction.hh.

◆ fCollID_patient

G4int B3a::EventAction::fCollID_patient = -1
private

Definition at line 59 of file EventAction.hh.


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

Applications | User Support | Publications | Collaboration