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 &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...
 
TRestDetectorReadoutChannelGetChannel (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...
 
TRestDetectorReadoutMappingGetMapping ()
 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...
 
TRestDetectorReadoutChanneloperator[] (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< TRestDetectorReadoutChannelfReadoutChannel
 
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
 

Constructor & Destructor Documentation

◆ TRestDetectorReadoutModule()

TRestDetectorReadoutModule::TRestDetectorReadoutModule ( )

Default TRestDetectorReadoutModule constructor.

Definition at line 60 of file TRestDetectorReadoutModule.cxx.

◆ ~TRestDetectorReadoutModule()

TRestDetectorReadoutModule::~TRestDetectorReadoutModule ( )
virtual

Default TRestDetectorReadoutModule destructor.

Definition at line 65 of file TRestDetectorReadoutModule.cxx.

Member Function Documentation

◆ AddChannel()

void TRestDetectorReadoutModule::AddChannel ( TRestDetectorReadoutChannel channel)

Adds a new channel to the module.

Definition at line 583 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 131 of file TRestDetectorReadoutModule.h.

◆ DisableWarnings()

void TRestDetectorReadoutModule::DisableWarnings ( )
inline

Disables warning output.

Definition at line 184 of file TRestDetectorReadoutModule.h.

◆ DoReadoutMapping()

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.

◆ Draw()

void TRestDetectorReadoutModule::Draw ( )

Not implemented.

Definition at line 618 of file TRestDetectorReadoutModule.cxx.

◆ EnableWarnings()

void TRestDetectorReadoutModule::EnableWarnings ( )
inline

Enables warning output.

Definition at line 181 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 322 of file TRestDetectorReadoutModule.cxx.

◆ GetChannel()

TRestDetectorReadoutChannel * TRestDetectorReadoutModule::GetChannel ( size_t  n)
inline

Returns a pointer to a readout channel by index.

Definition at line 170 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 458 of file TRestDetectorReadoutModule.cxx.

◆ GetMapping()

TRestDetectorReadoutMapping * TRestDetectorReadoutModule::GetMapping ( )
inline

Returns a pointer to the readout mapping.

Definition at line 165 of file TRestDetectorReadoutModule.h.

◆ GetMappingNodes()

Int_t TRestDetectorReadoutModule::GetMappingNodes ( ) const
inline

Definition at line 128 of file TRestDetectorReadoutModule.h.

◆ GetMaxDaqID()

Int_t TRestDetectorReadoutModule::GetMaxDaqID ( ) const
inline

Returns the maximum daq id number.

Definition at line 126 of file TRestDetectorReadoutModule.h.

◆ GetMinDaqID()

Int_t TRestDetectorReadoutModule::GetMinDaqID ( ) const
inline

Returns the minimum daq id number.

Definition at line 123 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 154 of file TRestDetectorReadoutModule.h.

◆ GetModuleID()

Int_t TRestDetectorReadoutModule::GetModuleID ( ) const
inline

Returns the module id.

Definition at line 141 of file TRestDetectorReadoutModule.h.

◆ GetName()

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

Returns the module name.

Definition at line 161 of file TRestDetectorReadoutModule.h.

◆ GetNumberOfChannels()

size_t TRestDetectorReadoutModule::GetNumberOfChannels ( ) const
inline

Returns the total number of channels defined inside the module.

Definition at line 178 of file TRestDetectorReadoutModule.h.

◆ GetOrigin()

TVector2 TRestDetectorReadoutModule::GetOrigin ( ) const
inline

Returns the module origin position.

Definition at line 144 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 505 of file TRestDetectorReadoutModule.cxx.

◆ GetPixelCenter() [2/2]

TVector2 TRestDetectorReadoutModule::GetPixelCenter ( TRestDetectorReadoutPixel pix)

Definition at line 537 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 479 of file TRestDetectorReadoutModule.cxx.

◆ GetPixelOrigin() [2/2]

TVector2 TRestDetectorReadoutModule::GetPixelOrigin ( TRestDetectorReadoutPixel pix)

Definition at line 526 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 520 of file TRestDetectorReadoutModule.cxx.

◆ GetPixelTriangle() [2/2]

Bool_t TRestDetectorReadoutModule::GetPixelTriangle ( TRestDetectorReadoutPixel pix)

Definition at line 544 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 490 of file TRestDetectorReadoutModule.cxx.

◆ GetPixelVertex() [2/2]

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

Definition at line 530 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 158 of file TRestDetectorReadoutModule.h.

◆ GetRotation()

Double_t TRestDetectorReadoutModule::GetRotation ( ) const
inline

Returns the module rotation in degrees.

Definition at line 150 of file TRestDetectorReadoutModule.h.

◆ GetSize()

TVector2 TRestDetectorReadoutModule::GetSize ( ) const
inline

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

Definition at line 147 of file TRestDetectorReadoutModule.h.

◆ GetTolerance()

Double_t TRestDetectorReadoutModule::GetTolerance ( ) const
inline

Gets the tolerance for independent pixel overlaps.

Definition at line 120 of file TRestDetectorReadoutModule.h.

◆ GetType()

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

Definition at line 162 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 555 of file TRestDetectorReadoutModule.cxx.

◆ Initialize()

void TRestDetectorReadoutModule::Initialize ( )
private

TRestDetectorReadoutModule initialization.

Definition at line 70 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 308 of file TRestDetectorReadoutModule.cxx.

◆ IsInside()

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.

◆ IsInsideChannel()

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.

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

◆ operator[]()

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

Definition at line 167 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 623 of file TRestDetectorReadoutModule.cxx.

◆ SetDecodingFile()

void TRestDetectorReadoutModule::SetDecodingFile ( const std::string &  decodingFile)

Set the decoding file in the readout module.

Definition at line 234 of file TRestDetectorReadoutModule.cxx.

◆ SetFirstDaqChannel()

void TRestDetectorReadoutModule::SetFirstDaqChannel ( Int_t  firstDaqChannel)
inline

Sets first DAQ channel.

Definition at line 114 of file TRestDetectorReadoutModule.h.

◆ SetMappingNodes()

void TRestDetectorReadoutModule::SetMappingNodes ( Int_t  nodes)
inline

Sets number of nodes.

Definition at line 117 of file TRestDetectorReadoutModule.h.

◆ SetMinMaxDaqIDs()

void TRestDetectorReadoutModule::SetMinMaxDaqIDs ( )

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

Definition at line 99 of file TRestDetectorReadoutModule.cxx.

◆ SetModuleID()

void TRestDetectorReadoutModule::SetModuleID ( Int_t  modID)
inline

Sets the module by id definition.

Definition at line 93 of file TRestDetectorReadoutModule.h.

◆ SetName()

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

Sets the name of the readout module.

Definition at line 105 of file TRestDetectorReadoutModule.h.

◆ SetOrigin()

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

Sets the module origin by definition using TVector2 input.

Definition at line 99 of file TRestDetectorReadoutModule.h.

◆ SetRotation()

void TRestDetectorReadoutModule::SetRotation ( Double_t  rotation)
inline

Sets the module rotation in degrees.

Definition at line 102 of file TRestDetectorReadoutModule.h.

◆ SetSize()

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

Sets the module size by definition using TVector2 input.

Definition at line 96 of file TRestDetectorReadoutModule.h.

◆ SetTolerance()

void TRestDetectorReadoutModule::SetTolerance ( Double_t  tolerance)
inline

Sets the tolerance for independent pixel overlaps.

Definition at line 111 of file TRestDetectorReadoutModule.h.

◆ SetType()

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

Sets the type of the readout module.

Definition at line 108 of file TRestDetectorReadoutModule.h.

◆ TransformToModuleCoordinates()

TVector2 TRestDetectorReadoutModule::TransformToModuleCoordinates ( const TVector2 &  coords) const
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.

◆ TransformToPlaneCoordinates()

TVector2 TRestDetectorReadoutModule::TransformToPlaneCoordinates ( const TVector2 &  coords) const
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.

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 47 of file TRestDetectorReadoutModule.h.

◆ fDecoding

Bool_t TRestDetectorReadoutModule::fDecoding
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.

◆ fDecodingFile

std::string TRestDetectorReadoutModule::fDecodingFile = ""
private

Decoding file.

Definition at line 64 of file TRestDetectorReadoutModule.h.

◆ fFirstDaqChannel

* default REST_Warning in TRestDetectorReadout will enable it* Int_t TRestDetectorReadoutModule::fFirstDaqChannel = 0
private

First DAQ channel.

Definition at line 62 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 54 of file TRestDetectorReadoutModule.h.

◆ fMappingNodes

Int_t TRestDetectorReadoutModule::fMappingNodes = 0
private

Number of nodes.

Definition at line 66 of file TRestDetectorReadoutModule.h.

◆ fName

std::string TRestDetectorReadoutModule::fName
private

Definition at line 71 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 40 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 51 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 45 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 42 of file TRestDetectorReadoutModule.h.

◆ fTolerance

Double_t TRestDetectorReadoutModule::fTolerance
private

Tolerance allowed in overlaps at the pixel boundaries in mm.

Definition at line 56 of file TRestDetectorReadoutModule.h.

◆ fType

std::string TRestDetectorReadoutModule::fType
private

Definition at line 72 of file TRestDetectorReadoutModule.h.

◆ showWarnings

Bool_t TRestDetectorReadoutModule::showWarnings
private

Definition at line 59 of file TRestDetectorReadoutModule.h.


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