All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimEnergyDepositLite.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////
2 /// \file lardataobj/Simulation/SimEnergyDepositLite.h
3 /// \brief contains information for a single step in the detector simulation
4 /// (pared down in size to the essential information)
5 /// \authors Laura Domine
6 ////////////////////////////////////////////////////////////////////////
7 #ifndef LARDATAOBJ_SIMULATION_SIMENERGYDEPOSITLITE_H
8 #define LARDATAOBJ_SIMULATION_SIMENERGYDEPOSITLITE_H
9 
10 // LArSoft includes
11 // Define the LArSoft standard geometry types and methods.
14 
15 // C++ includes
16 #include <vector>
17 
18 namespace sim
19 {
20  /**
21  * @brief Energy deposition in the active material (lite version).
22  *
23  * The detector simulation (presently LArG4, which invokes Geant4)
24  * propagates particles through the detector in intervals of "steps".
25  * These are usually stored in sim::SimEnergyDeposit objects. For
26  * filesize concerns we pare it down to the essential information.
27  */
29  {
30  public:
31 
32  using Length_t = float;
34 
35  SimEnergyDepositLite(double e = 0.,
36  geo::Point_t middle = {0., 0., 0.},
37  double t = 0.,
38  int id = 0)
39  : edep(e)
40  , middlePos(middle)
41  , middleTime(t)
42  , trackID(id)
43  {}
44 
45  double Energy() const { return edep; }
46  geo::Point_t const& Position() const noexcept { return middlePos; }
47  geo::Point_t const& MidPoint() const noexcept { return Position();} ///< Just an alias for compatibility with SED
48  double Time() const { return middleTime; }
49  int TrackID() const { return trackID; }
50 
51  geo::Length_t X() const { return middlePos.X(); }
52  geo::Length_t Y() const { return middlePos.Y(); }
53  geo::Length_t Z() const { return middlePos.Z(); }
54  double T() const { return middleTime; }
55  double E() const { return edep; }
56 
57  bool operator<(const SimEnergyDepositLite& rhs) const
58  {
59  if (trackID < rhs.trackID) return true;
60  if (trackID > rhs.trackID) return false;
61  if (middleTime < rhs.middleTime) return true;
62  if (middleTime > rhs.middleTime) return false;
63  if (middlePos.Z() < rhs.Z()) return true;
64  if (middlePos.Z() > rhs.Z()) return false;
65  if (middlePos.Y() < rhs.Y()) return true;
66  if (middlePos.Y() > rhs.Y()) return false;
67  if (middlePos.X() < rhs.X()) return true;
68  if (middlePos.X() > rhs.X()) return false;
69  return (edep > rhs.edep); // sort by _decreasing_ energy
70  }
71 
72  // Need to be aware that information is obviously not complete
73  // (e.g. no exact start/end point or time, only middle point or time)
74  operator sim::SimEnergyDeposit() const {
75  return sim::SimEnergyDeposit(0, 0, 0,
76  edep,
77  middlePos,
78  middlePos,
79  middleTime,
80  middleTime,
81  trackID,
82  0);
83  }
84 
85  private:
86  float edep; ///< energy deposition (MeV)
87  geo::Point_t middlePos; ///< position in (cm)
88  double middleTime; ///< (ns)
89  int trackID; ///< simulation track id
90 
91  };
92 
93  typedef std::vector<SimEnergyDepositLite> SimEnergyDepositLiteCollection;
94 } // namespace sim
95 #endif // LARDATAOBJ_SIMULATION_SIMENERGYDEPOSITLITE_H
96 
bool operator<(const SimEnergyDepositLite &rhs) const
geo::Point_t middlePos
position in (cm)
double Length_t
Type used for coordinates and distances. They are measured in centimeters.
Definition: geo_vectors.h:137
geo::Length_t Y() const
geo::Length_t Z() const
int trackID
simulation track id
std::vector< SimEnergyDepositLite > SimEnergyDepositLiteCollection
SimEnergyDepositLite(double e=0., geo::Point_t middle={0., 0., 0.}, double t=0., int id=0)
geo::Length_t X() const
Definitions of geometry vector data types.
geo::Point_t const & MidPoint() const noexcept
Just an alias for compatibility with SED.
float edep
energy deposition (MeV)
Energy deposition in the active material (lite version).
contains information for a single step in the detector simulation
Energy deposition in the active material.
do i e
geo::Point_t const & Position() const noexcept
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184