23#ifndef RestCore_TRestDetectorReadout
24#define RestCore_TRestDetectorReadout
26#include <TRestMetadata.h>
30#include "TRestDetectorReadoutPlane.h"
39 std::vector<TRestDetectorReadoutPlane>
44 std::vector<TRestDetectorReadoutModule> fModuleDefinitions;
61 Int_t GetNumberOfReadoutPlanes()
const {
return fReadoutPlanes.size(); }
69 void GetPlaneModuleChannel(Int_t daqID, Int_t& planeID, Int_t& moduleID, Int_t& channelID);
70 Int_t GetHitsDaqChannel(
const TVector3& position, Int_t& planeID, Int_t& moduleID, Int_t& channelID);
77 Int_t
GetDaqId(
const TVector3& position,
bool check =
true);
79 std::string GetTypeForChannelDaqId(Int_t daqId);
81 std::set<Int_t> GetAllDaqIds();
83 Double_t
GetX(Int_t signalID);
84 Double_t
GetY(Int_t signalID);
87 Double_t
GetX(Int_t planeID, Int_t modID, Int_t chID);
88 Double_t
GetY(Int_t planeID, Int_t modID, Int_t chID);
101 void Export(
const std::string& fileName);
A metadata class to generate/store a readout description.
std::vector< TRestDetectorReadoutPlane > fReadoutPlanes
A std::vector storing the TRestDetectorReadoutPlane definitions.
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
Int_t GetNumberOfChannels()
Returns the total number of channels implemented in all the readout planes and modules.
~TRestDetectorReadout() override
TRestDetectorReadout default destructor.
void AddReadoutPlane(const TRestDetectorReadoutPlane &plane)
Adds a readout plane to the readout.
TRestDetectorReadoutPlane * GetReadoutPlane(int p)
Returns a pointer to the readout plane by index.
TRestDetectorReadoutPlane * GetReadoutPlaneWithID(int id)
Returns a pointer to the readout plane by ID.
Double_t GetY(Int_t signalID)
It returns the physical Y-coordinate corresponding to a given signal id in plane coordinates.
TRestDetectorReadout()
TRestDetectorReadout default constructor.
void InitFromConfigFile() override
Initializes the readout members using the information given in the TRestDetectorReadout RML section.
void Export(const std::string &fileName)
Export readout to a root file.
TRestDetectorReadoutModule * GetReadoutModuleWithID(int id)
Returns a pointer to the readout module by ID.
Double_t GetX(Int_t signalID)
It returns the physical X-coordinate corresponding to a given signal id in plane coordinates.
Int_t GetNumberOfModules()
Returns the total number of modules implemented in all the readout planes.
std::tuple< Int_t, Int_t, Int_t > GetHitsDaqChannelAtReadoutPlane(const TVector3 &position, Int_t planeId=0)
Returns a tuple with the DaqID, ModuleID, ChannelID.
TRestDetectorReadoutChannel * GetReadoutChannelWithDaqID(int daqId)
Returns a pointer to the readout channel by daq id.
void Initialize() override
Initializes the readout members and defines the section name.
*TRestDetectorReadoutModule definitions *void ValidateReadout() const
This method is not implemented yet. But it could do some checks to help verifying the readout.
void Draw()
Draws the readout on screen. Not yet implemented.
Int_t GetModuleDefinitionId(const TString &name)
Returns the id of the readout module with a given name.
Int_t GetDaqId(const TVector3 &position, bool check=true)
Returns the DaqID of the channel for position. If no channel is found returns -1.