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

Detailed Description

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

Author
Javier Galan

Definition at line 36 of file TRestDetectorReadoutModule.h.

#include <TRestDetectorReadoutModule.h>

Public Member Functions

void AddChannel (TRestDetectorReadoutChannel &rChannel)
 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 (Int_t nodes=0)
 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 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...
 
const char * 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...
 
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)
 Determines if the position TVector2 pos relative to the readout plane are inside this readout module. More...
 
Bool_t isInside (Double_t x, Double_t y)
 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 isInsideChannel (Int_t channel, Double_t x, Double_t y)
 Determines if the position x,y 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 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...
 
 TRestDetectorReadoutModule ()
 Default TRestDetectorReadoutModule constructor. More...
 
virtual ~TRestDetectorReadoutModule ()
 Default TRestDetectorReadoutModule destructor. More...
 

Private Member Functions

*default REST_Warning in TRestDetectorReadout will enable it *void Initialize ()
 TRestDetectorReadoutModule initialization. More...
 
TVector2 TransformToModuleCoordinates (const TVector2 &xyPhysical) const
 
TVector2 TransformToPlaneCoordinates (Double_t xMod, Double_t yMod) const
 

Private Attributes

std::pair< Int_t, Int_t > fDaqIdRange
 The minimum and maximum daq channel ids associated to the module. More...
 
Int_t fId = -1
 The module id given by the readout definition. More...
 
TRestDetectorReadoutMapping fMapping
 The readout module uniform grid mapping. More...
 
std::string fName
 The assigned module name. More...
 
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
 
Bool_t showWarnings
 

Constructor & Destructor Documentation

◆ TRestDetectorReadoutModule()

TRestDetectorReadoutModule::TRestDetectorReadoutModule ( )

Default TRestDetectorReadoutModule constructor.

Definition at line 57 of file TRestDetectorReadoutModule.cxx.

◆ ~TRestDetectorReadoutModule()

TRestDetectorReadoutModule::~TRestDetectorReadoutModule ( )
virtual

Default TRestDetectorReadoutModule destructor.

Definition at line 62 of file TRestDetectorReadoutModule.cxx.

Member Function Documentation

◆ AddChannel()

void TRestDetectorReadoutModule::AddChannel ( TRestDetectorReadoutChannel &  rChannel)

Adds a new channel to the module.

Definition at line 499 of file TRestDetectorReadoutModule.cxx.

◆ DaqToReadoutChannel()

Int_t TRestDetectorReadoutModule::DaqToReadoutChannel ( Int_t  daqChannel)
inline

Returns the physical readout channel index for a given daq id channel number.

Definition at line 118 of file TRestDetectorReadoutModule.h.

◆ DisableWarnings()

void TRestDetectorReadoutModule::DisableWarnings ( )
inline

Disables warning output.

Definition at line 170 of file TRestDetectorReadoutModule.h.

◆ DoReadoutMapping()

void TRestDetectorReadoutModule::DoReadoutMapping ( Int_t  nodes = 0)

Starts the readout mapping initialization. This process is computationally expensive but it greatly optimizes the FindChannel process later on.

Definition at line 107 of file TRestDetectorReadoutModule.cxx.

◆ Draw()

void TRestDetectorReadoutModule::Draw ( )

Not implemented.

Definition at line 526 of file TRestDetectorReadoutModule.cxx.

◆ EnableWarnings()

void TRestDetectorReadoutModule::EnableWarnings ( )
inline

Enables warning output.

Definition at line 167 of file TRestDetectorReadoutModule.h.

◆ FindChannel()

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 234 of file TRestDetectorReadoutModule.cxx.

◆ GetChannel()

TRestDetectorReadoutChannel * TRestDetectorReadoutModule::GetChannel ( size_t  n)
inline

Returns a pointer to a readout channel by index.

Definition at line 156 of file TRestDetectorReadoutModule.h.

◆ GetDistanceToModule()

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 374 of file TRestDetectorReadoutModule.cxx.

◆ GetMapping()

TRestDetectorReadoutMapping * TRestDetectorReadoutModule::GetMapping ( )
inline

Returns a pointer to the readout mapping.

Definition at line 151 of file TRestDetectorReadoutModule.h.

◆ GetMaxDaqID()

Int_t TRestDetectorReadoutModule::GetMaxDaqID ( ) const
inline

Returns the maximum daq id number.

Definition at line 115 of file TRestDetectorReadoutModule.h.

◆ GetMinDaqID()

Int_t TRestDetectorReadoutModule::GetMinDaqID ( ) const
inline

Returns the minimum daq id number.

Definition at line 112 of file TRestDetectorReadoutModule.h.

◆ GetModuleCoordinates()

TVector2 TRestDetectorReadoutModule::GetModuleCoordinates ( const TVector2 &  p) const
inline

Converts the coordinates given by TVector2 in the readout plane reference system to the readout module reference system.

Definition at line 141 of file TRestDetectorReadoutModule.h.

◆ GetModuleID()

Int_t TRestDetectorReadoutModule::GetModuleID ( ) const
inline

Returns the module id.

Definition at line 128 of file TRestDetectorReadoutModule.h.

◆ GetName()

const char * TRestDetectorReadoutModule::GetName ( ) const
inline

Returns the module name.

Definition at line 148 of file TRestDetectorReadoutModule.h.

◆ GetNumberOfChannels()

size_t TRestDetectorReadoutModule::GetNumberOfChannels ( ) const
inline

Returns the total number of channels defined inside the module.

Definition at line 164 of file TRestDetectorReadoutModule.h.

◆ GetOrigin()

TVector2 TRestDetectorReadoutModule::GetOrigin ( ) const
inline

Returns the module origin position.

Definition at line 131 of file TRestDetectorReadoutModule.h.

◆ GetPixelCenter() [1/2]

TVector2 TRestDetectorReadoutModule::GetPixelCenter ( Int_t  channel,
Int_t  pixel 
)

Returns the center pixel position for a given channel and pixel indexes.

Parameters
vertexA value between 0-3 defining the vertex position to be returned

Definition at line 421 of file TRestDetectorReadoutModule.cxx.

◆ GetPixelCenter() [2/2]

TVector2 TRestDetectorReadoutModule::GetPixelCenter ( TRestDetectorReadoutPixel *  pix)

Definition at line 453 of file TRestDetectorReadoutModule.cxx.

◆ GetPixelOrigin() [1/2]

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 395 of file TRestDetectorReadoutModule.cxx.

◆ GetPixelOrigin() [2/2]

TVector2 TRestDetectorReadoutModule::GetPixelOrigin ( TRestDetectorReadoutPixel *  pix)

Definition at line 442 of file TRestDetectorReadoutModule.cxx.

◆ GetPixelTriangle() [1/2]

Bool_t TRestDetectorReadoutModule::GetPixelTriangle ( Int_t  channel,
Int_t  pixel 
)

Returns the pixel type for a given channel and pixel indexes.

Parameters
vertexA boolean that is true if the pixel is triangular, false otherwise

Definition at line 436 of file TRestDetectorReadoutModule.cxx.

◆ GetPixelTriangle() [2/2]

Bool_t TRestDetectorReadoutModule::GetPixelTriangle ( TRestDetectorReadoutPixel *  pix)

Definition at line 460 of file TRestDetectorReadoutModule.cxx.

◆ GetPixelVertex() [1/2]

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.

Parameters
vertexA value between 0-3 defining the vertex position to be returned

Definition at line 406 of file TRestDetectorReadoutModule.cxx.

◆ GetPixelVertex() [2/2]

TVector2 TRestDetectorReadoutModule::GetPixelVertex ( TRestDetectorReadoutPixel *  pix,
Int_t  vertex 
)

Definition at line 446 of file TRestDetectorReadoutModule.cxx.

◆ GetPlaneCoordinates()

TVector2 TRestDetectorReadoutModule::GetPlaneCoordinates ( const TVector2 &  p)
inline

Converts the coordinates given by TVector2 in the readout module reference system to the readout plane reference system.

Definition at line 145 of file TRestDetectorReadoutModule.h.

◆ GetRotation()

Double_t TRestDetectorReadoutModule::GetRotation ( ) const
inline

Returns the module rotation in degrees.

Definition at line 137 of file TRestDetectorReadoutModule.h.

◆ GetSize()

TVector2 TRestDetectorReadoutModule::GetSize ( ) const
inline

Returns the module size (x, y) in mm.

Definition at line 134 of file TRestDetectorReadoutModule.h.

◆ GetTolerance()

Double_t TRestDetectorReadoutModule::GetTolerance ( ) const
inline

Gets the tolerance for independent pixel overlaps.

Definition at line 109 of file TRestDetectorReadoutModule.h.

◆ GetVertex()

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.

Parameters
nA value between 0-3 defining the vertex position to be returned

Definition at line 471 of file TRestDetectorReadoutModule.cxx.

◆ Initialize()

void TRestDetectorReadoutModule::Initialize ( )
private

TRestDetectorReadoutModule initialization.

Definition at line 67 of file TRestDetectorReadoutModule.cxx.

◆ isDaqIDInside()

Bool_t TRestDetectorReadoutModule::isDaqIDInside ( Int_t  daqID)

Determines if a given daqID number is in the range of the module.

Definition at line 220 of file TRestDetectorReadoutModule.cxx.

◆ isInside() [1/2]

Bool_t TRestDetectorReadoutModule::isInside ( const TVector2 &  position)

Determines if the position TVector2 pos relative to the readout plane are inside this readout module.

Definition at line 327 of file TRestDetectorReadoutModule.cxx.

◆ isInside() [2/2]

Bool_t TRestDetectorReadoutModule::isInside ( Double_t  x,
Double_t  y 
)
inline

Determines if the position x,y relative to the readout plane are inside this readout module.

Definition at line 180 of file TRestDetectorReadoutModule.h.

◆ isInsideChannel() [1/2]

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 349 of file TRestDetectorReadoutModule.cxx.

◆ isInsideChannel() [2/2]

Bool_t TRestDetectorReadoutModule::isInsideChannel ( Int_t  channel,
Double_t  x,
Double_t  y 
)

Determines if the position x,y is found in any of the pixels of the readout channel index given.

Definition at line 341 of file TRestDetectorReadoutModule.cxx.

◆ isInsidePixel()

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 360 of file TRestDetectorReadoutModule.cxx.

◆ operator[]()

TRestDetectorReadoutChannel & TRestDetectorReadoutModule::operator[] ( int  n)
inline

Definition at line 153 of file TRestDetectorReadoutModule.h.

◆ Print()

void TRestDetectorReadoutModule::Print ( Int_t  DetailLevel = 0)

Prints the module details and channels if fullDetail is enabled.

Definition at line 531 of file TRestDetectorReadoutModule.cxx.

◆ SetMinMaxDaqIDs()

void TRestDetectorReadoutModule::SetMinMaxDaqIDs ( )

Initializes the max and min values for the daq channel number.

Definition at line 86 of file TRestDetectorReadoutModule.cxx.

◆ SetModuleID()

void TRestDetectorReadoutModule::SetModuleID ( Int_t  modID)
inline

Sets the module by id definition.

Definition at line 91 of file TRestDetectorReadoutModule.h.

◆ SetName()

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

Sets the name of the readout module.

Definition at line 103 of file TRestDetectorReadoutModule.h.

◆ SetOrigin()

void TRestDetectorReadoutModule::SetOrigin ( const TVector2 &  origin)
inline

Sets the module origin by definition using TVector2 input.

Definition at line 97 of file TRestDetectorReadoutModule.h.

◆ SetRotation()

void TRestDetectorReadoutModule::SetRotation ( Double_t  rotation)
inline

Sets the module rotation in degrees.

Definition at line 100 of file TRestDetectorReadoutModule.h.

◆ SetSize()

void TRestDetectorReadoutModule::SetSize ( const TVector2 &  size)
inline

Sets the module size by definition using TVector2 input.

Definition at line 94 of file TRestDetectorReadoutModule.h.

◆ SetTolerance()

void TRestDetectorReadoutModule::SetTolerance ( Double_t  tolerance)
inline

Sets the tolerance for independent pixel overlaps.

Definition at line 106 of file TRestDetectorReadoutModule.h.

◆ TransformToModuleCoordinates()

TVector2 TRestDetectorReadoutModule::TransformToModuleCoordinates ( const TVector2 &  xyPhysical) const
inlineprivate

Converts the coordinates (xPhys,yPhys) in the readout plane reference system to the readout module reference system.

Definition at line 68 of file TRestDetectorReadoutModule.h.

◆ TransformToPlaneCoordinates()

TVector2 TRestDetectorReadoutModule::TransformToPlaneCoordinates ( Double_t  xMod,
Double_t  yMod 
) const
inlineprivate

Converts the coordinates (xMod,yMod) in the readout module reference system to the readout plane reference system.

Definition at line 77 of file TRestDetectorReadoutModule.h.

Field Documentation

◆ fDaqIdRange

std::pair<Int_t, Int_t> TRestDetectorReadoutModule::fDaqIdRange
private
Initial value:
= {
-1, -1}

The minimum and maximum daq channel ids associated to the module.

Definition at line 49 of file TRestDetectorReadoutModule.h.

◆ fId

Int_t TRestDetectorReadoutModule::fId = -1
private

The module id given by the readout definition.

Definition at line 38 of file TRestDetectorReadoutModule.h.

◆ fMapping

TRestDetectorReadoutMapping TRestDetectorReadoutModule::fMapping
private

The readout module uniform grid mapping.

Definition at line 56 of file TRestDetectorReadoutModule.h.

◆ fName

std::string TRestDetectorReadoutModule::fName
private

The assigned module name.

Definition at line 40 of file TRestDetectorReadoutModule.h.

◆ fOrigin

TVector2 TRestDetectorReadoutModule::fOrigin = {0, 0}
private

The module (x, y) position relative to the readout plane position.

Definition at line 42 of file TRestDetectorReadoutModule.h.

◆ fReadoutChannel

std::vector<TRestDetectorReadoutChannel> TRestDetectorReadoutModule::fReadoutChannel
private

A std::vector of the instances of TRestDetectorReadoutChannel contained in the readout module.

Definition at line 53 of file TRestDetectorReadoutModule.h.

◆ fRotation

Double_t TRestDetectorReadoutModule::fRotation = 0
private

The rotation of the module around the module origin (fModuleOriginX, fModuleOriginY) in radians.

Definition at line 47 of file TRestDetectorReadoutModule.h.

◆ fSize

TVector2 TRestDetectorReadoutModule::fSize = {0, 0}
private

The module (x, y) size. All pixels should be contained within this size.

Definition at line 44 of file TRestDetectorReadoutModule.h.

◆ fTolerance

Double_t TRestDetectorReadoutModule::fTolerance
private

Tolerance allowed in overlaps at the pixel boundaries in mm.

Definition at line 58 of file TRestDetectorReadoutModule.h.

◆ showWarnings

Bool_t TRestDetectorReadoutModule::showWarnings
private

Definition at line 61 of file TRestDetectorReadoutModule.h.


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