LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
larg4::AuxDetReadout Class Reference

#include "AuxDetReadout.h"

Inheritance diagram for larg4::AuxDetReadout:

Public Member Functions

 AuxDetReadout (std::string const &name, unsigned int adNum, unsigned int svNum)
 
virtual ~AuxDetReadout ()
 
virtual void Initialize (G4HCofThisEvent *)
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
virtual void clear ()
 
virtual G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
virtual void AddParticleStep (int inputTrackID, float inputEnergyDeposited, float inputEntryX, float inputEntryY, float inputEntryZ, float inputEntryT, float inputExitX, float inputExitY, float inputExitZ, float inputExitT, float inputExitMomentumX, float inputExitMomentumY, float inputExitMomentumZ)
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 
sim::AuxDetSimChannel const GetAuxDetSimChannel () const
 

Private Attributes

art::ServiceHandle< geo::GeometryfGeoHandle
 Handle to the Geometry service. More...
 
uint32_t fAuxDet
 which AuxDet this AuxDetReadout corresponds to More...
 
uint32_t fAuxDetSensitive
 which sensitive volume of the AuxDet this AuxDetReadout corresponds to More...
 
sim::AuxDetSimChannel fAuxDetSimChannel
 Contains the sim::AuxDetSimChannel for this AuxDet. More...
 
std::vector< sim::AuxDetIDEfAuxDetIDEs
 list of IDEs in one channel More...
 

Detailed Description

Definition at line 27 of file AuxDetReadout.h.

Constructor & Destructor Documentation

larg4::AuxDetReadout::AuxDetReadout ( std::string const &  name,
unsigned int  adNum,
unsigned int  svNum 
)

Definition at line 26 of file AuxDetReadout.cxx.

29  : G4VSensitiveDetector(name)
30  , fAuxDet(adNum)
31  , fAuxDetSensitive(svNum)
32  {
33  }
uint32_t fAuxDet
which AuxDet this AuxDetReadout corresponds to
Definition: AuxDetReadout.h:77
uint32_t fAuxDetSensitive
which sensitive volume of the AuxDet this AuxDetReadout corresponds to
Definition: AuxDetReadout.h:78
larg4::AuxDetReadout::~AuxDetReadout ( )
virtual

Definition at line 36 of file AuxDetReadout.cxx.

36 {}

Member Function Documentation

void larg4::AuxDetReadout::AddParticleStep ( int  inputTrackID,
float  inputEnergyDeposited,
float  inputEntryX,
float  inputEntryY,
float  inputEntryZ,
float  inputEntryT,
float  inputExitX,
float  inputExitY,
float  inputExitZ,
float  inputExitT,
float  inputExitMomentumX,
float  inputExitMomentumY,
float  inputExitMomentumZ 
)
virtual

Definition at line 103 of file AuxDetReadout.cxx.

References sim::AuxDetIDE::energyDeposited, sim::AuxDetIDE::entryT, sim::AuxDetIDE::entryX, sim::AuxDetIDE::entryY, sim::AuxDetIDE::entryZ, sim::AuxDetIDE::exitMomentumX, sim::AuxDetIDE::exitMomentumY, sim::AuxDetIDE::exitMomentumZ, sim::AuxDetIDE::exitT, sim::AuxDetIDE::exitX, sim::AuxDetIDE::exitY, sim::AuxDetIDE::exitZ, fAuxDetIDEs, and sim::AuxDetIDE::trackID.

Referenced by ProcessHits().

116  {
117 
118  sim::AuxDetIDE auxDetIDE;
119  auxDetIDE.trackID = inputTrackID;
120  auxDetIDE.energyDeposited = inputEnergyDeposited;
121  auxDetIDE.entryX = inputEntryX;
122  auxDetIDE.entryY = inputEntryY;
123  auxDetIDE.entryZ = inputEntryZ;
124  auxDetIDE.entryT = inputEntryT;
125  auxDetIDE.exitX = inputExitX;
126  auxDetIDE.exitY = inputExitY;
127  auxDetIDE.exitZ = inputExitZ;
128  auxDetIDE.exitT = inputExitT;
129  auxDetIDE.exitMomentumX = inputExitMomentumX;
130  auxDetIDE.exitMomentumY = inputExitMomentumY;
131  auxDetIDE.exitMomentumZ = inputExitMomentumZ;
132 
134  = std::find(fAuxDetIDEs.begin(), fAuxDetIDEs.end(), auxDetIDE);
135 
136  if(IDEitr != fAuxDetIDEs.end()){ //If trackID is already in the map, update it
137 
138  IDEitr->energyDeposited += inputEnergyDeposited;
139  IDEitr->exitX = inputExitX;
140  IDEitr->exitY = inputExitY;
141  IDEitr->exitZ = inputExitZ;
142  IDEitr->exitT = inputExitT;
143  IDEitr->exitMomentumX = inputExitMomentumX;
144  IDEitr->exitMomentumY = inputExitMomentumY;
145  IDEitr->exitMomentumZ = inputExitMomentumZ;
146  }
147  else{ //if trackID is not in the set yet, add it
148  fAuxDetIDEs.push_back(std::move(auxDetIDE));
149  }//else
150  }//AddParticleStep
intermediate_table::iterator iterator
int trackID
Geant4 supplied track ID.
float exitMomentumZ
Exit Z-Momentum of particle.
float exitY
Exit position Y of particle.
float entryT
Entry time of particle.
float exitMomentumX
Exit X-Momentum of particle.
float exitT
Exit time of particle.
float exitZ
Exit position Z of particle.
float entryZ
Entry position Z of particle.
float exitX
Exit position X of particle.
float energyDeposited
total energy deposited for this track ID and time
float entryX
Entry position X of particle.
float entryY
Entry position Y of particle.
MC truth information to make RawDigits and do back tracking.
std::vector< sim::AuxDetIDE > fAuxDetIDEs
list of IDEs in one channel
Definition: AuxDetReadout.h:80
float exitMomentumY
Exit Y-Momentum of particle.
void larg4::AuxDetReadout::clear ( void  )
virtual

Definition at line 49 of file AuxDetReadout.cxx.

References fAuxDetIDEs.

Referenced by larg4::LArG4::produce().

50  {
51  fAuxDetIDEs.clear();
52  }
std::vector< sim::AuxDetIDE > fAuxDetIDEs
list of IDEs in one channel
Definition: AuxDetReadout.h:80
void larg4::AuxDetReadout::DrawAll ( )
virtual

Definition at line 154 of file AuxDetReadout.cxx.

154 {}
void larg4::AuxDetReadout::EndOfEvent ( G4HCofThisEvent )
virtual

Definition at line 44 of file AuxDetReadout.cxx.

References fAuxDet, fAuxDetIDEs, fAuxDetSensitive, and fAuxDetSimChannel.

45  {
47  }
Collection of particles crossing one auxiliary detector cell.
uint32_t fAuxDet
which AuxDet this AuxDetReadout corresponds to
Definition: AuxDetReadout.h:77
sim::AuxDetSimChannel fAuxDetSimChannel
Contains the sim::AuxDetSimChannel for this AuxDet.
Definition: AuxDetReadout.h:79
std::vector< sim::AuxDetIDE > fAuxDetIDEs
list of IDEs in one channel
Definition: AuxDetReadout.h:80
uint32_t fAuxDetSensitive
which sensitive volume of the AuxDet this AuxDetReadout corresponds to
Definition: AuxDetReadout.h:78
sim::AuxDetSimChannel const larg4::AuxDetReadout::GetAuxDetSimChannel ( ) const
inline

Definition at line 73 of file AuxDetReadout.h.

References fAuxDetSimChannel, and fGeoHandle.

Referenced by larg4::LArG4::produce().

73 { return fAuxDetSimChannel; };
sim::AuxDetSimChannel fAuxDetSimChannel
Contains the sim::AuxDetSimChannel for this AuxDet.
Definition: AuxDetReadout.h:79
void larg4::AuxDetReadout::Initialize ( G4HCofThisEvent )
virtual

Definition at line 40 of file AuxDetReadout.cxx.

41  {}
void larg4::AuxDetReadout::PrintAll ( )
virtual

Definition at line 155 of file AuxDetReadout.cxx.

155 {}
G4bool larg4::AuxDetReadout::ProcessHits ( G4Step *  step,
G4TouchableHistory *   
)
virtual

Definition at line 57 of file AuxDetReadout.cxx.

References AddParticleStep(), and larg4::ParticleListAction::GetCurrentTrackID().

58  {
59  // collect the info for this step
60 
61  const int trackID = ParticleListAction::GetCurrentTrackID();
62 
63  G4double energyDeposited = step->GetTotalEnergyDeposit()/CLHEP::GeV;
64 
65  G4ThreeVector startG4(step->GetPreStepPoint()->GetPosition() );
66  double startWorld[3] = {startG4.getX()/CLHEP::cm,
67  startG4.getY()/CLHEP::cm,
68  startG4.getZ()/CLHEP::cm};
69 
70  double startTime = step->GetPreStepPoint()->GetGlobalTime()/CLHEP::ns;
71 
72  G4ThreeVector stopG4( step->GetPostStepPoint()->GetPosition());
73  double stopWorld[3] = {stopG4.getX()/CLHEP::cm,
74  stopG4.getY()/CLHEP::cm,
75  stopG4.getZ()/CLHEP::cm};
76 
77  G4ThreeVector stopG4Momentum( step->GetPostStepPoint()->GetMomentum());
78  double stopWorldMomVector[3] = {stopG4Momentum.getX()/CLHEP::GeV,
79  stopG4Momentum.getY()/CLHEP::GeV,
80  stopG4Momentum.getZ()/CLHEP::GeV};
81 
82  double stopTime = step->GetPostStepPoint()->GetGlobalTime()/CLHEP::ns;
83 
84  this->AddParticleStep( trackID,
85  energyDeposited,
86  startWorld[0],
87  startWorld[1],
88  startWorld[2],
89  startTime,
90  stopWorld[0],
91  stopWorld[1],
92  stopWorld[2],
93  stopTime,
94  stopWorldMomVector[0],
95  stopWorldMomVector[1],
96  stopWorldMomVector[2]
97  );
98 
99  return true;
100  }
virtual void AddParticleStep(int inputTrackID, float inputEnergyDeposited, float inputEntryX, float inputEntryY, float inputEntryZ, float inputEntryT, float inputExitX, float inputExitY, float inputExitZ, float inputExitT, float inputExitMomentumX, float inputExitMomentumY, float inputExitMomentumZ)

Member Data Documentation

uint32_t larg4::AuxDetReadout::fAuxDet
private

which AuxDet this AuxDetReadout corresponds to

Definition at line 77 of file AuxDetReadout.h.

Referenced by EndOfEvent().

std::vector<sim::AuxDetIDE> larg4::AuxDetReadout::fAuxDetIDEs
private

list of IDEs in one channel

Definition at line 80 of file AuxDetReadout.h.

Referenced by AddParticleStep(), clear(), and EndOfEvent().

uint32_t larg4::AuxDetReadout::fAuxDetSensitive
private

which sensitive volume of the AuxDet this AuxDetReadout corresponds to

Definition at line 78 of file AuxDetReadout.h.

Referenced by EndOfEvent().

sim::AuxDetSimChannel larg4::AuxDetReadout::fAuxDetSimChannel
private

Contains the sim::AuxDetSimChannel for this AuxDet.

Definition at line 79 of file AuxDetReadout.h.

Referenced by EndOfEvent(), and GetAuxDetSimChannel().

art::ServiceHandle<geo::Geometry> larg4::AuxDetReadout::fGeoHandle
private

Handle to the Geometry service.

Definition at line 73 of file AuxDetReadout.h.

Referenced by GetAuxDetSimChannel().


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