ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
InDet::TRT_DetElementsLayer_xk Class Reference

#include <TRT_DetElementsLayer_xk.h>

Collaboration diagram for InDet::TRT_DetElementsLayer_xk:

Public Member Functions

 TRT_DetElementsLayer_xk ()
 
 TRT_DetElementsLayer_xk (double, double, double, double, double)
 
 TRT_DetElementsLayer_xk (const TRT_DetElementsLayer_xk &)=default
 
 ~TRT_DetElementsLayer_xk ()
 
TRT_DetElementsLayer_xkoperator= (const TRT_DetElementsLayer_xk &)=default
 
TRT_DetElementsLayer_xkoperator= (TRT_DetElementsLayer_xk &&)=default
 
const float & r () const
 
const float & dr () const
 
const float & z () const
 
const float & dz () const
 
const float & dfe () const
 
void set (double, double, double, double, double, double, double)
 
void add (TRT_DetElementLink_xk &&)
 
int nElements () const
 Get number of links to detector elements. More...
 
void getBarrelDetElementsATL (const float *, const float *, std::vector< std::pair< const InDet::TRT_DetElementLink_xk *, float > > &, std::vector< InDet::TRT_DetElementLink_xk::Used_t > &used) const
 
void getBarrelDetElementsCTB (const float *, const float *, std::vector< std::pair< const InDet::TRT_DetElementLink_xk *, float > > &, std::vector< InDet::TRT_DetElementLink_xk::Used_t > &used) const
 
void getEndcapDetElements (const float *, const float *, std::vector< std::pair< const InDet::TRT_DetElementLink_xk *, float > > &, std::vector< InDet::TRT_DetElementLink_xk::Used_t > &used) const
 
void reserve (std::size_t n_elements)
 

Protected Attributes

float m_z
 
float m_dz
 
float m_r
 
float m_dr
 
float m_dfe
 
float m_f0
 
float m_sfi
 
float m_wf
 
float m_wz
 
std::vector< TRT_DetElementLink_xkm_elements
 

Detailed Description

Definition at line 27 of file TRT_DetElementsLayer_xk.h.

Constructor & Destructor Documentation

◆ TRT_DetElementsLayer_xk() [1/3]

InDet::TRT_DetElementsLayer_xk::TRT_DetElementsLayer_xk ( )
inline

Definition at line 125 of file TRT_DetElementsLayer_xk.h.

126  {
127  m_z = 0.;
128  m_dz = 0.;
129  m_r = 0.;
130  m_dr = 0.;
131  m_dfe = 0.;
132  m_f0 = 0.;
133  m_sfi = 0.;
134  m_wf = 0.;
135  m_wz = 0.;
136  }

◆ TRT_DetElementsLayer_xk() [2/3]

InDet::TRT_DetElementsLayer_xk::TRT_DetElementsLayer_xk ( double  r,
double  dr,
double  z,
double  dz,
double  df 
)
inline

Definition at line 138 of file TRT_DetElementsLayer_xk.h.

140  {
141  m_r = float(r );
142  m_dr = float(dr);
143  m_z = float(z );
144  m_dz = float(dz);
145  m_dfe = float(df);
146  m_f0 = 0. ;
147  m_sfi = 0. ;
148  m_wf = 0. ;
149  m_wz = 0. ;
150  }

◆ TRT_DetElementsLayer_xk() [3/3]

InDet::TRT_DetElementsLayer_xk::TRT_DetElementsLayer_xk ( const TRT_DetElementsLayer_xk )
default

◆ ~TRT_DetElementsLayer_xk()

InDet::TRT_DetElementsLayer_xk::~TRT_DetElementsLayer_xk ( )
inline

Definition at line 152 of file TRT_DetElementsLayer_xk.h.

152 {}

Member Function Documentation

◆ add()

void InDet::TRT_DetElementsLayer_xk::add ( TRT_DetElementLink_xk &&  link)
inline

Definition at line 154 of file TRT_DetElementsLayer_xk.h.

155  {
156  m_elements.push_back(std::move(link));
157  }

◆ dfe()

const float& InDet::TRT_DetElementsLayer_xk::dfe ( ) const
inline

Definition at line 54 of file TRT_DetElementsLayer_xk.h.

54 {return this->m_dfe;}

◆ dr()

const float& InDet::TRT_DetElementsLayer_xk::dr ( ) const
inline

Definition at line 51 of file TRT_DetElementsLayer_xk.h.

51 {return this->m_dr ;}

◆ dz()

const float& InDet::TRT_DetElementsLayer_xk::dz ( ) const
inline

Definition at line 53 of file TRT_DetElementsLayer_xk.h.

53 {return this->m_dz ;}

◆ getBarrelDetElementsATL()

void InDet::TRT_DetElementsLayer_xk::getBarrelDetElementsATL ( const float *  P,
const float *  A,
std::vector< std::pair< const InDet::TRT_DetElementLink_xk *, float > > &  lDE,
std::vector< InDet::TRT_DetElementLink_xk::Used_t > &  used 
) const
Parameters
?
?
willbe filled with pairs of detector elements and way(?)
arraywith size matching number of elements, which tells which elements are already used.

Definition at line 55 of file TRT_DetElementsLayer_xk.cxx.

60 {
61  // Tell clang to optimize assuming that FP exceptions can trap.
62  // Otherwise, it can vectorize the division, which can lead to
63  // spurious division-by-zero traps from unused vector lanes.
65  float a = (A[0]*P[0]+A[1]*P[1])*2.;
66  float s = 0. ;
67  if(a!=0.) {
68  float d = (m_r-P[0]-P[1])*(m_r+P[0]+P[1])+2.*P[0]*P[1];
69  float b = 2.*(A[0]*A[0]+A[1]*A[1]);
70  float sq = a*a+2.*d*b; sq>0. ? sq=std::sqrt(sq) : sq=0.;
71  float s1 =-(a+sq)/b;
72  float s2 =-(a-sq)/b;
73 
74  if((s1*s2) > 0.) {std::abs(s1) < std::abs(s2) ? s = s1 : s = s2;}
75  else { s1 > 0. ? s = s1 : s = s2;}
76 
77  }
78  float zc = P[2]+A[2]*s ; if(std::abs(zc-m_z)>(m_dz+P[4])) return;
79  float zc0 = zc-P[4]-m_z ;
80  float zc1 = zc+P[4]-m_z ;
81  float yc = P[1]+A[1]*s ;
82  float xc = P[0]+A[0]*s ; s+=P[5];
83  float fc = std::atan2(yc,xc);
84  int m = m_elements.size()-2;
85  int n = int((fc-m_f0)*m_sfi)*2; if(n<0) n=0; else if(n>m) n=m;
86 
87  float dF = fc-m_elements[n].phi();
88  float dx = std::abs(yc*m_elements[n].cos()-xc*m_elements[n].sin()-m_elements[n].centerf());
89  if((dx-m_wf-P[4]) <= 0.) {
90 
91  assert( used.size() > static_cast<unsigned int>(n));
92  if(zc0 <= 0 && !used[n].used()) {
93  lDE.emplace_back(&m_elements[n],s); used[n].setUsed();
94  }
95 
96  int k = n+1;
97  assert( used.size() > static_cast<unsigned int>(k));
98  if(zc1 >= 0. && !used[k].used() ) {
99  lDE.emplace_back(&m_elements[k],s); used[k].setUsed();
100  }
101  }
102  if(dF>0.) { n!=62 ? n+=2 : n=0 ;}
103  else { n!= 0 ? n-=2 : n=62;}
104 
105  dx = std::abs(yc*m_elements[n].cos()-xc*m_elements[n].sin()-m_elements[n].centerf());
106  if((dx-m_wf-P[4]) <= 0.) {
107 
108  assert( used.size() > static_cast<unsigned int>(n));
109  if(zc0 <= 0. && !used[n].used()) {
110  lDE.emplace_back(&m_elements[n],s); used[n].setUsed();
111  }
112 
113  int k = n+1;
114  assert( used.size() > static_cast<unsigned int>(k));
115  if(zc1 >= 0. && !used[k].used()) {
116  lDE.emplace_back(&m_elements[k],s); used[k].setUsed();
117  }
118  }
119 }

◆ getBarrelDetElementsCTB()

void InDet::TRT_DetElementsLayer_xk::getBarrelDetElementsCTB ( const float *  P,
const float *  A,
std::vector< std::pair< const InDet::TRT_DetElementLink_xk *, float > > &  lDE,
std::vector< InDet::TRT_DetElementLink_xk::Used_t > &  used 
) const
Parameters
?
?
willbe filled with pairs of detector elements and way(?)
arraywith size matching number of elements, which tells which elements are already used.

Definition at line 131 of file TRT_DetElementsLayer_xk.cxx.

136 {
137  float a = (A[0]*P[0]+A[1]*P[1])*2.;
138  float s = 0. ;
139  if(a!=0.) {
140  float d = (m_r-P[0]-P[1])*(m_r+P[0]+P[1])+2.*P[0]*P[1];
141  float b = 2.*(A[0]*A[0]+A[1]*A[1]);
142  float sq = a*a+2.*d*b; sq>0. ? sq=std::sqrt(sq) : sq=0.;
143  float s1 =-(a+sq)/b;
144  float s2 =-(a-sq)/b;
145 
146  if((s1*s2) > 0.) {std::abs(s1) < std::abs(s2) ? s = s1 : s = s2;}
147  else { s1 > 0. ? s = s1 : s = s2;}
148 
149  }
150  float zc = P[2]+A[2]*s ; if(std::abs(zc-m_z)>(m_dz+P[4])) return;
151  float zc0 = zc-P[4]-m_z ;
152  float zc1 = zc+P[4]-m_z ;
153  float yc = P[1]+A[1]*s ;
154  float xc = P[0]+A[0]*s ; s+=P[5];
155 
156  for(size_t n = 0; n < m_elements.size(); n+=2) {
157 
158  float dx = std::abs(yc*m_elements[n].cos()-xc*m_elements[n].sin()-m_elements[n].centerf());
159  if((dx-m_wf-P[4]) <= 0.) {
160 
161  assert( used.size() > static_cast<unsigned int>(n));
162  if(zc0 <= 0. && !used[n].used()) {
163  lDE.emplace_back(&m_elements[n],s); used[n].setUsed();
164  }
165 
166  assert( used.size() > static_cast<unsigned int>(n+1));
167  if(zc1 >= 0. && !used[n+1].used()) {
168 
169  lDE.emplace_back(&m_elements[n+1],s); used[n+1].setUsed();
170  }
171  }
172  }
173 }

◆ getEndcapDetElements()

void InDet::TRT_DetElementsLayer_xk::getEndcapDetElements ( const float *  P,
const float *  A,
std::vector< std::pair< const InDet::TRT_DetElementLink_xk *, float > > &  lDE,
std::vector< InDet::TRT_DetElementLink_xk::Used_t > &  used 
) const
Parameters
?
?
willbe filled with pairs of detector elements and way(?)
arraywith size matching number of elements, which tells which elements are already used.

Definition at line 185 of file TRT_DetElementsLayer_xk.cxx.

190 {
191  const float pi2=2.*M_PI;
192 
193  float s = (m_z-P[2])/A[2];
194  float xc = P[0]+A[0]*s;
195  float yc = P[1]+A[1]*s; s+=P[5];
196  float rc = std::sqrt(xc*xc+yc*yc); if(std::abs(rc-m_r)>m_dr+P[4]) return;
197  float fc = std::atan2(yc,xc);
198  float sf = 0.09817477+P[4]/rc;
199 
200  int m = m_elements.size()-1;
201  int n = int((fc-m_f0)*m_sfi); if(n<0) n=0; else if(n>m) n=m;
202  float dF = fc-m_elements[n].phi();
203 
204  assert( used.size() > static_cast<unsigned int>(n));
205  if(std::abs(dF) < sf && !used[n].used()) {
206  lDE.emplace_back(&m_elements[n],s); used[n].setUsed();
207  }
208 
209  // if(dF>0.) {if(n!=63) ++n; else {n=0 ; fc-=pi2;}}
210  // else {if(n!=0 ) --n; else {n=63; fc+=pi2;}}
211  if(dF>0.) {if(n!=m) ++n; else {n=0 ; fc-=pi2;}}
212  else {if(n!=0) --n; else {n=m ; fc+=pi2;}}
213 
214  assert( used.size() > static_cast<size_t>(n));
215  if(std::abs(fc-m_elements[n].phi()) < sf && !used[n].used()) {
216  lDE.emplace_back(&m_elements[n],s); used[n].setUsed();
217  }
218 }

◆ nElements()

int InDet::TRT_DetElementsLayer_xk::nElements ( ) const
inline

Get number of links to detector elements.

Definition at line 159 of file TRT_DetElementsLayer_xk.h.

160  {
161  return m_elements.size();
162  }

◆ operator=() [1/2]

TRT_DetElementsLayer_xk& InDet::TRT_DetElementsLayer_xk::operator= ( const TRT_DetElementsLayer_xk )
default

◆ operator=() [2/2]

TRT_DetElementsLayer_xk& InDet::TRT_DetElementsLayer_xk::operator= ( TRT_DetElementsLayer_xk &&  )
default

◆ r()

const float& InDet::TRT_DetElementsLayer_xk::r ( ) const
inline

Definition at line 50 of file TRT_DetElementsLayer_xk.h.

50 {return this->m_r ;}

◆ reserve()

void InDet::TRT_DetElementsLayer_xk::reserve ( std::size_t  n_elements)
inline

Definition at line 96 of file TRT_DetElementsLayer_xk.h.

96  {
97  m_elements.reserve(n_elements);
98  }

◆ set()

void InDet::TRT_DetElementsLayer_xk::set ( double  r,
double  dr,
double  z,
double  dz,
double  df,
double  wf,
double  wz 
)

Definition at line 27 of file TRT_DetElementsLayer_xk.cxx.

29 {
30  m_r = float(r ) ;
31  m_dr = float(dr) ;
32  m_z = float(z ) ;
33  m_dz = float(dz) ;
34  m_dfe = float(df) ;
35  m_wf = float(wf) ;
36  m_wz = float(wz) ;
37  m_f0 = m_elements[0].phi();
38  m_sfi = 0. ;
39  if(m_elements.size()<=1) return;
40  m_sfi = m_elements[1].phi()-m_elements[0].phi();
41  if(m_sfi < .001) m_sfi = m_elements[2].phi()-m_elements[0].phi();
42  m_sfi = 1./m_sfi;
43 }

◆ z()

const float& InDet::TRT_DetElementsLayer_xk::z ( ) const
inline

Definition at line 52 of file TRT_DetElementsLayer_xk.h.

52 {return this->m_z ;}

Member Data Documentation

◆ m_dfe

float InDet::TRT_DetElementsLayer_xk::m_dfe
protected

Definition at line 109 of file TRT_DetElementsLayer_xk.h.

◆ m_dr

float InDet::TRT_DetElementsLayer_xk::m_dr
protected

Definition at line 108 of file TRT_DetElementsLayer_xk.h.

◆ m_dz

float InDet::TRT_DetElementsLayer_xk::m_dz
protected

Definition at line 106 of file TRT_DetElementsLayer_xk.h.

◆ m_elements

std::vector<TRT_DetElementLink_xk> InDet::TRT_DetElementsLayer_xk::m_elements
protected

Definition at line 114 of file TRT_DetElementsLayer_xk.h.

◆ m_f0

float InDet::TRT_DetElementsLayer_xk::m_f0
protected

Definition at line 110 of file TRT_DetElementsLayer_xk.h.

◆ m_r

float InDet::TRT_DetElementsLayer_xk::m_r
protected

Definition at line 107 of file TRT_DetElementsLayer_xk.h.

◆ m_sfi

float InDet::TRT_DetElementsLayer_xk::m_sfi
protected

Definition at line 111 of file TRT_DetElementsLayer_xk.h.

◆ m_wf

float InDet::TRT_DetElementsLayer_xk::m_wf
protected

Definition at line 112 of file TRT_DetElementsLayer_xk.h.

◆ m_wz

float InDet::TRT_DetElementsLayer_xk::m_wz
protected

Definition at line 113 of file TRT_DetElementsLayer_xk.h.

◆ m_z

float InDet::TRT_DetElementsLayer_xk::m_z
protected

Definition at line 105 of file TRT_DetElementsLayer_xk.h.


The documentation for this class was generated from the following files:
used
CXXUTILS_TRAPPING_FP
#define CXXUTILS_TRAPPING_FP
Definition: trapping_fp.h:24
InDet::TRT_DetElementsLayer_xk::m_f0
float m_f0
Definition: TRT_DetElementsLayer_xk.h:110
ReadCellNoiseFromCoolCompare.s1
s1
Definition: ReadCellNoiseFromCoolCompare.py:378
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
InDet::TRT_DetElementsLayer_xk::r
const float & r() const
Definition: TRT_DetElementsLayer_xk.h:50
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
hist_file_dump.d
d
Definition: hist_file_dump.py:137
DMTest::P
P_v1 P
Definition: P.h:23
python.PhysicalConstants.pi2
float pi2
Definition: PhysicalConstants.py:52
M_PI
#define M_PI
Definition: ActiveFraction.h:11
InDet::TRT_DetElementsLayer_xk::m_sfi
float m_sfi
Definition: TRT_DetElementsLayer_xk.h:111
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
A
beamspotman.n
n
Definition: beamspotman.py:731
sq
#define sq(x)
Definition: CurvedSegmentFinder.cxx:6
InDet::TRT_DetElementsLayer_xk::m_r
float m_r
Definition: TRT_DetElementsLayer_xk.h:107
InDet::TRT_DetElementsLayer_xk::m_z
float m_z
Definition: TRT_DetElementsLayer_xk.h:105
InDet::TRT_DetElementsLayer_xk::m_dr
float m_dr
Definition: TRT_DetElementsLayer_xk.h:108
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
InDet::TRT_DetElementsLayer_xk::m_dz
float m_dz
Definition: TRT_DetElementsLayer_xk.h:106
InDet::TRT_DetElementsLayer_xk::m_wf
float m_wf
Definition: TRT_DetElementsLayer_xk.h:112
InDet::TRT_DetElementsLayer_xk::m_elements
std::vector< TRT_DetElementLink_xk > m_elements
Definition: TRT_DetElementsLayer_xk.h:114
a
TList * a
Definition: liststreamerinfos.cxx:10
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
InDet::TRT_DetElementsLayer_xk::m_wz
float m_wz
Definition: TRT_DetElementsLayer_xk.h:113
ReadCellNoiseFromCoolCompare.s2
s2
Definition: ReadCellNoiseFromCoolCompare.py:379
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
python.TriggerAPI.TriggerAPISession.df
df
Definition: TriggerAPISession.py:432
InDet::TRT_DetElementsLayer_xk::dz
const float & dz() const
Definition: TRT_DetElementsLayer_xk.h:53
readCCLHist.float
float
Definition: readCCLHist.py:83
InDet::TRT_DetElementsLayer_xk::m_dfe
float m_dfe
Definition: TRT_DetElementsLayer_xk.h:109
InDet::TRT_DetElementsLayer_xk::dr
const float & dr() const
Definition: TRT_DetElementsLayer_xk.h:51
python.trfValidateRootFile.rc
rc
Definition: trfValidateRootFile.py:349
InDet::TRT_DetElementsLayer_xk::z
const float & z() const
Definition: TRT_DetElementsLayer_xk.h:52
fitman.k
k
Definition: fitman.py:528