32 if (
fId<rhs.
fId)
return true;
66 return sqrt(x*x + y*y + z*z);
74 double path_length = 0.0;
96 return (xyz[step] + xyz[step+1]) * 0.5;
109 weight += path_length;
120 ,std::ostream& os)
const 122 bool is_everything_ok =
true;
125 if(
fX.size() < 2 ) {is_everything_ok =
false;
if(print_errors){os<<
"Vector fX is empty\n";}}
126 if(
fY.size() < 2 ) {is_everything_ok =
false;
if(print_errors){os<<
"Vector fY is empty\n";}}
127 if(
fZ.size() < 2 ) {is_everything_ok =
false;
if(print_errors){os<<
"Vector fZ is empty\n";}}
128 if(
fT.size() < 2 ) {is_everything_ok =
false;
if(print_errors){os<<
"Vector fT is empty\n";}}
129 if(
fEnergy.size() < 2 ) {is_everything_ok =
false;
if(print_errors){os<<
"Vector fEnergy is empty\n";}}
130 if(
fVectorEdep.size() < 2 ) {is_everything_ok =
false;
if(print_errors){os<<
"Vector fVectorEdep is empty\n";}}
131 if(
fVectorEdepBirks.size() < 2 ) {is_everything_ok =
false;
if(print_errors){os<<
"Vector fVectorEdepBirks is empty\n";}}
134 if(
fX.size() !=
fY.size() ||
135 fX.size() !=
fZ.size() ||
136 fX.size() !=
fT.size() ||
139 is_everything_ok =
false;
141 os<<
"Vectors fX, fY, fZ, fT, fEnergy should have the same size, but they have sizes";
147 os<<
" respectively.\n";
153 is_everything_ok =
false;
155 os<<
"Vectors fVectorEdep and fVectorEdepBirks, but they have sizes";
158 os<<
" respectively.\n";
164 is_everything_ok =
false;
166 os<<
"Vector fX should have one more entry than fVectorEdep, but they have sizes";
169 os<<
" respectively.\n";
175 is_everything_ok =
false;
177 os<<
"Vector fT did not increase monotonically\n";
183 is_everything_ok =
false;
185 os<<
"Vector fEnergy did not decrease monotonically\n";
191 is_everything_ok =
false;
197 return is_everything_ok;
205 o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
geo::CellUniqueId GetCellUniqueId() const
Unique Cell ID.
float GetEntryX() const
Entry point of the particle (position, time and energy)
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
std::vector< float > fY
Start or end of the step inside scintillator. Y position, cm.
int GetPlaneID() const
Plane ID.
float GetEnergyLoss(const int step) const
Get energy loss of a particular step.
float GetEntryEnergy() const
float GetPathLength(const int step) const
Get path length of a particular step.
int GetCellID() const
Cell ID.
std::vector< float > fZ
Start or end of the step inside scintillator. Z position, cm.
float GetTotalPathLength() const
Get path length of all steps in FLSHit.
int GetNSteps() const
Number of steps in FLSHit. Should be equal to GetNPoints() - 1.
float GetTotalEnergyLoss() const
Get total energy loss in the entire FLSHit.
std::vector< float > fVectorEdep
Amount of energy deposited during a Geant4 step (GeV)
unsigned short int fCellId
Cell number.
float GetNCerenkov() const
Get total N Cerenkov photons.
std::vector< double > fT
Start or end of the step inside scintillator. Time, ns.
std::vector< float > fVectorNCerenkov
Amount of Cerenkov light emitteded in scintillator.
A single unit of energy deposition in the liquid scintillator.
float GetExitX() const
Exit point of the particle (position, time and energy)
bool IsFLSHitReasonable(const bool print_errors=false, std::ostream &error_printint_stream=std::cout) const
bool operator<(const FLSHit &rhs) const
unsigned short int fPlaneId
Plane number.
geo::CellUniqueId fId
Unique cell ID.
std::ostream & operator<<(std::ostream &o, const FLSHit &a)
std::vector< float > fVectorEdepBirks
Amount of energy deposited during a Geant4 step ; Birks weighted (GeV)
Example routine for calculating the "ultimate e-m mother" of a particle in a simulated event...
float GetEdepBirks() const
Get total Energy with Birks suppression deposited into the cell for the whole FLSHit.
int fPDG
PDG code of parent particle.
float GetExitEnergy() const
bool operator==(const FLSHit &rhs) const
int fTrackId
Index number of the Global track producing hit.
int GetTrackID() const
Track ID.
std::vector< float > fX
Start or end of the step inside scintillator. X position, cm.
void Clear()
Clear the FLS hit.
float GetEdep() const
Get total Energy deposited into the cell for the whole FLSHit.
float GetXYZAverage(const std::vector< float > &xyz, const int step) const
bool DoesDecreaseMonotonically(const std::vector< T > &input_vector) const
Checks whether the input vector decreases monotonically.
std::vector< float > fEnergy
Start or end of the step inside scintillator. Energy, GeV.
bool DoesIncreaseMonotonically(const std::vector< T > &input_vector) const
Checks whether the input vector increases monotonically.