@@ -36,7 +36,6 @@ class TRestDetectorReadout : public TRestMetadata {
3636
3737 void Initialize () override ;
3838
39- Int_t fNReadoutPlanes ; // /< Number of readout planes present on the readout
4039 std::vector<TRestDetectorReadoutPlane>
4140 fReadoutPlanes ; // /< A std::vector storing the TRestDetectorReadoutPlane definitions.
4241
@@ -45,32 +44,42 @@ class TRestDetectorReadout : public TRestMetadata {
4544 std::vector<TRestDetectorReadoutModule> fModuleDefinitions ; // !///< A std::vector storing the different
4645 // ! TRestDetectorReadoutModule definitions.
4746
48- void ValidateReadout ();
47+ void ValidateReadout () const ;
4948
5049 public:
5150 TRestDetectorReadoutPlane& operator [](int p) { return fReadoutPlanes [p]; }
5251
5352 TRestDetectorReadoutPlane* GetReadoutPlane (int p);
54- void AddReadoutPlane (TRestDetectorReadoutPlane plane);
53+ void AddReadoutPlane (const TRestDetectorReadoutPlane& plane);
5554
5655 // ///////////////////////////////////
5756 TRestDetectorReadoutPlane* GetReadoutPlaneWithID (int id);
5857 TRestDetectorReadoutModule* GetReadoutModuleWithID (int id);
5958 TRestDetectorReadoutChannel* GetReadoutChannelWithDaqID (int daqId);
6059 // ///////////////////////////////////
6160
62- Int_t GetNumberOfReadoutPlanes ();
61+ Int_t GetNumberOfReadoutPlanes () const { return fReadoutPlanes . size (); }
6362 Int_t GetNumberOfModules ();
6463 Int_t GetNumberOfChannels ();
6564
66- Int_t GetModuleDefinitionId (TString name);
65+ Int_t GetModuleDefinitionId (const TString& name);
6766
6867 // ///////////////////////////////////
6968 TRestDetectorReadoutModule* ParseModuleDefinition (TiXmlElement* moduleDefinition);
7069 void GetPlaneModuleChannel (Int_t daqID, Int_t& planeID, Int_t& moduleID, Int_t& channelID);
7170 Int_t GetHitsDaqChannel (const TVector3& position, Int_t& planeID, Int_t& moduleID, Int_t& channelID);
72- Int_t GetHitsDaqChannelAtReadoutPlane (const TVector3& hitPosition, Int_t& moduleID, Int_t& channelID,
73- Int_t planeId = 0 );
71+
72+ // / Returns a tuple with the DaqID, ModuleID, ChannelID
73+ std::tuple<Int_t, Int_t, Int_t> GetHitsDaqChannelAtReadoutPlane (const TVector3& position,
74+ Int_t planeId = 0 );
75+
76+ // / \brief Returns the DaqID of the channel for position. If no channel is found returns -1
77+ Int_t GetDaqId (const TVector3& position, bool check = true );
78+
79+ std::string GetTypeForChannelDaqId (Int_t daqId);
80+
81+ std::set<Int_t> GetAllDaqIds ();
82+
7483 Double_t GetX (Int_t signalID);
7584 Double_t GetY (Int_t signalID);
7685 // ///////////////////////////////////
@@ -94,10 +103,10 @@ class TRestDetectorReadout : public TRestMetadata {
94103 // Constructor
95104 TRestDetectorReadout ();
96105 explicit TRestDetectorReadout (const char * configFilename);
97- TRestDetectorReadout (const char * configFilename, std::string name);
106+ TRestDetectorReadout (const char * configFilename, const std::string& name);
98107 // Destructor
99108 ~TRestDetectorReadout () override ;
100109
101- ClassDefOverride (TRestDetectorReadout, 2 );
110+ ClassDefOverride (TRestDetectorReadout, 3 );
102111};
103112#endif
0 commit comments