-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathTRestDetectorReadout.h
More file actions
107 lines (86 loc) · 4.63 KB
/
Copy pathTRestDetectorReadout.h
File metadata and controls
107 lines (86 loc) · 4.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*************************************************************************
* This file is part of the REST software framework. *
* *
* Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
* For more information see http://gifna.unizar.es/trex *
* *
* REST is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* REST is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have a copy of the GNU General Public License along with *
* REST in $REST_PATH/LICENSE. *
* If not, see http://www.gnu.org/licenses/. *
* For the list of contributors see $REST_PATH/CREDITS. *
*************************************************************************/
#ifndef RestCore_TRestDetectorReadout
#define RestCore_TRestDetectorReadout
#include <TObject.h>
#include <TRestMetadata.h>
#include <iostream>
#include "TRestDetectorReadoutPlane.h"
/// A metadata class to generate/store a readout description.
class TRestDetectorReadout : public TRestMetadata {
private:
void InitFromConfigFile() override;
void Initialize() override;
Bool_t fDecoding; ///< Defines if a decoding file was used to set the relation
///< between a physical readout channel id and a signal daq id
Int_t fNReadoutPlanes; ///< Number of readout planes present on the readout
std::vector<TRestDetectorReadoutPlane>
fReadoutPlanes; ///< A std::vector storing the TRestDetectorReadoutPlane definitions.
#ifndef __CINT__
Int_t fMappingNodes; //!///< Number of nodes per axis used on the readout
//! coordinate mapping. See also TRestDetectorReadoutMapping.
std::vector<TRestDetectorReadoutModule> fModuleDefinitions; //!///< A std::vector storing the different
//! TRestDetectorReadoutModule definitions.
#endif
void ValidateReadout();
public:
TRestDetectorReadoutPlane& operator[](int p) { return fReadoutPlanes[p]; }
TRestDetectorReadoutPlane* GetReadoutPlane(int p);
void AddReadoutPlane(TRestDetectorReadoutPlane plane);
/////////////////////////////////////
TRestDetectorReadoutPlane* GetReadoutPlaneWithID(int id);
TRestDetectorReadoutModule* GetReadoutModuleWithID(int id);
TRestDetectorReadoutChannel* GetReadoutChannelWithDaqID(int daqId);
/////////////////////////////////////
Int_t GetNumberOfReadoutPlanes();
Int_t GetNumberOfModules();
Int_t GetNumberOfChannels();
Int_t GetModuleDefinitionId(TString name);
/////////////////////////////////////
TRestDetectorReadoutModule* ParseModuleDefinition(TiXmlElement* moduleDefinition);
void GetPlaneModuleChannel(Int_t daqID, Int_t& planeID, Int_t& moduleID, Int_t& channelID);
Int_t GetHitsDaqChannel(const TVector3& position, Int_t& planeID, Int_t& moduleID, Int_t& channelID);
Int_t GetHitsDaqChannelAtReadoutPlane(const TVector3& position, Int_t& moduleID, Int_t& channelID,
Int_t planeId = 0);
Double_t GetX(Int_t signalID);
Double_t GetY(Int_t signalID);
/////////////////////////////////////
Double_t GetX(Int_t planeID, Int_t modID, Int_t chID);
Double_t GetY(Int_t planeID, Int_t modID, Int_t chID);
// Detail Level:
// 0->this readout
// 1->+all readout plane
// 2->+all readout module
// 3->+all readout channel
// 4->+all readout pixel
inline void PrintMetadata() override { PrintMetadata(1); }
void PrintMetadata(Int_t DetailLevel);
void Draw();
// Constructor
TRestDetectorReadout();
TRestDetectorReadout(const char* configFilename);
TRestDetectorReadout(const char* configFilename, std::string name);
// Destructor
virtual ~TRestDetectorReadout();
ClassDefOverride(TRestDetectorReadout, 1);
};
#endif