ATLAS Offline Software
Loading...
Searching...
No Matches
RegSelSiLUT.h
Go to the documentation of this file.
1
15
16
17#ifndef REGSELSILUT_H
18#define REGSELSILUT_H
19
20
21#include <stdint.h>
22
23#include <vector>
24#include <set>
25#include <map>
26#include <iostream>
27#include <algorithm>
28
29#include "RegSelLUT/RegSelRoI.h"
34
35
37
38
39
40
41class RegSelSiLUT : public RegSelName, virtual public IRegSelLUT {
42
43public:
44
45 typedef enum { UNDEF, PIXEL, SCT, TRT, FTK, MM, sTGC, RPC } DET;
46
47public:
48
50 RegSelSiLUT(DET id);
52 RegSelSiLUT(const std::string& s);
53
54 virtual ~RegSelSiLUT() override { }
55
56
59 virtual void HashIDList( const IRoiDescriptor& roi, std::vector<IdentifierHash>& idlist ) const override;
60
61 virtual void HashIDList( long layer, const IRoiDescriptor& roi, std::vector<IdentifierHash>& idlist ) const override;
62
64 virtual void ROBIDList( const IRoiDescriptor& roi, std::vector<uint32_t>& roblist ) const override;
65
66 virtual void ROBIDList( long layer, const IRoiDescriptor& roi, std::vector<uint32_t>& roblist ) const override;
67
68
69public:
70
71 void addModule(RegSelModule& module) { m_modules.push_back(module); }
72 void addModules(const std::vector<RegSelModule>& m) { m_modules = m; }
73
74 // Access the lookup table for data taking
75 const std::vector<RegSelModule>& getModules() const { return m_modules; }
76 bool getRoIData(const RegSelRoI& r, std::vector<const RegSelModule*>& modules) const;
77 bool getRoIData(const RegSelRoI& r, unsigned layer, std::vector<const RegSelModule*>& modules) const;
78 bool getRoIData(const RegSelRoI& r, unsigned subdetector, unsigned layer, std::vector<const RegSelModule*>& modules) const;
79
80 bool getRoIData(const RegSelRoI& r, std::vector<const RegSelModule*>& modules, double x, double y) const;
81 bool getRoIData(const RegSelRoI& r, unsigned subdetector, unsigned layer, std::vector<const RegSelModule*>& modules, double x, double y) const;
82
83
84 DET ID() const { return m_ID; }
85
86 // reset (empty) the lookup table, back to
87 // main module vector
88 void reset();
89
90 // initialise (fill) the lookup tables from
91 // the module vector
92 void initialise();
93
94 // and for the disabled modules
96
97 // and for the full scan lists
98 void initialiseFullScan();
99
100 // IO
101 void write(std::ostream& s=std::cout) const;
102 void write(const std::string& filename) const;
103
104 bool read(std::istream& s);
105 bool read(const std::string& s);
106
107 // get the sub detectors
108 const std::vector<RegSelSubDetector>& getSubDet() const { return m_SubDet; }
109
110 // get a module from it's hash id
111 const RegSelModule* Module(const IdentifierHash& h) const;
112
113
119 void getModules( unsigned layer, std::vector<const RegSelModule*>& modules) const;
120
121
122
123 // roi access methods
124
125 // access functions to get the list of hash id's
126 virtual void getHashList(const RegSelRoI& roi, std::vector<IdentifierHash>& hashlist ) const;
127
128 // access functions to get the list of hash id's
129 virtual void getHashList(const RegSelRoI& roi, std::vector<IdentifierHash>& hashlist, double x, double y) const;
130
131 // roi layer methods
132 // get the hash id's for a specified layer - see comment above about the layer format
133 virtual void getHashList(const RegSelRoI& roi, unsigned layer, std::vector<IdentifierHash>& hashlist) const;
134
135 // get the hash id's for the entire detector
136 virtual void getHashList(std::vector<IdentifierHash>& hashlist) const;
137
138 // get the hash id's for a complete layer - see comment above about the layer format
139 virtual void getHashList(unsigned layer, std::vector<IdentifierHash>& hashlist) const;
140 // void getHashList(long int& layer, std::vector<IdentifierHash>& hashlist ) const { return getHashList( unsigned(layer), hashlist ); }
141
142
143
144
145 // get the rob id's for a specified layer - see comment above about the layer format
146 virtual void getRobList(const RegSelRoI& roi, unsigned layer, std::vector<uint32_t>& roblist, bool removeduplicates=true ) const;
147
148 // access functions to get the roblist as wanted by athena
149 virtual void getRobList(const RegSelRoI& roi, std::vector<uint32_t>& roblist, bool removeduplicates=true ) const;
150
151 // with beam line position
152 // access functions to get the roblist as wanted by athena
153 virtual void getRobList(const RegSelRoI& roi, std::vector<uint32_t>& roblist, double x, double y ) const;
154
155 // full scan methods
156 // get the rob list for the entire detector
157 virtual void getRobList(std::vector<uint32_t>& roblist) const;
158
159 // get the rob list for a complete layer - see comment above about the layer format
160 virtual void getRobList(unsigned layer, std::vector<uint32_t>& roblist) const;
161 // void getRobList(long int& layer, std::vector<uint32_t>& roblist) const { return getRobList( unsigned(layer), roblist ); }
162
163
164
165
166 // get the hash id's and robs for the entire detector
167 virtual void getRobHashList(std::vector<uint32_t>& roblist, std::vector<IdentifierHash>& hashlist) const;
168
169 // get the rob list and hash id's for an roi
170 virtual void getRobHashList(const RegSelRoI& roi, std::vector<uint32_t>& roblist, std::vector<IdentifierHash>& hashlist) const;
171
172 // get the rob list and hash id's for an roi - see comment above about the layer format
173 virtual void getRobHashList(const RegSelRoI& roi, unsigned layer, std::vector<uint32_t>& roblist, std::vector<IdentifierHash>& hashlist) const;
174
175
176
177
178
179 // disabled module access
180
181 // get the hash id's of *disabled* modules in a specified layer
182 void getDisabledHashList(const RegSelRoI& roi, unsigned layer, std::vector<IdentifierHash>& hashlist) const;
183
184 // get get a list of layers with disabled modules from the specified sub-detector component
185 void getDisabledLayers(const RegSelRoI& roi, int subdetector, std::vector<int>& layers) const;
186
187
188 // enabling and disabling
189 // enable or disable all the modules in the lookup table
190 void enableRobs();
191 void disableRobs();
192
193 // enable or disable all the modules in the lookup table
196
197 // enable or disable the modules corresponding to the robs in the roblist
198 void enableRobList(const std::vector<uint32_t>& roblist);
199 void disableRobList(const std::vector<uint32_t>& roblist);
200
201 // enable or disable all modules from a list
202 void enableModuleList(const std::vector<IdentifierHash>& hashlist);
203 void disableModuleList(const std::vector<IdentifierHash>& hashlist);
204
205 // enable/disable individual subdetectors
206 void disableSubDetector(int id);
207 void enableSubDetector(int id);
208
209 // enable/disable individual layers
210 void disableLayer(int id, unsigned layer);
211 void enableLayer(int id, unsigned layer);
212
213 // draw the object (??)
214 void drawlayers(std::vector<const ZRObject*>& c) const {
215 for ( unsigned i=0 ; i<m_SubDet.size() ; i++ ) m_SubDet[i].drawlayers(c);
216 }
217
218protected:
219
220 virtual void construct();
221
222protected:
223
224 DET m_ID; // pixel (0), sct (1) or trt (2)
225
226 std::vector<RegSelSubDetector> m_SubDet; // subdetectors
227 std::vector<RegSelModule> m_modules; // actual module store
228
229 std::vector<RegSelModule*> m_disabled; // disabled module list
230
231 std::map<const IdentifierHash, const RegSelModule*> m_map; // hashID lookup table
232
233 // quick look ups for entire detector
234 std::vector<IdentifierHash> m_allHashes; // hashID lookup table
235 std::vector<uint32_t> m_allROBids;
236
237 std::map<int, int> m_idmap; // hashID lookup table
238
239
240protected:
241
245
246 static void cleanup( std::vector<IdentifierHash>& idvec ) {
247 for ( size_t i=idvec.size() ; i-- ; ) idvec[i] = IdentifierHash( ((unsigned)idvec[i]) & 0xfff );
249 }
250
251
253
255
256 virtual void HashIDList_internal( const IRoiDescriptor& roi, std::vector<IdentifierHash>& idlist ) const;
257
258 virtual void HashIDList_internal( long layer, const IRoiDescriptor& roi, std::vector<IdentifierHash>& idlist ) const;
259
261 virtual void ROBIDList_internal( const IRoiDescriptor& roi, std::vector<uint32_t>& roblist ) const;
262
263 virtual void ROBIDList_internal( long layer, const IRoiDescriptor& roi, std::vector<uint32_t>& roblist ) const;
264
265
266};
267
268
269
270#endif /* REGSELSILUT_H */
271
272
273
274
275
276
277
278
279
280
#define y
#define x
Header file for AthHistogramAlgorithm.
static void removeDuplicates(std::vector< T > &vec)
useful for removing duplicates if required ...
Definition IRegSelLUT.h:78
Describes the API of the Region of Ineterest geometry.
This is a "hash" representation of an Identifier.
RegSelName(const std::string &s="")
Definition RegSelName.h:37
void enableRobs()
bool read(std::istream &s)
void write(std::ostream &s=std::cout) const
std::vector< RegSelModule > m_modules
virtual void ROBIDList_internal(const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const
rob methods
void initialiseDisabledModules()
virtual void construct()
std::vector< RegSelSubDetector > m_SubDet
std::map< int, int > m_idmap
void disableModuleList(const std::vector< IdentifierHash > &hashlist)
void drawlayers(std::vector< const ZRObject * > &c) const
void getDisabledLayers(const RegSelRoI &roi, int subdetector, std::vector< int > &layers) const
std::vector< RegSelModule * > m_disabled
std::vector< uint32_t > m_allROBids
std::vector< IdentifierHash > m_allHashes
std::map< const IdentifierHash, const RegSelModule * > m_map
void addModule(RegSelModule &module)
Definition RegSelSiLUT.h:71
void initialiseFullScan()
virtual void getRobList(const RegSelRoI &roi, unsigned layer, std::vector< uint32_t > &roblist, bool removeduplicates=true) const
bool getRoIData(const RegSelRoI &r, std::vector< const RegSelModule * > &modules) const
DET ID() const
Definition RegSelSiLUT.h:84
virtual void HashIDList(const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const override
implementation of the IRegSelUT interface hash id methods
void enableRobList(const std::vector< uint32_t > &roblist)
static void cleanup(std::vector< IdentifierHash > &idvec)
annoying cleanup function specifically for the RPC, but we have to add it here since we have abstract...
virtual void getHashList(const RegSelRoI &roi, std::vector< IdentifierHash > &hashlist) const
void enableModules()
void disableLayer(int id, unsigned layer)
void disableRobList(const std::vector< uint32_t > &roblist)
const std::vector< RegSelModule > & getModules() const
Definition RegSelSiLUT.h:75
virtual void HashIDList_internal(const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const
horrible internal interface methods
void enableModuleList(const std::vector< IdentifierHash > &hashlist)
void disableSubDetector(int id)
const RegSelModule * Module(const IdentifierHash &h) const
void enableLayer(int id, unsigned layer)
virtual void getRobHashList(std::vector< uint32_t > &roblist, std::vector< IdentifierHash > &hashlist) const
virtual void ROBIDList(const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const override
rob methods
void addModules(const std::vector< RegSelModule > &m)
Definition RegSelSiLUT.h:72
void enableSubDetector(int id)
void initialise()
void disableRobs()
virtual ~RegSelSiLUT() override
Definition RegSelSiLUT.h:54
const std::vector< RegSelSubDetector > & getSubDet() const
void disableModules()
void getDisabledHashList(const RegSelRoI &roi, unsigned layer, std::vector< IdentifierHash > &hashlist) const
int r
Definition globals.cxx:22
Definition HitInfo.h:33