Monte Carlo LYSO
Geant4 simulation for the LYSO calorimeter prototype
Public Member Functions | Public Attributes | List of all members
MyEventAction Class Reference

User action concrete class of G4UserEventAction. In addition to defining procedures executed at the start and end of the event, this class also implements all the cointers for data to be saved in the output root file, along with some methods for extracting them during the event. More...

#include <event.hh>

Inheritance diagram for MyEventAction:
Inheritance graph
[legend]
Collaboration diagram for MyEventAction:
Collaboration graph
[legend]

Public Member Functions

 MyEventAction ()=default
 Constructor of the class.
 
 ~MyEventAction () override=default
 Destructor of the class.
 
void BeginOfEventAction (const G4Event *event) override
 Resets every data containers at the beginning of a new event. More...
 
void EndOfEventAction (const G4Event *event) override
 Fills the TTree with the data of the event. More...
 
void SetArrivalandFirstInteraction (G4double newtimein, G4ThreeVector newposin, G4double newtimeinter, G4ThreeVector newposinter)
 Stores the time and the position of arrival to the crystal of the primary gamma. More...
 
void AddEdep (G4double edep)
 For every G4Step inside the crystal it sums the energy deposit. More...
 
void SetMaxEdep (G4double edepondx, G4ThreeVector maxedeppos)
 Stores the maximum deposit of energy per unit length and its position inside the crystal. More...
 
void SetDecayTriggerSi (G4bool trg)
 
void SetCosmicTriggerUp (G4bool trg)
 
void SetCosmicTriggerBottom (G4bool trg)
 

Public Attributes

G4double fTimeIn
 Time of arrival of primary gamma.
 
G4double fPosXIn
 X position of arrival of primary gamma.
 
G4double fPosYIn
 Y position of arrival of primary gamma.
 
G4double fPosZIn
 Z position of arrival of primary gamma.
 
G4double fTimeFirstInter
 Time of first interaction of primary gamma.
 
G4double fPosXFirstInter
 X position of first interaction of primary gamma.
 
G4double fPosYFirstInter
 Y position of first interaction of primary gamma.
 
G4double fPosZFirstInter
 Z position of first interaction of primary gamma.
 
G4double fEdep
 Total energy deposited inside the crystal.
 
G4double fMaxEdep
 Maximum deposit of energy per unit length (MeV/mm) in the crystal.
 
G4ThreeVector fMaxEdepPos
 Position of the maximum deposit of energy per unit length in the crystal.
 
G4int fHitsNum_F
 Total number of optical photons detected by SiPMs on the front face.
 
G4int fHitsNum_B
 Total number of optical photons detected by SiPMs on the back face.
 
std::vector< G4double > fT_F
 Vector containing times of detection of optical photons on the front face.
 
std::vector< G4double > fX_F
 Vector containing x-positions of detection of optical photons on the front face.
 
std::vector< G4double > fY_F
 Vector containing y-positions of detection of optical photons on the front face.
 
std::vector< G4double > fT_B
 Vector containing times of detection of optical photons on the back face.
 
std::vector< G4double > fX_B
 Vector containing x-positions of detection of optical photons on the back face.
 
std::vector< G4double > fY_B
 Vector containing y-positions of detection of optical photons on the back face.
 
std::vector< G4int > fHitsNum_F_Ch
 
std::vector< G4int > fChannel_F
 Vector containing SiPM channels of detection of optical photons on the front face.
 
std::vector< G4int > fHitsNum_B_Ch
 
std::vector< G4int > fChannel_B
 Vector containing SiPM channels of detection of optical photons on the back face.
 
G4double fTimeOfDecay
 
G4bool fDecayTriggerSi
 
G4bool fCosmicTriggerUp
 
G4bool fCosmicTriggerBottom
 

Detailed Description

User action concrete class of G4UserEventAction. In addition to defining procedures executed at the start and end of the event, this class also implements all the cointers for data to be saved in the output root file, along with some methods for extracting them during the event.

Definition at line 25 of file event.hh.

Member Function Documentation

◆ AddEdep()

void MyEventAction::AddEdep ( G4double  edep)
inline

For every G4Step inside the crystal it sums the energy deposit.

Parameters
edepThe total energy deposit in the step.

Definition at line 75 of file event.hh.

◆ BeginOfEventAction()

void MyEventAction::BeginOfEventAction ( const G4Event *  event)
override

Resets every data containers at the beginning of a new event.

Parameters
eventPointer to the G4Event.

Definition at line 7 of file event.cc.

◆ EndOfEventAction()

void MyEventAction::EndOfEventAction ( const G4Event *  event)
override

Fills the TTree with the data of the event.

It accesses the MyHitsCollection of the event and fills the detector branches with data stored in it. After that, it fills the other branches with data concerning the primary particle and the energy deposit in the crystal.

Parameters
eventPointer to the G4Event.

Definition at line 42 of file event.cc.

◆ SetArrivalandFirstInteraction()

void MyEventAction::SetArrivalandFirstInteraction ( G4double  newtimein,
G4ThreeVector  newposin,
G4double  newtimeinter,
G4ThreeVector  newposinter 
)
inline

Stores the time and the position of arrival to the crystal of the primary gamma.

Parameters
newtimeinThe time of arrival to be saved.
newposinThe position of arrival to be saved.

Definition at line 55 of file event.hh.

◆ SetMaxEdep()

void MyEventAction::SetMaxEdep ( G4double  edepondx,
G4ThreeVector  maxedeppos 
)
inline

Stores the maximum deposit of energy per unit length and its position inside the crystal.

Parameters
edepondxThe total energy deposit in the step divided by the step length.
maxedepposThe position of the energy deposit in the step.

Definition at line 84 of file event.hh.


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