ATLAS Offline Software
RegSelectorMap.h
Go to the documentation of this file.
1 // emacs: this is -*- c++ -*-
2 /*
3  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
4 */
5 
6 #ifndef REGSELECTORMAP_H
7 #define REGSELECTORMAP_H
8 
9 
10 #include "RegSelectorMapElement.h"
11 #include "RegionSelectorLUT.h"
12 
15 
16 #include "GaudiKernel/StatusCode.h"
17 #include <vector>
18 #include <list>
19 #include <set>
20 #include <fstream>
21 #include <iostream>
22 #include <stdio.h>
23 #include <stdint.h>
24 #include <cstdio>
25 
26 
27 
28 class RegSelectorMap : virtual public IRegSelLUT {
29 
30 public:
31 
32 
34 
36 
37  virtual void HashIDList( const IRoiDescriptor& roi, std::vector<IdentifierHash>& idlist ) const override;
38 
39  virtual void HashIDList( long layer, const IRoiDescriptor& roi, std::vector<IdentifierHash>& idlist ) const override;
40 
42 
43  virtual void ROBIDList( const IRoiDescriptor& roi, std::vector<uint32_t>& roblist ) const override;
44 
45  virtual void ROBIDList( long layer, const IRoiDescriptor& roi, std::vector<uint32_t>& roblist ) const override;
46 
47  virtual ~RegSelectorMap() override = default;
48 
49 public:
50 
51  double etaminValue(void) const;
52  double etamaxValue(void) const;
53  double phiminValue(void) const;
54  double phimaxValue(void) const;
55 
56  const std::vector<IdentifierHash>& hashIdOut(void) const;
57  const std::vector<uint32_t>& robIdOut(void) const;
58 
59  const std::vector<int>& barORendOut(void) const;
60  const std::vector<int>& layORdskOut(void) const;
61  const std::vector<double>& etaMinOut(void) const;
62  const std::vector<double>& etaMaxOut(void) const;
63  const std::vector<double>& phiMinOut(void) const;
64  const std::vector<double>& phiMaxOut(void) const;
65 
66  void mountDataStruct(void);
67 
69  double etaminIn, double etamaxIn,
70  double phiminIn, double phimaxIn,
71  std::vector<uint32_t>& outList ) const;
72 
73  void regionSelectorRobIdUint( double etaminIn, double etamaxIn,
74  double phiminIn, double phimaxIn,
75  std::vector<uint32_t>& outList ) const;
76 
77  void regionSelectorRobIdUint( long layNumber,
78  double etaminIn, double etamaxIn,
79  double phiminIn, double phimaxIn,
80  std::vector<uint32_t>& outList ) const;
81 
82  void addLut( const RegionSelectorLUT* detLut );
83  void addLut( const RegionSelectorLUT& detLut ) { addLut(&detLut); }
84 
86  double etaminIn, double etamaxIn,
87  double phiminIn, double phimaxIn,
88  std::vector<IdentifierHash>& outList) const;
89 
90  void regionSelector( TYPEID typeinID,
91  double etaminIn, double etamaxIn,
92  double phiminIn, double phimaxIn,
93  std::vector<IdentifierHash>& outList ) const;
94 
95  void regionSelector( long layNumber,
96  double etaminIn, double etamaxIn,
97  double phiminIn, double phimaxIn,
98  std::vector<IdentifierHash>& outList ) const;
99 
100  StatusCode read(const char *filename, DETID type);
101 
102  void summaryDataFile( std::list<RegSelectorMapElement> &dataList );
103 
104  void verifyInputsInternal( double &etaminIn, double &etamaxIn,
105  double &phiminIn, double &phimaxIn ) const;
106 
107  StatusCode verifyInputs( double &etaminIn, double &etamaxIn,
108  double &phiminIn, double &phimaxIn ) const;
109 
110  StatusCode verifyInputsMinusPi( double &etaminIn, double &etamaxIn,
111  double &phiminIn, double &phimaxIn ) const;
112 
113  void verifyOutput( double etaminIn, double etamaxIn,
114  double phiminIn, double phimaxIn,
115  const std::vector<IdentifierHash>& outputIdlist ) const;
116 
117  void getEtaPhi( IdentifierHash hashId,
118  double *etaMin, double *etaMax,
119  double *phiMin, double *phiMax ) const;
120 
121 private:
122 
123  void findPosition( TYPEID typeinID, bool posORneg, std::list<RegSelectorMapElement>::const_iterator& it ) const;
124 
125  void findPosition( long layNumber, bool posORneg, std::list<RegSelectorMapElement>::const_iterator& it ) const;
126 
127  void findMaxMinValues( std::list<RegSelectorMapElement>& dataList );
128 
129  RegSelectorMapElement creatingElement( int& positionIn, int& numberIn,
130  double& etaminIn, double& etamaxIn,
131  double& phiminIn, double& phimaxIn, IdentifierHash& hashIdIn, uint32_t& robId);
132 
133  void insertList( std::list<RegSelectorMapElement> &dataList,
134  int positionIn, int numberIn,
135  double etaminIn, double etamaxIn,
136  double phiminIn, double phimaxIn,
137  IdentifierHash hashIdIn,
138  uint32_t& robIdIn);
139 
140  void insertDataElement(int& positionIn, int& numberIn, double& etaminIn, double& etamaxIn,
141  double& phiminIn, double& phimaxIn, IdentifierHash& hashIdIn, uint32_t& robIdIn);
142 
143  void writeLine(int barORend, int layORdsk, IdentifierHash hashId, uint32_t robId, double emin, double emax,
144  double pmin, double pmax);
145 
146  StatusCode readTILE(const char *filename);
147 
148 private:
149 
150  std::list<RegSelectorMapElement> m_barreldataList, m_posdataList, m_negdataList;
151 
152  std::vector<int> m_barORend, m_layORdsk;
153 
154  std::vector<IdentifierHash> m_hashId;
155 
156  std::vector<uint32_t> m_robId;
157 
158  std::vector<double> m_etamin, m_etamax;
159 
160  std::vector<double> m_phimin, m_phimax;
161 
163 
165 
166 
167 };
168 
169 #endif
170 
171 
172 
173 
RegSelectorMap::phimaxValue
double phimaxValue(void) const
Definition: RegSelectorMap.cxx:54
RegSelectorMap::read
StatusCode read(const char *filename, DETID type)
Definition: RegSelectorMap.cxx:341
RegSelectorMap::phiminValue
double phiminValue(void) const
Definition: RegSelectorMap.cxx:50
RegSelectorMap
Definition: RegSelectorMap.h:28
RegSelectorMap::writeLine
void writeLine(int barORend, int layORdsk, IdentifierHash hashId, uint32_t robId, double emin, double emax, double pmin, double pmax)
Definition: RegSelectorMap.cxx:739
RegSelectorMap::etaminValue
double etaminValue(void) const
the rest of the class starts here
Definition: RegSelectorMap.cxx:42
RegionSelectorLUT.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
RegSelectorMap::insertList
void insertList(std::list< RegSelectorMapElement > &dataList, int positionIn, int numberIn, double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, IdentifierHash hashIdIn, uint32_t &robIdIn)
Definition: RegSelectorMap.cxx:691
RegSelectorMap::etamaxValue
double etamaxValue(void) const
Definition: RegSelectorMap.cxx:46
RegSelectorMapElement
Definition: RegSelectorMapElement.h:17
RegSelectorMap::hashIdOut
const std::vector< IdentifierHash > & hashIdOut(void) const
Definition: RegSelectorMap.cxx:58
RegSelectorMap::getEtaPhi
void getEtaPhi(IdentifierHash hashId, double *etaMin, double *etaMax, double *phiMin, double *phiMax) const
Definition: RegSelectorMap.cxx:781
RegSelectorMap::m_barORend
std::vector< int > m_barORend
Definition: RegSelectorMap.h:152
skel.it
it
Definition: skel.GENtoEVGEN.py:423
xAOD::etaMax
etaMax
Definition: HIEventShape_v2.cxx:46
RegSelectorMap::m_phimaxDet
double m_phimaxDet
Definition: RegSelectorMap.h:164
RegSelectorMap::m_posdataList
std::list< RegSelectorMapElement > m_posdataList
Definition: RegSelectorMap.h:150
RegSelectorMap::verifyInputsMinusPi
StatusCode verifyInputsMinusPi(double &etaminIn, double &etamaxIn, double &phiminIn, double &phimaxIn) const
Definition: RegSelectorMap.cxx:418
RegSelectorMap::m_layORdsk
std::vector< int > m_layORdsk
Definition: RegSelectorMap.h:152
DETID
DETID
An enum to define subdetector names.
Definition: RegSelEnums.h:23
RegSelectorMap::addLut
void addLut(const RegionSelectorLUT *detLut)
Definition: RegSelectorMap.cxx:180
RegSelectorMap::layORdskOut
const std::vector< int > & layORdskOut(void) const
Definition: RegSelectorMap.cxx:70
RegSelectorMap::etaMinOut
const std::vector< double > & etaMinOut(void) const
Definition: RegSelectorMap.cxx:74
RegSelectorMap::creatingElement
RegSelectorMapElement creatingElement(int &positionIn, int &numberIn, double &etaminIn, double &etamaxIn, double &phiminIn, double &phimaxIn, IdentifierHash &hashIdIn, uint32_t &robId)
Definition: RegSelectorMap.cxx:677
RegSelectorMap::barORendOut
const std::vector< int > & barORendOut(void) const
Definition: RegSelectorMap.cxx:66
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition: IRoiDescriptor.h:23
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
RegSelectorMap::phiMinOut
const std::vector< double > & phiMinOut(void) const
Definition: RegSelectorMap.cxx:82
IRegSelLUT.h
IRegSelLUT
Definition: IRegSelLUT.h:25
RegSelectorMap::~RegSelectorMap
virtual ~RegSelectorMap() override=default
RegSelectorMap::ROBIDList
virtual void ROBIDList(const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const override
Rob identifier methods.
Definition: RegSelectorMap.cxx:29
TYPEID
TYPEID
An enum to define Muon chambers names.
Definition: RegSelEnums.h:9
TYPE
#define TYPE(CODE, TYP, IOTYP)
RegSelectorMap::regionSelector
void regionSelector(DETID TYPE, double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< IdentifierHash > &outList) const
Definition: RegSelectorMap.cxx:197
RegSelectorMap::m_etamin
std::vector< double > m_etamin
Definition: RegSelectorMap.h:158
RegSelectorMap::m_etamaxDet
double m_etamaxDet
Definition: RegSelectorMap.h:162
RegSelectorMap::verifyInputsInternal
void verifyInputsInternal(double &etaminIn, double &etamaxIn, double &phiminIn, double &phimaxIn) const
Definition: RegSelectorMap.cxx:387
RegSelectorMap::phiMaxOut
const std::vector< double > & phiMaxOut(void) const
Definition: RegSelectorMap.cxx:86
RegSelectorMap::insertDataElement
void insertDataElement(int &positionIn, int &numberIn, double &etaminIn, double &etamaxIn, double &phiminIn, double &phimaxIn, IdentifierHash &hashIdIn, uint32_t &robIdIn)
Definition: RegSelectorMap.cxx:723
RegSelectorMap::m_etaminDet
double m_etaminDet
Definition: RegSelectorMap.h:162
RegSelectorMap::m_barreldataList
std::list< RegSelectorMapElement > m_barreldataList
Definition: RegSelectorMap.h:150
RegSelectorMapElement.h
RegSelectorMap::m_etamax
std::vector< double > m_etamax
Definition: RegSelectorMap.h:158
RegSelectorMap::m_phimin
std::vector< double > m_phimin
Definition: RegSelectorMap.h:160
RegSelectorMap::m_phiminDet
double m_phiminDet
Definition: RegSelectorMap.h:164
LArCellBinning.etaMin
etaMin
Definition: LArCellBinning.py:84
RegSelectorMap::etaMaxOut
const std::vector< double > & etaMaxOut(void) const
Definition: RegSelectorMap.cxx:78
RegSelectorMap::verifyOutput
void verifyOutput(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, const std::vector< IdentifierHash > &outputIdlist) const
Definition: RegSelectorMap.cxx:444
RegSelectorMap::findPosition
void findPosition(TYPEID typeinID, bool posORneg, std::list< RegSelectorMapElement >::const_iterator &it) const
Definition: RegSelectorMap.cxx:604
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
zebraShift.outList
list outList
Definition: zebraShift.py:103
RegSelectorMap::m_robId
std::vector< uint32_t > m_robId
Definition: RegSelectorMap.h:156
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
RegSelectorMap::HashIDList
virtual void HashIDList(const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const override
implementation of the IRegSelUT interface - intentionally inlined
Definition: RegSelectorMap.cxx:17
RegSelectorMap::findMaxMinValues
void findMaxMinValues(std::list< RegSelectorMapElement > &dataList)
Definition: RegSelectorMap.cxx:660
RegSelectorMap::addLut
void addLut(const RegionSelectorLUT &detLut)
Definition: RegSelectorMap.h:83
RegSelectorMap::m_negdataList
std::list< RegSelectorMapElement > m_negdataList
Definition: RegSelectorMap.h:150
RegSelectorMap::summaryDataFile
void summaryDataFile(std::list< RegSelectorMapElement > &dataList)
Definition: RegSelectorMap.cxx:369
RegSelectorMap::robIdOut
const std::vector< uint32_t > & robIdOut(void) const
Definition: RegSelectorMap.cxx:62
IdentifierHash
Definition: IdentifierHash.h:38
RegSelectorMap::readTILE
StatusCode readTILE(const char *filename)
Definition: RegSelectorMap.cxx:753
RegSelectorMap::regionSelectorRobIdUint
void regionSelectorRobIdUint(DETID TYPE, double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< uint32_t > &outList) const
Definition: RegSelectorMap.cxx:116
RegSelEnums.h
RegionSelectorLUT
Definition: RegionSelectorLUT.h:14
RegSelectorMap::m_hashId
std::vector< IdentifierHash > m_hashId
Definition: RegSelectorMap.h:154
RegSelectorMap::m_phimax
std::vector< double > m_phimax
Definition: RegSelectorMap.h:160
RegSelectorMap::verifyInputs
StatusCode verifyInputs(double &etaminIn, double &etamaxIn, double &phiminIn, double &phimaxIn) const
Definition: RegSelectorMap.cxx:410
RegSelectorMap::mountDataStruct
void mountDataStruct(void)
Definition: RegSelectorMap.cxx:90