ATLAS Offline Software
Public Member Functions | Public Attributes | Protected Attributes | List of all members
TrigFTF_GNN_Layer Class Reference

#include <GNN_Geometry.h>

Collaboration diagram for TrigFTF_GNN_Layer:

Public Member Functions

 TrigFTF_GNN_Layer (const TrigInDetSiLayer &, float, int)
 
 ~TrigFTF_GNN_Layer ()
 
int getEtaBin (float, float) const
 
float getMinBinRadius (int) const
 
float getMaxBinRadius (int) const
 
int num_bins () const
 
bool verifyBin (const TrigFTF_GNN_Layer *, int, int, float, float) const
 

Public Attributes

const TrigInDetSiLayerm_layer
 
std::vector< int > m_bins
 
std::vector< float > m_minRadius
 
std::vector< float > m_maxRadius
 
std::vector< float > m_minBinCoord
 
std::vector< float > m_maxBinCoord
 
float m_minEta
 
float m_maxEta
 

Protected Attributes

float m_etaBinWidth
 
float m_r1
 
float m_z1
 
float m_r2
 
float m_z2
 
int m_nBins
 
float m_etaBin
 

Detailed Description

Definition at line 16 of file GNN_Geometry.h.

Constructor & Destructor Documentation

◆ TrigFTF_GNN_Layer()

TrigFTF_GNN_Layer::TrigFTF_GNN_Layer ( const TrigInDetSiLayer ls,
float  ew,
int  bin0 
)

Definition at line 13 of file GNN_Geometry.cxx.

13  : m_layer(ls), m_etaBinWidth(ew) {
14 
15  if(m_layer.m_type == 0) {//barrel
20  }
21  else {//endcap
26  }
27 
28  float t1 = m_z1/m_r1;
29  float eta1 = -std::log(sqrt(1+t1*t1)-t1);
30 
31 
32  float t2 = m_z2/m_r2;
33  float eta2 = -std::log(sqrt(1+t2*t2)-t2);
34 
35  m_minEta = eta1;
36  m_maxEta = eta2;
37 
38  if(m_maxEta < m_minEta) {
39  m_minEta = eta2;
40  m_maxEta = eta1;
41  }
42 
43  m_maxEta += 1e-6;//increasing them slightly to avoid range_check exceptions
44  m_minEta -= 1e-6;
45 
46  float deltaEta = m_maxEta - m_minEta;
47 
48  int binCounter = bin0;
49 
50  if(deltaEta < m_etaBinWidth) {
51  m_nBins = 1;
52  m_bins.push_back(binCounter++);
54  if(m_layer.m_type == 0) {//barrel
55  m_minRadius.push_back(m_layer.m_refCoord - 2.0);
56  m_maxRadius.push_back(m_layer.m_refCoord + 2.0);
57  m_minBinCoord.push_back(m_layer.m_minBound);
58  m_maxBinCoord.push_back(m_layer.m_maxBound);
59  }
60  else {//endcap
61  m_minRadius.push_back(m_layer.m_minBound - 2.0);
62  m_maxRadius.push_back(m_layer.m_maxBound + 2.0);
63  m_minBinCoord.push_back(m_layer.m_minBound);
64  m_maxBinCoord.push_back(m_layer.m_maxBound);
65  }
66  }
67  else {
68  float nB = static_cast<int>(deltaEta/m_etaBinWidth);
69  m_nBins = nB;
71 
73 
74  if(m_nBins == 1) {
75  m_bins.push_back(binCounter++);
76  if(m_layer.m_type == 0) {//barrel
77  m_minRadius.push_back(m_layer.m_refCoord - 2.0);
78  m_maxRadius.push_back(m_layer.m_refCoord + 2.0);
79  m_minBinCoord.push_back(m_layer.m_minBound);
80  m_maxBinCoord.push_back(m_layer.m_maxBound);
81  }
82  else {//endcap
83  m_minRadius.push_back(m_layer.m_minBound - 2.0);
84  m_maxRadius.push_back(m_layer.m_maxBound + 2.0);
85  m_minBinCoord.push_back(m_layer.m_minBound);
86  m_maxBinCoord.push_back(m_layer.m_maxBound);
87  }
88  }
89  else {
90 
91  float eta = m_minEta+0.5*m_etaBin;
92 
93  for(int i=1;i<=m_nBins;i++) {
94 
95  m_bins.push_back(binCounter++);
96 
97  float e1 = eta - 0.5*m_etaBin;
98  float e2 = eta + 0.5*m_etaBin;
99 
100  if(m_layer.m_type == 0) {//barrel
101  m_minRadius.push_back(m_layer.m_refCoord - 2.0);
102  m_maxRadius.push_back(m_layer.m_refCoord + 2.0);
103  float z1 = m_layer.m_refCoord*std::sinh(e1);
104  m_minBinCoord.push_back(z1);
105  float z2 = m_layer.m_refCoord*std::sinh(e2);
106  m_maxBinCoord.push_back(z2);
107  }
108  else {//endcap
109  float r = m_layer.m_refCoord/std::sinh(e1);
110  m_minBinCoord.push_back(r);
111  m_minRadius.push_back(r - 2.0);
112  r = m_layer.m_refCoord/std::sinh(e2);
113  m_maxBinCoord.push_back(r);
114  m_maxRadius.push_back(r + 2.0);
115 
116  }
117 
118  eta += m_etaBin;
119  }
120  }
121  }
122 }

◆ ~TrigFTF_GNN_Layer()

TrigFTF_GNN_Layer::~TrigFTF_GNN_Layer ( )

Definition at line 215 of file GNN_Geometry.cxx.

215  {
216  m_bins.clear();
217 }

Member Function Documentation

◆ getEtaBin()

int TrigFTF_GNN_Layer::getEtaBin ( float  zh,
float  rh 
) const

Definition at line 184 of file GNN_Geometry.cxx.

184  {
185 
186  if(m_bins.size() == 1) return m_bins.at(0);
187 
188  float t1 = zh/rh;
189  float eta = -std::log(std::sqrt(1+t1*t1)-t1);
190 
191 
192  int idx = static_cast<int>((eta-m_minEta)/m_etaBin);
193 
194 
195  if(idx < 0) idx = 0;
196  if(idx >= static_cast<int>(m_bins.size())) idx = static_cast<int>(m_bins.size())-1;
197 
198  return m_bins.at(idx);//index in the global storage
199 }

◆ getMaxBinRadius()

float TrigFTF_GNN_Layer::getMaxBinRadius ( int  idx) const

Definition at line 208 of file GNN_Geometry.cxx.

208  {
209  if(idx >= static_cast<int>(m_maxRadius.size())) idx = idx-1;
210  if(idx < 0) idx = 0;
211 
212  return m_maxRadius.at(idx);
213 }

◆ getMinBinRadius()

float TrigFTF_GNN_Layer::getMinBinRadius ( int  idx) const

Definition at line 201 of file GNN_Geometry.cxx.

201  {
202  if(idx >= static_cast<int>(m_minRadius.size())) idx = idx-1;
203  if(idx < 0) idx = 0;
204 
205  return m_minRadius.at(idx);
206 }

◆ num_bins()

int TrigFTF_GNN_Layer::num_bins ( ) const
inline

Definition at line 26 of file GNN_Geometry.h.

26 {return m_bins.size();}

◆ verifyBin()

bool TrigFTF_GNN_Layer::verifyBin ( const TrigFTF_GNN_Layer pL,
int  b1,
int  b2,
float  min_z0,
float  max_z0 
) const

Definition at line 124 of file GNN_Geometry.cxx.

124  {
125 
126  float z1min = m_minBinCoord.at(b1);
127  float z1max = m_maxBinCoord.at(b1);
128  float r1 = m_layer.m_refCoord;
129 
130  if(m_layer.m_type == 0 && pL->m_layer.m_type == 0) {//barrel -> barrel
131 
132  const float tol = 5.0;
133 
134  float min_b2 = pL->m_minBinCoord.at(b2);
135  float max_b2 = pL->m_maxBinCoord.at(b2);
136 
137  float r2 = pL->m_layer.m_refCoord;
138 
139  float A = r2/(r2-r1);
140  float B = r1/(r2-r1);
141 
142  float z0_min = z1min*A - max_b2*B;
143  float z0_max = z1max*A - min_b2*B;
144 
145  if(z0_max < min_z0-tol || z0_min > max_z0+tol) return false;
146 
147  return true;
148  }
149 
150  if(m_layer.m_type == 0 && pL->m_layer.m_type != 0) {//barrel -> endcap
151 
152  const float tol = 10.0;
153 
154  float z2 = pL->m_layer.m_refCoord;
155  float r2max = pL->m_maxBinCoord.at(b2);
156  float r2min = pL->m_minBinCoord.at(b2);
157 
158  if(r2max <= r1) return false;
159 
160  if(r2min <= r1) {
161  r2min = r1 + 1e-3;
162  }
163 
164  float z0_max = 0.0;
165  float z0_min = 0.0;
166 
167  if(z2 > 0) {
168  z0_max = (z1max*r2max - z2*r1)/(r2max-r1);
169  z0_min = (z1min*r2min - z2*r1)/(r2min-r1);
170  }
171  else {
172  z0_max = (z1max*r2min - z2*r1)/(r2min-r1);
173  z0_min = (z1min*r2max - z2*r1)/(r2max-r1);
174  }
175 
176  if(z0_max < min_z0-tol || z0_min > max_z0+tol) return false;
177  return true;
178  }
179 
180  return true;
181 }

Member Data Documentation

◆ m_bins

std::vector<int> TrigFTF_GNN_Layer::m_bins

Definition at line 31 of file GNN_Geometry.h.

◆ m_etaBin

float TrigFTF_GNN_Layer::m_etaBin
protected

Definition at line 45 of file GNN_Geometry.h.

◆ m_etaBinWidth

float TrigFTF_GNN_Layer::m_etaBinWidth
protected

Definition at line 41 of file GNN_Geometry.h.

◆ m_layer

const TrigInDetSiLayer& TrigFTF_GNN_Layer::m_layer

Definition at line 30 of file GNN_Geometry.h.

◆ m_maxBinCoord

std::vector<float> TrigFTF_GNN_Layer::m_maxBinCoord

Definition at line 35 of file GNN_Geometry.h.

◆ m_maxEta

float TrigFTF_GNN_Layer::m_maxEta

Definition at line 37 of file GNN_Geometry.h.

◆ m_maxRadius

std::vector<float> TrigFTF_GNN_Layer::m_maxRadius

Definition at line 33 of file GNN_Geometry.h.

◆ m_minBinCoord

std::vector<float> TrigFTF_GNN_Layer::m_minBinCoord

Definition at line 34 of file GNN_Geometry.h.

◆ m_minEta

float TrigFTF_GNN_Layer::m_minEta

Definition at line 37 of file GNN_Geometry.h.

◆ m_minRadius

std::vector<float> TrigFTF_GNN_Layer::m_minRadius

Definition at line 32 of file GNN_Geometry.h.

◆ m_nBins

int TrigFTF_GNN_Layer::m_nBins
protected

Definition at line 44 of file GNN_Geometry.h.

◆ m_r1

float TrigFTF_GNN_Layer::m_r1
protected

Definition at line 43 of file GNN_Geometry.h.

◆ m_r2

float TrigFTF_GNN_Layer::m_r2
protected

Definition at line 43 of file GNN_Geometry.h.

◆ m_z1

float TrigFTF_GNN_Layer::m_z1
protected

Definition at line 43 of file GNN_Geometry.h.

◆ m_z2

float TrigFTF_GNN_Layer::m_z2
protected

Definition at line 43 of file GNN_Geometry.h.


The documentation for this class was generated from the following files:
TrigFTF_GNN_Layer::m_minBinCoord
std::vector< float > m_minBinCoord
Definition: GNN_Geometry.h:34
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
beamspotman.r
def r
Definition: beamspotman.py:676
TrigFTF_GNN_Layer::m_r2
float m_r2
Definition: GNN_Geometry.h:43
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
egammaEnergyPositionAllSamples::e1
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
TrigFTF_GNN_Layer::m_bins
std::vector< int > m_bins
Definition: GNN_Geometry.h:31
xAOD::eta1
setEt setPhi setE277 setWeta2 eta1
Definition: TrigEMCluster_v1.cxx:41
TrigFTF_GNN_Layer::m_maxRadius
std::vector< float > m_maxRadius
Definition: GNN_Geometry.h:33
MCP::ScaleSmearParam::r2
@ r2
TrigFTF_GNN_Layer::m_z1
float m_z1
Definition: GNN_Geometry.h:43
TrigFTF_GNN_Layer::m_etaBinWidth
float m_etaBinWidth
Definition: GNN_Geometry.h:41
A
TrigFTF_GNN_Layer::m_r1
float m_r1
Definition: GNN_Geometry.h:43
P4Helpers::deltaEta
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Definition: P4Helpers.h:66
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigInDetSiLayer::m_maxBound
float m_maxBound
Definition: TrigInDetSiLayer.h:13
TrigFTF_GNN_Layer::m_nBins
int m_nBins
Definition: GNN_Geometry.h:44
TrigFTF_GNN_Layer::m_layer
const TrigInDetSiLayer & m_layer
Definition: GNN_Geometry.h:30
TrigFTF_GNN_Layer::m_z2
float m_z2
Definition: GNN_Geometry.h:43
TrigInDetSiLayer::m_minBound
float m_minBound
Definition: TrigInDetSiLayer.h:13
TrigFTF_GNN_Layer::m_etaBin
float m_etaBin
Definition: GNN_Geometry.h:45
TrigFTF_GNN_Layer::m_minEta
float m_minEta
Definition: GNN_Geometry.h:37
TrigInDetSiLayer::m_type
int m_type
Definition: TrigInDetSiLayer.h:11
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
TrigFTF_GNN_Layer::m_maxBinCoord
std::vector< float > m_maxBinCoord
Definition: GNN_Geometry.h:35
ALFA_EventTPCnv_Dict::t2
std::vector< ALFA_RawDataContainer_p1 > t2
Definition: ALFA_EventTPCnvDict.h:44
TrigInDetSiLayer::m_refCoord
float m_refCoord
Definition: TrigInDetSiLayer.h:12
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
MCP::ScaleSmearParam::r1
@ r1
getReferenceRun.ls
def ls(fpath)
Definition: getReferenceRun.py:29
TrigFTF_GNN_Layer::m_maxEta
float m_maxEta
Definition: GNN_Geometry.h:37
TrigFTF_GNN_Layer::m_minRadius
std::vector< float > m_minRadius
Definition: GNN_Geometry.h:32