|
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 (TRestDetectorReadoutModule &rModule) |
| 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) |
| 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... | |
| Int_t | GetModuleIDFromPosition (Double_t x, Double_t y, Double_t z) |
| This method returns the module id where the hits with coordinates (x,y,z) 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... | |
| 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 () |
| 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... | |
| 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... | |
| 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 | 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) |
| 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... | |
| 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... | |
| TRestDetectorReadoutPlane::TRestDetectorReadoutPlane | ( | ) |
Default TRestDetectorReadoutPlane constructor.
Definition at line 42 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Adds a new module to the readout plane.
Definition at line 140 of file TRestDetectorReadoutPlane.h.
| void TRestDetectorReadoutPlane::Draw | ( | ) |
Draws the readout plane using GetReadoutHistogram.
Definition at line 386 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 244 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Returns a TVector3 with a vector that defines the X-axis plane coordinate system.
Definition at line 103 of file TRestDetectorReadoutPlane.h.
|
inline |
Returns a TVector3 with a vector that defines the Y-axis plane coordinate system.
Definition at line 106 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 430 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Returns a TVector3 with the cathode position.
Definition at line 97 of file TRestDetectorReadoutPlane.h.
|
inline |
Returns the charge collection ratio at this readout plane.
Definition at line 109 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 259 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 122 of file TRestDetectorReadoutPlane.h.
| Double_t TRestDetectorReadoutPlane::GetDistanceToPlane | ( | const TVector3 & | point | ) | const |
Definition at line 523 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Returns the total drift distance. Equivalent to the height of the readout volume.
Definition at line 112 of file TRestDetectorReadoutPlane.h.
|
inline |
Returns the height of the readout volume.
Definition at line 115 of file TRestDetectorReadoutPlane.h.
|
inline |
Returns an integer with the plane id number.
Definition at line 88 of file TRestDetectorReadoutPlane.h.
|
inline |
Returns a pointer to a readout module using its std::vector index.
Definition at line 129 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 & | pos | ) |
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.
| pos | A TVector3 defining the position. |
Definition at line 336 of file TRestDetectorReadoutPlane.cxx.
| Int_t TRestDetectorReadoutPlane::GetModuleIDFromPosition | ( | Double_t | x, |
| Double_t | y, | ||
| Double_t | z | ||
| ) |
This method returns the module id where the hits with coordinates (x,y,z) 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.
| x,y,z | Three Double_t defining the position. |
Definition at line 320 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Returns a TVector3 with a vector normal to the readout plane.
Definition at line 100 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 137 of file TRestDetectorReadoutPlane.h.
|
inline |
Returns a TVector3 with the readout plane position.
Definition at line 91 of file TRestDetectorReadoutPlane.h.
| TVector2 TRestDetectorReadoutPlane::GetPositionInPlane | ( | const TVector3 & | point | ) | const |
Definition at line 512 of file TRestDetectorReadoutPlane.cxx.
| TVector3 TRestDetectorReadoutPlane::GetPositionInWorld | ( | const TVector2 & | point, |
| Double_t | height = 0 |
||
| ) | const |
Definition at line 519 of file TRestDetectorReadoutPlane.cxx.
| TH2Poly * TRestDetectorReadoutPlane::GetReadoutHistogram | ( | ) |
Creates and returns a TH2Poly object with the readout pixel description.
Definition at line 392 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Returns the rotation angle in radians of the reference frame with respect to the normal vector.
Definition at line 94 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 111 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 178 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 283 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 299 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 270 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Definition at line 126 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 356 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Prints the readout plane description.
Definition at line 143 of file TRestDetectorReadoutPlane.h.
| void TRestDetectorReadoutPlane::SetAxisX | ( | const TVector3 & | axis | ) |
Definition at line 527 of file TRestDetectorReadoutPlane.cxx.
|
inline |
Sets the value for the charge collection.
Definition at line 78 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 70 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 73 of file TRestDetectorReadoutPlane.h.
| void TRestDetectorReadoutPlane::SetRotation | ( | Double_t | radians | ) |
Definition at line 506 of file TRestDetectorReadoutPlane.cxx.
|
private |
Definition at line 451 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 |
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 63 of file TRestDetectorReadoutPlane.h.
|
private |
Rotation (in radians) of the readout plane around the normal vector.
Definition at line 60 of file TRestDetectorReadoutPlane.h.