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

Detailed Description

A class to store the readout plane definition used in TRestDetectorReadout. It allows to integrate any number of independent readout modules.

This class stores the readout plane geometrical description, plane position, orientation, and cathode position. It contains a vector of TRestDetectorReadoutModule with the readout modules that are implemented in the readout plane.

Coordinate axes

In order to define 2-dimensional components in an arbitrary readout plane orientation we use coordinate axes which are orthonormal vectors contained in the plane, fAxisX and fAxisY, therefore perpendicular to the normal vector. They are calculated internally from the normal vector and the plane rotation. A normal vector of (0,0,1) and a rotation of 0 degrees will result in a plane with axes (1,0,0) and (0,1,0). See the TRestDetectorReadoutPlane::UpdateAxes() method for details.


RESTsoft - Software for Rare Event Searches with TPCs

History of developments:

2016-mar: First concept. Javier Galan

Author
Javier Galan

Definition at line 36 of file TRestDetectorReadoutPlane.h.

#include <TRestDetectorReadoutPlane.h>

Public Member Functions

void AddModule (const TRestDetectorReadoutModule &module)
 Adds a new module to the readout plane.
 
void Draw ()
 Draws the readout plane using GetReadoutHistogram.
 
Int_t FindChannel (Int_t module, const TVector2 &position)
 Finds the readout channel index for a given module stored in a given module index stored in the readout plane (internal readout plane module id). More...
 
TVector3 GetAxisX () const
 Returns a TVector3 with a vector that defines the X-axis plane coordinate system.
 
TVector3 GetAxisY () const
 Returns a TVector3 with a vector that defines the Y-axis plane coordinate system.
 
void GetBoundaries (double &xmin, double &xmax, double &ymin, double &ymax)
 Finds the xy boundaries of the readout plane delimited by the modules.
 
TVector3 GetCathodePosition () const
 Returns a TVector3 with the cathode position.
 
Double_t GetChargeCollection () const
 Returns the charge collection ratio at this readout plane.
 
Double_t GetDistanceTo (const TVector3 &pos) const
 Returns the perpendicular distance to the readout plane from a given position pos. More...
 
TVector2 GetDistanceToModule (Int_t mod, const TVector2 &position)
 
Double_t GetDistanceToPlane (const TVector3 &point) const
 
Double_t GetDriftDistance () const
 Returns the total drift distance. Equivalent to the height of the readout volume.
 
Double_t GetHeight () const
 Returns the height of the readout volume.
 
Int_t GetID () const
 Returns an integer with the plane id number.
 
TRestDetectorReadoutModuleGetModule (size_t mod)
 Returns a pointer to a readout module using its std::vector index.
 
TRestDetectorReadoutModuleGetModuleByID (Int_t modID)
 Returns a pointer to a module using its internal module id.
 
Int_t GetModuleIDFromPosition (const TVector3 &position) const
 This method returns the module id where pos is found. The z-coordinate must be found in between the cathode and the readout plane. The x and y values must be found inside one of the readout modules defined inside the readout plane. More...
 
std::string GetName () const
 
TVector3 GetNormal () const
 Returns a TVector3 with a vector normal to the readout plane.
 
Int_t GetNumberOfChannels ()
 Returns the total number of channels in the readout plane.
 
size_t GetNumberOfModules () const
 Returns the total number of modules in the readout plane.
 
TVector3 GetPosition () const
 Returns a TVector3 with the readout plane position.
 
TVector2 GetPositionInPlane (const TVector3 &point) const
 
TVector3 GetPositionInWorld (const TVector2 &point, Double_t height=0) const
 
TH2Poly * GetReadoutHistogram ()
 Creates and returns a TH2Poly object with the readout pixel description.
 
Double_t GetRotation () const
 Returns the rotation angle in radians of the reference frame with respect to the normal vector.
 
std::string GetType () const
 
Double_t GetX (Int_t modID, Int_t chID)
 Returns the X coordinate of a given channel in a given module using their internal module and channel ids. More...
 
Double_t GetY (Int_t modID, Int_t chID)
 Returns the Y coordinate of a given channel in a given module using their internal module and channel ids. More...
 
Bool_t isDaqIDInside (Int_t daqId)
 This method determines if the daqId given is associated to any of the readout readout channels in any readout modules. More...
 
bool IsInside (const TVector3 &point) const
 Check if the point is inside any module of the readout plane.
 
Int_t isZInsideDriftVolume (const TVector3 &position)
 This method determines if the z-coordinate is inside the drift volume for this readout plane. More...
 
Int_t isZInsideDriftVolume (Double_t z)
 This method determines if a given position in z is inside the drift volume drifting distance for this readout plane. More...
 
TRestDetectorReadoutModuleoperator[] (int mod)
 
void Print (Int_t DetailLevel=0)
 Prints information with details of the readout plane and modules defined inside the readout plane.
 
void PrintMetadata ()
 Prints the readout plane description.
 
void SetAxisX (const TVector3 &axis)
 
void SetChargeCollection (Double_t charge)
 Sets the value for the charge collection.
 
void SetHeight (Double_t d)
 Used to define the height of the readout volume with sign crosscheck.
 
void SetID (int id)
 Sets the planeId. This is done by TRestDetectorReadout during initialization.
 
void SetName (const std::string &name)
 
void SetNormal (const TVector3 &normal)
 It updates the value of the normal vector and recalculates the corresponding X and Y axis.
 
void SetPosition (const TVector3 &position)
 Sets the readout plane position.
 
void SetRotation (Double_t radians)
 
void SetType (const std::string &type)
 
 TRestDetectorReadoutPlane ()
 Default TRestDetectorReadoutPlane constructor.
 
virtual ~TRestDetectorReadoutPlane ()
 Default TRestDetectorReadoutPlane destructor.
 

Private Member Functions

void UpdateAxes ()
 

Private Attributes

TVector3 fAxisX
 A vector contained in the plane that defines the plane X-axis.
 
TVector3 fAxisY
 A vector contained in the plane that defines the plane Y-axis.
 
Double_t fChargeCollection = 1
 The fraction of charge/energy this readout plane collects from a hit position.
 
Double_t fHeight = 0
 A length in mm that confers a 3rd dimension to the readout plane and defines a volume.
 
Int_t fId = -1
 The plane id number imposed by the order of creation. Being the first id=0.
 
std::string fName
 
TVector3 fNormal = {0, 0, 1}
 A vector that defines the plane orientation and the side of the active volume.
 
TVector3 fPosition = {0, 0, 0}
 The position of the readout plane that defines the origin (0,0) in plane coordinates.
 
std::vector< TRestDetectorReadoutModulefReadoutModules
 < A list of TRestDetectorReadoutModule components contained in the readout plane.
 
Double_t fRotation = 0
 Rotation (in radians) of the readout plane around the normal vector.
 
std::string fType
 

Member Function Documentation

◆ FindChannel()

Int_t TRestDetectorReadoutPlane::FindChannel ( Int_t  module,
const TVector2 &  position 
)

Finds the readout channel index for a given module stored in a given module index stored in the readout plane (internal readout plane module id).

Parameters
absXIt is the x absolut physical position
absYIt is the y absolut physical position
Returns
The corresponding channel id

Definition at line 246 of file TRestDetectorReadoutPlane.cxx.

◆ GetDistanceTo()

Double_t TRestDetectorReadoutPlane::GetDistanceTo ( const TVector3 &  pos) const

Returns the perpendicular distance to the readout plane from a given position pos.

Returns the perpendicular distance to the readout plane of a given TVector3 position.

Definition at line 261 of file TRestDetectorReadoutPlane.cxx.

◆ GetDistanceToModule()

TVector2 TRestDetectorReadoutPlane::GetDistanceToModule ( Int_t  mod,
const TVector2 &  position 
)
inline

Returns a TVector2 oriented as the shortest distance of a given position pos on the plane to a specific module with id mod

Definition at line 128 of file TRestDetectorReadoutPlane.h.

◆ GetModuleIDFromPosition()

Int_t TRestDetectorReadoutPlane::GetModuleIDFromPosition ( const TVector3 &  position) const

This method returns the module id where pos is found. The z-coordinate must be found in between the cathode and the readout plane. The x and y values must be found inside one of the readout modules defined inside the readout plane.

Parameters
positionA TVector3 defining the position.
Returns
the module id where the hit is found. If no module id is found it returns -1.

Definition at line 325 of file TRestDetectorReadoutPlane.cxx.

◆ GetX()

Double_t TRestDetectorReadoutPlane::GetX ( Int_t  modID,
Int_t  chID 
)

Returns the X coordinate of a given channel in a given module using their internal module and channel ids.

This method evaluates if the channel is a strip or a pixel. If it is a strip and the X-axis is not localized, this function returns NaN.

Parameters
modIDInternal module id. As defined on the readout.
chIDInternal channel id. As defined on the readout.
Returns
The value of the X-coordinate relative to the readout position

Definition at line 113 of file TRestDetectorReadoutPlane.cxx.

◆ GetY()

Double_t TRestDetectorReadoutPlane::GetY ( Int_t  modID,
Int_t  chID 
)

Returns the Y coordinate of a given channel in a given module using their internal module and channel ids.

This method evaluates if the channel is a strip or a pixel. If it is a strip and the Y-axis is not localized, this function returns NaN.

Parameters
modIDInternal module id. As defined on the readout.
chIDInternal channel id. As defined on the readout.
Returns
The value of the X-coordinate relative to the readout position

Definition at line 180 of file TRestDetectorReadoutPlane.cxx.

◆ isDaqIDInside()

Bool_t TRestDetectorReadoutPlane::isDaqIDInside ( Int_t  daqId)

This method determines if the daqId given is associated to any of the readout readout channels in any readout modules.

Returns
true if daqId is found returns false if daqId is not found

Definition at line 286 of file TRestDetectorReadoutPlane.cxx.

◆ isZInsideDriftVolume() [1/2]

Int_t TRestDetectorReadoutPlane::isZInsideDriftVolume ( const TVector3 &  position)

This method determines if the z-coordinate is inside the drift volume for this readout plane.

Parameters
positionA TVector3 defining the position.
Returns
1 if the Z-position is found inside the drift volume definition. 0 otherwise

Definition at line 302 of file TRestDetectorReadoutPlane.cxx.

◆ isZInsideDriftVolume() [2/2]

Int_t TRestDetectorReadoutPlane::isZInsideDriftVolume ( Double_t  z)

This method determines if a given position in z is inside the drift volume drifting distance for this readout plane.

Returns
1 if the Z-position is found inside the drift volume definition. 0 otherwise returns -1.

Definition at line 273 of file TRestDetectorReadoutPlane.cxx.


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