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

Detailed Description

Definition at line 31 of file TRestGeant4Hits.h.

Inheritance diagram for TRestGeant4Hits:
TRestHits

Public Member Functions

Double_t GetEnergyInVolume (Int_t volumeID) const
 
std::vector< Float_t > & GetEnergyRef ()
 
const TRestGeant4EventGetEvent () const
 
TVector3 GetFirstPositionInVolume (Int_t volumeID) const
 
TRestGeant4MetadataGetGeant4Metadata () const
 
bool GetHadronicOk () const
 
int GetHadronicTargetIsotopeA (size_t n) const
 
std::string GetHadronicTargetIsotopeName (size_t n) const
 
int GetHadronicTargetIsotopeZ (size_t n) const
 
Int_t GetHitProcess (size_t n) const
 
Int_t GetHitVolume (size_t n) const
 
Double_t GetKineticEnergy (size_t n) const
 
TVector3 GetLastPositionInVolume (Int_t volumeID) const
 
TVector3 GetMeanPositionInVolume (Int_t volumeID) const
 
TVector3 GetMomentumDirection (size_t n) const
 
size_t GetNumberOfHitsInVolume (Int_t volumeID) const
 
Int_t GetProcess (size_t n) const
 
Int_t GetProcessId (size_t n) const
 
TString GetProcessName (size_t n) const
 
const TRestGeant4TrackGetTrack () const
 
Int_t GetVolumeId (size_t n) const
 
TString GetVolumeName (size_t n) const
 
void InsertStep (const G4Step *)
 
void RemoveG4Hits ()
 
void SetEvent (TRestGeant4Event *event)
 
void SetTrack (TRestGeant4Track *track)
 
- 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.
 

Protected Attributes

TRestGeant4EventfEvent = nullptr
 
std::vector< int > fHadronicTargetIsotopeA = {}
 
std::vector< std::string > fHadronicTargetIsotopeName = {}
 
std::vector< int > fHadronicTargetIsotopeZ = {}
 
std::vector< Float_t > fKineticEnergy = {}
 
std::vector< TVector3 > fMomentumDirection = {}
 
std::vector< Int_t > fProcessID = {}
 
TRestGeant4TrackfTrack = nullptr
 
std::vector< Int_t > fVolumeID = {}
 
- 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
 
- 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...
 

Constructor & Destructor Documentation

◆ TRestGeant4Hits()

TRestGeant4Hits::TRestGeant4Hits ( )

Definition at line 26 of file TRestGeant4Hits.cxx.

Member Function Documentation

◆ GetEnergyInVolume()

Double_t TRestGeant4Hits::GetEnergyInVolume ( Int_t  volumeID) const

Definition at line 38 of file TRestGeant4Hits.cxx.

◆ GetEnergyRef()

std::vector< Float_t > & TRestGeant4Hits::GetEnergyRef ( )
inline

Definition at line 83 of file TRestGeant4Hits.h.

◆ GetEvent()

const TRestGeant4Event * TRestGeant4Hits::GetEvent ( ) const
inline

Definition at line 51 of file TRestGeant4Hits.h.

◆ GetFirstPositionInVolume()

TVector3 TRestGeant4Hits::GetFirstPositionInVolume ( Int_t  volumeID) const

Definition at line 68 of file TRestGeant4Hits.cxx.

◆ GetGeant4Metadata()

TRestGeant4Metadata * TRestGeant4Hits::GetGeant4Metadata ( ) const

Definition at line 96 of file TRestGeant4Hits.cxx.

◆ GetHadronicOk()

bool TRestGeant4Hits::GetHadronicOk ( ) const
inline

Definition at line 65 of file TRestGeant4Hits.h.

◆ GetHadronicTargetIsotopeA()

int TRestGeant4Hits::GetHadronicTargetIsotopeA ( size_t  n) const
inline

Definition at line 67 of file TRestGeant4Hits.h.

◆ GetHadronicTargetIsotopeName()

std::string TRestGeant4Hits::GetHadronicTargetIsotopeName ( size_t  n) const
inline

Definition at line 66 of file TRestGeant4Hits.h.

◆ GetHadronicTargetIsotopeZ()

int TRestGeant4Hits::GetHadronicTargetIsotopeZ ( size_t  n) const
inline

Definition at line 68 of file TRestGeant4Hits.h.

◆ GetHitProcess()

Int_t TRestGeant4Hits::GetHitProcess ( size_t  n) const
inline

Definition at line 58 of file TRestGeant4Hits.h.

◆ GetHitVolume()

Int_t TRestGeant4Hits::GetHitVolume ( size_t  n) const
inline

Definition at line 62 of file TRestGeant4Hits.h.

◆ GetKineticEnergy()

Double_t TRestGeant4Hits::GetKineticEnergy ( size_t  n) const
inline

Definition at line 72 of file TRestGeant4Hits.h.

◆ GetLastPositionInVolume()

TVector3 TRestGeant4Hits::GetLastPositionInVolume ( Int_t  volumeID) const

Definition at line 76 of file TRestGeant4Hits.cxx.

◆ GetMeanPositionInVolume()

TVector3 TRestGeant4Hits::GetMeanPositionInVolume ( Int_t  volumeID) const

Definition at line 50 of file TRestGeant4Hits.cxx.

◆ GetMomentumDirection()

TVector3 TRestGeant4Hits::GetMomentumDirection ( size_t  n) const
inline

Definition at line 54 of file TRestGeant4Hits.h.

◆ GetNumberOfHitsInVolume()

size_t TRestGeant4Hits::GetNumberOfHitsInVolume ( Int_t  volumeID) const

Definition at line 86 of file TRestGeant4Hits.cxx.

◆ GetProcess()

Int_t TRestGeant4Hits::GetProcess ( size_t  n) const
inline

Definition at line 57 of file TRestGeant4Hits.h.

◆ GetProcessId()

Int_t TRestGeant4Hits::GetProcessId ( size_t  n) const
inline

Definition at line 56 of file TRestGeant4Hits.h.

◆ GetProcessName()

TString TRestGeant4Hits::GetProcessName ( size_t  n) const

Definition at line 109 of file TRestGeant4Hits.cxx.

◆ GetTrack()

const TRestGeant4Track * TRestGeant4Hits::GetTrack ( ) const
inline

Definition at line 48 of file TRestGeant4Hits.h.

◆ GetVolumeId()

Int_t TRestGeant4Hits::GetVolumeId ( size_t  n) const
inline

Definition at line 61 of file TRestGeant4Hits.h.

◆ GetVolumeName()

TString TRestGeant4Hits::GetVolumeName ( size_t  n) const

Definition at line 114 of file TRestGeant4Hits.cxx.

◆ RemoveG4Hits()

void TRestGeant4Hits::RemoveG4Hits ( )

Definition at line 30 of file TRestGeant4Hits.cxx.

◆ SetEvent()

void TRestGeant4Hits::SetEvent ( TRestGeant4Event event)
inline

Definition at line 52 of file TRestGeant4Hits.h.

◆ SetTrack()

void TRestGeant4Hits::SetTrack ( TRestGeant4Track track)
inline

Definition at line 49 of file TRestGeant4Hits.h.

Field Documentation

◆ fEvent

TRestGeant4Event* TRestGeant4Hits::fEvent = nullptr
protected

Definition at line 43 of file TRestGeant4Hits.h.

◆ fHadronicTargetIsotopeA

std::vector<int> TRestGeant4Hits::fHadronicTargetIsotopeA = {}
protected

Definition at line 39 of file TRestGeant4Hits.h.

◆ fHadronicTargetIsotopeName

std::vector<std::string> TRestGeant4Hits::fHadronicTargetIsotopeName = {}
protected

Definition at line 38 of file TRestGeant4Hits.h.

◆ fHadronicTargetIsotopeZ

std::vector<int> TRestGeant4Hits::fHadronicTargetIsotopeZ = {}
protected

Definition at line 40 of file TRestGeant4Hits.h.

◆ fKineticEnergy

std::vector<Float_t> TRestGeant4Hits::fKineticEnergy = {}
protected

Definition at line 35 of file TRestGeant4Hits.h.

◆ fMomentumDirection

std::vector<TVector3> TRestGeant4Hits::fMomentumDirection = {}
protected

Definition at line 36 of file TRestGeant4Hits.h.

◆ fProcessID

std::vector<Int_t> TRestGeant4Hits::fProcessID = {}
protected

Definition at line 33 of file TRestGeant4Hits.h.

◆ fTrack

TRestGeant4Track* TRestGeant4Hits::fTrack = nullptr
protected

Definition at line 42 of file TRestGeant4Hits.h.

◆ fVolumeID

std::vector<Int_t> TRestGeant4Hits::fVolumeID = {}
protected

Definition at line 34 of file TRestGeant4Hits.h.


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