ATLAS Offline Software
Loading...
Searching...
No Matches
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
25LArHEC_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
50{
51 return m_nbEtaBins ;
52}
53
54short 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
75{
76 return m_minEta ;
77}
78
80{
82}
83
85{
86 return m_minPhi ;
87}
88
90{
91 return (m_minPhi + m_nPhi*m_granulPhi) ;
92}
93
94unsigned int LArHEC_region::hashMin() const
95{
96 return m_hashMin ;
97}
98
99unsigned 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
114bool 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
121bool 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
128bool 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
135bool 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
142const std::vector<short int>& LArHEC_region::nextSamplingRegion() const
143{
144 return m_nextSampReg;
145}
146
147const std::vector<short int>& LArHEC_region::prevSamplingRegion() const
148{
149 return m_prevSampReg;
150}
151
152
153
154
155
156
bool isEtaMax(const unsigned int &index) const
is the considered cell in the last eta bin of the region ?
float etaGranularity() const
eta granularity
bool isPhiMax(const unsigned int &index) const
is the considered cell in the last phi bin of the region ?
const std::vector< short int > & prevSamplingRegion() const
region number of the prev region in sampling
short int m_nbEtaBins
short int m_prevEtaReg
float etaMax() const
end eta
const std::vector< short int > & nextSamplingRegion() const
region number of the next region in sampling
short int nextEtaRegion() const
region number of the next region in eta
short int m_nextEtaReg
unsigned int hashMax() const
hash Id of the last cell of the region +1
std::vector< short int > m_prevSampReg
~LArHEC_region(void)
std::vector< short int > m_nextSampReg
unsigned int hashMin() const
hash Id of the first cell of the region
float phiMax() const
end phi
short int numberOfEta() const
number of eta bins in the whole region
float phiMin() const
starting phi
short int prevEtaRegion() const
region number of the previous region in eta
float phiGranularity() const
phi granularity
short int phiN() const
number of phi bins
unsigned int m_hashMin
short int m_nPhi
float etaMin() const
starting eta
bool isPhiMin(const unsigned int &index) const
is the considered cell in the first phi bin of the region ?
bool isEtaMin(const unsigned int &index) const
is the considered cell in the first eta bin of the region ?
bool fullTwoPi() const
true if detector covers full 2pi (== wraparound option in dictionary)
Definition index.py:1