ATLAS Offline Software
LArHEC_region.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "LArHEC_region.h"
6 
7 #include <cmath>
8 #include <vector>
9 
10 
12  m_hashMin(0)
13  ,m_nbEtaBins(0)
14  ,m_nPhi(0)
15  ,m_minEta(99)
16  ,m_granulEta(0)
17  ,m_minPhi(99)
18  ,m_granulPhi(0)
19  ,m_fullSym(true)
20  ,m_prevEtaReg(63)
21  ,m_nextEtaReg(63)
22 {
23 }
24 
25 LArHEC_region::LArHEC_region(unsigned int& minHash, short int& nbEtaBins, short int& nPhi,
26  float minEta, float granulEta, float minPhi, float granulPhi, bool fullSym,
27  short int& prevEtaReg, short int& nextEtaReg,
28  std::vector<short int>& prevSampReg, std::vector<short int>& nextSampReg)
29  : m_hashMin (minHash),
30  m_nbEtaBins (nbEtaBins),
31  m_nPhi (nPhi),
32  m_minEta (minEta),
33  m_granulEta (granulEta),
34  m_minPhi (minPhi),
35  m_granulPhi (granulPhi),
36  m_fullSym (fullSym),
37  m_prevEtaReg (prevEtaReg),
38  m_nextEtaReg (nextEtaReg),
39  m_prevSampReg(prevSampReg),
40  m_nextSampReg(nextSampReg)
41 {
42 
43 
44 }
45 
47 = default;
48 
49 short int LArHEC_region::numberOfEta() const
50 {
51  return m_nbEtaBins ;
52 }
53 
54 short int LArHEC_region::phiN() const
55 {
56  return m_nPhi ;
57 }
58 
60 {
61  return m_granulEta ;
62 }
63 
65 {
66  return m_granulPhi ;
67 }
68 
70 {
71  return m_fullSym ;
72 }
73 
74 float LArHEC_region::etaMin() const
75 {
76  return m_minEta ;
77 }
78 
79 float LArHEC_region::etaMax() const
80 {
81  return (m_minEta + m_nbEtaBins*m_granulEta) ;
82 }
83 
84 float LArHEC_region::phiMin() const
85 {
86  return m_minPhi ;
87 }
88 
89 float LArHEC_region::phiMax() const
90 {
91  return (m_minPhi + m_nPhi*m_granulPhi) ;
92 }
93 
94 unsigned int LArHEC_region::hashMin() const
95 {
96  return m_hashMin ;
97 }
98 
99 unsigned int LArHEC_region::hashMax() const
100 {
101  return (m_hashMin + m_nbEtaBins * m_nPhi) ;
102 }
103 
105 {
106  return m_prevEtaReg;
107 }
108 
110 {
111  return m_nextEtaReg;
112 }
113 
114 bool LArHEC_region::isEtaMin(const unsigned int& index) const
115 {
116  bool result=false;
117  if( ((m_hashMin<=index) && (index<(m_hashMin+m_nPhi))))result=true;
118  return result;
119 }
120 
121 bool LArHEC_region::isEtaMax(const unsigned int& index) const
122 {
123  bool result=false;
124  if( ((hashMax()-m_nPhi)<=index) && (index<hashMax()))result=true;
125  return result;
126 }
127 
128 bool LArHEC_region::isPhiMin(const unsigned int& index) const
129 {
130  bool result=false;
131  if( !m_fullSym && (index-m_hashMin)%m_nPhi == 0 )result=true;
132  return result;
133 }
134 
135 bool LArHEC_region::isPhiMax(const unsigned int& index) const
136 {
137  bool result=false;
138  if( !m_fullSym && (index-m_hashMin+1)%m_nPhi == 0 )result=true;
139  return result;
140 }
141 
142 const std::vector<short int>& LArHEC_region::nextSamplingRegion() const
143 {
144  return m_nextSampReg;
145 }
146 
147 const std::vector<short int>& LArHEC_region::prevSamplingRegion() const
148 {
149  return m_prevSampReg;
150 }
151 
152 
153 
154 
155 
156 
LArHEC_region::isPhiMax
bool isPhiMax(const unsigned int &index) const
is the considered cell in the last phi bin of the region ?
Definition: LArHEC_region.cxx:135
LArHEC_region::m_nPhi
short int m_nPhi
Definition: LArHEC_region.h:95
LArHEC_region::hashMin
unsigned int hashMin() const
hash Id of the first cell of the region
Definition: LArHEC_region.cxx:94
get_generator_info.result
result
Definition: get_generator_info.py:21
LArHEC_region::m_prevSampReg
std::vector< short int > m_prevSampReg
Definition: LArHEC_region.h:104
LArHEC_region::etaMax
float etaMax() const
end eta
Definition: LArHEC_region.cxx:79
index
Definition: index.py:1
LArHEC_region::nextSamplingRegion
const std::vector< short int > & nextSamplingRegion() const
region number of the next region in sampling
Definition: LArHEC_region.cxx:142
LArHEC_region::m_nbEtaBins
short int m_nbEtaBins
Definition: LArHEC_region.h:94
LArHEC_region::phiMax
float phiMax() const
end phi
Definition: LArHEC_region.cxx:89
LArHEC_region::isPhiMin
bool isPhiMin(const unsigned int &index) const
is the considered cell in the first phi bin of the region ?
Definition: LArHEC_region.cxx:128
LArHEC_region::m_prevEtaReg
short int m_prevEtaReg
Definition: LArHEC_region.h:102
LArHEC_region::isEtaMax
bool isEtaMax(const unsigned int &index) const
is the considered cell in the last eta bin of the region ?
Definition: LArHEC_region.cxx:121
LArHEC_region::LArHEC_region
LArHEC_region(void)
Definition: LArHEC_region.cxx:11
LArHEC_region::~LArHEC_region
~LArHEC_region(void)
TrigVSI::AlgConsts::nPhi
constexpr int nPhi
Default bin number of phi for vertex map.
Definition: Trigger/TrigTools/TrigVrtSecInclusive/TrigVrtSecInclusive/Constants.h:27
LArHEC_region::etaMin
float etaMin() const
starting eta
Definition: LArHEC_region.cxx:74
LArHEC_region::phiGranularity
float phiGranularity() const
phi granularity
Definition: LArHEC_region.cxx:64
LArHEC_region::m_granulEta
float m_granulEta
Definition: LArHEC_region.h:97
LArHEC_region::m_minEta
float m_minEta
Definition: LArHEC_region.h:96
LArHEC_region::m_nextSampReg
std::vector< short int > m_nextSampReg
Definition: LArHEC_region.h:105
LArHEC_region::isEtaMin
bool isEtaMin(const unsigned int &index) const
is the considered cell in the first eta bin of the region ?
Definition: LArHEC_region.cxx:114
LArHEC_region::prevSamplingRegion
const std::vector< short int > & prevSamplingRegion() const
region number of the prev region in sampling
Definition: LArHEC_region.cxx:147
LArHEC_region::phiMin
float phiMin() const
starting phi
Definition: LArHEC_region.cxx:84
LArHEC_region::etaGranularity
float etaGranularity() const
eta granularity
Definition: LArHEC_region.cxx:59
LArHEC_region.h
LArHEC_region::phiN
short int phiN() const
number of phi bins
Definition: LArHEC_region.cxx:54
LArHEC_region::m_fullSym
bool m_fullSym
Definition: LArHEC_region.h:100
LArHEC_region::m_nextEtaReg
short int m_nextEtaReg
Definition: LArHEC_region.h:103
LArHEC_region::nextEtaRegion
short int nextEtaRegion() const
region number of the next region in eta
Definition: LArHEC_region.cxx:109
LArHEC_region::m_granulPhi
float m_granulPhi
Definition: LArHEC_region.h:99
LArHEC_region::hashMax
unsigned int hashMax() const
hash Id of the last cell of the region +1
Definition: LArHEC_region.cxx:99
LArHEC_region::m_minPhi
float m_minPhi
Definition: LArHEC_region.h:98
LArHEC_region::numberOfEta
short int numberOfEta() const
number of eta bins in the whole region
Definition: LArHEC_region.cxx:49
LArHEC_region::fullTwoPi
bool fullTwoPi() const
true if detector covers full 2pi (== wraparound option in dictionary)
Definition: LArHEC_region.cxx:69
LArHEC_region::m_hashMin
unsigned int m_hashMin
Definition: LArHEC_region.h:93
LArHEC_region::prevEtaRegion
short int prevEtaRegion() const
region number of the previous region in eta
Definition: LArHEC_region.cxx:104