Public Member Functions | Private Member Functions | Private Attributes | List of all members
sim::FLSHit Class Reference

A single unit of energy deposition in the liquid scintillator. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-10-28/Simulation/FLSHit.h"

Public Member Functions

 FLSHit ()
 
 ~FLSHit ()
 
bool operator== (const FLSHit &rhs) const
 
bool operator< (const FLSHit &rhs) const
 
void Clear ()
 Clear the FLS hit. More...
 
float GetEdep () const
 Get total Energy deposited into the cell for the whole FLSHit. More...
 
float GetEdepBirks () const
 Get total Energy with Birks suppression deposited into the cell for the whole FLSHit. More...
 
float GetNCerenkov () const
 Get total N Cerenkov photons. More...
 
int GetPlaneID () const
 Plane ID. More...
 
int GetCellID () const
 Cell ID. More...
 
geo::CellUniqueId GetCellUniqueId () const
 Unique Cell ID. More...
 
int GetPDG () const
 PDG. More...
 
int GetTrackID () const
 Track ID. More...
 
float GetEntryX () const
 Entry point of the particle (position, time and energy) More...
 
float GetEntryY () const
 
float GetEntryZ () const
 
float GetEntryT () const
 
float GetEntryEnergy () const
 
float GetExitX () const
 Exit point of the particle (position, time and energy) More...
 
float GetExitY () const
 
float GetExitZ () const
 
float GetExitT () const
 
float GetExitEnergy () const
 
int GetNPoints () const
 Number of end points in FLSHit (could be Geant end points) More...
 
int GetNSteps () const
 Number of steps in FLSHit. Should be equal to GetNPoints() - 1. More...
 
float GetPathLength (const int step) const
 Get path length of a particular step. More...
 
float GetTotalPathLength () const
 Get path length of all steps in FLSHit. More...
 
float GetEnergyLoss (const int step) const
 Get energy loss of a particular step. More...
 
float GetTotalEnergyLoss () const
 Get total energy loss in the entire FLSHit. More...
 
float GetXAverage (const int step) const
 Get X-average for the step. This is in local coordinates. More...
 
float GetYAverage (const int step) const
 Get Y-average for the step. This is in local coordinates. More...
 
float GetZAverage (const int step) const
 Get Z-average for the step. This is in local coordinates. More...
 
float GetXAverage () const
 Get X-average for the FLSHit. This is in local coordinates. More...
 
float GetYAverage () const
 Get Y-average for the FLSHit. This is in local coordinates. More...
 
float GetZAverage () const
 Get Z-average for the FLSHit. This is in local coordinates. More...
 
float GetX (const int ipoint) const
 Get a point of the particle in the FLSHit (position, time and energy) More...
 
float GetY (const int ipoint) const
 
float GetZ (const int ipoint) const
 
float GetT (const int ipoint) const
 
float GetEnergy (const int ipoint) const
 
float GetEdep (const int ipoint) const
 
float GetEdepBirks (const int ipoint) const
 
float GetNCerenkov (const int ipoint) const
 
void SetPDG (const int pdg)
 Set methods. More...
 
void SetTrackId (const int trackid)
 
void SetPlane (const int ip)
 
void SetCell (const int ic)
 
void SetCellUniqueId (const geo::CellUniqueId &id)
 
void AddEdep (const float edep)
 
void AddEdepBirks (const float edepbirks)
 
void AddNCerenkov (const float ncerenkov)
 
void AddPos (const float x, const float y, const float z, const double t, const float energy)
 
bool IsFLSHitReasonable (const bool print_errors=false, std::ostream &error_printint_stream=std::cout) const
 

Private Member Functions

template<class T >
T getSum (const std::vector< T > &input_vector) const
 Sums over the array of the vector. More...
 
template<class T >
T getElement (const std::vector< T > &input_vector, const unsigned int ipoint) const
 Gets i-th element of the vector. More...
 
template<class T >
T getFirst (const std::vector< T > &input_vector) const
 Gets the last element of the vector. More...
 
template<class T >
T getLast (const std::vector< T > &input_vector) const
 Gets the last element of the vector. More...
 
float GetXYZAverage (const std::vector< float > &xyz, const int step) const
 
float GetXYZAverage (const std::vector< float > &xyz) const
 
template<class T >
bool DoesIncreaseMonotonically (const std::vector< T > &input_vector) const
 Checks whether the input vector increases monotonically. More...
 
template<class T >
bool DoesDecreaseMonotonically (const std::vector< T > &input_vector) const
 Checks whether the input vector decreases monotonically. More...
 

Private Attributes

geo::CellUniqueId fId
 Unique cell ID. More...
 
unsigned short int fPlaneId
 Plane number. More...
 
unsigned short int fCellId
 Cell number. More...
 
int fPDG
 PDG code of parent particle. More...
 
int fTrackId
 Index number of the Global track producing hit. More...
 
std::vector< float > fX
 Start or end of the step inside scintillator. X position, cm. More...
 
std::vector< float > fY
 Start or end of the step inside scintillator. Y position, cm. More...
 
std::vector< float > fZ
 Start or end of the step inside scintillator. Z position, cm. More...
 
std::vector< float > fEnergy
 Start or end of the step inside scintillator. Energy, GeV. More...
 
std::vector< double > fT
 Start or end of the step inside scintillator. Time, ns. More...
 
std::vector< float > fVectorEdep
 Amount of energy deposited during a Geant4 step (GeV) More...
 
std::vector< float > fVectorEdepBirks
 Amount of energy deposited during a Geant4 step ; Birks weighted (GeV) More...
 
std::vector< float > fVectorNCerenkov
 Amount of Cerenkov light emitteded in scintillator. More...
 

Detailed Description

A single unit of energy deposition in the liquid scintillator.

Definition at line 19 of file FLSHit.h.

Constructor & Destructor Documentation

sim::FLSHit::FLSHit ( )

Definition at line 12 of file FLSHit.cxx.

12  :
13  fId (0)
14  ,fPlaneId(0)
15  ,fCellId (0)
16  ,fPDG (0)
17  ,fTrackId(0)
18  { }
unsigned short int fCellId
Cell number.
Definition: FLSHit.h:187
unsigned short int fPlaneId
Plane number.
Definition: FLSHit.h:186
geo::CellUniqueId fId
Unique cell ID.
Definition: FLSHit.h:184
int fPDG
PDG code of parent particle.
Definition: FLSHit.h:188
int fTrackId
Index number of the Global track producing hit.
Definition: FLSHit.h:189
sim::FLSHit::~FLSHit ( )

Definition at line 20 of file FLSHit.cxx.

20 { }

Member Function Documentation

void sim::FLSHit::AddEdep ( const float  edep)
inline

Definition at line 105 of file FLSHit.h.

References fVectorEdep.

Referenced by g4n::FLSHitListAction::SteppingAction(), and g4n::FLSHitListAction::supressFLSHitList().

105 { fVectorEdep.push_back(edep); }
std::vector< float > fVectorEdep
Amount of energy deposited during a Geant4 step (GeV)
Definition: FLSHit.h:197
Double_t edep
Definition: macro.C:13
void sim::FLSHit::AddEdepBirks ( const float  edepbirks)
inline

Definition at line 106 of file FLSHit.h.

References fVectorEdepBirks.

Referenced by g4n::FLSHitListAction::SteppingAction(), and g4n::FLSHitListAction::supressFLSHitList().

106 { fVectorEdepBirks.push_back(edepbirks);}
std::vector< float > fVectorEdepBirks
Amount of energy deposited during a Geant4 step ; Birks weighted (GeV)
Definition: FLSHit.h:198
void sim::FLSHit::AddNCerenkov ( const float  ncerenkov)
inline

Definition at line 107 of file FLSHit.h.

References fVectorNCerenkov.

Referenced by g4n::FLSHitListAction::SteppingAction(), and g4n::FLSHitListAction::supressFLSHitList().

107 { fVectorNCerenkov.push_back(ncerenkov); }
std::vector< float > fVectorNCerenkov
Amount of Cerenkov light emitteded in scintillator.
Definition: FLSHit.h:199
void sim::FLSHit::AddPos ( const float  x,
const float  y,
const float  z,
const double  t,
const float  energy 
)
inline

Definition at line 108 of file FLSHit.h.

References om::cout, fEnergy, fT, fX, fY, fZ, and IsFLSHitReasonable().

Referenced by g4n::FLSHitListAction::SteppingAction(), and g4n::FLSHitListAction::supressFLSHitList().

108 {fX.push_back(x);fY.push_back(y);fZ.push_back(z);fT.push_back(t);fEnergy.push_back(energy);}
std::vector< float > fY
Start or end of the step inside scintillator. Y position, cm.
Definition: FLSHit.h:192
std::vector< float > fZ
Start or end of the step inside scintillator. Z position, cm.
Definition: FLSHit.h:193
std::vector< double > fT
Start or end of the step inside scintillator. Time, ns.
Definition: FLSHit.h:195
double energy
Definition: plottest35.C:25
z
Definition: test.py:28
std::vector< float > fX
Start or end of the step inside scintillator. X position, cm.
Definition: FLSHit.h:191
std::vector< float > fEnergy
Start or end of the step inside scintillator. Energy, GeV.
Definition: FLSHit.h:194
void sim::FLSHit::Clear ( )

Clear the FLS hit.

Definition at line 39 of file FLSHit.cxx.

References fCellId, fEnergy, fPDG, fPlaneId, fT, fTrackId, fVectorEdep, fVectorEdepBirks, fVectorNCerenkov, fX, fY, and fZ.

Referenced by g4n::FLSHitListAction::PreTrackingAction(), MergeG4Collections::MergeG4Collections::produce(), MergeCollections::MergeCollections::produce(), and g4n::FLSHitListAction::SteppingAction().

39  {
40 
41  // Clear almost everything. We don't want to clear fId, though
42 
43  fPlaneId = 0;
44  fCellId = 0;
45  fTrackId = 0;
46  fPDG = 0;
47 
48  fX.clear();
49  fY.clear();
50  fZ.clear();
51  fT.clear();
52  fEnergy.clear();
53  fVectorEdep.clear();
54  fVectorEdepBirks.clear();
55  fVectorNCerenkov.clear();
56  }
std::vector< float > fY
Start or end of the step inside scintillator. Y position, cm.
Definition: FLSHit.h:192
std::vector< float > fZ
Start or end of the step inside scintillator. Z position, cm.
Definition: FLSHit.h:193
std::vector< float > fVectorEdep
Amount of energy deposited during a Geant4 step (GeV)
Definition: FLSHit.h:197
unsigned short int fCellId
Cell number.
Definition: FLSHit.h:187
std::vector< double > fT
Start or end of the step inside scintillator. Time, ns.
Definition: FLSHit.h:195
std::vector< float > fVectorNCerenkov
Amount of Cerenkov light emitteded in scintillator.
Definition: FLSHit.h:199
unsigned short int fPlaneId
Plane number.
Definition: FLSHit.h:186
std::vector< float > fVectorEdepBirks
Amount of energy deposited during a Geant4 step ; Birks weighted (GeV)
Definition: FLSHit.h:198
int fPDG
PDG code of parent particle.
Definition: FLSHit.h:188
int fTrackId
Index number of the Global track producing hit.
Definition: FLSHit.h:189
std::vector< float > fX
Start or end of the step inside scintillator. X position, cm.
Definition: FLSHit.h:191
std::vector< float > fEnergy
Start or end of the step inside scintillator. Energy, GeV.
Definition: FLSHit.h:194
template<class T >
bool sim::FLSHit::DoesDecreaseMonotonically ( const std::vector< T > &  input_vector) const
inlineprivate

Checks whether the input vector decreases monotonically.

if size is less than 2, then it's monotonic, obviously

Definition at line 166 of file FLSHit.h.

References MECModelEnuComparisons::i.

Referenced by IsFLSHitReasonable().

166  {
167 
168  const int n_size = input_vector.size();
169 
170  /// if size is less than 2, then it's monotonic, obviously
171  if(n_size < 2) return true;
172 
173  for(int i=1; i<n_size; ++i){
174  if(input_vector[i-1] < input_vector[i])
175  return false;
176  }
177 
178  return true;
179  }// end of DoesDecreaseMonotonically
template<class T >
bool sim::FLSHit::DoesIncreaseMonotonically ( const std::vector< T > &  input_vector) const
inlineprivate

Checks whether the input vector increases monotonically.

if size is less than 2, then it's monotonic, obviously

Definition at line 149 of file FLSHit.h.

References MECModelEnuComparisons::i.

Referenced by IsFLSHitReasonable().

149  {
150 
151  const int n_size = input_vector.size();
152 
153  /// if size is less than 2, then it's monotonic, obviously
154  if(n_size < 2) return true;
155 
156  for(int i=1; i<n_size; ++i){
157  if(input_vector[i-1] > input_vector[i])
158  return false;
159  }
160 
161  return true;
162  }// end of DoesIncreaseMonotonically
int sim::FLSHit::GetCellID ( ) const
inline
geo::CellUniqueId sim::FLSHit::GetCellUniqueId ( ) const
inline

Unique Cell ID.

Definition at line 41 of file FLSHit.h.

References fId.

Referenced by photrans::ImprovedTransport::GetPosCorr(), sim::operator<<(), g4n::FLSHitListAction::SteppingAction(), and g4n::FLSHitListAction::supressFLSHitList().

41 {return fId;}
geo::CellUniqueId fId
Unique cell ID.
Definition: FLSHit.h:184
float sim::FLSHit::GetEdep ( ) const
inline

Get total Energy deposited into the cell for the whole FLSHit.

Definition at line 31 of file FLSHit.h.

References fVectorEdep, and getSum().

Referenced by slid::LIDTraining::analyze(), upmuana::UpMuRecoAna::analyze(), showere::ShowerEnergyFilterMC::filter(), evd::SimulationDrawer::FLSHit2D(), evd::SimulationDrawer::FLSHit3D(), evd::MCTrueView::LoadEvent(), sim::operator<<(), calib::PCHitsList::ProcessTrackForFLSHits(), cheat::sortFLSHit(), photrans::ImprovedTransport::StepAlongHit(), g4n::FLSHitListAction::SteppingAction(), and g4n::FLSHitListAction::supressFLSHitList().

31 {return getSum(fVectorEdep);}
std::vector< float > fVectorEdep
Amount of energy deposited during a Geant4 step (GeV)
Definition: FLSHit.h:197
T getSum(const std::vector< T > &input_vector) const
Sums over the array of the vector.
Definition: FLSHit.h:119
float sim::FLSHit::GetEdep ( const int  ipoint) const
inline

Definition at line 95 of file FLSHit.h.

References fVectorEdep, and getElement().

95 {return getElement(fVectorEdep , ipoint);}
std::vector< float > fVectorEdep
Amount of energy deposited during a Geant4 step (GeV)
Definition: FLSHit.h:197
T getElement(const std::vector< T > &input_vector, const unsigned int ipoint) const
Gets i-th element of the vector.
Definition: FLSHit.h:126
float sim::FLSHit::GetEdepBirks ( ) const
inline

Get total Energy with Birks suppression deposited into the cell for the whole FLSHit.

Definition at line 33 of file FLSHit.h.

References fVectorEdepBirks, and getSum().

Referenced by showere::ShowerEnergyAna::analyze(), sim::operator<<(), photrans::PhotonSystRewriter::produce(), photrans::ImprovedTransport::StepAlongHit(), and g4n::FLSHitListAction::supressFLSHitList().

33 {return getSum(fVectorEdepBirks);}
std::vector< float > fVectorEdepBirks
Amount of energy deposited during a Geant4 step ; Birks weighted (GeV)
Definition: FLSHit.h:198
T getSum(const std::vector< T > &input_vector) const
Sums over the array of the vector.
Definition: FLSHit.h:119
float sim::FLSHit::GetEdepBirks ( const int  ipoint) const
inline

Definition at line 96 of file FLSHit.h.

References fVectorEdepBirks, and getElement().

96 {return getElement(fVectorEdepBirks, ipoint);}
std::vector< float > fVectorEdepBirks
Amount of energy deposited during a Geant4 step ; Birks weighted (GeV)
Definition: FLSHit.h:198
T getElement(const std::vector< T > &input_vector, const unsigned int ipoint) const
Gets i-th element of the vector.
Definition: FLSHit.h:126
template<class T >
T sim::FLSHit::getElement ( const std::vector< T > &  input_vector,
const unsigned int  ipoint 
) const
inlineprivate

Gets i-th element of the vector.

Definition at line 126 of file FLSHit.h.

Referenced by GetEdep(), GetEdepBirks(), GetEnergy(), GetNCerenkov(), GetT(), GetX(), GetY(), and GetZ().

126  {
127  return input_vector.at(ipoint);
128  }// end of getElement
float sim::FLSHit::GetEnergy ( const int  ipoint) const
inline

Definition at line 94 of file FLSHit.h.

References fEnergy, and getElement().

94 {return getElement(fEnergy , ipoint);}
T getElement(const std::vector< T > &input_vector, const unsigned int ipoint) const
Gets i-th element of the vector.
Definition: FLSHit.h:126
std::vector< float > fEnergy
Start or end of the step inside scintillator. Energy, GeV.
Definition: FLSHit.h:194
float sim::FLSHit::GetEnergyLoss ( const int  step) const

Get energy loss of a particular step.

Definition at line 84 of file FLSHit.cxx.

References fEnergy, and fillBadChanDBTables::step.

Referenced by GetNSteps().

84  {
85  return fEnergy[step] - fEnergy[step+1];
86 }
std::vector< float > fEnergy
Start or end of the step inside scintillator. Energy, GeV.
Definition: FLSHit.h:194
float sim::FLSHit::GetEntryEnergy ( ) const
inline

Definition at line 52 of file FLSHit.h.

References fEnergy, and getFirst().

Referenced by GetTotalEnergyLoss(), sim::operator<<(), and g4n::FLSHitListAction::supressFLSHitList().

52 {return getFirst(fEnergy);}
T getFirst(const std::vector< T > &input_vector) const
Gets the last element of the vector.
Definition: FLSHit.h:132
std::vector< float > fEnergy
Start or end of the step inside scintillator. Energy, GeV.
Definition: FLSHit.h:194
float sim::FLSHit::GetEntryT ( ) const
inline

Definition at line 51 of file FLSHit.h.

References fT, and getFirst().

Referenced by mono::SlowMonopoleAna::analyze(), novaddt::UpMuAna::analyze(), mono::Monopole::analyze(), evd::SimulationDrawer::GetTimeLimits(), evd::MCTrueView::LoadEvent(), operator<(), sim::operator<<(), operator==(), photrans::ImprovedTransport::StepAlongHit(), and g4n::FLSHitListAction::supressFLSHitList().

51 {return getFirst(fT);}
std::vector< double > fT
Start or end of the step inside scintillator. Time, ns.
Definition: FLSHit.h:195
T getFirst(const std::vector< T > &input_vector) const
Gets the last element of the vector.
Definition: FLSHit.h:132
float sim::FLSHit::GetEntryX ( ) const
inline

Entry point of the particle (position, time and energy)

Definition at line 48 of file FLSHit.h.

References fX, and getFirst().

Referenced by evd::SimulationDrawer::FLSHit3D(), photrans::ImprovedTransport::GetPosCorr(), sim::operator<<(), photrans::ImprovedTransport::StepAlongHit(), g4n::FLSHitListAction::supressFLSHitList(), and calib::PCHitsList::TrueW().

48 {return getFirst(fX);}
std::vector< float > fX
Start or end of the step inside scintillator. X position, cm.
Definition: FLSHit.h:191
T getFirst(const std::vector< T > &input_vector) const
Gets the last element of the vector.
Definition: FLSHit.h:132
float sim::FLSHit::GetEntryY ( ) const
inline

Definition at line 49 of file FLSHit.h.

References fY, and getFirst().

Referenced by evd::SimulationDrawer::FLSHit3D(), photrans::ImprovedTransport::GetPosCorr(), sim::operator<<(), photrans::ImprovedTransport::StepAlongHit(), g4n::FLSHitListAction::supressFLSHitList(), and calib::PCHitsList::TrueW().

49 {return getFirst(fY);}
std::vector< float > fY
Start or end of the step inside scintillator. Y position, cm.
Definition: FLSHit.h:192
T getFirst(const std::vector< T > &input_vector) const
Gets the last element of the vector.
Definition: FLSHit.h:132
float sim::FLSHit::GetEntryZ ( ) const
inline

Definition at line 50 of file FLSHit.h.

References fZ, and getFirst().

Referenced by evd::SimulationDrawer::FLSHit3D(), photrans::ImprovedTransport::GetPosCorr(), sim::operator<<(), photrans::ImprovedTransport::StepAlongHit(), g4n::FLSHitListAction::supressFLSHitList(), and calib::PCHitsList::TrueW().

50 {return getFirst(fZ);}
std::vector< float > fZ
Start or end of the step inside scintillator. Z position, cm.
Definition: FLSHit.h:193
T getFirst(const std::vector< T > &input_vector) const
Gets the last element of the vector.
Definition: FLSHit.h:132
float sim::FLSHit::GetExitEnergy ( ) const
inline

Definition at line 58 of file FLSHit.h.

References fEnergy, and getLast().

Referenced by GetTotalEnergyLoss(), sim::operator<<(), and g4n::FLSHitListAction::supressFLSHitList().

58 {return getLast(fEnergy);}
std::vector< float > fEnergy
Start or end of the step inside scintillator. Energy, GeV.
Definition: FLSHit.h:194
T getLast(const std::vector< T > &input_vector) const
Gets the last element of the vector.
Definition: FLSHit.h:138
float sim::FLSHit::GetExitT ( ) const
inline

Definition at line 57 of file FLSHit.h.

References fT, and getLast().

Referenced by novaddt::UpMuAna::analyze(), evd::SimulationDrawer::GetTimeLimits(), sim::operator<<(), photrans::ImprovedTransport::StepAlongHit(), and g4n::FLSHitListAction::supressFLSHitList().

57 {return getLast(fT);}
std::vector< double > fT
Start or end of the step inside scintillator. Time, ns.
Definition: FLSHit.h:195
T getLast(const std::vector< T > &input_vector) const
Gets the last element of the vector.
Definition: FLSHit.h:138
float sim::FLSHit::GetExitX ( ) const
inline

Exit point of the particle (position, time and energy)

Definition at line 54 of file FLSHit.h.

References fX, and getLast().

Referenced by evd::SimulationDrawer::FLSHit3D(), photrans::ImprovedTransport::GetPosCorr(), sim::operator<<(), photrans::ImprovedTransport::StepAlongHit(), g4n::FLSHitListAction::supressFLSHitList(), and calib::PCHitsList::TrueW().

54 {return getLast(fX);}
std::vector< float > fX
Start or end of the step inside scintillator. X position, cm.
Definition: FLSHit.h:191
T getLast(const std::vector< T > &input_vector) const
Gets the last element of the vector.
Definition: FLSHit.h:138
float sim::FLSHit::GetExitY ( ) const
inline

Definition at line 55 of file FLSHit.h.

References fY, and getLast().

Referenced by evd::SimulationDrawer::FLSHit3D(), photrans::ImprovedTransport::GetPosCorr(), sim::operator<<(), photrans::ImprovedTransport::StepAlongHit(), g4n::FLSHitListAction::supressFLSHitList(), and calib::PCHitsList::TrueW().

55 {return getLast(fY);}
std::vector< float > fY
Start or end of the step inside scintillator. Y position, cm.
Definition: FLSHit.h:192
T getLast(const std::vector< T > &input_vector) const
Gets the last element of the vector.
Definition: FLSHit.h:138
float sim::FLSHit::GetExitZ ( ) const
inline

Definition at line 56 of file FLSHit.h.

References fZ, and getLast().

Referenced by evd::SimulationDrawer::FLSHit3D(), photrans::ImprovedTransport::GetPosCorr(), sim::operator<<(), photrans::ImprovedTransport::StepAlongHit(), g4n::FLSHitListAction::supressFLSHitList(), and calib::PCHitsList::TrueW().

56 {return getLast(fZ);}
std::vector< float > fZ
Start or end of the step inside scintillator. Z position, cm.
Definition: FLSHit.h:193
T getLast(const std::vector< T > &input_vector) const
Gets the last element of the vector.
Definition: FLSHit.h:138
template<class T >
T sim::FLSHit::getFirst ( const std::vector< T > &  input_vector) const
inlineprivate

Gets the last element of the vector.

Definition at line 132 of file FLSHit.h.

Referenced by GetEntryEnergy(), GetEntryT(), GetEntryX(), GetEntryY(), and GetEntryZ().

132  {
133  return getElement<T>(input_vector, 0);
134  }// end of getFirst
template<class T >
T sim::FLSHit::getLast ( const std::vector< T > &  input_vector) const
inlineprivate

Gets the last element of the vector.

Definition at line 138 of file FLSHit.h.

References GetXYZAverage(), and T.

Referenced by GetExitEnergy(), GetExitT(), GetExitX(), GetExitY(), and GetExitZ().

138  {
139  const int n_size = input_vector.size();
140  if(n_size == 0) return (T)(0.0);
141  return input_vector[n_size - 1];
142  }// end of getLast
double T
Definition: Xdiff_gwt.C:5
float sim::FLSHit::GetNCerenkov ( ) const
inline

Get total N Cerenkov photons.

Definition at line 35 of file FLSHit.h.

References fVectorNCerenkov, and getSum().

Referenced by sim::operator<<(), photrans::PhotonSystRewriter::produce(), photrans::ImprovedTransport::StepAlongHit(), and g4n::FLSHitListAction::supressFLSHitList().

35 {return getSum(fVectorNCerenkov);}
std::vector< float > fVectorNCerenkov
Amount of Cerenkov light emitteded in scintillator.
Definition: FLSHit.h:199
T getSum(const std::vector< T > &input_vector) const
Sums over the array of the vector.
Definition: FLSHit.h:119
float sim::FLSHit::GetNCerenkov ( const int  ipoint) const
inline

Definition at line 97 of file FLSHit.h.

References fVectorNCerenkov, and getElement().

97 {return getElement(fVectorNCerenkov, ipoint);}
std::vector< float > fVectorNCerenkov
Amount of Cerenkov light emitteded in scintillator.
Definition: FLSHit.h:199
T getElement(const std::vector< T > &input_vector, const unsigned int ipoint) const
Gets i-th element of the vector.
Definition: FLSHit.h:126
int sim::FLSHit::GetNPoints ( ) const
inline

Number of end points in FLSHit (could be Geant end points)

Definition at line 61 of file FLSHit.h.

References fX.

Referenced by evd::SimulationDrawer::FLSHit2D().

61 { return fX.size();}
std::vector< float > fX
Start or end of the step inside scintillator. X position, cm.
Definition: FLSHit.h:191
int sim::FLSHit::GetNSteps ( ) const
inline

Number of steps in FLSHit. Should be equal to GetNPoints() - 1.

Definition at line 63 of file FLSHit.h.

References fVectorEdep, GetEnergyLoss(), GetPathLength(), GetTotalEnergyLoss(), GetTotalPathLength(), and fillBadChanDBTables::step.

Referenced by GetTotalPathLength(), GetXYZAverage(), and photrans::PhotonSystRewriter::produce().

63 { return fVectorEdep.size();}
std::vector< float > fVectorEdep
Amount of energy deposited during a Geant4 step (GeV)
Definition: FLSHit.h:197
float sim::FLSHit::GetPathLength ( const int  step) const

Get path length of a particular step.

Definition at line 60 of file FLSHit.cxx.

References fX, fY, fZ, std::sqrt(), fillBadChanDBTables::step, submit_syst::x, submit_syst::y, and test::z.

Referenced by GetNSteps(), GetTotalPathLength(), and GetXYZAverage().

60  {
61 
62  const double x = fX[step+1] - fX[step];
63  const double y = fY[step+1] - fY[step];
64  const double z = fZ[step+1] - fZ[step];
65 
66  return sqrt(x*x + y*y + z*z);
67 }
std::vector< float > fY
Start or end of the step inside scintillator. Y position, cm.
Definition: FLSHit.h:192
std::vector< float > fZ
Start or end of the step inside scintillator. Z position, cm.
Definition: FLSHit.h:193
T sqrt(T number)
Definition: d0nt_math.hpp:156
z
Definition: test.py:28
std::vector< float > fX
Start or end of the step inside scintillator. X position, cm.
Definition: FLSHit.h:191
int sim::FLSHit::GetPDG ( ) const
inline

PDG.

Definition at line 43 of file FLSHit.h.

References fPDG.

Referenced by novaddt::UpMuAna::analyze(), slid::LIDTraining::analyze(), evd::SimulationDrawer::FLSHit2D(), evd::SimulationDrawer::FLSHit3D(), and cheat::BackTracker::ParticleToFLSHit().

43 {return fPDG;}
int fPDG
PDG code of parent particle.
Definition: FLSHit.h:188
int sim::FLSHit::GetPlaneID ( ) const
inline
template<class T >
T sim::FLSHit::getSum ( const std::vector< T > &  input_vector) const
inlineprivate

Sums over the array of the vector.

Definition at line 119 of file FLSHit.h.

References sum, and T.

Referenced by GetEdep(), GetEdepBirks(), and GetNCerenkov().

119  {
120  const T sum = std::accumulate(input_vector.begin(), input_vector.end(), 0.0);
121  return sum;
122  }// end of getSum
double T
Definition: Xdiff_gwt.C:5
Double_t sum
Definition: plot.C:31
float sim::FLSHit::GetT ( const int  ipoint) const
inline

Definition at line 93 of file FLSHit.h.

References fT, and getElement().

93 {return getElement(fT , ipoint);}
std::vector< double > fT
Start or end of the step inside scintillator. Time, ns.
Definition: FLSHit.h:195
T getElement(const std::vector< T > &input_vector, const unsigned int ipoint) const
Gets i-th element of the vector.
Definition: FLSHit.h:126
float sim::FLSHit::GetTotalEnergyLoss ( ) const

Get total energy loss in the entire FLSHit.

Definition at line 90 of file FLSHit.cxx.

References GetEntryEnergy(), and GetExitEnergy().

Referenced by GetNSteps().

90  {
91  return GetEntryEnergy() - GetExitEnergy();
92 }
float GetEntryEnergy() const
Definition: FLSHit.h:52
float GetExitEnergy() const
Definition: FLSHit.h:58
float sim::FLSHit::GetTotalPathLength ( ) const

Get path length of all steps in FLSHit.

Definition at line 70 of file FLSHit.cxx.

References GetNSteps(), GetPathLength(), MECModelEnuComparisons::i, and nsteps.

Referenced by GetNSteps(), and calib::PCHitsList::ProcessTrackForFLSHits().

70  {
71 
72  const int nsteps = GetNSteps();
73 
74  double path_length = 0.0;
75  for(int i=0; i<nsteps; ++i){
76  path_length += GetPathLength(i);
77  }
78 
79  return path_length;
80 }
float GetPathLength(const int step) const
Get path length of a particular step.
Definition: FLSHit.cxx:60
const int nsteps
int GetNSteps() const
Number of steps in FLSHit. Should be equal to GetNPoints() - 1.
Definition: FLSHit.h:63
int sim::FLSHit::GetTrackID ( ) const
inline
float sim::FLSHit::GetX ( const int  ipoint) const
inline

Get a point of the particle in the FLSHit (position, time and energy)

Definition at line 90 of file FLSHit.h.

References fX, and getElement().

Referenced by evd::SimulationDrawer::FLSHit2D().

90 {return getElement(fX , ipoint);}
T getElement(const std::vector< T > &input_vector, const unsigned int ipoint) const
Gets i-th element of the vector.
Definition: FLSHit.h:126
std::vector< float > fX
Start or end of the step inside scintillator. X position, cm.
Definition: FLSHit.h:191
float sim::FLSHit::GetXAverage ( const int  step) const
inline

Get X-average for the step. This is in local coordinates.

Definition at line 76 of file FLSHit.h.

References fX, and GetXYZAverage().

Referenced by evd::SimulationDrawer::FLSHit2D(), and calib::PCHitsList::ProcessTrackForFLSHits().

76 {return GetXYZAverage(fX, step);}
std::vector< float > fX
Start or end of the step inside scintillator. X position, cm.
Definition: FLSHit.h:191
float GetXYZAverage(const std::vector< float > &xyz, const int step) const
Definition: FLSHit.cxx:95
float sim::FLSHit::GetXAverage ( ) const
inline

Get X-average for the FLSHit. This is in local coordinates.

Definition at line 82 of file FLSHit.h.

References fX, and GetXYZAverage().

82 { return GetXYZAverage(fX);}
std::vector< float > fX
Start or end of the step inside scintillator. X position, cm.
Definition: FLSHit.h:191
float GetXYZAverage(const std::vector< float > &xyz, const int step) const
Definition: FLSHit.cxx:95
float sim::FLSHit::GetXYZAverage ( const std::vector< float > &  xyz,
const int  step 
) const
private

Definition at line 95 of file FLSHit.cxx.

Referenced by getLast(), GetXAverage(), GetXYZAverage(), GetYAverage(), and GetZAverage().

95  {
96  return (xyz[step] + xyz[step+1]) * 0.5;
97 }
float sim::FLSHit::GetXYZAverage ( const std::vector< float > &  xyz) const
private

Definition at line 100 of file FLSHit.cxx.

References GetNSteps(), GetPathLength(), GetXYZAverage(), MECModelEnuComparisons::i, nsteps, and ana::weight.

100  {
101  const int nsteps = GetNSteps();
102 
103  double xyz_av = 0.0;
104  double weight = 0.0;
105 
106  for(int i=0; i<nsteps; ++i){
107  const double path_length = GetPathLength(i);
108 
109  weight += path_length;
110  xyz_av += path_length * GetXYZAverage(xyz, i);
111  }
112 
113  return xyz_av / weight;
114 }
const Var weight
float GetPathLength(const int step) const
Get path length of a particular step.
Definition: FLSHit.cxx:60
const int nsteps
int GetNSteps() const
Number of steps in FLSHit. Should be equal to GetNPoints() - 1.
Definition: FLSHit.h:63
float GetXYZAverage(const std::vector< float > &xyz, const int step) const
Definition: FLSHit.cxx:95
float sim::FLSHit::GetY ( const int  ipoint) const
inline

Definition at line 91 of file FLSHit.h.

References fY, and getElement().

Referenced by evd::SimulationDrawer::FLSHit2D().

91 {return getElement(fY , ipoint);}
std::vector< float > fY
Start or end of the step inside scintillator. Y position, cm.
Definition: FLSHit.h:192
T getElement(const std::vector< T > &input_vector, const unsigned int ipoint) const
Gets i-th element of the vector.
Definition: FLSHit.h:126
float sim::FLSHit::GetYAverage ( const int  step) const
inline

Get Y-average for the step. This is in local coordinates.

Definition at line 78 of file FLSHit.h.

References fY, and GetXYZAverage().

Referenced by evd::SimulationDrawer::FLSHit2D(), and calib::PCHitsList::ProcessTrackForFLSHits().

78 {return GetXYZAverage(fY, step);}
std::vector< float > fY
Start or end of the step inside scintillator. Y position, cm.
Definition: FLSHit.h:192
float GetXYZAverage(const std::vector< float > &xyz, const int step) const
Definition: FLSHit.cxx:95
float sim::FLSHit::GetYAverage ( ) const
inline

Get Y-average for the FLSHit. This is in local coordinates.

Definition at line 84 of file FLSHit.h.

References fY, and GetXYZAverage().

84 { return GetXYZAverage(fY);}
std::vector< float > fY
Start or end of the step inside scintillator. Y position, cm.
Definition: FLSHit.h:192
float GetXYZAverage(const std::vector< float > &xyz, const int step) const
Definition: FLSHit.cxx:95
float sim::FLSHit::GetZ ( const int  ipoint) const
inline

Definition at line 92 of file FLSHit.h.

References fZ, and getElement().

Referenced by evd::SimulationDrawer::FLSHit2D().

92 {return getElement(fZ , ipoint);}
std::vector< float > fZ
Start or end of the step inside scintillator. Z position, cm.
Definition: FLSHit.h:193
T getElement(const std::vector< T > &input_vector, const unsigned int ipoint) const
Gets i-th element of the vector.
Definition: FLSHit.h:126
float sim::FLSHit::GetZAverage ( const int  step) const
inline

Get Z-average for the step. This is in local coordinates.

Definition at line 80 of file FLSHit.h.

References fZ, and GetXYZAverage().

Referenced by evd::SimulationDrawer::FLSHit2D(), mono::Monopole::get_position(), and mono::SlowMonopoleAna::get_position().

80 {return GetXYZAverage(fZ, step);}
std::vector< float > fZ
Start or end of the step inside scintillator. Z position, cm.
Definition: FLSHit.h:193
float GetXYZAverage(const std::vector< float > &xyz, const int step) const
Definition: FLSHit.cxx:95
float sim::FLSHit::GetZAverage ( ) const
inline

Get Z-average for the FLSHit. This is in local coordinates.

Definition at line 86 of file FLSHit.h.

References fZ, and GetXYZAverage().

86 { return GetXYZAverage(fZ);}
std::vector< float > fZ
Start or end of the step inside scintillator. Z position, cm.
Definition: FLSHit.h:193
float GetXYZAverage(const std::vector< float > &xyz, const int step) const
Definition: FLSHit.cxx:95
bool sim::FLSHit::IsFLSHitReasonable ( const bool  print_errors = false,
std::ostream &  error_printint_stream = std::cout 
) const

Performs various checks on the size of the data and its content. Has an option to print errors out, which is turned off by default.

All sizes should be at least 2 (Entry+Exit)

Compare the sizes. Should be identical

Compare the sizes. Should be identical

Compare the sizes. fX should have one more entry than fVectorEdep

Time should increase monotonically

Energy should decrease monotonically

ID of the FLSHit should be non-zero

Definition at line 119 of file FLSHit.cxx.

References DoesDecreaseMonotonically(), DoesIncreaseMonotonically(), fEnergy, fId, fT, fVectorEdep, fVectorEdepBirks, fX, fY, and fZ.

Referenced by AddPos().

121  {
122  bool is_everything_ok = true;
123 
124  /// All sizes should be at least 2 (Entry+Exit)
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";}}
132 
133  /// Compare the sizes. Should be identical
134  if(fX.size() != fY.size() ||
135  fX.size() != fZ.size() ||
136  fX.size() != fT.size() ||
137  fX.size() != fEnergy.size()
138  ){
139  is_everything_ok = false;
140  if(print_errors){
141  os<<"Vectors fX, fY, fZ, fT, fEnergy should have the same size, but they have sizes";
142  os<<" "<<fX.size();
143  os<<" "<<fY.size();
144  os<<" "<<fZ.size();
145  os<<" "<<fT.size();
146  os<<" "<<fEnergy.size();
147  os<<" respectively.\n";
148  }// end of printing
149  }// end of checking
150 
151  /// Compare the sizes. Should be identical
152  if(fVectorEdep.size() != fVectorEdepBirks.size()){
153  is_everything_ok = false;
154  if(print_errors){
155  os<<"Vectors fVectorEdep and fVectorEdepBirks, but they have sizes";
156  os<<" "<<fVectorEdep.size();
157  os<<" "<<fVectorEdepBirks.size();
158  os<<" respectively.\n";
159  }// end of printing
160  }// end of checking
161 
162  /// Compare the sizes. fX should have one more entry than fVectorEdep
163  if(fX.size() != fVectorEdep.size() + 1){
164  is_everything_ok = false;
165  if(print_errors){
166  os<<"Vector fX should have one more entry than fVectorEdep, but they have sizes";
167  os<<" "<<fX.size();
168  os<<" "<<fVectorEdep.size();
169  os<<" respectively.\n";
170  }// end of printing
171  }// end of checking
172 
173  /// Time should increase monotonically
175  is_everything_ok = false;
176  if(print_errors){
177  os<<"Vector fT did not increase monotonically\n";
178  }// end of printing
179  }// end of checking
180 
181  /// Energy should decrease monotonically
183  is_everything_ok = false;
184  if(print_errors){
185  os<<"Vector fEnergy did not decrease monotonically\n";
186  }// end of printing
187  }// end of checking
188 
189  /// ID of the FLSHit should be non-zero
190  if(fId == 0){
191  is_everything_ok = false;
192  if(print_errors){
193  os<<"fID is zero\n";
194  }// end of printing
195  }// end of checking fID
196 
197  return is_everything_ok;
198  }// end of IsFLSHitReasonable
std::vector< float > fY
Start or end of the step inside scintillator. Y position, cm.
Definition: FLSHit.h:192
std::vector< float > fZ
Start or end of the step inside scintillator. Z position, cm.
Definition: FLSHit.h:193
std::vector< float > fVectorEdep
Amount of energy deposited during a Geant4 step (GeV)
Definition: FLSHit.h:197
std::vector< double > fT
Start or end of the step inside scintillator. Time, ns.
Definition: FLSHit.h:195
geo::CellUniqueId fId
Unique cell ID.
Definition: FLSHit.h:184
std::vector< float > fVectorEdepBirks
Amount of energy deposited during a Geant4 step ; Birks weighted (GeV)
Definition: FLSHit.h:198
std::vector< float > fX
Start or end of the step inside scintillator. X position, cm.
Definition: FLSHit.h:191
bool DoesDecreaseMonotonically(const std::vector< T > &input_vector) const
Checks whether the input vector decreases monotonically.
Definition: FLSHit.h:166
std::vector< float > fEnergy
Start or end of the step inside scintillator. Energy, GeV.
Definition: FLSHit.h:194
bool DoesIncreaseMonotonically(const std::vector< T > &input_vector) const
Checks whether the input vector increases monotonically.
Definition: FLSHit.h:149
bool sim::FLSHit::operator< ( const FLSHit rhs) const

Definition at line 30 of file FLSHit.cxx.

References fId, and GetEntryT().

31  {
32  if (fId<rhs.fId) return true;
33  if (fId == rhs.fId)
34  if (GetEntryT() < rhs.GetEntryT()) return true;
35  return false;
36  }
geo::CellUniqueId fId
Unique cell ID.
Definition: FLSHit.h:184
float GetEntryT() const
Definition: FLSHit.h:51
bool sim::FLSHit::operator== ( const FLSHit rhs) const

Definition at line 23 of file FLSHit.cxx.

References fId, and GetEntryT().

24  {
25  if (fId == rhs.fId && GetEntryT() == rhs.GetEntryT()) return true;
26  return false;
27  }
geo::CellUniqueId fId
Unique cell ID.
Definition: FLSHit.h:184
float GetEntryT() const
Definition: FLSHit.h:51
void sim::FLSHit::SetCell ( const int  ic)
inline

Definition at line 103 of file FLSHit.h.

References fCellId.

Referenced by g4n::FLSHitListAction::SteppingAction(), and g4n::FLSHitListAction::supressFLSHitList().

103 { fCellId = ic; }
unsigned short int fCellId
Cell number.
Definition: FLSHit.h:187
void sim::FLSHit::SetCellUniqueId ( const geo::CellUniqueId id)
inline

Definition at line 104 of file FLSHit.h.

References fId.

Referenced by g4n::FLSHitListAction::PreTrackingAction(), g4n::FLSHitListAction::SteppingAction(), and g4n::FLSHitListAction::supressFLSHitList().

104 { fId = id;}
::xsd::cxx::tree::id< char, ncname > id
Definition: Database.h:165
geo::CellUniqueId fId
Unique cell ID.
Definition: FLSHit.h:184
void sim::FLSHit::SetPDG ( const int  pdg)
inline

Set methods.

Definition at line 100 of file FLSHit.h.

References fPDG, and make_root_from_grid_output::pdg.

Referenced by g4n::FLSHitListAction::SteppingAction(), and g4n::FLSHitListAction::supressFLSHitList().

100 { fPDG = pdg; }
int fPDG
PDG code of parent particle.
Definition: FLSHit.h:188
void sim::FLSHit::SetPlane ( const int  ip)
inline

Definition at line 102 of file FLSHit.h.

References fPlaneId, and ip.

Referenced by g4n::FLSHitListAction::SteppingAction(), and g4n::FLSHitListAction::supressFLSHitList().

102 { fPlaneId = ip; }
TString ip
Definition: loadincs.C:5
unsigned short int fPlaneId
Plane number.
Definition: FLSHit.h:186
void sim::FLSHit::SetTrackId ( const int  trackid)
inline

Definition at line 101 of file FLSHit.h.

References fTrackId.

Referenced by MergeCollections::MergeCollections::produce(), MergeG4Collections::MergeG4Collections::produce(), g4n::FLSHitListAction::SteppingAction(), and g4n::FLSHitListAction::supressFLSHitList().

101 { fTrackId = trackid; }
int fTrackId
Index number of the Global track producing hit.
Definition: FLSHit.h:189

Member Data Documentation

unsigned short int sim::FLSHit::fCellId
private

Cell number.

Definition at line 187 of file FLSHit.h.

Referenced by Clear(), GetCellID(), and SetCell().

std::vector<float> sim::FLSHit::fEnergy
private

Start or end of the step inside scintillator. Energy, GeV.

Definition at line 194 of file FLSHit.h.

Referenced by AddPos(), Clear(), GetEnergy(), GetEnergyLoss(), GetEntryEnergy(), GetExitEnergy(), and IsFLSHitReasonable().

geo::CellUniqueId sim::FLSHit::fId
private

Unique cell ID.

Definition at line 184 of file FLSHit.h.

Referenced by GetCellUniqueId(), IsFLSHitReasonable(), operator<(), operator==(), and SetCellUniqueId().

int sim::FLSHit::fPDG
private

PDG code of parent particle.

Definition at line 188 of file FLSHit.h.

Referenced by Clear(), GetPDG(), and SetPDG().

unsigned short int sim::FLSHit::fPlaneId
private

Plane number.

Definition at line 186 of file FLSHit.h.

Referenced by Clear(), GetPlaneID(), and SetPlane().

std::vector<double> sim::FLSHit::fT
private

Start or end of the step inside scintillator. Time, ns.

Definition at line 195 of file FLSHit.h.

Referenced by AddPos(), Clear(), GetEntryT(), GetExitT(), GetT(), and IsFLSHitReasonable().

int sim::FLSHit::fTrackId
private

Index number of the Global track producing hit.

Definition at line 189 of file FLSHit.h.

Referenced by Clear(), GetTrackID(), and SetTrackId().

std::vector<float> sim::FLSHit::fVectorEdep
private

Amount of energy deposited during a Geant4 step (GeV)

Definition at line 197 of file FLSHit.h.

Referenced by AddEdep(), Clear(), GetEdep(), GetNSteps(), and IsFLSHitReasonable().

std::vector<float> sim::FLSHit::fVectorEdepBirks
private

Amount of energy deposited during a Geant4 step ; Birks weighted (GeV)

Definition at line 198 of file FLSHit.h.

Referenced by AddEdepBirks(), Clear(), GetEdepBirks(), and IsFLSHitReasonable().

std::vector<float> sim::FLSHit::fVectorNCerenkov
private

Amount of Cerenkov light emitteded in scintillator.

Definition at line 199 of file FLSHit.h.

Referenced by AddNCerenkov(), Clear(), and GetNCerenkov().

std::vector<float> sim::FLSHit::fX
private

Start or end of the step inside scintillator. X position, cm.

Definition at line 191 of file FLSHit.h.

Referenced by AddPos(), Clear(), GetEntryX(), GetExitX(), GetNPoints(), GetPathLength(), GetX(), GetXAverage(), and IsFLSHitReasonable().

std::vector<float> sim::FLSHit::fY
private

Start or end of the step inside scintillator. Y position, cm.

Definition at line 192 of file FLSHit.h.

Referenced by AddPos(), Clear(), GetEntryY(), GetExitY(), GetPathLength(), GetY(), GetYAverage(), and IsFLSHitReasonable().

std::vector<float> sim::FLSHit::fZ
private

Start or end of the step inside scintillator. Z position, cm.

Definition at line 193 of file FLSHit.h.

Referenced by AddPos(), Clear(), GetEntryZ(), GetExitZ(), GetPathLength(), GetZ(), GetZAverage(), and IsFLSHitReasonable().


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