LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
SimEnergyDepositLite.h
Go to the documentation of this file.
1 #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 {
28  public:
29  using Length_t = float;
31 
32  SimEnergyDepositLite(double e = 0.,
33  geo::Point_t middle = {0., 0., 0.},
34  double t = 0.,
35  int id = 0)
36  : edep(e), middlePos(middle), middleTime(t), trackID(id)
37  {}
38 
39  double Energy() const { return edep; }
40  geo::Point_t const& Position() const noexcept { return middlePos; }
41  geo::Point_t const& MidPoint() const noexcept
42  {
43  return Position();
44  }
45  double Time() const { return middleTime; }
46  int TrackID() const { return trackID; }
47 
48  geo::Length_t X() const { return middlePos.X(); }
49  geo::Length_t Y() const { return middlePos.Y(); }
50  geo::Length_t Z() const { return middlePos.Z(); }
51  double T() const { return middleTime; }
52  double E() const { return edep; }
53 
54  bool operator<(const SimEnergyDepositLite& rhs) const
55  {
56  if (trackID < rhs.trackID) return true;
57  if (trackID > rhs.trackID) return false;
58  if (middleTime < rhs.middleTime) return true;
59  if (middleTime > rhs.middleTime) return false;
60  if (middlePos.Z() < rhs.Z()) return true;
61  if (middlePos.Z() > rhs.Z()) return false;
62  if (middlePos.Y() < rhs.Y()) return true;
63  if (middlePos.Y() > rhs.Y()) return false;
64  if (middlePos.X() < rhs.X()) return true;
65  if (middlePos.X() > rhs.X()) return false;
66  return (edep > rhs.edep); // sort by _decreasing_ energy
67  }
68 
69  // Need to be aware that information is obviously not complete
70  // (e.g. no exact start/end point or time, only middle point or time)
71  operator sim::SimEnergyDeposit() const
72  {
73  return sim::SimEnergyDeposit(
75  }
76 
77  private:
78  float edep;
80  double middleTime;
81  int trackID;
82  };
83 
84  typedef std::vector<SimEnergyDepositLite> SimEnergyDepositLiteCollection;
85 } // namespace sim
86 #endif // LARDATAOBJ_SIMULATION_SIMENERGYDEPOSITLITE_H
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:133
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
geo::Point_t const & MidPoint() const noexcept
Just an alias for compatibility with SED.
Definitions of geometry vector data types.
float edep
energy deposition (MeV)
Monte Carlo Simulation.
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:180
Energy deposition in the active material (lite version).
contains information for a single step in the detector simulation
Energy deposition in the active material.
geo::Point_t const & Position() const noexcept
Float_t e
Definition: plot.C:35