108 void AddPos (
const float x,
const float y,
const float z,
const double t,
const float energy) {
fX.push_back(x);
fY.push_back(y);
fZ.push_back(z);
fT.push_back(t);
fEnergy.push_back(energy);}
113 ,std::ostream& error_printint_stream =
std::cout)
const;
119 T getSum(
const std::vector<T>& input_vector)
const{
120 const T sum = std::accumulate(input_vector.begin(), input_vector.end(), 0.0);
126 T getElement(
const std::vector<T>& input_vector,
const unsigned int ipoint)
const{
127 return input_vector.at(ipoint);
133 return getElement<T>(input_vector, 0);
138 T getLast(
const std::vector<T>& input_vector)
const{
139 const int n_size = input_vector.size();
140 if(n_size == 0)
return (
T)(0.0);
141 return input_vector[n_size - 1];
144 float GetXYZAverage(
const std::vector<float>& xyz,
const int step)
const;
151 const int n_size = input_vector.size();
154 if(n_size < 2)
return true;
156 for(
int i=1;
i<n_size; ++
i){
157 if(input_vector[
i-1] > input_vector[
i])
168 const int n_size = input_vector.size();
171 if(n_size < 2)
return true;
173 for(
int i=1;
i<n_size; ++
i){
174 if(input_vector[
i-1] < input_vector[
i])
191 std::vector<float>
fX;
192 std::vector<float>
fY;
193 std::vector<float>
fZ;
195 std::vector<double>
fT;
geo::CellUniqueId GetCellUniqueId() const
Unique Cell ID.
void AddNCerenkov(const float ncerenkov)
::xsd::cxx::tree::id< char, ncname > id
float GetNCerenkov(const int ipoint) const
float GetEntryX() const
Entry point of the particle (position, time and energy)
void SetTrackId(const int trackid)
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.
int GetNPoints() const
Number of end points in FLSHit (could be Geant end points)
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)
void SetCell(const int ic)
bool IsFLSHitReasonable(const bool print_errors=false, std::ostream &error_printint_stream=std::cout) const
Give every cell in the geometry a unique ID number based on the TGeo path to the node.
float GetXAverage() const
Get X-average for the FLSHit. This is in local coordinates.
void SetCellUniqueId(const geo::CellUniqueId &id)
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)
void SetPDG(const int pdg)
Set methods.
std::vector< float > fVectorEdepBirks
Amount of energy deposited during a Geant4 step ; Birks weighted (GeV)
float GetY(const int ipoint) const
float GetXAverage(const int step) const
Get X-average for the step. This is in local coordinates.
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.
float GetT(const int ipoint) const
int fPDG
PDG code of parent particle.
float GetExitEnergy() const
unsigned long long int CellUniqueId
void AddPos(const float x, const float y, const float z, const double t, const float energy)
bool operator==(const FLSHit &rhs) const
int fTrackId
Index number of the Global track producing hit.
void AddEdep(const float edep)
T getElement(const std::vector< T > &input_vector, const unsigned int ipoint) const
Gets i-th element of the vector.
int GetTrackID() const
Track ID.
void SetPlane(const int ip)
float GetZ(const int ipoint) const
float GetEdep(const int ipoint) const
float GetEdepBirks(const int ipoint) const
std::vector< float > fX
Start or end of the step inside scintillator. X position, cm.
void Clear()
Clear the FLS hit.
float GetYAverage() const
Get Y-average for the FLSHit. This is in local coordinates.
float GetEdep() const
Get total Energy deposited into the cell for the whole FLSHit.
float GetZAverage(const int step) const
Get Z-average for the step. This is in local coordinates.
float GetYAverage(const int step) const
Get Y-average for the step. This is in local coordinates.
float GetX(const int ipoint) const
Get a point of the particle in the FLSHit (position, time and energy)
T getFirst(const std::vector< T > &input_vector) const
Gets the last element of the vector.
void AddEdepBirks(const float edepbirks)
T getSum(const std::vector< T > &input_vector) const
Sums over the array of the vector.
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.
float GetZAverage() const
Get Z-average for the FLSHit. This is in local coordinates.
std::vector< float > fEnergy
Start or end of the step inside scintillator. Energy, GeV.
T getLast(const std::vector< T > &input_vector) const
Gets the last element of the vector.
float GetEnergy(const int ipoint) const
bool DoesIncreaseMonotonically(const std::vector< T > &input_vector) const
Checks whether the input vector increases monotonically.