ATLAS Offline Software
RegSelectorHashMap.h
Go to the documentation of this file.
1 // emacs: this is -*- c++ -*-
2 /*
3  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
4 */
5 
6 #ifndef REGSELECTORHASHMAP_H
7 #define REGSELECTORHASHMAP_H
8 
9 // Includes --------------------------------------------------------------
10 #include "RegSelectorMapElement.h"
11 #include "RegionSelectorLUT.h"
13 #include "GaudiKernel/StatusCode.h"
14 
16 
17 #include <vector>
18 #include <list>
19 #include <set>
20 #include <cstdint>
21 
22 class RegionSelectorLUT;
23 
24 #define INITHASH 30000 // nonexistent hashID number (init value)
25 
26 struct equalsUint{
27  bool operator() (uint32_t i, uint32_t j) const{
28  return i==j;
29  }
30 };
31 
32 struct equals{
33  bool operator() (int i, int j) const{
34  return i==j;
35  }
36 };
37 
38 
39 // Class RegSelectorHashMap ----------------------------------------------------
40 class RegSelectorHashMap : virtual public IRegSelLUT {
41 
42 public:
43 
45 
47 
48  virtual void HashIDList( const IRoiDescriptor& roi, std::vector<IdentifierHash>& idlist ) const override;
49 
50  virtual void HashIDList( long layer, const IRoiDescriptor& roi, std::vector<IdentifierHash>& idlist ) const override;
51 
53 
54  virtual void ROBIDList( const IRoiDescriptor& roi, std::vector<uint32_t>& roblist ) const override;
55 
56  virtual void ROBIDList( long layer, const IRoiDescriptor& roi, std::vector<uint32_t>& roblist ) const override;
57 
58  virtual ~RegSelectorHashMap() override = default;
59 public:
60 
61  double etaminValue() const ;
62  double etamaxValue() const ;
63  double phiminValue() const ;
64  double phimaxValue() const ;
65 
66  const std::vector<double>& etaMinOut(void) const ;
67  const std::vector<double>& etaMaxOut(void) const ;
68  const std::vector<double>& phiMinOut(void) const ;
69  const std::vector<double>& phiMaxOut(void) const ;
70 
71  void mountDataStruct(void);
72 
73  const std::vector<IdentifierHash>& hashIdOut(void) const ;
74  const std::vector<std::vector<uint32_t> >& robIdOut(void) const ;
75  const std::vector<int>& sampleOut(void) const ;
76  const std::vector<int>& layerOut(void) const ;
77 
78  void regionSelectorRobIdUint(double etaminIn, double etamaxIn,
79  double phiminIn, double phimaxIn,
80  std::vector<uint32_t>& outRobIDList) const;
81 
82  void regionSelectorRobIdUint(int sampling,
83  double etaminIn, double etamaxIn,
84  double phiminIn, double phimaxIn,
85  std::vector<uint32_t>& outRobIDList) const;
86 
87  void regionSelector(double etaminIn, double etamaxIn,
88  double phiminIn, double phimaxIn,
89  std::vector<IdentifierHash> & outList) const;
90 
91  void regionSelector(int sampling,
92  double etaminIn, double etamaxIn,
93  double phiminIn, double phimaxIn,
94  std::vector<IdentifierHash> & outList) const;
95 
96  void initvar(void);
97  StatusCode read(const char *filename);
98  void addLut(const RegionSelectorLUT *detLut);
99  void summaryDataFile(std::list<RegSelectorMapElement> &dataList);
100  void verifyInputs(double &etaminIn, double &etamaxIn,double &phiminIn, double &phimaxIn) const;
101 
102  void verifyROBIDOutput(double etaminIn, double etamaxIn,
103  double phiminIn, double phimaxIn,
104  std::vector<uint32_t>& outputIdlist) const ;
105 
106  void verifyROBIDOutput(int sampling,
107  double etaminIn, double etamaxIn,
108  double phiminIn, double phimaxIn,
109  std::vector<uint32_t>& outputIdlist) const;
110 
111  void verifyOutput(double etaminIn, double etamaxIn,
112  double phiminIn, double phimaxIn,
113  std::vector<IdentifierHash>* outputIdlist) const;
114 
115  void verifyOutput(int sampling, double etaminIn, double etamaxIn,
116  double phiminIn, double phimaxIn,
117  std::vector<IdentifierHash>* outputIdlist) const;
118 
119  void getEtaPhi(IdentifierHash hashId,
120  double *etaMin, double *etaMax,
121  double *phiMin, double *phiMax) const;
122 
123  void DisableMissingROBs(const std::vector<uint32_t>& vec);
124 
125 
126  private:
127 
129 
130  std::list<RegSelectorMapElement> m_dataList;
131  std::vector<int> m_sample, m_layer;
132  std::vector<IdentifierHash> m_hashId;
133  std::vector<double> m_etamin, m_etamax;
134  std::vector<double> m_phimin, m_phimax;
135  std::vector<std::vector<uint32_t> > m_robId;
141  std::vector<std::vector<uint32_t> > m_robIDMap;
142  std::vector<IdentifierHash> m_hashIDMap;
143 
144  void populateMatrix(int iPage,IdentifierHash value);
145  void populateMatrixRobId(int iPage, uint32_t value);
146  void initMatrix(void);
147  void writeLine(const int& layer, const IdentifierHash& hashId, const std::vector<uint32_t>& robId, const double& emin,
148  const double& emax, const double& pmin, const double& pmax, const int& samp);
149  int MyRound(double pdValue);
150  void regionSelectorIN(const int& sampling, const double& etaminIn,
151  const double& etamaxIn, const double& phiminIn, const double& phimaxIn,
152  std::vector<IdentifierHash>* outListIH ) const;
153 
154  void regionSelectorINROB(const int& sampling, const double& etaminIn,
155  const double& etamaxIn, const double& phiminIn, const double& phimaxIn,
156  std::vector<uint32_t>* outList) const;
157 
158  void phiCondition(const std::vector<IdentifierHash>& identifier, int i,
159  double etaminIn, double etamaxIn,
160  double phiminIn, double phimaxIn,
161  double etamin, double etamax,
162  std::set<IdentifierHash>* outset) const;
163 
164  void phiConditionRobId(const std::vector<std::vector<uint32_t> >& identifier, int i,
165  double etaminIn, double etamaxIn,
166  double phiminIn, double phimaxIn,
167  double etamin, double etamax,
168  std::set<uint32_t>* outset) const;
169 
170  //LRSIdentHash
171  void findIdentifier(std::vector<IdentifierHash> &auxsetIH,
172  const int iXBeg, const int iXEnd,
173  const int iYBeg, const int iYEnd,
174  const int iPage) const;
175 
176  //LRSUint
177  void findIdentifierROB(std::vector<uint32_t> &auxset,
178  const int iXBeg, const int iXEnd,
179  const int iYBeg, const int iYEnd,
180  const int iPage) const;
181 
182 };
183 #endif
184 
185 
186 
187 
RegSelectorHashMap::sampleOut
const std::vector< int > & sampleOut(void) const
Definition: RegSelectorHashMap.cxx:71
RegSelectorHashMap::m_hashId
std::vector< IdentifierHash > m_hashId
Definition: RegSelectorHashMap.h:132
RegSelectorHashMap::verifyROBIDOutput
void verifyROBIDOutput(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< uint32_t > &outputIdlist) const
Definition: RegSelectorHashMap.cxx:696
RegSelectorHashMap::m_iColumns
int m_iColumns
Definition: RegSelectorHashMap.h:139
RegSelectorHashMap::m_phiminDet
double m_phiminDet
Definition: RegSelectorHashMap.h:137
RegSelectorHashMap::populateMatrix
void populateMatrix(int iPage, IdentifierHash value)
Definition: RegSelectorHashMap.cxx:204
RegionSelectorLUT.h
RegSelectorHashMap::findIdentifierROB
void findIdentifierROB(std::vector< uint32_t > &auxset, const int iXBeg, const int iXEnd, const int iYBeg, const int iYEnd, const int iPage) const
Definition: RegSelectorHashMap.cxx:970
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
RegSelectorHashMap::populateMatrixRobId
void populateMatrixRobId(int iPage, uint32_t value)
Definition: RegSelectorHashMap.cxx:228
RegSelectorHashMap
Definition: RegSelectorHashMap.h:40
RegSelectorHashMap::layerOut
const std::vector< int > & layerOut(void) const
Definition: RegSelectorHashMap.cxx:75
RegSelectorHashMap::m_phimaxDet
double m_phimaxDet
Definition: RegSelectorHashMap.h:137
RegSelectorHashMap::etamaxValue
double etamaxValue() const
Definition: RegSelectorHashMap.cxx:51
RegSelectorHashMap::m_robId
std::vector< std::vector< uint32_t > > m_robId
Definition: RegSelectorHashMap.h:135
RegSelectorHashMap::addLut
void addLut(const RegionSelectorLUT *detLut)
Definition: RegSelectorHashMap.cxx:588
RegSelectorHashMap::regionSelectorIN
void regionSelectorIN(const int &sampling, const double &etaminIn, const double &etamaxIn, const double &phiminIn, const double &phimaxIn, std::vector< IdentifierHash > *outListIH) const
Definition: RegSelectorHashMap.cxx:282
RegSelectorHashMap::etaMaxOut
const std::vector< double > & etaMaxOut(void) const
Definition: RegSelectorHashMap.cxx:83
xAOD::etaMax
etaMax
Definition: HIEventShape_v2.cxx:46
athena.value
value
Definition: athena.py:124
RegSelectorHashMap::ROBIDList
virtual void ROBIDList(const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const override
rob methods
Definition: RegSelectorHashMap.cxx:33
RegSelectorHashMap::findIdentifier
void findIdentifier(std::vector< IdentifierHash > &auxsetIH, const int iXBeg, const int iXEnd, const int iYBeg, const int iYEnd, const int iPage) const
Definition: RegSelectorHashMap.cxx:948
RegSelectorHashMap::m_robIDMap
std::vector< std::vector< uint32_t > > m_robIDMap
Definition: RegSelectorHashMap.h:141
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
RegSelectorHashMap::hashIdOut
const std::vector< IdentifierHash > & hashIdOut(void) const
Definition: RegSelectorHashMap.cxx:63
RegSelectorHashMap::m_etamax
std::vector< double > m_etamax
Definition: RegSelectorHashMap.h:133
xAOD::identifier
identifier
Definition: UncalibratedMeasurement_v1.cxx:15
RegSelectorHashMap::getEtaPhi
void getEtaPhi(IdentifierHash hashId, double *etaMin, double *etaMax, double *phiMin, double *phiMax) const
Definition: RegSelectorHashMap.cxx:996
equalsUint::operator()
bool operator()(uint32_t i, uint32_t j) const
Definition: RegSelectorHashMap.h:27
RegSelectorHashMap::m_etaminDet
double m_etaminDet
Definition: RegSelectorHashMap.h:136
RegSelectorHashMap::m_iLines
int m_iLines
Definition: RegSelectorHashMap.h:139
RegSelectorHashMap::initvar
void initvar(void)
Definition: RegSelectorHashMap.cxx:523
RegSelectorHashMap::m_stepMinPhi
double m_stepMinPhi
Definition: RegSelectorHashMap.h:128
equals::operator()
bool operator()(int i, int j) const
Definition: RegSelectorHashMap.h:33
RegSelectorHashMap::m_dataList
std::list< RegSelectorMapElement > m_dataList
Definition: RegSelectorHashMap.h:130
RegSelectorHashMap::m_phimax
std::vector< double > m_phimax
Definition: RegSelectorHashMap.h:134
RegSelectorHashMap::phimaxValue
double phimaxValue() const
Definition: RegSelectorHashMap.cxx:59
RegSelectorHashMap::HashIDList
virtual void HashIDList(const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const override
implementation of the IRegSelUT interface
Definition: RegSelectorHashMap.cxx:21
RegSelectorHashMap::phiMinOut
const std::vector< double > & phiMinOut(void) const
Definition: RegSelectorHashMap.cxx:87
RegSelectorHashMap::regionSelectorINROB
void regionSelectorINROB(const int &sampling, const double &etaminIn, const double &etamaxIn, const double &phiminIn, const double &phimaxIn, std::vector< uint32_t > *outList) const
Definition: RegSelectorHashMap.cxx:359
RegSelectorHashMap::etaminValue
double etaminValue() const
rest of the class implementation
Definition: RegSelectorHashMap.cxx:47
RegSelectorHashMap::etaMinOut
const std::vector< double > & etaMinOut(void) const
Definition: RegSelectorHashMap.cxx:79
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
RegSelectorHashMap::m_etamaxDet
double m_etamaxDet
Definition: RegSelectorHashMap.h:136
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition: IRoiDescriptor.h:23
RegSelectorHashMap::m_stepMinEta
double m_stepMinEta
Definition: RegSelectorHashMap.h:128
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
RegSelectorHashMap::m_sample
std::vector< int > m_sample
Definition: RegSelectorHashMap.h:131
RegSelectorHashMap::writeLine
void writeLine(const int &layer, const IdentifierHash &hashId, const std::vector< uint32_t > &robId, const double &emin, const double &emax, const double &pmin, const double &pmax, const int &samp)
Definition: RegSelectorHashMap.cxx:252
RegSelectorHashMap::verifyInputs
void verifyInputs(double &etaminIn, double &etamaxIn, double &phiminIn, double &phimaxIn) const
Definition: RegSelectorHashMap.cxx:667
equalsUint
Definition: RegSelectorHashMap.h:26
RegSelectorHashMap::DisableMissingROBs
void DisableMissingROBs(const std::vector< uint32_t > &vec)
Definition: RegSelectorHashMap.cxx:1006
RegSelectorHashMap::m_etamin
std::vector< double > m_etamin
Definition: RegSelectorHashMap.h:133
RegSelectorHashMap::m_readFromFile
bool m_readFromFile
Definition: RegSelectorHashMap.h:140
RegSelectorHashMap::m_phimin
std::vector< double > m_phimin
Definition: RegSelectorHashMap.h:134
IRegSelLUT.h
RegSelectorHashMap::m_layer
std::vector< int > m_layer
Definition: RegSelectorHashMap.h:131
IRegSelLUT
Definition: IRegSelLUT.h:25
RegSelectorHashMap::phiminValue
double phiminValue() const
Definition: RegSelectorHashMap.cxx:55
RegSelectorHashMap::phiCondition
void phiCondition(const std::vector< IdentifierHash > &identifier, int i, double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, double etamin, double etamax, std::set< IdentifierHash > *outset) const
Definition: RegSelectorHashMap.cxx:439
RegSelectorHashMap::regionSelectorRobIdUint
void regionSelectorRobIdUint(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< uint32_t > &outRobIDList) const
Definition: RegSelectorHashMap.cxx:192
equals
Definition: RegSelectorHashMap.h:32
RegSelectorHashMap::verifyOutput
void verifyOutput(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< IdentifierHash > *outputIdlist) const
Definition: RegSelectorHashMap.cxx:827
RegSelectorHashMap::robIdOut
const std::vector< std::vector< uint32_t > > & robIdOut(void) const
Definition: RegSelectorHashMap.cxx:67
RegSelectorHashMap::phiMaxOut
const std::vector< double > & phiMaxOut(void) const
Definition: RegSelectorHashMap.cxx:91
RegSelectorHashMap::mountDataStruct
void mountDataStruct(void)
Definition: RegSelectorHashMap.cxx:95
RegSelectorMapElement.h
LArCellBinning.etaMin
etaMin
Definition: LArCellBinning.py:84
RegSelectorHashMap::read
StatusCode read(const char *filename)
Definition: RegSelectorHashMap.cxx:531
RegSelectorHashMap::initMatrix
void initMatrix(void)
Definition: RegSelectorHashMap.cxx:240
zebraShift.outList
list outList
Definition: zebraShift.py:103
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
RegSelectorHashMap::regionSelector
void regionSelector(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< IdentifierHash > &outList) const
Definition: RegSelectorHashMap.cxx:507
RegSelectorHashMap::phiConditionRobId
void phiConditionRobId(const std::vector< std::vector< uint32_t > > &identifier, int i, double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, double etamin, double etamax, std::set< uint32_t > *outset) const
Definition: RegSelectorHashMap.cxx:473
RegSelectorHashMap::m_NumSamples
int m_NumSamples
Definition: RegSelectorHashMap.h:138
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
RegSelectorHashMap::MyRound
int MyRound(double pdValue)
Definition: RegSelectorHashMap.cxx:268
RegSelEnums.h
RegionSelectorLUT
Definition: RegionSelectorLUT.h:14
RegSelectorHashMap::~RegSelectorHashMap
virtual ~RegSelectorHashMap() override=default
RegSelectorHashMap::summaryDataFile
void summaryDataFile(std::list< RegSelectorMapElement > &dataList)
Definition: RegSelectorHashMap.cxx:652
RegSelectorHashMap::m_hashIDMap
std::vector< IdentifierHash > m_hashIDMap
Definition: RegSelectorHashMap.h:142