REST-for-Physics
v2.3
Rare Event Searches ToolKit for Physics
|
A class to store the readout module definition used in TRestDetectorReadoutPlane. It allows to integrate any number of independent readout channels.
This class stores the readout module geometrical description, module position, orientation, and size. It contains a vector of TRestDetectorReadoutChannel with the definition of the readout channels existing in the readout module.
RESTsoft - Software for Rare Event Searches with TPCs
History of developments:
2015-aug: First concept. Javier Galan
Definition at line 36 of file TRestDetectorReadoutModule.h.
#include <TRestDetectorReadoutModule.h>
Public Member Functions | |
void | AddChannel (TRestDetectorReadoutChannel &channel) |
Adds a new channel to the module. More... | |
Int_t | DaqToReadoutChannel (Int_t daqChannel) |
Returns the physical readout channel index for a given daq id channel number. More... | |
void | DisableWarnings () |
Disables warning output. More... | |
void | DoReadoutMapping () |
Starts the readout mapping initialization. This process is computationally expensive but it greatly optimizes the FindChannel process later on. More... | |
void | Draw () |
Not implemented. More... | |
void | EnableWarnings () |
Enables warning output. More... | |
Int_t | FindChannel (const TVector2 &position) |
Returns the channel index corresponding to the absolute coordinates (absX, absY), but relative to the readout plane coordinate system. More... | |
TRestDetectorReadoutChannel * | GetChannel (size_t n) |
Returns a pointer to a readout channel by index. More... | |
TVector2 | GetDistanceToModule (const TVector2 &position) |
Creates a TVector2 with shortest norm going from the given position pos to the module. It can be seen as the vector to add to move from the position to the closest border of the module. More... | |
TRestDetectorReadoutMapping * | GetMapping () |
Returns a pointer to the readout mapping. More... | |
Int_t | GetMappingNodes () const |
Int_t | GetMaxDaqID () const |
Returns the maximum daq id number. More... | |
Int_t | GetMinDaqID () const |
Returns the minimum daq id number. More... | |
TVector2 | GetModuleCoordinates (const TVector2 &p) const |
Int_t | GetModuleID () const |
Returns the module id. More... | |
std::string | GetName () const |
Returns the module name. More... | |
size_t | GetNumberOfChannels () const |
Returns the total number of channels defined inside the module. More... | |
TVector2 | GetOrigin () const |
Returns the module origin position. More... | |
TVector2 | GetPixelCenter (Int_t channel, Int_t pixel) |
Returns the center pixel position for a given channel and pixel indexes. More... | |
TVector2 | GetPixelCenter (TRestDetectorReadoutPixel *pix) |
TVector2 | GetPixelOrigin (Int_t channel, Int_t pixel) |
Returns the pixel origin (left-bottom) position for a given channel and pixel indexes. More... | |
TVector2 | GetPixelOrigin (TRestDetectorReadoutPixel *pix) |
Bool_t | GetPixelTriangle (Int_t channel, Int_t pixel) |
Returns the pixel type for a given channel and pixel indexes. More... | |
Bool_t | GetPixelTriangle (TRestDetectorReadoutPixel *pix) |
TVector2 | GetPixelVertex (Int_t channel, Int_t pixel, Int_t vertex) |
Returns any of the pixel vertex position for a given channel and pixel indexes. More... | |
TVector2 | GetPixelVertex (TRestDetectorReadoutPixel *pix, Int_t vertex) |
TVector2 | GetPlaneCoordinates (const TVector2 &p) |
Double_t | GetRotation () const |
Returns the module rotation in degrees. More... | |
TVector2 | GetSize () const |
Returns the module size (x, y) in mm. More... | |
Double_t | GetTolerance () const |
Gets the tolerance for independent pixel overlaps. More... | |
std::string | GetType () const |
TVector2 | GetVertex (int n) const |
Returns the coordinates of the specified vertex index n. The physical coordinates relative to the readout plane are returned, including rotation. More... | |
Bool_t | IsDaqIDInside (Int_t daqID) |
Determines if a given daqID number is in the range of the module. More... | |
Bool_t | IsInside (const TVector2 &position) const |
Determines if the position x,y relative to the readout plane are inside this readout module. More... | |
Bool_t | IsInsideChannel (Int_t channel, const TVector2 &position) |
Determines if the position TVector2 pos is found in any of the pixels of the readout channel index given. More... | |
Bool_t | IsInsidePixel (Int_t channel, Int_t pixel, const TVector2 &position) |
Determines if the position TVector2 pos is found at a specific pixel id inside the readout channel given. More... | |
TRestDetectorReadoutChannel & | operator[] (int n) |
void | Print (Int_t DetailLevel=0) |
Prints the module details and channels if fullDetail is enabled. More... | |
void | SetDecodingFile (const std::string &decodingFile) |
Set the decoding file in the readout module. More... | |
void | SetFirstDaqChannel (Int_t firstDaqChannel) |
Sets first DAQ channel. More... | |
void | SetMappingNodes (Int_t nodes) |
Sets number of nodes. More... | |
void | SetMinMaxDaqIDs () |
Initializes the max and min values for the daq channel number. More... | |
void | SetModuleID (Int_t modID) |
Sets the module by id definition. More... | |
void | SetName (const std::string &name) |
Sets the name of the readout module. More... | |
void | SetOrigin (const TVector2 &origin) |
Sets the module origin by definition using TVector2 input. More... | |
void | SetRotation (Double_t rotation) |
Sets the module rotation in degrees. More... | |
void | SetSize (const TVector2 &size) |
Sets the module size by definition using TVector2 input. More... | |
void | SetTolerance (Double_t tolerance) |
Sets the tolerance for independent pixel overlaps. More... | |
void | SetType (const std::string &type) |
Sets the type of the readout module. More... | |
TRestDetectorReadoutModule () | |
Default TRestDetectorReadoutModule constructor. More... | |
virtual | ~TRestDetectorReadoutModule () |
Default TRestDetectorReadoutModule destructor. More... | |
Private Member Functions | |
void | Initialize () |
TRestDetectorReadoutModule initialization. More... | |
TVector2 | TransformToModuleCoordinates (const TVector2 &coords) const |
TVector2 | TransformToPlaneCoordinates (const TVector2 &coords) const |
Private Attributes | |
std::pair< Int_t, Int_t > | fDaqIdRange |
The minimum and maximum daq channel ids associated to the module. More... | |
Bool_t | fDecoding |
std::string | fDecodingFile = "" |
Decoding file. More... | |
*default REST_Warning in TRestDetectorReadout will enable it *Int_t | fFirstDaqChannel = 0 |
First DAQ channel. More... | |
Int_t | fId = -1 |
The module id given by the readout definition. More... | |
TRestDetectorReadoutMapping | fMapping |
The readout module uniform grid mapping. More... | |
Int_t | fMappingNodes = 0 |
Number of nodes. More... | |
std::string | fName |
TVector2 | fOrigin = {0, 0} |
The module (x, y) position relative to the readout plane position. More... | |
std::vector< TRestDetectorReadoutChannel > | fReadoutChannel |
Double_t | fRotation = 0 |
The rotation of the module around the module origin (fModuleOriginX, fModuleOriginY) in radians. More... | |
TVector2 | fSize = {0, 0} |
The module (x, y) size. All pixels should be contained within this size. More... | |
Double_t | fTolerance |
std::string | fType |
Bool_t | showWarnings |
TRestDetectorReadoutModule::TRestDetectorReadoutModule | ( | ) |
Default TRestDetectorReadoutModule constructor.
Definition at line 60 of file TRestDetectorReadoutModule.cxx.
|
virtual |
Default TRestDetectorReadoutModule destructor.
Definition at line 65 of file TRestDetectorReadoutModule.cxx.
void TRestDetectorReadoutModule::AddChannel | ( | TRestDetectorReadoutChannel & | channel | ) |
Adds a new channel to the module.
Definition at line 583 of file TRestDetectorReadoutModule.cxx.
|
inline |
Returns the physical readout channel index for a given daq id channel number.
Definition at line 131 of file TRestDetectorReadoutModule.h.
|
inline |
Disables warning output.
Definition at line 184 of file TRestDetectorReadoutModule.h.
void TRestDetectorReadoutModule::DoReadoutMapping | ( | ) |
Starts the readout mapping initialization. This process is computationally expensive but it greatly optimizes the FindChannel process later on.
Definition at line 120 of file TRestDetectorReadoutModule.cxx.
void TRestDetectorReadoutModule::Draw | ( | ) |
Not implemented.
Definition at line 618 of file TRestDetectorReadoutModule.cxx.
|
inline |
Enables warning output.
Definition at line 181 of file TRestDetectorReadoutModule.h.
Int_t TRestDetectorReadoutModule::FindChannel | ( | const TVector2 & | position | ) |
Returns the channel index corresponding to the absolute coordinates (absX, absY), but relative to the readout plane coordinate system.
The readout mapping (see TRestDetectorReadoutMapping) is used to help finding the pixel where coordinates absX and absY fall in.
Definition at line 322 of file TRestDetectorReadoutModule.cxx.
|
inline |
Returns a pointer to a readout channel by index.
Definition at line 170 of file TRestDetectorReadoutModule.h.
TVector2 TRestDetectorReadoutModule::GetDistanceToModule | ( | const TVector2 & | position | ) |
Creates a TVector2 with shortest norm going from the given position pos to the module. It can be seen as the vector to add to move from the position to the closest border of the module.
Definition at line 458 of file TRestDetectorReadoutModule.cxx.
|
inline |
Returns a pointer to the readout mapping.
Definition at line 165 of file TRestDetectorReadoutModule.h.
|
inline |
Definition at line 128 of file TRestDetectorReadoutModule.h.
|
inline |
Returns the maximum daq id number.
Definition at line 126 of file TRestDetectorReadoutModule.h.
|
inline |
Returns the minimum daq id number.
Definition at line 123 of file TRestDetectorReadoutModule.h.
|
inline |
Converts the coordinates given by TVector2 in the readout plane reference system to the readout module reference system.
Definition at line 154 of file TRestDetectorReadoutModule.h.
|
inline |
Returns the module id.
Definition at line 141 of file TRestDetectorReadoutModule.h.
|
inline |
Returns the module name.
Definition at line 161 of file TRestDetectorReadoutModule.h.
|
inline |
Returns the total number of channels defined inside the module.
Definition at line 178 of file TRestDetectorReadoutModule.h.
|
inline |
Returns the module origin position.
Definition at line 144 of file TRestDetectorReadoutModule.h.
TVector2 TRestDetectorReadoutModule::GetPixelCenter | ( | Int_t | channel, |
Int_t | pixel | ||
) |
Returns the center pixel position for a given channel and pixel indexes.
vertex | A value between 0-3 defining the vertex position to be returned |
Definition at line 505 of file TRestDetectorReadoutModule.cxx.
TVector2 TRestDetectorReadoutModule::GetPixelCenter | ( | TRestDetectorReadoutPixel * | pix | ) |
Definition at line 537 of file TRestDetectorReadoutModule.cxx.
TVector2 TRestDetectorReadoutModule::GetPixelOrigin | ( | Int_t | channel, |
Int_t | pixel | ||
) |
Returns the pixel origin (left-bottom) position for a given channel and pixel indexes.
Definition at line 479 of file TRestDetectorReadoutModule.cxx.
TVector2 TRestDetectorReadoutModule::GetPixelOrigin | ( | TRestDetectorReadoutPixel * | pix | ) |
Definition at line 526 of file TRestDetectorReadoutModule.cxx.
Bool_t TRestDetectorReadoutModule::GetPixelTriangle | ( | Int_t | channel, |
Int_t | pixel | ||
) |
Returns the pixel type for a given channel and pixel indexes.
vertex | A boolean that is true if the pixel is triangular, false otherwise |
Definition at line 520 of file TRestDetectorReadoutModule.cxx.
Bool_t TRestDetectorReadoutModule::GetPixelTriangle | ( | TRestDetectorReadoutPixel * | pix | ) |
Definition at line 544 of file TRestDetectorReadoutModule.cxx.
TVector2 TRestDetectorReadoutModule::GetPixelVertex | ( | Int_t | channel, |
Int_t | pixel, | ||
Int_t | vertex | ||
) |
Returns any of the pixel vertex position for a given channel and pixel indexes.
vertex | A value between 0-3 defining the vertex position to be returned |
Definition at line 490 of file TRestDetectorReadoutModule.cxx.
TVector2 TRestDetectorReadoutModule::GetPixelVertex | ( | TRestDetectorReadoutPixel * | pix, |
Int_t | vertex | ||
) |
Definition at line 530 of file TRestDetectorReadoutModule.cxx.
|
inline |
Converts the coordinates given by TVector2 in the readout module reference system to the readout plane reference system.
Definition at line 158 of file TRestDetectorReadoutModule.h.
|
inline |
Returns the module rotation in degrees.
Definition at line 150 of file TRestDetectorReadoutModule.h.
|
inline |
Returns the module size (x, y) in mm.
Definition at line 147 of file TRestDetectorReadoutModule.h.
|
inline |
Gets the tolerance for independent pixel overlaps.
Definition at line 120 of file TRestDetectorReadoutModule.h.
|
inline |
Definition at line 162 of file TRestDetectorReadoutModule.h.
TVector2 TRestDetectorReadoutModule::GetVertex | ( | int | n | ) | const |
Returns the coordinates of the specified vertex index n. The physical coordinates relative to the readout plane are returned, including rotation.
n | A value between 0-3 defining the vertex position to be returned |
Definition at line 555 of file TRestDetectorReadoutModule.cxx.
|
private |
TRestDetectorReadoutModule initialization.
Definition at line 70 of file TRestDetectorReadoutModule.cxx.
Bool_t TRestDetectorReadoutModule::IsDaqIDInside | ( | Int_t | daqID | ) |
Determines if a given daqID number is in the range of the module.
Definition at line 308 of file TRestDetectorReadoutModule.cxx.
Bool_t TRestDetectorReadoutModule::IsInside | ( | const TVector2 & | position | ) | const |
Determines if the position x,y relative to the readout plane are inside this readout module.
Determines if the position TVector2 pos relative to the readout plane are inside this readout module.
Definition at line 415 of file TRestDetectorReadoutModule.cxx.
Bool_t TRestDetectorReadoutModule::IsInsideChannel | ( | Int_t | channel, |
const TVector2 & | position | ||
) |
Determines if the position TVector2 pos is found in any of the pixels of the readout channel index given.
Definition at line 426 of file TRestDetectorReadoutModule.cxx.
Bool_t TRestDetectorReadoutModule::IsInsidePixel | ( | Int_t | channel, |
Int_t | pixel, | ||
const TVector2 & | position | ||
) |
Determines if the position TVector2 pos is found at a specific pixel id inside the readout channel given.
Definition at line 440 of file TRestDetectorReadoutModule.cxx.
|
inline |
Definition at line 167 of file TRestDetectorReadoutModule.h.
void TRestDetectorReadoutModule::Print | ( | Int_t | DetailLevel = 0 | ) |
Prints the module details and channels if fullDetail is enabled.
Definition at line 623 of file TRestDetectorReadoutModule.cxx.
void TRestDetectorReadoutModule::SetDecodingFile | ( | const std::string & | decodingFile | ) |
Set the decoding file in the readout module.
Definition at line 234 of file TRestDetectorReadoutModule.cxx.
|
inline |
Sets first DAQ channel.
Definition at line 114 of file TRestDetectorReadoutModule.h.
|
inline |
Sets number of nodes.
Definition at line 117 of file TRestDetectorReadoutModule.h.
void TRestDetectorReadoutModule::SetMinMaxDaqIDs | ( | ) |
Initializes the max and min values for the daq channel number.
Definition at line 99 of file TRestDetectorReadoutModule.cxx.
|
inline |
Sets the module by id definition.
Definition at line 93 of file TRestDetectorReadoutModule.h.
|
inline |
Sets the name of the readout module.
Definition at line 105 of file TRestDetectorReadoutModule.h.
|
inline |
Sets the module origin by definition using TVector2 input.
Definition at line 99 of file TRestDetectorReadoutModule.h.
|
inline |
Sets the module rotation in degrees.
Definition at line 102 of file TRestDetectorReadoutModule.h.
|
inline |
Sets the module size by definition using TVector2 input.
Definition at line 96 of file TRestDetectorReadoutModule.h.
|
inline |
Sets the tolerance for independent pixel overlaps.
Definition at line 111 of file TRestDetectorReadoutModule.h.
|
inline |
Sets the type of the readout module.
Definition at line 108 of file TRestDetectorReadoutModule.h.
|
inlineprivate |
Converts the coordinates (xPhys,yPhys) in the readout plane reference system to the readout module reference system.
Definition at line 78 of file TRestDetectorReadoutModule.h.
|
inlineprivate |
Converts the coordinates (xMod,yMod) in the readout module reference system to the readout plane reference system.
Definition at line 84 of file TRestDetectorReadoutModule.h.
|
private |
The minimum and maximum daq channel ids associated to the module.
Definition at line 47 of file TRestDetectorReadoutModule.h.
|
private |
Defines if a decoding file was used to set the relation between a physical readout channel id and a signal daq id
Definition at line 68 of file TRestDetectorReadoutModule.h.
|
private |
Decoding file.
Definition at line 64 of file TRestDetectorReadoutModule.h.
|
private |
First DAQ channel.
Definition at line 62 of file TRestDetectorReadoutModule.h.
|
private |
The module id given by the readout definition.
Definition at line 38 of file TRestDetectorReadoutModule.h.
|
private |
The readout module uniform grid mapping.
Definition at line 54 of file TRestDetectorReadoutModule.h.
|
private |
Number of nodes.
Definition at line 66 of file TRestDetectorReadoutModule.h.
|
private |
Definition at line 71 of file TRestDetectorReadoutModule.h.
|
private |
The module (x, y) position relative to the readout plane position.
Definition at line 40 of file TRestDetectorReadoutModule.h.
|
private |
A std::vector of the instances of TRestDetectorReadoutChannel contained in the readout module.
Definition at line 51 of file TRestDetectorReadoutModule.h.
|
private |
The rotation of the module around the module origin (fModuleOriginX, fModuleOriginY) in radians.
Definition at line 45 of file TRestDetectorReadoutModule.h.
|
private |
The module (x, y) size. All pixels should be contained within this size.
Definition at line 42 of file TRestDetectorReadoutModule.h.
|
private |
Tolerance allowed in overlaps at the pixel boundaries in mm.
Definition at line 56 of file TRestDetectorReadoutModule.h.
|
private |
Definition at line 72 of file TRestDetectorReadoutModule.h.
|
private |
Definition at line 59 of file TRestDetectorReadoutModule.h.