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