REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Public Member Functions | Static Public Member Functions | Protected Attributes
TRestVolumeHits Class Reference

Detailed Description




         RESTSoft : Software for Rare Event Searches with TPCs

         TRestVolumeHits.h

         Event class to store signals form simulation and acquisition
         events. We should make sure that all the hit points in it is
         with same type. e.g. all XZ hits

         oct 2015:   First concept
             Created as part of the conceptualization of existing REST
             software.
             Javier Gracia

Definition at line 30 of file TRestVolumeHits.h.

#include <TRestVolumeHits.h>

Inheritance diagram for TRestVolumeHits:
TRestHits

Public Member Functions

void AddHit (const TRestVolumeHits &hits, Int_t n)
 
void AddHit (const TVector3 &pos, Double_t en, Double_t time, REST_HitType type, const TVector3 &sigma)
 
void AddHit (Double_t x, Double_t y, Double_t z, Double_t en, Double_t time, REST_HitType type, Double_t sigmaX, Double_t sigmaY, Double_t sigmaZ)
 
Bool_t areXY () const
 It will return true only if all the hits inside are of type XY. More...
 
Bool_t areXYZ () const
 It will return true only if all the hits inside are of type XYZ. More...
 
Bool_t areXZ () const
 It will return true only if all the hits inside are of type XZ. More...
 
Bool_t areYZ () const
 It will return true only if all the hits inside are of type YZ. More...
 
Double_t GetClusterSize (int n) const
 
TVector3 GetSigma (int n) const
 
Double_t GetSigmaX (int n) const
 
Double_t GetSigmaY (int n) const
 
Double_t GetSigmaZ (int n) const
 
Double_t GetXYSize (int n) const
 
void MergeHits (Int_t n, Int_t m)
 
void PrintHits () const
 
void RemoveHit (int n)
 It removes the hit at position n from the list. More...
 
void RemoveHits ()
 It removes all hits inside the class. More...
 
void SortByEnergy ()
 
void SwapHits (Int_t i, Int_t j)
 It exchanges hits n and m affecting to the ordering of the hits inside the list of hits. More...
 
- Public Member Functions inherited from TRestHits
void AddHit (const TVector3 &position, Double_t energy, Double_t time=0, REST_HitType type=XYZ)
 Adds a new hit to the list of hits using a TVector3. More...
 
void AddHit (TRestHits &hits, Int_t n)
 Adds a new hit to the list of hits using the hit n inside another TRestHits object. More...
 
virtual Bool_t areXY () const
 It will return true only if all the hits inside are of type XY. More...
 
virtual Bool_t areXYZ () const
 It will return true only if all the hits inside are of type XYZ. More...
 
virtual Bool_t areXZ () const
 It will return true only if all the hits inside are of type XZ. More...
 
virtual Bool_t areYZ () const
 It will return true only if all the hits inside are of type YZ. More...
 
TRestHits_Iterator begin ()
 
TRestHits_Iterator end ()
 
Int_t GetClosestHit (const TVector3 &position) const
 It returns the closest hit to a given position. More...
 
Double_t GetDistance (int N, int M) const
 
Double_t GetDistance2 (int n, int m) const
 It returns the euclidian distance between hits n and m. More...
 
Double_t GetDistanceToNode (Int_t n) const
 It determines the distance required to travel from the first hit to the hit n adding all the distances of the hits that are found till the hit n. More...
 
Double_t GetEnergy (int n) const
 
Double_t GetEnergyInCylinder (const TVector3 &x0, const TVector3 &x1, Double_t radius) const
 It determines the total energy contained inside a cylinder with a given radius and delimited between x0 and y0 vertex. More...
 
Double_t GetEnergyInCylinder (Int_t i, Int_t j, Double_t radius) const
 It determines the total energy contained inside a cylinder with a given radius and delimited between the hit number i and the hit number j. More...
 
Double_t GetEnergyInPrism (const TVector3 &x0, const TVector3 &x1, Double_t sizeX, Double_t sizeY, Double_t theta) const
 It determines the total hit energy contained inside a prisma delimited between x0 and y0 vertex, and with face dimensions sizeX by sizeY. The angle theta should serve to rotate the prism along its axis to give full freedom. More...
 
Double_t GetEnergyInSphere (const TVector3 &pos0, Double_t radius) const
 It determines the total energy contained in a sphere with position pos0 for a given spherical radius. More...
 
Double_t GetEnergyInSphere (Double_t x, Double_t y, Double_t z, Double_t radius) const
 It determines the total energy contained in a sphere with position x0,y0 and y0 for a given radius. More...
 
const std::vector< Float_t > & GetEnergyVector () const
 
Double_t GetEnergyX () const
 It calculates the total energy of hits with a valid X coordinate. More...
 
Double_t GetEnergyY () const
 It calculates the total energy of hits with a valid Y coordinate. More...
 
Double_t GetGaussSigmaX (Double_t error=150.0, Int_t nHitsMin=100000)
 It computes the gaussian sigma in the X-coordinate. It adds a hit to the right and a hit to the left, with energy = 0 +/- user defined error in ADC. Then it fits a gaussian to the hits and extracts the sigma. The hits are just added for fitting purposes and do not go into any further processing. More...
 
Double_t GetGaussSigmaY (Double_t error=150.0, Int_t nHitsMin=100000)
 It computes the gaussian sigma in the Y-coordinate. It adds a hit to the right and a hit to the left, with energy = 0 +/- user defined error in ADC. Then it fits a gaussian to the hits and extracts the sigma. The hits are just added for fitting purposes and do not go into any further processing. More...
 
Double_t GetGaussSigmaZ (Double_t error=150.0, Int_t nHitsMin=100000)
 It computes the gaussian sigma in the Z-coordinate. It adds a hit to the right and a hit to the left, with energy = 0 +/- user defined error in ADC. Then it fits a gaussian to the hits and extracts the sigma. The hits are just added for fitting purposes and do not go into any further processing. More...
 
Double_t GetHitsPathLength (Int_t n=0, Int_t m=0) const
 It determines the distance required to travel from hit n to hit m adding all the distances of the hits that are found between both. More...
 
Double_t GetHitsTwist (Int_t n, Int_t m) const
 A parameter measuring how straight is a given sequence of hits. If the value is close to zero, the hits follow a straight path in average. I believe the value should be then -1 to 1 depending where the track is twisting. Or may be just a positive value giving the measurement of twist. Not 100% sure now. More...
 
Double_t GetHitsTwistWeighted (Int_t n, Int_t m) const
 Same as GetHitsTwist but weighting with the energy. More...
 
Double_t GetMaximumHitDistance () const
 It returns the maximum distance between 2-hits. More...
 
Double_t GetMaximumHitDistance2 () const
 It returns the maximum squared distance between 2-hits. More...
 
Double_t GetMaximumHitEnergy () const
 It returns the maximum hit energy. More...
 
Double_t GetMeanHitEnergy () const
 It returns the mean hits energy. More...
 
TVector3 GetMeanPosition () const
 It calculates the mean position weighting with the energy of the hits. Each coordinate is calculated considering the valid coordinates of each hit component. More...
 
TVector3 GetMeanPositionInCylinder (const TVector3 &x0, const TVector3 &x1, Double_t radius) const
 It determines the mean position using the hits contained inside a cylinder with a given radius and delimited between x0 and x1 vertex. More...
 
TVector3 GetMeanPositionInPrism (const TVector3 &x0, const TVector3 &x1, Double_t sizeX, Double_t sizeY, Double_t theta) const
 It determines the mean position of hits contained inside a prisma delimited between x0 and x1 vertex, and with face dimensions sizeX by sizeY. The angle theta should serve to rotate the prism along its axis to give full freedom. More...
 
Double_t GetMeanPositionX () const
 It calculates the mean X position weighting with the energy of the hits with a valid X coordinate. More...
 
Double_t GetMeanPositionXInCylinder (const TVector3 &x0, const TVector3 &x1, Double_t radius) const
 It determines the mean position X using the hits contained inside a cylinder with a given radius and delimited between x0 and x1 vertex. More...
 
Double_t GetMeanPositionXInPrism (const TVector3 &x0, const TVector3 &x1, Double_t sizeX, Double_t sizeY, Double_t theta) const
 It determines the mean X position of hits contained inside a prisma delimited between x0 and x1 vertex, and with face dimensions sizeX by sizeY. The angle theta should serve to rotate the prism along its axis to give full freedom. More...
 
Double_t GetMeanPositionY () const
 It calculates the mean Y position weighting with the energy of the hits with a valid Y coordinate. More...
 
Double_t GetMeanPositionYInCylinder (const TVector3 &x0, const TVector3 &x1, Double_t radius) const
 It determines the mean position Y using the hits contained inside a cylinder with a given radius and delimited between x0 and x1 vertex. More...
 
Double_t GetMeanPositionYInPrism (const TVector3 &x0, const TVector3 &x1, Double_t sizeX, Double_t sizeY, Double_t theta) const
 It determines the mean Y position of hits contained inside a prisma delimited between x0 and x1 vertex, and with face dimensions sizeX by sizeY. The angle theta should serve to rotate the prism along its axis to give full freedom. More...
 
Double_t GetMeanPositionZ () const
 It calculates the mean Z position weighting with the energy of the hits with a valid Z coordinate. More...
 
Double_t GetMeanPositionZInCylinder (const TVector3 &x0, const TVector3 &x1, Double_t radius) const
 It determines the mean position Z using the hits contained inside a cylinder with a given radius and delimited between x0 and x1 vertex. More...
 
Double_t GetMeanPositionZInPrism (const TVector3 &x0, const TVector3 &x1, Double_t sizeX, Double_t sizeY, Double_t theta) const
 It determines the mean Z position of hits contained inside a prisma delimited between x0 and x1 vertex, and with face dimensions sizeX by sizeY. The angle theta should serve to rotate the prism along its axis to give full freedom. More...
 
Double_t GetMinimumHitEnergy () const
 It returns the minimum hit energy. More...
 
Int_t GetMostEnergeticHitInRange (Int_t n, Int_t m) const
 It returns the most energetic hit found between hits n and m. More...
 
size_t GetNumberOfHits () const
 
Int_t GetNumberOfHitsInsideCylinder (const TVector3 &x0, const TVector3 &x1, Double_t radius) const
 It determines the total number of hits contained inside a cylinder with a given radius and delimited between x0 and y0 vertex. More...
 
Int_t GetNumberOfHitsInsideCylinder (Int_t i, Int_t j, Double_t radius) const
 It determines the total number of hits contained inside a cylinder with a given radius and delimited between the hit number i and the hit number j. More...
 
Int_t GetNumberOfHitsInsidePrism (const TVector3 &x0, const TVector3 &x1, Double_t sizeX, Double_t sizeY, Double_t theta) const
 It determines the total number of hits contained inside a prisma delimited between x0 and y0 vertex, and with face dimensions sizeX by sizeY. The angle theta should serve to rotate the prism along its axis to give full freedom. More...
 
Int_t GetNumberOfHitsX () const
 It returns the number of hits with a valid X coordinate. More...
 
Int_t GetNumberOfHitsY () const
 It returns the number of hits with a valid Y coordinate. More...
 
TVector3 GetPosition (int n) const
 It returns the position of hit number n. More...
 
TVector2 GetProjection (Int_t n, Int_t m, const TVector3 &position) const
 It returns the longitudinal and transversal projections of position to the axis defined by the hits n and m. More...
 
Double_t GetSigmaX () const
 It calculates the hits standard deviation in the X-coordinate. More...
 
Double_t GetSigmaXY2 () const
 It calculates the 2-dimensional hits variance. More...
 
Double_t GetSigmaY () const
 It calculates the hits standard deviation in the Y-coordinate. More...
 
Double_t GetSigmaZ2 () const
 It returns the hits distribution variance on the Z-axis. More...
 
Double_t GetSkewXY () const
 It returns the 2-dimensional skewness on the XY-plane which is a measure of the hits distribution asymmetry. More...
 
Double_t GetSkewZ () const
 It returns the hits distribution skewness, or asymmetry on the Z-axis. More...
 
const std::vector< Float_t > & GetTime () const
 
Double_t GetTime (int n) const
 
Double_t GetTotalDistance () const
 It determines the distance required to travel from the first to the last hit adding all the distances of the hits that are found between both. More...
 
Double_t GetTotalEnergy () const
 
Double_t GetTransversalProjection (const TVector3 &p0, const TVector3 &direction, const TVector3 &position) const
 It returns the transversal projection of position to the line defined by position and direction. More...
 
REST_HitType GetType (int n) const
 
TVector3 GetVector (int i, int j) const
 It returns the vector that goes from hit j to hit i. More...
 
const std::vector< Float_t > & GetX () const
 
Double_t GetX (int n) const
 
const std::vector< Float_t > & GetY () const
 
Double_t GetY (int n) const
 
const std::vector< Float_t > & GetZ () const
 
Double_t GetZ (int n) const
 
Bool_t isHitNInsideCylinder (Int_t n, const TVector3 &x0, const TVector3 &x1, Double_t radius) const
 It determines if hit n is contained inside a cylinder with a given radius and delimited between x0 and x1 vertex. More...
 
Bool_t isHitNInsidePrism (Int_t n, const TVector3 &x0, const TVector3 &x1, Double_t sizeX, Double_t sizeY, Double_t theta) const
 It determines if hit n is contained inside a prisma delimited between x0 and y0 vertex, and with face dimensions sizeX by sizeY. The angle theta should serve to rotate the prism along its axis to give full freedom. More...
 
Bool_t isHitNInsideSphere (Int_t n, const TVector3 &pos0, Double_t radius) const
 It determines if the hit n is contained in a sphere with position pos0 for a given sphereical radius. More...
 
Bool_t isHitNInsideSphere (Int_t n, Double_t x0, Double_t y0, Double_t z0, Double_t radius) const
 It determines the total energy contained in a sphere with position x0,y0 and y0 for a given radius. More...
 
Bool_t isNaN (Int_t n) const
 It will return true only if all the 3-coordinates of hit number n are not a number,. More...
 
Bool_t isSortedByEnergy () const
 It returns true if the hits are ordered in increasing energies. More...
 
virtual void MergeHits (int n, int m)
 It merges hits n and m being the resulting hit placed at the weighted center and being its final energy the addition of the energies of the hits n and m. More...
 
virtual void PrintHits (Int_t nHits=-1) const
 It prints on screen the first nHits from the list. More...
 
virtual void RemoveHit (int n)
 It removes the hit at position n from the list. More...
 
virtual void RemoveHits ()
 It removes all hits inside the class. More...
 
void Rotate (Int_t n, Double_t alpha, const TVector3 &vAxis, const TVector3 &vMean)
 It rotates hit n by an angle akpha along the vAxis with center at vMean. More...
 
void RotateIn3D (Int_t n, Double_t alpha, Double_t beta, Double_t gamma, const TVector3 &center)
 It rotates hit n following rotations in Z, Y and X by angles gamma, beta and alpha. The rotation is performed with center at vMean. More...
 
virtual void SwapHits (Int_t i, Int_t j)
 It exchanges hits n and m affecting to the ordering of the hits inside the list of hits. More...
 
void Translate (Int_t n, Double_t x, Double_t y, Double_t z)
 It moves hit n by a given amount (x,y,z). More...
 
 TRestHits ()
 Default constructor.
 
void WriteHitsToTextFile (TString filename)
 It writes the hits to a plain text file. More...
 
 ~TRestHits ()
 Default destructor.
 

Static Public Member Functions

static void kMeansClustering (TRestVolumeHits *hits, TRestVolumeHits &vHits, int maxIt=100)
 
- Static Public Member Functions inherited from TRestHits
static void GetBoundaries (std::vector< double > &val, double &max, double &min, int &nBins, double offset=10)
 TODO This method is not using any TRestHits member. This probably means that it should be placed somewhere else. More...
 

Protected Attributes

std::vector< Float_t > fSigmaX
 
std::vector< Float_t > fSigmaY
 
std::vector< Float_t > fSigmaZ
 
- Protected Attributes inherited from TRestHits
std::vector< Float_t > fEnergy
 Energy deposited at each 3-coordinate position (units keV) More...
 
size_t fNHits = 0
 Number of punctual energy depositions, it is the length for all the arrays. More...
 
std::vector< Float_t > fTime
 Absolute time information for each punctual deposition (units us, 0 is time of decay) More...
 
Double_t fTotalEnergy = 0
 Event total energy. More...
 
std::vector< REST_HitType > fType
 The type of hit X,Y,XY,XYZ, ... More...
 
std::vector< Float_t > fX
 Position on X axis for each punctual deposition (units mm) More...
 
std::vector< Float_t > fY
 Position on Y axis for each punctual deposition (units mm) More...
 
std::vector< Float_t > fZ
 Position on Z axis for each punctual deposition (units mm) More...
 

Additional Inherited Members

- Public Types inherited from TRestHits
typedef TRestHits_Iterator iterator
 

Constructor & Destructor Documentation

◆ TRestVolumeHits()

TRestVolumeHits::TRestVolumeHits ( )

Definition at line 25 of file TRestVolumeHits.cxx.

◆ ~TRestVolumeHits()

TRestVolumeHits::~TRestVolumeHits ( )

Definition at line 29 of file TRestVolumeHits.cxx.

Member Function Documentation

◆ AddHit() [1/3]

void TRestVolumeHits::AddHit ( const TRestVolumeHits hits,
Int_t  n 
)

Definition at line 59 of file TRestVolumeHits.cxx.

◆ AddHit() [2/3]

void TRestVolumeHits::AddHit ( const TVector3 &  pos,
Double_t  en,
Double_t  time,
REST_HitType  type,
const TVector3 &  sigma 
)

Definition at line 46 of file TRestVolumeHits.cxx.

◆ AddHit() [3/3]

void TRestVolumeHits::AddHit ( Double_t  x,
Double_t  y,
Double_t  z,
Double_t  en,
Double_t  time,
REST_HitType  type,
Double_t  sigmaX,
Double_t  sigmaY,
Double_t  sigmaZ 
)

Definition at line 33 of file TRestVolumeHits.cxx.

◆ areXY()

Bool_t TRestVolumeHits::areXY ( ) const
virtual

It will return true only if all the hits inside are of type XY.

Reimplemented from TRestHits.

Definition at line 87 of file TRestVolumeHits.cxx.

◆ areXYZ()

Bool_t TRestVolumeHits::areXYZ ( ) const
virtual

It will return true only if all the hits inside are of type XYZ.

Reimplemented from TRestHits.

Definition at line 105 of file TRestVolumeHits.cxx.

◆ areXZ()

Bool_t TRestVolumeHits::areXZ ( ) const
virtual

It will return true only if all the hits inside are of type XZ.

Reimplemented from TRestHits.

Definition at line 93 of file TRestVolumeHits.cxx.

◆ areYZ()

Bool_t TRestVolumeHits::areYZ ( ) const
virtual

It will return true only if all the hits inside are of type YZ.

Reimplemented from TRestHits.

Definition at line 99 of file TRestVolumeHits.cxx.

◆ GetClusterSize()

Double_t TRestVolumeHits::GetClusterSize ( int  n) const
inline

Definition at line 65 of file TRestVolumeHits.h.

◆ GetSigma()

TVector3 TRestVolumeHits::GetSigma ( int  n) const

Definition at line 153 of file TRestVolumeHits.cxx.

◆ GetSigmaX()

Double_t TRestVolumeHits::GetSigmaX ( int  n) const
inline

Definition at line 57 of file TRestVolumeHits.h.

◆ GetSigmaY()

Double_t TRestVolumeHits::GetSigmaY ( int  n) const
inline

Definition at line 58 of file TRestVolumeHits.h.

◆ GetSigmaZ()

Double_t TRestVolumeHits::GetSigmaZ ( int  n) const
inline

Definition at line 59 of file TRestVolumeHits.h.

◆ GetXYSize()

Double_t TRestVolumeHits::GetXYSize ( int  n) const
inline

Definition at line 68 of file TRestVolumeHits.h.

◆ kMeansClustering()

void TRestVolumeHits::kMeansClustering ( TRestVolumeHits hits,
TRestVolumeHits vHits,
int  maxIt = 100 
)
static

Definition at line 165 of file TRestVolumeHits.cxx.

◆ MergeHits()

void TRestVolumeHits::MergeHits ( Int_t  n,
Int_t  m 
)

Definition at line 112 of file TRestVolumeHits.cxx.

◆ PrintHits()

void TRestVolumeHits::PrintHits ( ) const

Definition at line 157 of file TRestVolumeHits.cxx.

◆ RemoveHit()

void TRestVolumeHits::RemoveHit ( int  n)
virtual

It removes the hit at position n from the list.

Reimplemented from TRestHits.

Definition at line 127 of file TRestVolumeHits.cxx.

◆ RemoveHits()

void TRestVolumeHits::RemoveHits ( )
virtual

It removes all hits inside the class.

Reimplemented from TRestHits.

Definition at line 79 of file TRestVolumeHits.cxx.

◆ SortByEnergy()

void TRestVolumeHits::SortByEnergy ( )

Definition at line 135 of file TRestVolumeHits.cxx.

◆ SwapHits()

void TRestVolumeHits::SwapHits ( Int_t  i,
Int_t  j 
)
virtual

It exchanges hits n and m affecting to the ordering of the hits inside the list of hits.

Reimplemented from TRestHits.

Definition at line 145 of file TRestVolumeHits.cxx.

Field Documentation

◆ fSigmaX

std::vector<Float_t> TRestVolumeHits::fSigmaX
protected

Definition at line 32 of file TRestVolumeHits.h.

◆ fSigmaY

std::vector<Float_t> TRestVolumeHits::fSigmaY
protected

Definition at line 33 of file TRestVolumeHits.h.

◆ fSigmaZ

std::vector<Float_t> TRestVolumeHits::fSigmaZ
protected

Definition at line 34 of file TRestVolumeHits.h.


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