LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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::Geometry const > fGeoHandle
 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 19 of file AuxDetReadout.cxx.

20  : G4VSensitiveDetector(name), fAuxDet(adNum), fAuxDetSensitive(svNum)
21  {}
uint32_t fAuxDet
which AuxDet this AuxDetReadout corresponds to
Definition: AuxDetReadout.h:74
uint32_t fAuxDetSensitive
which sensitive volume of the AuxDet this AuxDetReadout corresponds to
Definition: AuxDetReadout.h:76
larg4::AuxDetReadout::~AuxDetReadout ( )
virtual

Definition at line 24 of file AuxDetReadout.cxx.

24 {}

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 87 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().

100  {
101 
102  sim::AuxDetIDE auxDetIDE;
103  auxDetIDE.trackID = inputTrackID;
104  auxDetIDE.energyDeposited = inputEnergyDeposited;
105  auxDetIDE.entryX = inputEntryX;
106  auxDetIDE.entryY = inputEntryY;
107  auxDetIDE.entryZ = inputEntryZ;
108  auxDetIDE.entryT = inputEntryT;
109  auxDetIDE.exitX = inputExitX;
110  auxDetIDE.exitY = inputExitY;
111  auxDetIDE.exitZ = inputExitZ;
112  auxDetIDE.exitT = inputExitT;
113  auxDetIDE.exitMomentumX = inputExitMomentumX;
114  auxDetIDE.exitMomentumY = inputExitMomentumY;
115  auxDetIDE.exitMomentumZ = inputExitMomentumZ;
116 
118  std::find(fAuxDetIDEs.begin(), fAuxDetIDEs.end(), auxDetIDE);
119 
120  if (IDEitr != fAuxDetIDEs.end()) { //If trackID is already in the map, update it
121 
122  IDEitr->energyDeposited += inputEnergyDeposited;
123  IDEitr->exitX = inputExitX;
124  IDEitr->exitY = inputExitY;
125  IDEitr->exitZ = inputExitZ;
126  IDEitr->exitT = inputExitT;
127  IDEitr->exitMomentumX = inputExitMomentumX;
128  IDEitr->exitMomentumY = inputExitMomentumY;
129  IDEitr->exitMomentumZ = inputExitMomentumZ;
130  }
131  else { //if trackID is not in the set yet, add it
132  fAuxDetIDEs.push_back(std::move(auxDetIDE));
133  } //else
134  } //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:78
float exitMomentumY
Exit Y-Momentum of particle.
void larg4::AuxDetReadout::clear ( )
virtual

Definition at line 36 of file AuxDetReadout.cxx.

References fAuxDetIDEs.

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

37  {
38  fAuxDetIDEs.clear();
39  }
std::vector< sim::AuxDetIDE > fAuxDetIDEs
list of IDEs in one channel
Definition: AuxDetReadout.h:78
void larg4::AuxDetReadout::DrawAll ( )
virtual

Definition at line 138 of file AuxDetReadout.cxx.

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

Definition at line 31 of file AuxDetReadout.cxx.

References fAuxDet, fAuxDetIDEs, fAuxDetSensitive, and fAuxDetSimChannel.

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

Definition at line 70 of file AuxDetReadout.h.

References fAuxDetSimChannel, and fGeoHandle.

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

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

Definition at line 28 of file AuxDetReadout.cxx.

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

Definition at line 139 of file AuxDetReadout.cxx.

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

Definition at line 44 of file AuxDetReadout.cxx.

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

45  {
46  // collect the info for this step
47 
48  const int trackID = ParticleListAction::GetCurrentTrackID();
49 
50  G4double energyDeposited = step->GetTotalEnergyDeposit() / CLHEP::GeV;
51 
52  G4ThreeVector startG4(step->GetPreStepPoint()->GetPosition());
53  double startWorld[3] = {
54  startG4.getX() / CLHEP::cm, startG4.getY() / CLHEP::cm, startG4.getZ() / CLHEP::cm};
55 
56  double startTime = step->GetPreStepPoint()->GetGlobalTime() / CLHEP::ns;
57 
58  G4ThreeVector stopG4(step->GetPostStepPoint()->GetPosition());
59  double stopWorld[3] = {
60  stopG4.getX() / CLHEP::cm, stopG4.getY() / CLHEP::cm, stopG4.getZ() / CLHEP::cm};
61 
62  G4ThreeVector stopG4Momentum(step->GetPostStepPoint()->GetMomentum());
63  double stopWorldMomVector[3] = {stopG4Momentum.getX() / CLHEP::GeV,
64  stopG4Momentum.getY() / CLHEP::GeV,
65  stopG4Momentum.getZ() / CLHEP::GeV};
66 
67  double stopTime = step->GetPostStepPoint()->GetGlobalTime() / CLHEP::ns;
68 
69  this->AddParticleStep(trackID,
70  energyDeposited,
71  startWorld[0],
72  startWorld[1],
73  startWorld[2],
74  startTime,
75  stopWorld[0],
76  stopWorld[1],
77  stopWorld[2],
78  stopTime,
79  stopWorldMomVector[0],
80  stopWorldMomVector[1],
81  stopWorldMomVector[2]);
82 
83  return true;
84  }
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 74 of file AuxDetReadout.h.

Referenced by EndOfEvent().

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

list of IDEs in one channel

Definition at line 78 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 76 of file AuxDetReadout.h.

Referenced by EndOfEvent().

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

Contains the sim::AuxDetSimChannel for this AuxDet.

Definition at line 77 of file AuxDetReadout.h.

Referenced by EndOfEvent(), and GetAuxDetSimChannel().

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

Handle to the Geometry service.

Definition at line 70 of file AuxDetReadout.h.

Referenced by GetAuxDetSimChannel().


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