Precalibrated Ion Beam Identification Detector Simulation 1.0
A pilot study detector simulation, written in C++ with Geant4.
Public Types | Public Member Functions | Private Attributes
AllAccumulatedStatistics Class Reference

Small class to keep track of the accumulated statistics. More...

#include <AllAccumulatedStatistics.hh>

List of all members.

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< EventHitGetEventHits ()
 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< EventHiteventHits
 The event hits for this accumulated statistics object.
G4double scintillatorTubes
G4double sumTime

Detailed Description

Small class to keep track of the accumulated statistics.

Definition at line 29 of file AllAccumulatedStatistics.hh.


Constructor & Destructor Documentation

AllAccumulatedStatistics::AllAccumulatedStatistics ( G4double  numberOfScintillatorTubes,
G4double  summationTime 
)

Constructor, constructs the class.

Parameters:
numberOfScintillatorTubesNumber of scintillator tubes.
summationTimeSummation time.

Definition at line 3 of file AllAccumulatedStatistics.cc.

  :scintillatorTubes(numberOfScintillatorTubes),sumTime(summationTime)
{
  
}

Member Function Documentation

void AllAccumulatedStatistics::AddGeDetectorEvent ( G4double  time,
G4double  energy 
)

Add a germanium detector event when such occurs.

Parameters:
timeThe time of the event.
energyThe energy of deposited.

Definition at line 33 of file AllAccumulatedStatistics.cc.

References eventHits, and timeCheck().

Referenced by EventAction::AddGeDetectorEvent().

{
  if(energy>0.1*eV) //don't add non-existent energies.
    {
      timeCheck(time);
      eventHits.back().geDetectorEnergy+=energy;
    }
}
void AllAccumulatedStatistics::AddScintillatorPlateEvent ( ScintillatorPlate  plate,
G4double  time,
G4double  energy 
)

Add a scintillator plate event.

Parameters:
plateThe plate the eventoccurred in
timeThe time of the event.
energyThe 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.

Parameters:
scintillatorIDThe scintillator ID
timeThe time of the event.
energyDeposited energy.

Definition at line 24 of file AllAccumulatedStatistics.cc.

References eventHits, and timeCheck().

Referenced by EventAction::AddScintillatorTubeEvent().

{
  if(energy>0.1*eV) //don't add non-existent energies.
    {
      timeCheck(time);
      eventHits.back().scintillatorTubeEnergies.at(ScintillatorID)+=energy;
    }
}
std::vector< EventHit > AllAccumulatedStatistics::GetEventHits ( )

Returns the eventHits we have accumulated.

Returns:
the EventHits accumulated this far.

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.

Returns:
true if a new EventHit object was created as a result of the check, false if not.
Parameters:
timeTime to check for.

Definition at line 14 of file AllAccumulatedStatistics.cc.

References eventHits.

Referenced by AddGeDetectorEvent(), AddScintillatorPlateEvent(), and AddScintillatorTubeEvent().

{
  if(eventHits.empty() || time > (eventHits.back().time + sumTime ))
    {
      eventHits.push_back(EventHit(scintillatorTubes,time));
      return true;
    }
  return false;
}

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines

Back to the main page of the Precalibrated Ion Beam Identification Detector project

Created by Rikard Lundmark