ATLAS Offline Software
Loading...
Searching...
No Matches
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
26LArFCAL_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
47{
48 return m_nbEtaBins ;
49}
50
51short 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{
79}
80
82{
83 return m_minPhi ;
84}
85
87{
88 return (m_minPhi + m_nPhi*m_granulPhi) ;
89}
90
91unsigned int LArFCAL_region::hashMin() const
92{
93 return m_hashMin ;
94}
95
96unsigned int LArFCAL_region::hashMax() const
97{
98 return (m_hashMin + m_nbEtaBins * m_nPhi) ;
99}
100
101bool 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
108bool 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
115bool 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
122bool 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
short int phiN() const
number of phi bins
bool isEtaMin(const unsigned int &index) const
is the considered cell in the first eta bin of the region ?
float phiGranularity() const
phi granularity
unsigned int m_hashMin
unsigned int hashMin() const
hash Id of the first cell of the region
short int prevSamplingRegion() const
region number of the prev region in sampling
bool fullTwoPi() const
true if detector covers full 2pi (== wraparound option in dictionary)
float etaGranularity() const
eta granularity
float etaMax() const
end eta
short int numberOfEta() const
number of eta bins in the whole region
bool isPhiMax(const unsigned int &index) const
is the considered cell in the last phi bin of the region ?
short int m_nextSampReg
float phiMin() const
starting phi
float phiMax() const
end phi
short int m_prevSampReg
float etaMin() const
starting eta
bool isEtaMax(const unsigned int &index) const
is the considered cell in the last eta bin of the region ?
short int m_nbEtaBins
bool isPhiMin(const unsigned int &index) const
is the considered cell in the first phi bin of the region ?
short int nextSamplingRegion() const
region number of the next region in sampling
unsigned int hashMax() const
hash Id of the last cell of the region +1
Definition index.py:1