ATLAS Offline Software
Functions
InDet::SiDetElementsRoadUtils_xk Namespace Reference

Functions

void detElementInformation (const InDetDD::SiDetectorElement &Si, double *P)
 

Function Documentation

◆ detElementInformation()

void InDet::SiDetElementsRoadUtils_xk::detElementInformation ( const InDetDD::SiDetectorElement Si,
double *  P 
)

Definition at line 42 of file SiDetElementsRoadUtils_xk.cxx.

43  {
44  const double pi2=2.*M_PI, pi= M_PI;
45 
46  double Sl = .5*Si.design().length ();
47  double Swmax = .5*Si.design().maxWidth();
48  double Swmin = .5*Si.design().minWidth();
49 
50  // Thickness of the waver
51  //
52  P[28] = Si.design().thickness();
53  Amg::Vector3D C = Si.center(); double x0=C.x(), y0=C.y(), z0=C.z();
54  Amg::Vector3D AT = Si.normal ();
55  Amg::Vector3D AF = Si.phiAxis();
56  Amg::Vector3D AE = Si.etaAxis();
57 
58  double A[3]={AT.x(),AT.y(),AT.z()};
59 
60  P[ 0] = sqrt(x0*x0+y0*y0);
61  P[ 1] = z0;
62  P[ 2] = atan2(y0,x0);
63  P[ 3] = A[0]*x0+A[1]*y0+A[2]*z0;
64  if(P[3]<0.) {P[3]*=-1.; A[0]*=-1.; A[1]*=-1.; A[2]*=-1.;}
65  P[ 7] = sqrt(A[0]*A[0]+A[1]*A[1]);
66 
67  if(P[7] >.000001) P[4]=atan2(A[1],A[0]); else P[4]=P[2];
68  sincos(P[4],&P[5],&P[6]);
69  P[ 8] = A[2];
70 
71  if( fabs(P[7]) <= .000001) {
72 
73  P[3] = fabs(P[1]);
74  if(P[8] > 0.) P[8] = 1.; else P[8] = -1.;
75  P[7] = 0.;
76  }
77 
78  double x[4],y[4],z[4];
79 
80  x[0] = x0+AF.x()*Swmax+AE.x()*Sl;
81  y[0] = y0+AF.y()*Swmax+AE.y()*Sl;
82  z[0] = z0+AF.z()*Swmax+AE.z()*Sl;
83 
84  x[1] = x0+AF.x()*Swmin-AE.x()*Sl;
85  y[1] = y0+AF.y()*Swmin-AE.y()*Sl;
86  z[1] = z0+AF.z()*Swmin-AE.z()*Sl;
87 
88  x[2] = x0-AF.x()*Swmin-AE.x()*Sl;
89  y[2] = y0-AF.y()*Swmin-AE.y()*Sl;
90  z[2] = z0-AF.z()*Swmin-AE.z()*Sl;
91 
92  x[3] = x0-AF.x()*Swmax+AE.x()*Sl;
93  y[3] = y0-AF.y()*Swmax+AE.y()*Sl;
94  z[3] = z0-AF.z()*Swmax+AE.z()*Sl;
95 
96  double rmin= 10000., rmax=-10000.;
97  double zmin= 10000., zmax=-10000.;
98  double fmin= 10000., fmax=-10000.;
99  for(int i=0; i!=4; ++i) {
100  double r = sqrt(x[i]*x[i]+y[i]*y[i]);
101  double f = atan2(y[i],x[i])-P[2]; if(f<-pi) f+=pi2; else if(f>pi) f-=pi2;
102  double zf= z[i];
103  if(r <rmin) rmin= r;
104  if(r >rmax) rmax= r;
105  if(zf<zmin) zmin=zf;
106  if(zf>zmax) zmax=zf;
107  if(f <fmin) fmin= f;
108  if(f >fmax) fmax= f;
109  }
110  P[ 9] = rmin;
111  P[10] = rmax;
112  P[11] = zmin;
113  P[12] = zmax;
114  P[13] = P[2]+fmin;
115  P[14] = P[2]+fmax;
116  P[15] = P[4]-P[2]; if(P[15]<-pi) P[15]+=pi2; else if(P[15]>pi) P[15]-=pi2;
117  P[16] = A[0]*x0+A[1]*y0;
118  P[17] = atan2(AE.y(),AE.x());
119  P[17] = P[17]-P[2]; if(P[17]<-pi) P[17]+=pi2; else if(P[17]>pi) P[17]-=pi2;
120 
121  // Calculation shape parameters
122  //
123  P[18] = y0*P[6]-x0*P[5]; // F center
124  P[19] = P[8]*(x0*P[6]+y0*P[5])-P[7]*z0; // ZR center
125  P[20] = +10000.; // -F
126  P[21] = 0. ; //
127  P[22] = 0. ; // +ZR
128  P[23] = -10000.; //
129  P[24] = -10000.; // +F
130  P[25] = 0. ; //
131  P[26] = 0. ; // -ZR
132  P[27] = +10000.; //
133  //
134  for(int i=0; i!=4; ++i) {
135 
136  int k1 = i;
137  int k2 = i+1; if(k2>3) k2=0;
138  double x1 = y[k1]*P[6]-x[k1]*P[5] -P[18];
139  double y1 = P[8]*(x[k1]*P[6]+y[k1]*P[5])-P[7]*z[k1]-P[19];
140  double x2 = y[k2]*P[6]-x[k2]*P[5] -P[18];
141  double y2 = P[8]*(x[k2]*P[6]+y[k2]*P[5])-P[7]*z[k2]-P[19];
142  double d = (x2-x1)*(x2-x1)+(y2-y1)*(y2-y1);
143  double ax =-(y2-y1)*(y1*x2-x1*y2)/d;
144  double ay = (x2-x1)*(y1*x2-x1*y2)/d;
145  if(ax<P[20]) {P[20]=ax; P[21]=ay;}
146  if(ax>P[24]) {P[24]=ax; P[25]=ay;}
147  if(ay<P[27]) {P[26]=ax; P[27]=ay;}
148  if(ay>P[23]) {P[22]=ax; P[23]=ay;}
149  }
150 
151  // Directions Phi and Eta in local system coordinates
152  //
153  P[29] = AF.y()*P[6]-AF.x()*P[5];
154  P[30] = P[8]*(AF.x()*P[6]+AF.y()*P[5])-P[7]*AF.z();
155  P[31] = AE.y()*P[6]-AE.x()*P[5];
156  P[32] = P[8]*(AE.x()*P[6]+AE.y()*P[5])-P[7]*AE.z();
157  }
beamspotman.r
def r
Definition: beamspotman.py:676
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
InDetDD::DetectorDesign::thickness
double thickness() const
Method which returns thickness of the silicon wafer.
Definition: DetectorDesign.h:271
fitman.ax
ax
Definition: fitman.py:522
PixelAthClusterMonAlgCfg.zmin
zmin
Definition: PixelAthClusterMonAlgCfg.py:169
hist_file_dump.d
d
Definition: hist_file_dump.py:137
DMTest::P
P_v1 P
Definition: P.h:23
InDetDD::SolidStateDetectorElementBase::center
virtual const Amg::Vector3D & center() const override final
Center in global coordinates.
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
python.HLT.MinBias.MinBiasMenuSequences.zf
zf
Definition: MinBiasMenuSequences.py:220
InDetDD::SolidStateDetectorElementBase::etaAxis
const Amg::Vector3D & etaAxis() const
Definition: SolidStateDetectorElementBase.cxx:88
DMTest::C
C_v1 C
Definition: C.h:26
python.PhysicalConstants.pi2
float pi2
Definition: PhysicalConstants.py:52
InDetDD::DetectorDesign::length
virtual double length() const =0
Method to calculate length of a module.
M_PI
#define M_PI
Definition: ActiveFraction.h:11
TRT_PAI_gasdata::AF
const float AF
Definition: TRT_PAI_gasdata.h:27
x
#define x
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
pi
#define pi
Definition: TileMuonFitter.cxx:65
A
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:169
hist_file_dump.f
f
Definition: hist_file_dump.py:135
InDetDD::DetectorDesign::maxWidth
virtual double maxWidth() const =0
Method to calculate maximum width of a module.
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
MuonR4::SegmentFit::ParamDefs::x0
@ x0
InDetDD::SolidStateDetectorElementBase::normal
virtual const Amg::Vector3D & normal() const override final
Get reconstruction local normal axes in global frame.
MuonR4::SegmentFit::ParamDefs::y0
@ y0
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
y
#define y
InDetDD::DetectorDesign::minWidth
virtual double minWidth() const =0
Method to calculate minimum width of a module.
InDetDD::SolidStateDetectorElementBase::phiAxis
const Amg::Vector3D & phiAxis() const
Definition: SolidStateDetectorElementBase.cxx:74
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
FlavorTagDiscriminants::AE
SG::AuxElement AE
Definition: BTagMuonAugmenter.h:36
fitman.ay
ay
Definition: fitman.py:525