REST-for-Physics
v2.3
Rare Event Searches ToolKit for Physics
|
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.
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
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... | |
TRestDetectorReadoutModule * | GetModule (size_t mod) |
Returns a pointer to a readout module using its std::vector index. More... | |
TRestDetectorReadoutModule * | GetModuleByID (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... | |
TRestDetectorReadoutModule & | operator[] (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< TRestDetectorReadoutModule > | fReadoutModules |
< 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 |
TRestDetectorReadoutPlane::TRestDetectorReadoutPlane | ( | ) |
Default TRestDetectorReadoutPlane constructor.
Definition at line 42 of file TRestDetectorReadoutPlane.cxx.
void TRestDetectorReadoutPlane::AddModule | ( | const TRestDetectorReadoutModule & | module | ) |
Adds a new module to the readout plane.
Definition at line 545 of file TRestDetectorReadoutPlane.cxx.
void TRestDetectorReadoutPlane::Draw | ( | ) |
Draws the readout plane using GetReadoutHistogram.
Definition at line 374 of file TRestDetectorReadoutPlane.cxx.
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).
absX | It is the x absolut physical position |
absY | It is the y absolut physical position |
Definition at line 246 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Returns a TVector3 with a vector that defines the X-axis plane coordinate system.
Definition at line 106 of file TRestDetectorReadoutPlane.h.
|
inline |
Returns a TVector3 with a vector that defines the Y-axis plane coordinate system.
Definition at line 109 of file TRestDetectorReadoutPlane.h.
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.
|
inline |
Returns a TVector3 with the cathode position.
Definition at line 100 of file TRestDetectorReadoutPlane.h.
|
inline |
Returns the charge collection ratio at this readout plane.
Definition at line 112 of file TRestDetectorReadoutPlane.h.
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.
|
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.
Double_t TRestDetectorReadoutPlane::GetDistanceToPlane | ( | const TVector3 & | point | ) | const |
Definition at line 512 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Returns the total drift distance. Equivalent to the height of the readout volume.
Definition at line 115 of file TRestDetectorReadoutPlane.h.
|
inline |
Returns the height of the readout volume.
Definition at line 118 of file TRestDetectorReadoutPlane.h.
|
inline |
Returns an integer with the plane id number.
Definition at line 91 of file TRestDetectorReadoutPlane.h.
|
inline |
Returns a pointer to a readout module using its std::vector index.
Definition at line 135 of file TRestDetectorReadoutPlane.h.
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.
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.
position | A TVector3 defining the position. |
Definition at line 325 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Definition at line 157 of file TRestDetectorReadoutPlane.h.
|
inline |
Returns a TVector3 with a vector normal to the readout plane.
Definition at line 103 of file TRestDetectorReadoutPlane.h.
Int_t TRestDetectorReadoutPlane::GetNumberOfChannels | ( | ) |
Returns the total number of channels in the readout plane.
Definition at line 52 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Returns the total number of modules in the readout plane.
Definition at line 143 of file TRestDetectorReadoutPlane.h.
|
inline |
Returns a TVector3 with the readout plane position.
Definition at line 94 of file TRestDetectorReadoutPlane.h.
TVector2 TRestDetectorReadoutPlane::GetPositionInPlane | ( | const TVector3 & | point | ) | const |
Definition at line 501 of file TRestDetectorReadoutPlane.cxx.
TVector3 TRestDetectorReadoutPlane::GetPositionInWorld | ( | const TVector2 & | point, |
Double_t | height = 0 |
||
) | const |
Definition at line 508 of file TRestDetectorReadoutPlane.cxx.
TH2Poly * TRestDetectorReadoutPlane::GetReadoutHistogram | ( | ) |
Creates and returns a TH2Poly object with the readout pixel description.
Definition at line 380 of file TRestDetectorReadoutPlane.cxx.
|
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.
|
inline |
Definition at line 155 of file TRestDetectorReadoutPlane.h.
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.
modID | Internal module id. As defined on the readout. |
chID | Internal channel id. As defined on the readout. |
Definition at line 113 of file TRestDetectorReadoutPlane.cxx.
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.
modID | Internal module id. As defined on the readout. |
chID | Internal channel id. As defined on the readout. |
Definition at line 180 of file TRestDetectorReadoutPlane.cxx.
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.
Definition at line 286 of file TRestDetectorReadoutPlane.cxx.
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.
Int_t TRestDetectorReadoutPlane::isZInsideDriftVolume | ( | const TVector3 & | position | ) |
This method determines if the z-coordinate is inside the drift volume for this readout plane.
position | A TVector3 defining the position. |
Definition at line 302 of file TRestDetectorReadoutPlane.cxx.
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.
Definition at line 273 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Definition at line 132 of file TRestDetectorReadoutPlane.h.
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.
|
inline |
Prints the readout plane description.
Definition at line 149 of file TRestDetectorReadoutPlane.h.
void TRestDetectorReadoutPlane::SetAxisX | ( | const TVector3 & | axis | ) |
Definition at line 516 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Sets the value for the charge collection.
Definition at line 81 of file TRestDetectorReadoutPlane.h.
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.
|
inline |
Sets the planeId. This is done by TRestDetectorReadout during initialization.
Definition at line 73 of file TRestDetectorReadoutPlane.h.
|
inline |
Definition at line 161 of file TRestDetectorReadoutPlane.h.
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.
|
inline |
Sets the readout plane position.
Definition at line 76 of file TRestDetectorReadoutPlane.h.
void TRestDetectorReadoutPlane::SetRotation | ( | Double_t | radians | ) |
Definition at line 495 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Definition at line 159 of file TRestDetectorReadoutPlane.h.
|
private |
Definition at line 440 of file TRestDetectorReadoutPlane.cxx.
|
private |
A vector contained in the plane that defines the plane X-axis.
Definition at line 48 of file TRestDetectorReadoutPlane.h.
|
private |
A vector contained in the plane that defines the plane Y-axis.
Definition at line 51 of file TRestDetectorReadoutPlane.h.
|
private |
The fraction of charge/energy this readout plane collects from a hit position.
Definition at line 54 of file TRestDetectorReadoutPlane.h.
|
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.
|
private |
The plane id number imposed by the order of creation. Being the first id=0.
Definition at line 39 of file TRestDetectorReadoutPlane.h.
|
private |
Definition at line 62 of file TRestDetectorReadoutPlane.h.
|
private |
A vector that defines the plane orientation and the side of the active volume.
Definition at line 45 of file TRestDetectorReadoutPlane.h.
|
private |
The position of the readout plane that defines the origin (0,0) in plane coordinates.
Definition at line 42 of file TRestDetectorReadoutPlane.h.
|
private |
< A list of TRestDetectorReadoutModule components contained in the readout plane.
Definition at line 66 of file TRestDetectorReadoutPlane.h.
|
private |
Rotation (in radians) of the readout plane around the normal vector.
Definition at line 60 of file TRestDetectorReadoutPlane.h.
|
private |
Definition at line 63 of file TRestDetectorReadoutPlane.h.