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. More...
 
void Draw ()
 Draws the readout plane using GetReadoutHistogram. More...
 
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. More...
 
TVector3 GetAxisY () const
 Returns a TVector3 with a vector that defines the Y-axis plane coordinate system. More...
 
void GetBoundaries (double &xmin, double &xmax, double &ymin, double &ymax)
 Finds the xy boundaries of the readout plane delimited by the modules. More...
 
TVector3 GetCathodePosition () const
 Returns a TVector3 with the cathode position. More...
 
Double_t GetChargeCollection () const
 Returns the charge collection ratio at this readout plane. More...
 
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. More...
 
Double_t GetHeight () const
 Returns the height of the readout volume. More...
 
Int_t GetID () const
 Returns an integer with the plane id number. More...
 
TRestDetectorReadoutModuleGetModule (size_t mod)
 Returns a pointer to a readout module using its std::vector index. More...
 
TRestDetectorReadoutModuleGetModuleByID (Int_t modID)
 Returns a pointer to a module using its internal module id. More...
 
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. More...
 
Int_t GetNumberOfChannels ()
 Returns the total number of channels in the readout plane. More...
 
size_t GetNumberOfModules () const
 Returns the total number of modules in the readout plane. More...
 
TVector3 GetPosition () const
 Returns a TVector3 with the readout plane position. More...
 
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. More...
 
Double_t GetRotation () const
 Returns the rotation angle in radians of the reference frame with respect to the normal vector. More...
 
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. More...
 
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. More...
 
void PrintMetadata ()
 Prints the readout plane description. More...
 
void SetAxisX (const TVector3 &axis)
 
void SetChargeCollection (Double_t charge)
 Sets the value for the charge collection. More...
 
void SetHeight (Double_t d)
 Used to define the height of the readout volume with sign crosscheck. More...
 
void SetID (int id)
 Sets the planeId. This is done by TRestDetectorReadout during initialization. More...
 
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. More...
 
void SetPosition (const TVector3 &position)
 Sets the readout plane position. More...
 
void SetRotation (Double_t radians)
 
void SetType (const std::string &type)
 
 TRestDetectorReadoutPlane ()
 Default TRestDetectorReadoutPlane constructor. More...
 
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. More...
 
TVector3 fAxisY
 A vector contained in the plane that defines the plane Y-axis. More...
 
Double_t fChargeCollection = 1
 The fraction of charge/energy this readout plane collects from a hit position. More...
 
Double_t fHeight = 0
 A length in mm that confers a 3rd dimension to the readout plane and defines a volume. More...
 
Int_t fId = -1
 The plane id number imposed by the order of creation. Being the first id=0. More...
 
std::string fName
 
TVector3 fNormal = {0, 0, 1}
 A vector that defines the plane orientation and the side of the active volume. More...
 
TVector3 fPosition = {0, 0, 0}
 The position of the readout plane that defines the origin (0,0) in plane coordinates. More...
 
std::vector< TRestDetectorReadoutModulefReadoutModules
 < A list of TRestDetectorReadoutModule components contained in the readout plane. More...
 
Double_t fRotation = 0
 Rotation (in radians) of the readout plane around the normal vector. More...
 
std::string fType
 

Constructor & Destructor Documentation

◆ TRestDetectorReadoutPlane()

TRestDetectorReadoutPlane::TRestDetectorReadoutPlane ( )

Default TRestDetectorReadoutPlane constructor.

Definition at line 42 of file TRestDetectorReadoutPlane.cxx.

Member Function Documentation

◆ AddModule()

void TRestDetectorReadoutPlane::AddModule ( const TRestDetectorReadoutModule module)

Adds a new module to the readout plane.

Definition at line 545 of file TRestDetectorReadoutPlane.cxx.

◆ Draw()

void TRestDetectorReadoutPlane::Draw ( )

Draws the readout plane using GetReadoutHistogram.

Definition at line 374 of file TRestDetectorReadoutPlane.cxx.

◆ 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.

◆ GetAxisX()

TVector3 TRestDetectorReadoutPlane::GetAxisX ( ) const
inline

Returns a TVector3 with a vector that defines the X-axis plane coordinate system.

Definition at line 106 of file TRestDetectorReadoutPlane.h.

◆ GetAxisY()

TVector3 TRestDetectorReadoutPlane::GetAxisY ( ) const
inline

Returns a TVector3 with a vector that defines the Y-axis plane coordinate system.

Definition at line 109 of file TRestDetectorReadoutPlane.h.

◆ GetBoundaries()

void TRestDetectorReadoutPlane::GetBoundaries ( double &  xmin,
double &  xmax,
double &  ymin,
double &  ymax 
)

Finds the xy boundaries of the readout plane delimited by the modules.

Definition at line 418 of file TRestDetectorReadoutPlane.cxx.

◆ GetCathodePosition()

TVector3 TRestDetectorReadoutPlane::GetCathodePosition ( ) const
inline

Returns a TVector3 with the cathode position.

Definition at line 100 of file TRestDetectorReadoutPlane.h.

◆ GetChargeCollection()

Double_t TRestDetectorReadoutPlane::GetChargeCollection ( ) const
inline

Returns the charge collection ratio at this readout plane.

Definition at line 112 of file TRestDetectorReadoutPlane.h.

◆ 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.

◆ GetDistanceToPlane()

Double_t TRestDetectorReadoutPlane::GetDistanceToPlane ( const TVector3 &  point) const

Definition at line 512 of file TRestDetectorReadoutPlane.cxx.

◆ GetDriftDistance()

Double_t TRestDetectorReadoutPlane::GetDriftDistance ( ) const
inline

Returns the total drift distance. Equivalent to the height of the readout volume.

Definition at line 115 of file TRestDetectorReadoutPlane.h.

◆ GetHeight()

Double_t TRestDetectorReadoutPlane::GetHeight ( ) const
inline

Returns the height of the readout volume.

Definition at line 118 of file TRestDetectorReadoutPlane.h.

◆ GetID()

Int_t TRestDetectorReadoutPlane::GetID ( ) const
inline

Returns an integer with the plane id number.

Definition at line 91 of file TRestDetectorReadoutPlane.h.

◆ GetModule()

TRestDetectorReadoutModule * TRestDetectorReadoutPlane::GetModule ( size_t  mod)
inline

Returns a pointer to a readout module using its std::vector index.

Definition at line 135 of file TRestDetectorReadoutPlane.h.

◆ GetModuleByID()

TRestDetectorReadoutModule * TRestDetectorReadoutPlane::GetModuleByID ( Int_t  modID)

Returns a pointer to a module using its internal module id.

Definition at line 91 of file TRestDetectorReadoutPlane.cxx.

◆ 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.

◆ GetName()

std::string TRestDetectorReadoutPlane::GetName ( ) const
inline

Definition at line 157 of file TRestDetectorReadoutPlane.h.

◆ GetNormal()

TVector3 TRestDetectorReadoutPlane::GetNormal ( ) const
inline

Returns a TVector3 with a vector normal to the readout plane.

Definition at line 103 of file TRestDetectorReadoutPlane.h.

◆ GetNumberOfChannels()

Int_t TRestDetectorReadoutPlane::GetNumberOfChannels ( )

Returns the total number of channels in the readout plane.

Definition at line 52 of file TRestDetectorReadoutPlane.cxx.

◆ GetNumberOfModules()

size_t TRestDetectorReadoutPlane::GetNumberOfModules ( ) const
inline

Returns the total number of modules in the readout plane.

Definition at line 143 of file TRestDetectorReadoutPlane.h.

◆ GetPosition()

TVector3 TRestDetectorReadoutPlane::GetPosition ( ) const
inline

Returns a TVector3 with the readout plane position.

Definition at line 94 of file TRestDetectorReadoutPlane.h.

◆ GetPositionInPlane()

TVector2 TRestDetectorReadoutPlane::GetPositionInPlane ( const TVector3 &  point) const

Definition at line 501 of file TRestDetectorReadoutPlane.cxx.

◆ GetPositionInWorld()

TVector3 TRestDetectorReadoutPlane::GetPositionInWorld ( const TVector2 &  point,
Double_t  height = 0 
) const

Definition at line 508 of file TRestDetectorReadoutPlane.cxx.

◆ GetReadoutHistogram()

TH2Poly * TRestDetectorReadoutPlane::GetReadoutHistogram ( )

Creates and returns a TH2Poly object with the readout pixel description.

Definition at line 380 of file TRestDetectorReadoutPlane.cxx.

◆ GetRotation()

Double_t TRestDetectorReadoutPlane::GetRotation ( ) const
inline

Returns the rotation angle in radians of the reference frame with respect to the normal vector.

Definition at line 97 of file TRestDetectorReadoutPlane.h.

◆ GetType()

std::string TRestDetectorReadoutPlane::GetType ( ) const
inline

Definition at line 155 of file TRestDetectorReadoutPlane.h.

◆ 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.

◆ IsInside()

bool TRestDetectorReadoutPlane::IsInside ( const TVector3 &  point) const

Check if the point is inside any module of the readout plane.

Definition at line 530 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.

◆ operator[]()

TRestDetectorReadoutModule & TRestDetectorReadoutPlane::operator[] ( int  mod)
inline

Definition at line 132 of file TRestDetectorReadoutPlane.h.

◆ Print()

void TRestDetectorReadoutPlane::Print ( Int_t  DetailLevel = 0)

Prints information with details of the readout plane and modules defined inside the readout plane.

Definition at line 344 of file TRestDetectorReadoutPlane.cxx.

◆ PrintMetadata()

void TRestDetectorReadoutPlane::PrintMetadata ( )
inline

Prints the readout plane description.

Definition at line 149 of file TRestDetectorReadoutPlane.h.

◆ SetAxisX()

void TRestDetectorReadoutPlane::SetAxisX ( const TVector3 &  axis)

Definition at line 516 of file TRestDetectorReadoutPlane.cxx.

◆ SetChargeCollection()

void TRestDetectorReadoutPlane::SetChargeCollection ( Double_t  charge)
inline

Sets the value for the charge collection.

Definition at line 81 of file TRestDetectorReadoutPlane.h.

◆ SetHeight()

void TRestDetectorReadoutPlane::SetHeight ( Double_t  d)

Used to define the height of the readout volume with sign crosscheck.

Definition at line 78 of file TRestDetectorReadoutPlane.cxx.

◆ SetID()

void TRestDetectorReadoutPlane::SetID ( int  id)
inline

Sets the planeId. This is done by TRestDetectorReadout during initialization.

Definition at line 73 of file TRestDetectorReadoutPlane.h.

◆ SetName()

void TRestDetectorReadoutPlane::SetName ( const std::string &  name)
inline

Definition at line 161 of file TRestDetectorReadoutPlane.h.

◆ SetNormal()

void TRestDetectorReadoutPlane::SetNormal ( const TVector3 &  normal)

It updates the value of the normal vector and recalculates the corresponding X and Y axis.

Definition at line 64 of file TRestDetectorReadoutPlane.cxx.

◆ SetPosition()

void TRestDetectorReadoutPlane::SetPosition ( const TVector3 &  position)
inline

Sets the readout plane position.

Definition at line 76 of file TRestDetectorReadoutPlane.h.

◆ SetRotation()

void TRestDetectorReadoutPlane::SetRotation ( Double_t  radians)

Definition at line 495 of file TRestDetectorReadoutPlane.cxx.

◆ SetType()

void TRestDetectorReadoutPlane::SetType ( const std::string &  type)
inline

Definition at line 159 of file TRestDetectorReadoutPlane.h.

◆ UpdateAxes()

void TRestDetectorReadoutPlane::UpdateAxes ( )
private

Definition at line 440 of file TRestDetectorReadoutPlane.cxx.

Field Documentation

◆ fAxisX

TVector3 TRestDetectorReadoutPlane::fAxisX
private

A vector contained in the plane that defines the plane X-axis.

Definition at line 48 of file TRestDetectorReadoutPlane.h.

◆ fAxisY

TVector3 TRestDetectorReadoutPlane::fAxisY
private

A vector contained in the plane that defines the plane Y-axis.

Definition at line 51 of file TRestDetectorReadoutPlane.h.

◆ fChargeCollection

Double_t TRestDetectorReadoutPlane::fChargeCollection = 1
private

The fraction of charge/energy this readout plane collects from a hit position.

Definition at line 54 of file TRestDetectorReadoutPlane.h.

◆ fHeight

Double_t TRestDetectorReadoutPlane::fHeight = 0
private

A length in mm that confers a 3rd dimension to the readout plane and defines a volume.

Definition at line 57 of file TRestDetectorReadoutPlane.h.

◆ fId

Int_t TRestDetectorReadoutPlane::fId = -1
private

The plane id number imposed by the order of creation. Being the first id=0.

Definition at line 39 of file TRestDetectorReadoutPlane.h.

◆ fName

std::string TRestDetectorReadoutPlane::fName
private

Definition at line 62 of file TRestDetectorReadoutPlane.h.

◆ fNormal

TVector3 TRestDetectorReadoutPlane::fNormal = {0, 0, 1}
private

A vector that defines the plane orientation and the side of the active volume.

Definition at line 45 of file TRestDetectorReadoutPlane.h.

◆ fPosition

TVector3 TRestDetectorReadoutPlane::fPosition = {0, 0, 0}
private

The position of the readout plane that defines the origin (0,0) in plane coordinates.

Definition at line 42 of file TRestDetectorReadoutPlane.h.

◆ fReadoutModules

std::vector<TRestDetectorReadoutModule> TRestDetectorReadoutPlane::fReadoutModules
private

< A list of TRestDetectorReadoutModule components contained in the readout plane.

Definition at line 66 of file TRestDetectorReadoutPlane.h.

◆ fRotation

Double_t TRestDetectorReadoutPlane::fRotation = 0
private

Rotation (in radians) of the readout plane around the normal vector.

Definition at line 60 of file TRestDetectorReadoutPlane.h.

◆ fType

std::string TRestDetectorReadoutPlane::fType
private

Definition at line 63 of file TRestDetectorReadoutPlane.h.


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