23#ifndef RestCore_TRestDetectorReadoutModule
24#define RestCore_TRestDetectorReadoutModule
31#include "TRestDetectorReadoutChannel.h"
32#include "TRestDetectorReadoutMapping.h"
50 std::vector<TRestDetectorReadoutChannel>
105 inline void SetName(
const std::string& name) { fName = name; }
108 inline void SetType(
const std::string& type) { fType = type; }
128 inline Int_t GetMappingNodes()
const {
return fMappingNodes; }
161 inline std::string
GetName()
const {
return fName; }
162 inline std::string GetType()
const {
return fType; }
194 Bool_t
IsInside(
const TVector2& position)
const;
198 Bool_t
IsInsidePixel(Int_t channel, Int_t pixel,
const TVector2& position);
205 TVector2
GetPixelVertex(Int_t channel, Int_t pixel, Int_t vertex);
222 void Print(Int_t DetailLevel = 0);
Int_t GetDaqID() const
Returns the corresponding daq channel id.
TRestDetectorReadoutModule()
Default TRestDetectorReadoutModule constructor.
std::vector< TRestDetectorReadoutChannel > fReadoutChannel
void DisableWarnings()
Disables warning output.
void SetSize(const TVector2 &size)
Sets the module size by definition using TVector2 input.
void AddChannel(TRestDetectorReadoutChannel &channel)
Adds a new channel to the module.
void SetType(const std::string &type)
Sets the type of the readout module.
TVector2 TransformToPlaneCoordinates(const TVector2 &coords) const
Int_t GetModuleID() const
Returns the module id.
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 gi...
void SetMappingNodes(Int_t nodes)
Sets number of nodes.
TVector2 GetPixelCenter(Int_t channel, Int_t pixel)
Returns the center pixel position for a given channel and pixel indexes.
Int_t GetMinDaqID() const
Returns the minimum daq id number.
void Initialize()
TRestDetectorReadoutModule initialization.
*default REST_Warning in TRestDetectorReadout will enable it *Int_t fFirstDaqChannel
First DAQ channel.
Double_t GetTolerance() const
Gets the tolerance for independent pixel overlaps.
TVector2 GetSize() const
Returns the module size (x, y) in mm.
void DoReadoutMapping()
Starts the readout mapping initialization. This process is computationally expensive but it greatly o...
TVector2 fOrigin
The module (x, y) position relative to the readout plane position.
std::string fDecodingFile
Decoding file.
TVector2 GetModuleCoordinates(const TVector2 &p) const
void SetDecodingFile(const std::string &decodingFile)
Set the decoding file in the readout module.
TRestDetectorReadoutChannel * GetChannel(size_t n)
Returns a pointer to a readout channel by index.
TVector2 GetPixelOrigin(Int_t channel, Int_t pixel)
Returns the pixel origin (left-bottom) position for a given channel and pixel indexes.
TVector2 fSize
The module (x, y) size. All pixels should be contained within this size.
void SetModuleID(Int_t modID)
Sets the module by id definition.
TVector2 TransformToModuleCoordinates(const TVector2 &coords) const
Bool_t GetPixelTriangle(Int_t channel, Int_t pixel)
Returns the pixel type for a given channel and pixel indexes.
void SetFirstDaqChannel(Int_t firstDaqChannel)
Sets first DAQ channel.
Bool_t IsInside(const TVector2 &position) const
Determines if the position x,y relative to the readout plane are inside this readout module.
Int_t FindChannel(const TVector2 &position)
Returns the channel index corresponding to the absolute coordinates (absX, absY), but relative to the...
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 gi...
TVector2 GetOrigin() const
Returns the module origin position.
std::string GetName() const
Returns the module name.
Double_t GetRotation() const
Returns the module rotation in degrees.
void EnableWarnings()
Enables warning output.
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.
TVector2 GetPlaneCoordinates(const TVector2 &p)
TRestDetectorReadoutMapping * GetMapping()
Returns a pointer to the readout mapping.
TVector2 GetVertex(int n) const
Returns the coordinates of the specified vertex index n. The physical coordinates relative to the rea...
Bool_t IsDaqIDInside(Int_t daqID)
Determines if a given daqID number is in the range of the module.
void SetTolerance(Double_t tolerance)
Sets the tolerance for independent pixel overlaps.
void SetRotation(Double_t rotation)
Sets the module rotation in degrees.
Double_t fRotation
The rotation of the module around the module origin (fModuleOriginX, fModuleOriginY) in radians.
Int_t fMappingNodes
Number of nodes.
Int_t GetMaxDaqID() const
Returns the maximum daq id number.
TRestDetectorReadoutMapping fMapping
The readout module uniform grid mapping.
void SetMinMaxDaqIDs()
Initializes the max and min values for the daq channel number.
Int_t fId
The module id given by the readout definition.
void SetName(const std::string &name)
Sets the name of the readout module.
virtual ~TRestDetectorReadoutModule()
Default TRestDetectorReadoutModule destructor.
void Draw()
Not implemented.
void Print(Int_t DetailLevel=0)
Prints the module details and channels if fullDetail is enabled.
void SetOrigin(const TVector2 &origin)
Sets the module origin by definition using TVector2 input.
size_t GetNumberOfChannels() const
Returns the total number of channels defined inside the module.
std::pair< Int_t, Int_t > fDaqIdRange
The minimum and maximum daq channel ids associated to the module.
Int_t DaqToReadoutChannel(Int_t daqChannel)
Returns the physical readout channel index for a given daq id channel number.
TVector2 GetDistanceToModule(const TVector2 &position)
Creates a TVector2 with shortest norm going from the given position pos to the module....
A class to store the readout pixel definition used in TRestDetectorReadoutChannel.