LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
AuxDetSimChannel.cxx
Go to the documentation of this file.
1 
9 
10 // our header
12 
13 // C/C++ standard library
14 #include <limits> // std::numeric_limits<>
15 #include <stdexcept>
16 
17 // LArSoft headers
19 
20 namespace sim{
21 
22  // Default constructor
23  //-------------------------------------------------
25  : trackID (util::kBogusI)
26  , energyDeposited(util::kBogusF)
27  , entryX (util::kBogusF)
28  , entryY (util::kBogusF)
29  , entryZ (util::kBogusF)
30  , entryT (util::kBogusF)
31  , exitX (util::kBogusF)
32  , exitY (util::kBogusF)
33  , exitZ (util::kBogusF)
34  , exitT (util::kBogusF)
35  , exitMomentumX (util::kBogusF)
36  , exitMomentumY (util::kBogusF)
37  , exitMomentumZ (util::kBogusF)
38  {}
39 
40  // Copy with offset constructor
41  //-------------------------------------------------
42  AuxDetIDE::AuxDetIDE(AuxDetIDE const& ide, int offset)
43  : trackID (ide.trackID+offset)
45  , entryX (ide.entryX)
46  , entryY (ide.entryY)
47  , entryZ (ide.entryZ)
48  , entryT (ide.entryT)
49  , exitX (ide.exitX)
50  , exitY (ide.exitY)
51  , exitZ (ide.exitZ)
52  , exitT (ide.exitT)
56  {}
57 
58  //----------------------------------------------------------------------------
60  : fAuxDetID(std::numeric_limits<uint32_t>::max())
61  , fAuxDetSensitiveID(std::numeric_limits<uint32_t>::max())
62  {
63  }
64 
65  //----------------------------------------------------------------------------
66  AuxDetSimChannel::AuxDetSimChannel(uint32_t inputAuxDetID,
67  uint32_t inputAuxDetSensitiveID)
68  : fAuxDetID(inputAuxDetID)
69  , fAuxDetSensitiveID(inputAuxDetSensitiveID)
70  {}
71 
72  //----------------------------------------------------------------------------
73  AuxDetSimChannel::AuxDetSimChannel(uint32_t inputAuxDetID,
74  const std::vector<sim::AuxDetIDE>& inputAuxDetIDEs,
75  uint32_t inputAuxDetSensitiveID)
76  : fAuxDetID(inputAuxDetID)
77  , fAuxDetSensitiveID(inputAuxDetSensitiveID)
78  , fAuxDetIDEs(inputAuxDetIDEs)
79  {}
80 
81  //----------------------------------------------------------------------------
82  AuxDetSimChannel::AuxDetSimChannel(uint32_t inputAuxDetID,
83  std::vector<sim::AuxDetIDE>&& inputAuxDetIDEs,
84  uint32_t inputAuxDetSensitiveID)
85  : fAuxDetID(inputAuxDetID)
86  , fAuxDetSensitiveID(inputAuxDetSensitiveID)
87  , fAuxDetIDEs(inputAuxDetIDEs)
88  {}
89 
90  //----------------------------------------------------------------------------
92  int offset)
93  {
94  if(this->fAuxDetID != chan.AuxDetID() && this->fAuxDetSensitiveID != chan.AuxDetSensitiveID())
95  throw std::runtime_error("ERROR AuxDetSimChannel Merge: Trying to merge different channels!");
96 
97  std::pair<int,int> range_trackID(std::numeric_limits<int>::max(),
99 
100  for(auto const& ide : AuxDetIDEs()){
101  this->fAuxDetIDEs.emplace_back(ide,offset);
102 
103  if( ide.trackID+offset < range_trackID.first )
104  range_trackID.first = ide.trackID+offset;
105  if( ide.trackID+offset > range_trackID.second )
106  range_trackID.second = ide.trackID+offset;
107  }
108 
109  return range_trackID;
110  }
111 
112  //----------------------------------------------------------------------------
114  {
115  if(fAuxDetID < other.AuxDetID() ) return true;
116 
117  return fAuxDetSensitiveID < other.AuxDetSensitiveID();
118  }
119 
120  //----------------------------------------------------------------------------
122  {
123  return (fAuxDetID == other.AuxDetID() && fAuxDetSensitiveID == other.AuxDetSensitiveID());
124  }
125 
126 
127 }//namespace sim
uint32_t fAuxDetSensitiveID
integer used to retrieve AuxDetSensitiveGeo object
std::vector< sim::AuxDetIDE > fAuxDetIDEs
one sim::AuxDetIDE for each G4 track id
Namespace for general, non-LArSoft-specific utilities.
Definition: PIDAAlg.h:17
std::pair< int, int > MergeAuxDetSimChannel(const AuxDetSimChannel &, int)
int trackID
Geant4 supplied track ID.
float exitMomentumZ
Exit Z-Momentum of particle.
bool operator<(const AuxDetSimChannel &other) const
AuxDetSimChannel()
Default constructor (invalid, empty data)
STL namespace.
constexpr int kBogusI
obviously bogus integer value
float exitY
Exit position Y of particle.
Collection of particles crossing one auxiliary detector cell.
Int_t max
Definition: plot.C:27
object containing MC truth information necessary for making RawDigits and doing back tracking ...
uint32_t AuxDetID() const
float entryT
Entry time of particle.
uint32_t fAuxDetID
geo->AuxDet(auxDetID), integer used to retrieve AuxDetGeo objec
float exitMomentumX
Exit X-Momentum of particle.
float exitT
Exit time of particle.
std::vector< sim::AuxDetIDE > const & AuxDetIDEs() const
float exitZ
Exit position Z of particle.
Monte Carlo Simulation.
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
constexpr float kBogusF
obviously bogus float value
float entryX
Entry position X of particle.
float entryY
Entry position Y of particle.
uint32_t AuxDetSensitiveID() const
Int_t min
Definition: plot.C:26
MC truth information to make RawDigits and do back tracking.
float exitMomentumY
Exit Y-Momentum of particle.
bool operator==(const AuxDetSimChannel &other) const