ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::VertexPointEstimator Class Reference

Some helper tools like: hits counter. More...

#include <VertexPointEstimator.h>

Inheritance diagram for InDet::VertexPointEstimator:
Collaboration diagram for InDet::VertexPointEstimator:

Public Types

typedef std::map< std::string, float > Values_t

Public Member Functions

 VertexPointEstimator (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~VertexPointEstimator ()=default
virtual StatusCode initialize () override
virtual StatusCode finalize () override
Amg::Vector3D getCirclesIntersectionPoint (const Trk::Perigee *per1, const Trk::Perigee *per2, unsigned int flag, int &errorcode) const
 Get intersection point of two track helices.
Amg::Vector3D getCirclesIntersectionPoint (const Trk::Perigee *per1, const Trk::Perigee *per2, unsigned int flag, int &errorcode, Values_t &decors) const
 Get intersection point of two track helices.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()
static std::vector< std::string > decorKeys ()
 Return list of keys used for decorations.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Amg::Vector3D intersectionImpl (const Trk::Perigee *per1, const Trk::Perigee *per2, unsigned int flag, int &errorcode, float &deltaPhi, float &deltaR) const
 internal implementation
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Static Private Member Functions

static double areaVar (double, double, double, double, double, double, double &)
static double areaVar (double, double, double, double, double, double, double &, double &, double &)
static bool circleIntersection (double, double, double, double, double, double, double &, double &, double &, double &)
static bool secondDegree (double, double, double, double &, double &)
static double areaTriangle (double, double, double, double, double, double)

Private Attributes

DoubleArrayProperty m_maxDR
DoubleArrayProperty m_maxDZ
DoubleArrayProperty m_maxR
DoubleArrayProperty m_minArcLength
DoubleArrayProperty m_maxArcLength
DoubleArrayProperty m_minDr
DoubleArrayProperty m_maxDr
DoubleArrayProperty m_maxHl {this, "MaxHl", {10000., 10000., 10000.}, "maximum ratio H/l"}
DoubleArrayProperty m_maxPhi
BooleanProperty m_returnOnError {this, "ReturnOnError", true}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Static Private Attributes

static const double s_bmagnt = 2.083

Detailed Description

Some helper tools like: hits counter.

Author
Tatjana Lenz , Thomas Koffas

Definition at line 20 of file VertexPointEstimator.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

◆ Values_t

typedef std::map<std::string, float> InDet::VertexPointEstimator::Values_t

Definition at line 33 of file VertexPointEstimator.h.

Constructor & Destructor Documentation

◆ VertexPointEstimator()

InDet::VertexPointEstimator::VertexPointEstimator ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 25 of file VertexPointEstimator.cxx.

25 :
26 AthAlgTool(type, name, parent)
27 {
28 declareInterface<VertexPointEstimator>(this);
29 }
AthAlgTool()
Default constructor:

◆ ~VertexPointEstimator()

virtual InDet::VertexPointEstimator::~VertexPointEstimator ( )
virtualdefault

Member Function Documentation

◆ areaTriangle()

double InDet::VertexPointEstimator::areaTriangle ( double a,
double b,
double d,
double e,
double g,
double h )
staticprivate

Definition at line 500 of file VertexPointEstimator.cxx.

502 { // double i)
503 double c = 1;
504 double f = 1;
505 double i = 1;
506 return fabs(0.5* ( (a*e*i + d*h*c + b*f*g) - (g*e*c + d*b*i + a*f*h) ) );
507 }
static Double_t a

◆ areaVar() [1/2]

double InDet::VertexPointEstimator::areaVar ( double xc1,
double yc1,
double r1,
double xc2,
double yc2,
double r2,
double & phi )
staticprivate

Definition at line 355 of file VertexPointEstimator.cxx.

356 {
357 double ret = -999999;
358 double xi1;
359 double yi1;
360 double xi2;
361 double yi2;
362 if (circleIntersection( xc1, yc1, r1, xc2, yc2, r2, xi1, yi1, xi2, yi2 ))
363 {
364 double h = 0.5*(sqrt( pow(xi1-xi2,2) + pow(yi1-yi2,2) ));
365 double l = sqrt( pow(xc1-xc2,2) + pow(yc1-yc2,2) );
366 if (l!=0) ret = h/l;
367
368 double norm1 = sqrt((xi1-xc1)*(xi1-xc1)+(yi1-yc1)*(yi1-yc1));
369 double norm2 = sqrt((xi1-xc2)*(xi1-xc2)+(yi1-yc2)*(yi1-yc2));
370 if((norm1!=0.) && (norm2!=0.)){ //rejecting pathology
371 //centers at the origin
372 norm1 = 1./norm1;
373 norm2 = 1./norm2;
374 double xa = (xi1-xc1)*norm1;
375 double ya = (yi1-yc1)*norm1;
376 double xb = (xi1-xc2)*norm2;
377 double yb = (yi1-yc2)*norm2;
378 double costheta = xa*xb + ya*yb;
379 phi = M_PI-std::acos(costheta);
380 }
381 }
382 return ret;
383 }
#define M_PI
Scalar phi() const
phi method
constexpr int pow(int base, int exp) noexcept
static bool circleIntersection(double, double, double, double, double, double, double &, double &, double &, double &)
l
Printing final latex table to .tex output file.

◆ areaVar() [2/2]

double InDet::VertexPointEstimator::areaVar ( double xc1,
double yc1,
double r1,
double xc2,
double yc2,
double r2,
double & h,
double & hl,
double & ddphi )
staticprivate

Definition at line 395 of file VertexPointEstimator.cxx.

396 {
397 double ret = -999999;
398 double xi1;
399 double yi1;
400 double xi2;
401 double yi2;
402 h = 0;
403 hl = 0;
404 ddphi = 0.;
405 if (circleIntersection( xc1, yc1, r1, xc2, yc2, r2, xi1, yi1, xi2, yi2 )) {
406
407 // the two triangles have identical area
408 ret = areaTriangle(xc1,yc1, xc2,yc2, xi1,yi1) ;
409
410 h = 0.5*(sqrt( pow(xi1-xi2,2) + pow(yi1-yi2,2) ));
411
412 double l = sqrt( pow(xc1-xc2,2) + pow(yc1-yc2,2) );
413 if (l!=0) hl = h/l;
414
415 // |AxB| = |A||B|sin(phi) => sinphi = |AxB| / |A||B|
416 // (xi1,yi1) = first intersection point; this is the one I use
417 // (xi2,yi2) = second intersection point; this is symmetric to the first
418 // (xc1,yc1) = centre first circle
419 // (xc2,yc2) = centre second circle
420 double norm1 = sqrt(pow(xi1-xc1,2)+pow(yi1-yc1,2));
421 double norm2 = sqrt(pow(xi1-xc2,2)+pow(yi1-yc2,2));
422 if ((norm1 != 0) && (norm2 != 0)){ // rejecting pathology
423 // centres at the origin
424 double xa = (xi1 - xc1)/norm1;
425 double ya = (yi1 - yc1)/norm1;
426 double xb = (xi1 - xc2)/norm2;
427 double yb = (yi1 - yc2)/norm2;
428 double costheta = xa*xb +ya*yb;
429 double phi = M_PI-internal_acos(costheta);
430 ddphi = phi;
431 }
432 }
433
434 return ret;
435 }
static double areaTriangle(double, double, double, double, double, double)
double internal_acos(double x)

◆ circleIntersection()

bool InDet::VertexPointEstimator::circleIntersection ( double xc1,
double yc1,
double r1,
double xc2,
double yc2,
double r2,
double & xi1,
double & yi1,
double & xi2,
double & yi2 )
staticprivate

Definition at line 438 of file VertexPointEstimator.cxx.

442 {
443 // Calculate the intersection of the two circles:
444 //
445 // (x-xc1)^2 + (y-yc1)^2 = R1^2
446 // (x-xc2)^2 + (y-yc2)^2 = R2^2
447
448 xi1 = -999999999.;
449 xi2 = -999999999.;
450 yi1 = -999999999.;
451 yi2 = -999999999.;
452
453 if ( yc1 != yc2) {
454 double A = (xc1 - xc2) / (yc2- yc1);
455 double B = (r1*r1 - r2*r2 - xc1*xc1 + xc2*xc2 - yc1*yc1 + yc2*yc2) / 2. / ( yc2 -yc1);
456 double a = 1 + A*A;
457 double b = 2*A*B - 2*xc1 -2*A*yc1;
458 double c = B*B - 2*B*yc1 + xc1*xc1 + yc1*yc1 - r1*r1;
459 if (secondDegree(a,b,c,xi1,xi2) ){
460 yi1 = A*xi1 + B;
461 yi2 = A*xi2 + B;
462 return true;
463 }
464 return false;
465 }
466 if (xc1 != xc2){
467 double A = (yc1 - yc2) / (xc2- xc1);
468 double B = (r1*r1 - r2*r2 - xc1*xc1 + xc2*xc2 - yc1*yc1 + yc2*yc2) / 2. / ( xc2 -xc1);
469 double a = 1 + A*A;
470 double b = 2*A*B - 2*yc1 -2*A*xc1;
471 double c = B*B - 2*B*xc1 + xc1*xc1 + yc1*yc1 - r1*r1;
472 if (secondDegree(a,b,c,yi1,yi2) ){
473 xi1 = A*yi1 + B;
474 xi2 = A*yi2 + B;
475 return true;
476 }
477 return false;
478 }
479
480 // circles are concentric and we don't care
481 return false;
482
483 return false;
484 }
static bool secondDegree(double, double, double, double &, double &)

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ decorKeys()

std::vector< std::string > InDet::VertexPointEstimator::decorKeys ( )
static

Return list of keys used for decorations.

Definition at line 74 of file VertexPointEstimator.cxx.

75 {
76 return {"deltaPhiTracks", "DR1R2"};
77 }

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode InDet::VertexPointEstimator::finalize ( )
overridevirtual

Definition at line 42 of file VertexPointEstimator.cxx.

42 {
43 return StatusCode::SUCCESS;
44 }

◆ getCirclesIntersectionPoint() [1/2]

Amg::Vector3D InDet::VertexPointEstimator::getCirclesIntersectionPoint ( const Trk::Perigee * per1,
const Trk::Perigee * per2,
unsigned int flag,
int & errorcode ) const

Get intersection point of two track helices.

circles intersection point calculation

Based on pure geometric arguments. Return error flag if problems.

Definition at line 49 of file VertexPointEstimator.cxx.

53 {
54 float deltaPhi;
55 float deltaR;
56 return intersectionImpl (per1, per2, flag, errorcode, deltaPhi, deltaR);
57 }
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
Scalar deltaR(const MatrixBase< Derived > &vec) const
Amg::Vector3D intersectionImpl(const Trk::Perigee *per1, const Trk::Perigee *per2, unsigned int flag, int &errorcode, float &deltaPhi, float &deltaR) const
internal implementation

◆ getCirclesIntersectionPoint() [2/2]

Amg::Vector3D InDet::VertexPointEstimator::getCirclesIntersectionPoint ( const Trk::Perigee * per1,
const Trk::Perigee * per2,
unsigned int flag,
int & errorcode,
Values_t & decors ) const

Get intersection point of two track helices.

Based on pure geometric arguments. Return error flag if problems. Also return dictionary of values for decorations.

Definition at line 61 of file VertexPointEstimator.cxx.

66 {
67 decors.clear();
68 return intersectionImpl (per1, per2, flag, errorcode,
69 decors["deltaPhiTracks"],
70 decors["DR1R2"]);
71 }

◆ initialize()

StatusCode InDet::VertexPointEstimator::initialize ( )
overridevirtual

Definition at line 37 of file VertexPointEstimator.cxx.

37 {
38 return StatusCode::SUCCESS;
39 }

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & InDet::VertexPointEstimator::interfaceID ( )
static

Definition at line 32 of file VertexPointEstimator.cxx.

32 {
34 }
static const InterfaceID IID_IVertexPointEstimator("InDet::VertexPointEstimator", 1, 0)

◆ intersectionImpl()

Amg::Vector3D InDet::VertexPointEstimator::intersectionImpl ( const Trk::Perigee * per1,
const Trk::Perigee * per2,
unsigned int flag,
int & errorcode,
float & deltaPhi,
float & deltaR ) const
private

internal implementation

Definition at line 83 of file VertexPointEstimator.cxx.

89 {
90 /*
91 Calculates the initial approximation to the vertex position. Based on CTVMFT.
92 Tries to intersect circles that are (R,Phi) projections of the helical trajectories of the two tracks
93 If the circles intersect, the intersection with smaller z difference between the 2 helices extrapolated to the intersection is chosen.
94 If the circles do not intersect, the vertex approximation is taken as the point of closest approach of the two circles.
95 per1 should be that of the track with the smaller radius
96 */
97 Amg::Vector3D intPoint(0.,0.,0.);
98 double aconst = -1.49898*s_bmagnt; //is it correct???????????????????
99 double DRMAX = 0.; // maximum XY separation, non-intersecting circles
100 double DZMAX = 0.; // maximum allowed track Z separation at the vertex
101 double RVMAX = 0.; // maximum allowed vertex radius
102 double minArcLength(0.);
103 double maxArcLength(0.);
104 double minDr(0.);
105 double maxDr(0.);
106 double maxHl(0.);
107 double maxPhi(0.);
108 if (flag <= 2) {
109 DRMAX = m_maxDR[flag]; //maximum XY separation, non-intersecting circles
110 DZMAX = m_maxDZ[flag]; //maximum allowed track Z separation at the vertex
111 RVMAX = m_maxR[flag] ; //maximum allowed vertex radius
112 minArcLength = m_minArcLength[flag];
113 maxArcLength = m_maxArcLength[flag];
114 minDr = m_minDr[flag];
115 maxDr = m_maxDr[flag];
116 maxHl = m_maxHl[flag];
117 maxPhi= m_maxPhi[flag];
118 }
119
120 double d0[2];
121 double z0[2];
122 double phi[2];
123 double cotTheta[2];
124 double qOverPt[2];
125 double RC[2];
126 double XC[2];
127 double YC[2];
128 double RA[2];
129 double AB[2];
130 double XSVI[2];
131 double YSVI[2];
132 double ZSVI[2];
133 double RVI[2];
134 double DZSVI[2];
135 double SS1[2];
136 double SS2[2];
137 double ZZ1[2];
138 double ZZ2[2];
139
140 double X=0.;
141 double Y=0.;
142 double Z=0.;
143 for (int I=0; I<2; ++I) {
144 d0[I] = -999.;
145 z0[I] = -999.;
146 phi[I] = -999.;
147 cotTheta[I] = -999.;
148 qOverPt[I] = -999.;
149 RC[I] = -999.;
150 XC[I] = -999.;
151 YC[I] = -999.;
152 RA[I] = +999.;
153 AB[I] = +999.;
154 XSVI[I] = 0.;
155 YSVI[I] = 0.;
156 ZSVI[I] = 0.;
157 RVI[I] = 2.0*RVMAX;
158 DZSVI[I] = 2.0*DZMAX;
159 SS1[I] = 0.;
160 SS2[I] = 0.;
161 ZZ1[I] = 0.;
162 ZZ2[I] = 0.;
163 }
164
165 double U(0.);
166 const AmgVector(5)& perParam1 = per1->parameters();
167 double pt1 = fabs(sin(perParam1[Trk::theta])/perParam1[Trk::qOverP]);
168 const AmgVector(5)& perParam2 = per2->parameters();
169 double pt2 = fabs(sin(perParam2[Trk::theta])/perParam2[Trk::qOverP]);
170 if (pt1 < pt2) {
171 d0[0] = perParam1[Trk::d0]; d0[1] = perParam2[Trk::d0];
172 z0[0] = perParam1[Trk::z0]; z0[1] = perParam2[Trk::z0];
173 phi[0] = perParam1[Trk::phi]; phi[1] = perParam2[Trk::phi];
174 double theta1 = perParam1[Trk::theta]; cotTheta[0] = 1./tan(theta1);
175 double theta2 = perParam2[Trk::theta]; cotTheta[1] = 1./tan(theta2);
176 double qOverP1 = perParam1[Trk::qOverP]; qOverPt[0] = qOverP1/sin(perParam1[Trk::theta]);
177 double qOverP2 = perParam2[Trk::qOverP]; qOverPt[1] = qOverP2/sin(perParam2[Trk::theta]);
178 RC[0] = 10.*0.5/(qOverPt[0]*aconst); RC[1] = 10.*0.5/(qOverPt[1]*aconst);//Radius of curvature
179 U = RC[0] + d0[0];
180 XC[0] = -1*U*sin(phi[0]); //Circle center x-coordinate
181 YC[0] = U*cos(phi[0]); //Circle center y-coordinate
182 RA[0] = fabs(RC[0]);
183 U = RC[1] + d0[1];
184 XC[1] = -1*U*sin(phi[1]); // Circle center x-coordinate
185 YC[1] = U*cos(phi[1]); // Circle center y-coordinate
186 RA[1] = fabs(RC[1]);
187 } else {
188 d0[0] = perParam2[Trk::d0]; d0[1] = perParam1[Trk::d0];
189 z0[0] = perParam2[Trk::z0]; z0[1] = perParam1[Trk::z0];
190 phi[0] = perParam2[Trk::phi]; phi[1] = perParam1[Trk::phi];
191 double theta2 = perParam2[Trk::theta]; cotTheta[0] = 1./tan(theta2);
192 double theta1 = perParam1[Trk::theta]; cotTheta[1] = 1./tan(theta1);
193 double qOverP2 = perParam2[Trk::qOverP]; qOverPt[0] = qOverP2/sin(perParam2[Trk::theta]);
194 double qOverP1 = perParam1[Trk::qOverP]; qOverPt[1] = qOverP1/sin(perParam1[Trk::theta]);
195 RC[0] = 10.*0.5/(qOverPt[0]*aconst); RC[1] = 10.*0.5/(qOverPt[1]*aconst);//Radius of curvature
196 double U = RC[0] + d0[0];
197 XC[0] = -1*U*sin(phi[0]); //Circle center x-coordinate
198 YC[0] = U*cos(phi[0]); //Circle center y-coordinate
199 RA[0] = fabs(RC[0]);
200 U = RC[1] + d0[1];
201 XC[1] = -1*U*sin(phi[1]); // Circle center x-coordinate
202 YC[1] = U*cos(phi[1]); // Circle center y-coordinate
203 RA[1] = fabs(RC[1]);
204 }
205
206 // get the circle centre separation
207 double DX = XC[1] - XC[0];
208 double DY = YC[1] - YC[0];
209 double D = DX*DX + DY*DY;
210 D = sqrt(D);
211 if (D == 0.) {
212 ATH_MSG_DEBUG("Concentric circles, should not happen return (0,0,0)");
213 errorcode = 1;
214 if(m_returnOnError) return intPoint;
215 }
216 U = D - RA[0] - RA[1]; // signed separation, if > 0., the circles do not intersect, if < 0., they might
217 // rotate, translate to a system, where the two circle centres lie on the X axis
218
219 //New cut from Mauro
220 deltaR = U; double PHI = -99999.;
221 double hl = areaVar(XC[0], YC[0], RA[0], XC[1], YC[1], RA[1], PHI);
222
223 double COST = DX/D;
224 double SINT = DY/D;
225 double Y0 = (-1*XC[0]*YC[1] + XC[1]*YC[0])/D; //Translation along the y-axis
226 for (int I=0; I<2; ++I) {
227 AB[I] = COST*XC[I] + SINT*YC[I]; // The new circle center positions in the rotated system. Essentially the new x-coordinates, since the y-coordinates are 0.
228 }
229 U = (XC[1] + XC[0])*(XC[1] - XC[0]) + (YC[1] + YC[0])*(YC[1] - YC[0]);
230 double V = (RA[1] + RA[0])*(RA[1] - RA[0]);
231 double XX = 0.5*(U - V)/D; // X of intersection in rotated coordinate system (a+AB[0]). Again the y is 0.
232 if ((XX - AB[0])*(XX - AB[0]) > 0.) {
233 U = sqrt((XX - AB[0])*(XX - AB[0])); //This is the a in my logbook
234 }
235 double YY2 = (RA[0] + U)*(RA[0] - U); //This is the h^2 in my logbook
236 double YY;
237 int nsol = 0;
238 if (YY2 > 0.) {
239
240 // the circles intersect
241 YY = sqrt(YY2); // two intersection points (+/- Y) or (+/- h) in my logbook
242
243 for (int I=0; I<2; ++I) {
244 U = YY + Y0; // invert the translation
245 XSVI[I] = COST*XX - SINT*U; // Invert the rotation
246 YSVI[I] = SINT*XX + COST*U;
247 YY = -1*YY;
248 }
249
250 nsol = 2;
251
252 } else {
253 // circles do not intersect - find how close they approach each other
254 // in the XY plane and take the point half way between them
255 U = D - RA[0] - RA[1];
256 if (U > 0.) {
257 //Circles do not overlap at all and are outside from each other.See logbook
258 V = U;
259 XX = AB[1] + RA[1];
260
261 if (AB[0] < AB[1]) XX = AB[0] + RA[0];
262 } else {
263 //Circles inside each other but off-centered.See logbook
264 if (AB[0] < AB[1]) { //To the left
265 XX = AB[1] - RA[1];
266 V = AB[0] - RA[0] - XX;
267 } else {
268 //To the right
269 XX = AB[0] + RA[0];
270 V = AB[1] + RA[1] - XX;
271 }
272 }
273 XX = XX + 0.5*V;
274 XSVI[0] = COST*XX - SINT*Y0; // rotate back to the original system
275 YSVI[0] = SINT*XX + COST*Y0; // one solution
276 nsol = 1;
277 if (V > DRMAX) {
278 //Cut if distance of minimum approach is too big
279 ATH_MSG_DEBUG("XY distance of minimum approach is too large, return (0,0,0)");
280 errorcode = 2;
281 if(m_returnOnError) return intPoint;
282 }
283 }
284
285 for (int J=0; J<nsol; ++J) { // loop over solutions
286 U = (XSVI[J] - XC[0])/RC[0];
287 V = -1*(YSVI[J] - YC[0])/RC[0];
288 U = atan2(U,V) - phi[0]; // turning angle from the track origin
289 if (U < -1*pi) U = U + twopi;
290 if (U > pi) U = U - twopi;
291 SS1[J] = RC[0]*U; // arc length
292 ZZ1[J] = z0[0] + SS1[J]*cotTheta[0];
293 U = (XSVI[J] - XC[1])/RC[1];
294 V = -1*(YSVI[J] - YC[1])/RC[1];
295 U = atan2(U,V) - phi[1];
296 if (U < -1*pi) U = U + twopi;
297 if (U > pi) U = U - twopi;
298 SS2[J] = RC[1]*U;
299 ZZ2[J] = z0[1] + SS1[J]*cotTheta[1];
300 RVI[J] = sqrt(XSVI[J]*XSVI[J] + YSVI[J]*YSVI[J]);
301 DZSVI[J] = ZZ2[J] - ZZ1[J];
302 }
303 ZSVI[0] = 0.5*(ZZ1[0] + ZZ2[0]);
304 ZSVI[1] = 0.5*(ZZ1[1] + ZZ2[1]);
305
306 if (std::min(RVI[0],RVI[1]) > RVMAX) { // check the vertex radius is acceptable
307 ATH_MSG_DEBUG("Unacceptable vertex radius");
308 errorcode = 3;
309 }
310
311 if (std::min(fabs(DZSVI[0]),fabs(DZSVI[1])) > DZMAX) { // check the Z difference
312 ATH_MSG_DEBUG("Unacceptable Z difference");
313 errorcode = 4;
314 }
315
316 double A = std::min(SS1[0],SS2[0]); // minimum track arc length, solution 1
317 double B = std::min(SS1[1],SS2[1]); // minimum track arc length, solution 2
318 if (std::max(A,B) < minArcLength || std::max(A,B) > maxArcLength) { // limit the minimum arc length
319 ATH_MSG_DEBUG("Unacceptable arc length");
320 errorcode = 5;
321 if(m_returnOnError) return intPoint;
322 }
323
324 int J = 0;
325 if ( nsol == 2 && (fabs(DZSVI[1]) < fabs(DZSVI[0])) ) J = 1;
326
327 X = XSVI[J];
328 Y = YSVI[J];
329 Z = ZSVI[J];
330 intPoint(0)=X; intPoint(1)=Y; intPoint(2)=Z;
331
332 if(deltaR>maxDr || deltaR<minDr){
333 ATH_MSG_DEBUG("Unaceptable circle distance");
334 errorcode = 6;
335 if(m_returnOnError) return intPoint;
336 }
337
338 if(hl>maxHl){
339 ATH_MSG_DEBUG("Unacceptable h/D ratio");
340 errorcode = 7;
341 if(m_returnOnError) return intPoint;
342 }
343
344 deltaPhi = PHI; // quick fix: cannot get rid of (double) PHI as it is passed by ref and deltaPhi is a float
345 if(deltaPhi>maxPhi){
346 ATH_MSG_DEBUG("Unacceptable difference in phi");
347 errorcode = 8;
348 if(m_returnOnError) return intPoint;
349 }
350
351 return intPoint;
352 }
#define ATH_MSG_DEBUG(x)
#define AmgVector(rows)
#define I(x, y, z)
Definition MD5.cxx:116
#define pi
constexpr double twopi
static double areaVar(double, double, double, double, double, double, double &)
Eigen::Matrix< double, 3, 1 > Vector3D
@ theta
Definition ParamDefs.h:66
@ qOverP
perigee
Definition ParamDefs.h:67
@ phi
Definition ParamDefs.h:75
@ d0
Definition ParamDefs.h:63
@ z0
Definition ParamDefs.h:64
bool flag
Definition master.py:29

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ secondDegree()

bool InDet::VertexPointEstimator::secondDegree ( double a,
double b,
double c,
double & y1,
double & y2 )
staticprivate

Definition at line 487 of file VertexPointEstimator.cxx.

488 {
489 y1 = -999999999;
490 y2 = -999999999;
491 double discr = b*b - 4*a*c;
492 if (discr < 0) return false;
493 y1 = (-b+sqrt(discr))/2./a;
494 y2 = (-b-sqrt(discr))/2./a;
495 return true;
496
497 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_maxArcLength

DoubleArrayProperty InDet::VertexPointEstimator::m_maxArcLength
private
Initial value:
{this, "MaxArcLength", {10000., 10000., 10000.},
"maximum permitted arc length, track to vertex, depends on the posion of the first measurement"}

Definition at line 91 of file VertexPointEstimator.h.

92 {this, "MaxArcLength", {10000., 10000., 10000.},
93 "maximum permitted arc length, track to vertex, depends on the posion of the first measurement"};

◆ m_maxDR

DoubleArrayProperty InDet::VertexPointEstimator::m_maxDR
private
Initial value:
{this, "MaxTrkXYDiffAtVtx", {10000., 10000., 10000.},
"maximum XY separation, non-intersecting circles"}

Definition at line 79 of file VertexPointEstimator.h.

80 {this, "MaxTrkXYDiffAtVtx", {10000., 10000., 10000.},
81 "maximum XY separation, non-intersecting circles"};

◆ m_maxDr

DoubleArrayProperty InDet::VertexPointEstimator::m_maxDr
private
Initial value:
{this, "MaxDeltaR", {5., 10., 10.},
"maximum difference between helix centers"}

Definition at line 97 of file VertexPointEstimator.h.

98 {this, "MaxDeltaR", {5., 10., 10.},
99 "maximum difference between helix centers"};

◆ m_maxDZ

DoubleArrayProperty InDet::VertexPointEstimator::m_maxDZ
private
Initial value:
{this, "MaxTrkZDiffAtVtx", {10000., 10000., 10000.},
"maximum allowed track Z separation at the vertex"}

Definition at line 82 of file VertexPointEstimator.h.

83 {this, "MaxTrkZDiffAtVtx", {10000., 10000., 10000.},
84 "maximum allowed track Z separation at the vertex"};

◆ m_maxHl

DoubleArrayProperty InDet::VertexPointEstimator::m_maxHl {this, "MaxHl", {10000., 10000., 10000.}, "maximum ratio H/l"}
private

Definition at line 100 of file VertexPointEstimator.h.

101{this, "MaxHl", {10000., 10000., 10000.}, "maximum ratio H/l"};

◆ m_maxPhi

DoubleArrayProperty InDet::VertexPointEstimator::m_maxPhi
private
Initial value:
{this, "MaxPhi", {0.05, 0.1, 0.1},
"maximum DPhi at the estimated vertex position"}

Definition at line 102 of file VertexPointEstimator.h.

103 {this, "MaxPhi", {0.05, 0.1, 0.1},
104 "maximum DPhi at the estimated vertex position"};

◆ m_maxR

DoubleArrayProperty InDet::VertexPointEstimator::m_maxR
private
Initial value:
{this, "MaxTrkXYValue", {10000., 10000., 10000.},
"maximum allowed vertex radius"}

Definition at line 85 of file VertexPointEstimator.h.

86 {this, "MaxTrkXYValue", {10000., 10000., 10000.},
87 "maximum allowed vertex radius"};

◆ m_minArcLength

DoubleArrayProperty InDet::VertexPointEstimator::m_minArcLength
private
Initial value:
{this, "MinArcLength", {-10000., -10000., -10000.},
"minimum permitted arc length, track to vertex, depends on the posion of the first measurement"}

Definition at line 88 of file VertexPointEstimator.h.

89 {this, "MinArcLength", {-10000., -10000., -10000.},
90 "minimum permitted arc length, track to vertex, depends on the posion of the first measurement"};

◆ m_minDr

DoubleArrayProperty InDet::VertexPointEstimator::m_minDr
private
Initial value:
{this, "MinDeltaR", {-5., -25., -50.},
"minimum difference between helix centers"}

Definition at line 94 of file VertexPointEstimator.h.

95 {this, "MinDeltaR", {-5., -25., -50.},
96 "minimum difference between helix centers"};

◆ m_returnOnError

BooleanProperty InDet::VertexPointEstimator::m_returnOnError {this, "ReturnOnError", true}
private

Definition at line 105 of file VertexPointEstimator.h.

105{this, "ReturnOnError", true};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ s_bmagnt

const double InDet::VertexPointEstimator::s_bmagnt = 2.083
staticprivate

Definition at line 78 of file VertexPointEstimator.h.


The documentation for this class was generated from the following files: