ATLAS Offline Software
LArEM_region.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LAREM_REGION_H
6 #define LAREM_REGION_H
7 
8 
9 #include <vector>
10 
11  enum { NOT_VALID_REGION = 63 };
12 
20 {
21 public:
22 
23  LArEM_region();
24 
25  LArEM_region(unsigned int& minHash, short int& nbEtaBins, short int& nPhi,
26  float minEta, float granulEta, float minPhi, float granulPhi, bool fullSym, bool isBarrelMiddle,
27  short int& prevEtaReg, short int& nextEtaReg,
28  std::vector<short int>& prevSampReg, std::vector<short int>& nextSampReg,
29  std::vector<short int>& prevSubdetReg, std::vector<short int>& nextSubdetReg);
30 
32 
34  short int numberOfEta() const { return m_nbEtaBins ; }
35 
37  short int phiN() const { return m_nPhi ; }
38 
40  float etaGranularity() const { return m_granulEta ; }
41 
43  float phiGranularity() const { return m_granulPhi ; }
44 
46  bool fullTwoPi() const { return m_fullSym ; }
47 
49  bool isFirstBarrelRegion() const { return m_isFirstBarrelRegion ; }
50 
52  float etaMin() const { return m_minEta ; }
53 
55  float etaMax() const { return (m_minEta + m_nbEtaBins*m_granulEta) ; }
56 
58  float phiMin() const { return m_minPhi ; }
59 
61  float phiMax() const { return (m_minPhi + m_nPhi*m_granulPhi) ; }
62 
64  unsigned int hashMin() const { return m_hashMin ; }
65 
67  unsigned int hashMax() const { return (m_hashMin + m_nbEtaBins * m_nPhi) ; }
68 
70  short int prevEtaRegion() const { return m_prevEtaReg; }
71 
73  short int nextEtaRegion() const { return m_nextEtaReg; }
74 
76  bool isEtaMin(unsigned int index) const {
77  return ((m_hashMin<=index) && (index<(m_hashMin+m_nPhi)));
78  }
79 
81  bool isEtaMax(unsigned int index) const {
82  return ((hashMax()-m_nPhi)<=index) && (index<hashMax());
83  }
84 
86  bool isPhiMin(unsigned int index) const {
87  return !m_fullSym && (index-m_hashMin)%m_nPhi == 0;
88  }
89 
91  bool isPhiMax(unsigned int index) const {
92  return !m_fullSym && (index-m_hashMin+1)%m_nPhi == 0;
93  }
94 
96  const std::vector<short int>& prevSamplingRegion() const { return m_prevSampReg; }
97 
99  const std::vector<short int>& nextSamplingRegion() const { return m_nextSampReg; }
100 
102  const std::vector<short int>& prevSubdetRegion() const { return m_prevSubdetReg; }
103 
105  const std::vector<short int>& nextSubdetRegion() const { return m_nextSubdetReg; }
106 
107 private:
108 
109  unsigned int m_hashMin;
110  short int m_nbEtaBins;
111  short int m_nPhi;
112  float m_minEta;
113  float m_granulEta;
114  float m_minPhi;
115  float m_granulPhi;
116  bool m_fullSym;
118 
119  short int m_prevEtaReg;
120  short int m_nextEtaReg;
121  std::vector<short int> m_prevSampReg;
122  std::vector<short int> m_nextSampReg;
123  std::vector<short int> m_prevSubdetReg;
124  std::vector<short int> m_nextSubdetReg;
125 
126 };
127 
128 #endif // LAREM_REGION_H
LArEM_region::prevSubdetRegion
const std::vector< short int > & prevSubdetRegion() const
region number of the prev region in subdet
Definition: LArEM_region.h:102
LArEM_region::m_prevSampReg
std::vector< short int > m_prevSampReg
Definition: LArEM_region.h:121
LArEM_region::isEtaMin
bool isEtaMin(unsigned int index) const
is the considered cell in the first eta bin of the region ?
Definition: LArEM_region.h:76
LArEM_region::LArEM_region
LArEM_region()
Definition: LArEM_region.cxx:12
LArEM_region::phiMin
float phiMin() const
starting phi
Definition: LArEM_region.h:58
LArEM_region::nextSubdetRegion
const std::vector< short int > & nextSubdetRegion() const
region number of the next region in subdet
Definition: LArEM_region.h:105
index
Definition: index.py:1
LArEM_region::m_nextSubdetReg
std::vector< short int > m_nextSubdetReg
Definition: LArEM_region.h:124
LArEM_region::isPhiMin
bool isPhiMin(unsigned int index) const
is the considered cell in the first phi bin of the region ?
Definition: LArEM_region.h:86
LArEM_region::m_nextSampReg
std::vector< short int > m_nextSampReg
Definition: LArEM_region.h:122
LArEM_region::m_prevEtaReg
short int m_prevEtaReg
Definition: LArEM_region.h:119
LArEM_region::etaMax
float etaMax() const
end eta
Definition: LArEM_region.h:55
TrigVSI::AlgConsts::nPhi
constexpr int nPhi
Default bin number of phi for vertex map.
Definition: Trigger/TrigTools/TrigVrtSecInclusive/TrigVrtSecInclusive/Constants.h:27
LArEM_region::fullTwoPi
bool fullTwoPi() const
true if detector covers full 2pi (== wraparound option in dictionary)
Definition: LArEM_region.h:46
LArEM_region::~LArEM_region
~LArEM_region()
LArEM_region
This class provides an interface to deal with regions in the neighbours finding
Definition: LArEM_region.h:20
LArEM_region::m_isFirstBarrelRegion
bool m_isFirstBarrelRegion
Definition: LArEM_region.h:117
LArEM_region::phiGranularity
float phiGranularity() const
phi granularity
Definition: LArEM_region.h:43
LArEM_region::m_minPhi
float m_minPhi
Definition: LArEM_region.h:114
LArEM_region::isEtaMax
bool isEtaMax(unsigned int index) const
is the considered cell in the last eta bin of the region ?
Definition: LArEM_region.h:81
LArEM_region::etaMin
float etaMin() const
starting eta
Definition: LArEM_region.h:52
LArEM_region::m_fullSym
bool m_fullSym
Definition: LArEM_region.h:116
NOT_VALID_REGION
@ NOT_VALID_REGION
Definition: LArEM_region.h:11
LArEM_region::hashMax
unsigned int hashMax() const
hash Id of the last cell of the region +1
Definition: LArEM_region.h:67
LArEM_region::phiN
short int phiN() const
number of phi bins
Definition: LArEM_region.h:37
LArEM_region::prevSamplingRegion
const std::vector< short int > & prevSamplingRegion() const
region number of the prev region in sampling
Definition: LArEM_region.h:96
LArEM_region::m_prevSubdetReg
std::vector< short int > m_prevSubdetReg
Definition: LArEM_region.h:123
LArEM_region::m_granulPhi
float m_granulPhi
Definition: LArEM_region.h:115
LArEM_region::m_minEta
float m_minEta
Definition: LArEM_region.h:112
LArEM_region::m_nPhi
short int m_nPhi
Definition: LArEM_region.h:111
LArEM_region::isFirstBarrelRegion
bool isFirstBarrelRegion() const
true if region close to barrel middle
Definition: LArEM_region.h:49
LArEM_region::nextEtaRegion
short int nextEtaRegion() const
region number of the next region in eta
Definition: LArEM_region.h:73
LArEM_region::m_hashMin
unsigned int m_hashMin
Definition: LArEM_region.h:109
LArEM_region::etaGranularity
float etaGranularity() const
eta granularity
Definition: LArEM_region.h:40
LArEM_region::m_granulEta
float m_granulEta
Definition: LArEM_region.h:113
LArEM_region::prevEtaRegion
short int prevEtaRegion() const
region number of the previous region in eta
Definition: LArEM_region.h:70
LArEM_region::isPhiMax
bool isPhiMax(unsigned int index) const
is the considered cell in the last phi bin of the region ?
Definition: LArEM_region.h:91
LArEM_region::m_nbEtaBins
short int m_nbEtaBins
Definition: LArEM_region.h:110
LArEM_region::phiMax
float phiMax() const
end phi
Definition: LArEM_region.h:61
LArEM_region::nextSamplingRegion
const std::vector< short int > & nextSamplingRegion() const
region number of the next region in sampling
Definition: LArEM_region.h:99
LArEM_region::numberOfEta
short int numberOfEta() const
number of eta bins in the whole region
Definition: LArEM_region.h:34
LArEM_region::hashMin
unsigned int hashMin() const
hash Id of the first cell of the region
Definition: LArEM_region.h:64
LArEM_region::m_nextEtaReg
short int m_nextEtaReg
Definition: LArEM_region.h:120