![]() |
Precalibrated Ion Beam Identification Detector Simulation 1.0
A pilot study detector simulation, written in C++ with Geant4.
|
Small class to keep track of the accumulated statistics. More...
#include <AllAccumulatedStatistics.hh>
Public Types | |
enum | ScintillatorPlate { UpperFront = 0, LowerFront = 1, Back = 2 } |
Public Member Functions | |
AllAccumulatedStatistics (G4double numberOfScintillatorTubes, G4double summationTime) | |
Constructor, constructs the class. | |
~AllAccumulatedStatistics () | |
Destructor. | |
void | AddScintillatorTubeEvent (G4int scintillatorID, G4double time, G4double energy) |
Add a scintillator event when such occurs. | |
void | AddGeDetectorEvent (G4double time, G4double energy) |
Add a germanium detector event when such occurs. | |
void | AddScintillatorPlateEvent (ScintillatorPlate plate, G4double time, G4double energy) |
Add a scintillator plate event. | |
std::vector< EventHit > | GetEventHits () |
Returns the eventHits we have accumulated. | |
bool | timeCheck (G4double time) |
Check if the time falls within the frame of the current EventHit object, if not it creates a new EventHit with the current time as the start time. | |
Private Attributes | |
std::vector< EventHit > | eventHits |
The event hits for this accumulated statistics object. | |
G4double | scintillatorTubes |
G4double | sumTime |
Small class to keep track of the accumulated statistics.
Definition at line 29 of file AllAccumulatedStatistics.hh.
AllAccumulatedStatistics::AllAccumulatedStatistics | ( | G4double | numberOfScintillatorTubes, |
G4double | summationTime | ||
) |
Constructor, constructs the class.
numberOfScintillatorTubes | Number of scintillator tubes. |
summationTime | Summation time. |
Definition at line 3 of file AllAccumulatedStatistics.cc.
:scintillatorTubes(numberOfScintillatorTubes),sumTime(summationTime) { }
void AllAccumulatedStatistics::AddGeDetectorEvent | ( | G4double | time, |
G4double | energy | ||
) |
Add a germanium detector event when such occurs.
time | The time of the event. |
energy | The energy of deposited. |
Definition at line 33 of file AllAccumulatedStatistics.cc.
References eventHits, and timeCheck().
Referenced by EventAction::AddGeDetectorEvent().
void AllAccumulatedStatistics::AddScintillatorPlateEvent | ( | ScintillatorPlate | plate, |
G4double | time, | ||
G4double | energy | ||
) |
Add a scintillator plate event.
plate | The plate the eventoccurred in |
time | The time of the event. |
energy | The energy of deposited. |
Definition at line 42 of file AllAccumulatedStatistics.cc.
References eventHits, and timeCheck().
Referenced by EventAction::AddScintillatorPlateEvent().
{ if(energy>0.1*eV) //don't add non-existent energies. { timeCheck(time); if(plate==UpperFront) eventHits.back().upperFrontScintillatorPanelEnergy+=energy; if(plate==LowerFront) eventHits.back().lowerFrontScintillatorPanelEnergy+=energy; if(plate==Back) eventHits.back().backScintillatorPanelEnergy+=energy; } }
void AllAccumulatedStatistics::AddScintillatorTubeEvent | ( | G4int | scintillatorID, |
G4double | time, | ||
G4double | energy | ||
) |
Add a scintillator event when such occurs.
scintillatorID | The scintillator ID |
time | The time of the event. |
energy | Deposited energy. |
Definition at line 24 of file AllAccumulatedStatistics.cc.
References eventHits, and timeCheck().
Referenced by EventAction::AddScintillatorTubeEvent().
std::vector< EventHit > AllAccumulatedStatistics::GetEventHits | ( | ) |
Returns the eventHits we have accumulated.
Definition at line 56 of file AllAccumulatedStatistics.cc.
References eventHits.
Referenced by RunAction::WriteResultsToFile().
{ return eventHits; }
bool AllAccumulatedStatistics::timeCheck | ( | G4double | time | ) |
Check if the time falls within the frame of the current EventHit object, if not it creates a new EventHit with the current time as the start time.
time | Time to check for. |
Definition at line 14 of file AllAccumulatedStatistics.cc.
References eventHits.
Referenced by AddGeDetectorEvent(), AddScintillatorPlateEvent(), and AddScintillatorTubeEvent().