BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
KalmanFit::Helix Class Reference

Helix parameter class. More...

#include <Helix.h>

Inheritance diagram for KalmanFit::Helix:

Public Member Functions

 Helix (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 Constructor with pivot, helix parameter a, and its error matrix.
 Helix (const HepPoint3D &pivot, const HepVector &a)
 Constructor without error matrix.
 Helix (const HepPoint3D &position, const Hep3Vector &momentum, double charge)
 Constructor with position, momentum, and charge.
virtual ~Helix ()
 Destructor.
const HepPoint3Dcenter (void) const
 returns position of helix center(z = 0.);
const HepPoint3Dpivot (void) const
 returns pivot position.
double radius (void) const
 returns radious of helix.
HepPoint3D x (double dPhi=0.) const
 returns position after rotating angle dPhi in phi direction.
double * x (double dPhi, double p[3]) const
HepPoint3D x (double dPhi, HepSymMatrix &Ex) const
 returns position and convariance matrix(Ex) after rotation.
Hep3Vector direction (double dPhi=0.) const
 returns direction vector after rotating angle dPhi in phi direction.
Hep3Vector momentum (double dPhi=0.) const
 returns momentum vector after rotating angle dPhi in phi direction.
Hep3Vector momentum (double dPhi, HepSymMatrix &Em) const
 returns momentum vector after rotating angle dPhi in phi direction.
HepLorentzVector momentum (double dPhi, double mass) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
HepLorentzVector momentum (double dPhi, double mass, HepSymMatrix &Em) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
HepLorentzVector momentum (double dPhi, double mass, HepPoint3D &x, HepSymMatrix &Emx) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
double dr (void) const
 returns an element of parameters.
double phi0 (void) const
double kappa (void) const
double dz (void) const
double tanl (void) const
double curv (void) const
double sinPhi0 (void) const
double cosPhi0 (void) const
const HepVector & a (void) const
 returns helix parameters.
const HepSymMatrix & Ea (void) const
 returns error matrix.
double approach (KalFitHitMdc &hit, bool doSagCorrection) const
double approach (HepPoint3D pfwd, HepPoint3D pbwd, bool doSagCorrection) const
const HepVector & a (const HepVector &newA)
 sets helix parameters.
const HepSymMatrix & Ea (const HepSymMatrix &newdA)
 sets helix paramters and error matrix.
const HepPoint3Dpivot (const HepPoint3D &newPivot)
 sets pivot position.
void set (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 sets helix pivot position, parameters, and error matrix.
void ignoreErrorMatrix (void)
double bFieldZ (double)
 sets/returns z componet of the magnetic field.
double bFieldZ (void) const
double alpha (void) const
Helixoperator= (const Helix &)
 Copy operator.
HepMatrix delApDelA (const HepVector &ap) const
HepMatrix delXDelA (double phi) const
HepMatrix delMDelA (double phi) const
HepMatrix del4MDelA (double phi, double mass) const
HepMatrix del4MXDelA (double phi, double mass) const
 Helix (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 Constructor with pivot, helix parameter a, and its error matrix.
 Helix (const HepPoint3D &pivot, const HepVector &a)
 Constructor without error matrix.
 Helix (const HepPoint3D &position, const Hep3Vector &momentum, double charge)
 Constructor with position, momentum, and charge.
virtual ~Helix ()
 Destructor.
const HepPoint3Dcenter (void) const
 returns position of helix center(z = 0.);
const HepPoint3Dpivot (void) const
 returns pivot position.
double radius (void) const
 returns radious of helix.
HepPoint3D x (double dPhi=0.) const
 returns position after rotating angle dPhi in phi direction.
double * x (double dPhi, double p[3]) const
HepPoint3D x (double dPhi, HepSymMatrix &Ex) const
 returns position and convariance matrix(Ex) after rotation.
Hep3Vector direction (double dPhi=0.) const
 returns direction vector after rotating angle dPhi in phi direction.
Hep3Vector momentum (double dPhi=0.) const
 returns momentum vector after rotating angle dPhi in phi direction.
Hep3Vector momentum (double dPhi, HepSymMatrix &Em) const
 returns momentum vector after rotating angle dPhi in phi direction.
HepLorentzVector momentum (double dPhi, double mass) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
HepLorentzVector momentum (double dPhi, double mass, HepSymMatrix &Em) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
HepLorentzVector momentum (double dPhi, double mass, HepPoint3D &x, HepSymMatrix &Emx) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
double dr (void) const
 returns an element of parameters.
double phi0 (void) const
double kappa (void) const
double dz (void) const
double tanl (void) const
double curv (void) const
double sinPhi0 (void) const
double cosPhi0 (void) const
const HepVector & a (void) const
 returns helix parameters.
const HepSymMatrix & Ea (void) const
 returns error matrix.
double approach (KalFitHitMdc &hit, bool doSagCorrection) const
double approach (HepPoint3D pfwd, HepPoint3D pbwd, bool doSagCorrection) const
const HepVector & a (const HepVector &newA)
 sets helix parameters.
const HepSymMatrix & Ea (const HepSymMatrix &newdA)
 sets helix paramters and error matrix.
const HepPoint3Dpivot (const HepPoint3D &newPivot)
 sets pivot position.
void set (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 sets helix pivot position, parameters, and error matrix.
void ignoreErrorMatrix (void)
double bFieldZ (double)
 sets/returns z componet of the magnetic field.
double bFieldZ (void) const
double alpha (void) const
Helixoperator= (const Helix &)
 Copy operator.
HepMatrix delApDelA (const HepVector &ap) const
HepMatrix delXDelA (double phi) const
HepMatrix delMDelA (double phi) const
HepMatrix del4MDelA (double phi, double mass) const
HepMatrix del4MXDelA (double phi, double mass) const
 Helix (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 Constructor with pivot, helix parameter a, and its error matrix.
 Helix (const HepPoint3D &pivot, const HepVector &a)
 Constructor without error matrix.
 Helix (const HepPoint3D &position, const Hep3Vector &momentum, double charge)
 Constructor with position, momentum, and charge.
virtual ~Helix ()
 Destructor.
const HepPoint3Dcenter (void) const
 returns position of helix center(z = 0.);
const HepPoint3Dpivot (void) const
 returns pivot position.
double radius (void) const
 returns radious of helix.
HepPoint3D x (double dPhi=0.) const
 returns position after rotating angle dPhi in phi direction.
double * x (double dPhi, double p[3]) const
HepPoint3D x (double dPhi, HepSymMatrix &Ex) const
 returns position and convariance matrix(Ex) after rotation.
Hep3Vector direction (double dPhi=0.) const
 returns direction vector after rotating angle dPhi in phi direction.
Hep3Vector momentum (double dPhi=0.) const
 returns momentum vector after rotating angle dPhi in phi direction.
Hep3Vector momentum (double dPhi, HepSymMatrix &Em) const
 returns momentum vector after rotating angle dPhi in phi direction.
HepLorentzVector momentum (double dPhi, double mass) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
HepLorentzVector momentum (double dPhi, double mass, HepSymMatrix &Em) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
HepLorentzVector momentum (double dPhi, double mass, HepPoint3D &x, HepSymMatrix &Emx) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
double dr (void) const
 returns an element of parameters.
double phi0 (void) const
double kappa (void) const
double dz (void) const
double tanl (void) const
double curv (void) const
double sinPhi0 (void) const
double cosPhi0 (void) const
const HepVector & a (void) const
 returns helix parameters.
const HepSymMatrix & Ea (void) const
 returns error matrix.
double approach (KalFitHitMdc &hit, bool doSagCorrection) const
double approach (HepPoint3D pfwd, HepPoint3D pbwd, bool doSagCorrection) const
const HepVector & a (const HepVector &newA)
 sets helix parameters.
const HepSymMatrix & Ea (const HepSymMatrix &newdA)
 sets helix paramters and error matrix.
const HepPoint3Dpivot (const HepPoint3D &newPivot)
 sets pivot position.
void set (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 sets helix pivot position, parameters, and error matrix.
void ignoreErrorMatrix (void)
double bFieldZ (double)
 sets/returns z componet of the magnetic field.
double bFieldZ (void) const
double alpha (void) const
Helixoperator= (const Helix &)
 Copy operator.
HepMatrix delApDelA (const HepVector &ap) const
HepMatrix delXDelA (double phi) const
HepMatrix delMDelA (double phi) const
HepMatrix del4MDelA (double phi, double mass) const
HepMatrix del4MXDelA (double phi, double mass) const

Static Public Attributes

static const double ConstantAlpha = 333.564095
 Constant alpha for uniform field.

Detailed Description

Helix parameter class.

Definition at line 36 of file InstallArea/x86_64-el9-gcc13-dbg/include/KalFitAlg/helix/Helix.h.

Constructor & Destructor Documentation

◆ Helix() [1/9]

Helix::Helix ( const HepPoint3D & pivot,
const HepVector & a,
const HepSymMatrix & Ea )

Constructor with pivot, helix parameter a, and its error matrix.

Definition at line 44 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

46 : // m_bField(-10.0),
47 // m_alpha(-333.564095),
48 m_pivot( pivot )
49 , m_a( a )
50 , m_matrixValid( true )
51 , m_Ea( Ea ) {
52 StatusCode scmgn = Gaudi::svcLocator()->service( "MagneticFieldSvc", m_pmgnIMF );
53 if ( scmgn != StatusCode::SUCCESS )
54 { std::cout << "Unable to open Magnetic field service" << std::endl; }
55 m_bField = 10000 * ( m_pmgnIMF->getReferField() );
56 m_alpha = 10000. / 2.99792458 / m_bField;
57 // m_alpha = 10000. / 2.99792458 / m_bField;
58 // m_alpha = 333.564095;
59 updateCache();
60 }
const HepSymMatrix & Ea(void) const
returns error matrix.
const HepVector & a(void) const
returns helix parameters.
const HepPoint3D & pivot(void) const
returns pivot position.

Referenced by approach(), approach(), KalFitTrack::chi2_next(), KalFitTrack::chi2_next(), KalFitHelixSeg::KalFitHelixSeg(), operator=(), KalFitTrack::order_wirhit(), KalFitTrack::pivot_numf(), and KalFitTrack::update_hits_csmalign().

◆ Helix() [2/9]

Helix::Helix ( const HepPoint3D & pivot,
const HepVector & a )

Constructor without error matrix.

Definition at line 62 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

64 : // m_bField(-10.0),
65 // m_alpha(-333.564095),
66 m_pivot( pivot )
67 , m_a( a )
68 , m_matrixValid( false )
69 , m_Ea( HepSymMatrix( 5, 0 ) ) {
70 StatusCode scmgn = Gaudi::svcLocator()->service( "MagneticFieldSvc", m_pmgnIMF );
71 if ( scmgn != StatusCode::SUCCESS )
72 {
73 // log << MSG::ERROR << "Unable to open Magnetic field service"<<endmsg;
74 std::cout << "Unable to open Magnetic field service" << std::endl;
75 }
76 m_bField = 10000 * ( m_pmgnIMF->getReferField() );
77 m_alpha = 10000. / 2.99792458 / m_bField;
78 // m_alpha = 333.564095;
79 // cout<<"MdcFastTrakAlg:: bField,alpha: "<<m_bField<<" , "<<m_alpha<<endl;
80 updateCache();
81 }

◆ Helix() [3/9]

Helix::Helix ( const HepPoint3D & position,
const Hep3Vector & momentum,
double charge )

Constructor with position, momentum, and charge.

Definition at line 83 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

85 : // m_bField(-10.0),
86 // m_alpha(-333.564095),
87 m_pivot( position )
88 , m_a( HepVector( 5, 0 ) )
89 , m_matrixValid( false )
90 , m_Ea( HepSymMatrix( 5, 0 ) ) {
91 StatusCode scmgn = Gaudi::svcLocator()->service( "MagneticFieldSvc", m_pmgnIMF );
92 if ( scmgn != StatusCode::SUCCESS )
93 {
94 // log << MSG::ERROR << "Unable to open Magnetic field service"<<endmsg;
95 std::cout << "Unable to open Magnetic field service" << std::endl;
96 }
97 m_bField = 10000 * ( m_pmgnIMF->getReferField() );
98 m_alpha = 10000. / 2.99792458 / m_bField;
99
100 m_a[0] = 0.;
101 m_a[1] = fmod( atan2( -momentum.x(), momentum.y() ) + M_PI4, M_PI2 );
102 m_a[3] = 0.;
103 double perp( momentum.perp() );
104 if ( perp != 0.0 )
105 {
106 m_a[2] = charge / perp;
107 m_a[4] = momentum.z() / perp;
108 }
109 else
110 {
111 m_a[2] = charge * ( DBL_MAX );
112 if ( momentum.z() >= 0 ) { m_a[4] = ( DBL_MAX ); }
113 else { m_a[4] = -( DBL_MAX ); }
114 }
115 // m_alpha = 333.564095;
116 updateCache();
117 }
const double M_PI2
const double M_PI4
Hep3Vector momentum(double dPhi=0.) const
returns momentum vector after rotating angle dPhi in phi direction.

◆ ~Helix() [1/3]

Helix::~Helix ( )
virtual

Destructor.

Definition at line 119 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

119{}

◆ Helix() [4/9]

KalmanFit::Helix::Helix ( const HepPoint3D & pivot,
const HepVector & a,
const HepSymMatrix & Ea )

Constructor with pivot, helix parameter a, and its error matrix.

◆ Helix() [5/9]

KalmanFit::Helix::Helix ( const HepPoint3D & pivot,
const HepVector & a )

Constructor without error matrix.

◆ Helix() [6/9]

KalmanFit::Helix::Helix ( const HepPoint3D & position,
const Hep3Vector & momentum,
double charge )

Constructor with position, momentum, and charge.

◆ ~Helix() [2/3]

virtual KalmanFit::Helix::~Helix ( )
virtual

Destructor.

◆ Helix() [7/9]

KalmanFit::Helix::Helix ( const HepPoint3D & pivot,
const HepVector & a,
const HepSymMatrix & Ea )

Constructor with pivot, helix parameter a, and its error matrix.

◆ Helix() [8/9]

KalmanFit::Helix::Helix ( const HepPoint3D & pivot,
const HepVector & a )

Constructor without error matrix.

◆ Helix() [9/9]

KalmanFit::Helix::Helix ( const HepPoint3D & position,
const Hep3Vector & momentum,
double charge )

Constructor with position, momentum, and charge.

◆ ~Helix() [3/3]

virtual KalmanFit::Helix::~Helix ( )
virtual

Destructor.

Member Function Documentation

◆ a() [1/6]

const HepVector & Helix::a ( const HepVector & newA)
inline

sets helix parameters.

Definition at line 207 of file InstallArea/x86_64-el9-gcc13-dbg/include/KalFitAlg/helix/Helix.h.

207 {
208 m_a = i;
209 updateCache();
210 return m_a;
211 }

◆ a() [2/6]

const HepVector & KalmanFit::Helix::a ( const HepVector & newA)

sets helix parameters.

◆ a() [3/6]

const HepVector & KalmanFit::Helix::a ( const HepVector & newA)

sets helix parameters.

◆ a() [4/6]

◆ a() [5/6]

const HepVector & KalmanFit::Helix::a ( void ) const

returns helix parameters.

◆ a() [6/6]

const HepVector & KalmanFit::Helix::a ( void ) const

returns helix parameters.

◆ alpha() [1/3]

double Helix::alpha ( void ) const
inline

Definition at line 224 of file InstallArea/x86_64-el9-gcc13-dbg/include/KalFitAlg/helix/Helix.h.

224{ return m_alpha; }

◆ alpha() [2/3]

double KalmanFit::Helix::alpha ( void ) const

◆ alpha() [3/3]

double KalmanFit::Helix::alpha ( void ) const

◆ approach() [1/6]

double Helix::approach ( HepPoint3D pfwd,
HepPoint3D pbwd,
bool doSagCorrection ) const

Definition at line 198 of file KalFitDoca.cxx.

198 {
199 // ...Cal. dPhi to rotate...
200 // const TMDCWire & w = * link.wire();
201 HepPoint3D positionOnWire, positionOnTrack;
202 HepPoint3D pv = pivot();
203 HepVector Va = a();
204 HepSymMatrix Ma = Ea();
205
206 Helix _helix( pv, Va, Ma );
207 Hep3Vector Wire;
208 Wire[0] = ( pfwd - pbwd ).x();
209 Wire[1] = ( pfwd - pbwd ).y();
210 Wire[2] = ( pfwd - pbwd ).z();
211 // xyPosition(), returns middle position of a wire. z componet is 0.
212 // w.xyPosition(wp);
213 double wp[3];
214 wp[0] = 0.5 * ( pfwd + pbwd ).x();
215 wp[1] = 0.5 * ( pfwd + pbwd ).y();
216 wp[2] = 0.;
217 double wb[3];
218 // w.backwardPosition(wb);
219 wb[0] = pbwd.x();
220 wb[1] = pbwd.y();
221 wb[2] = pbwd.z();
222 double v[3];
223 v[0] = Wire.unit().x();
224 v[1] = Wire.unit().y();
225 v[2] = Wire.unit().z();
226 // std::cout<<"Wire.unit() is "<<Wire.unit()<<std::endl;
227
228 // ...Sag correction...
229 /* if (doSagCorrection) {
230 HepVector3D dir = w.direction();
231 HepPoint3D xw(wp[0], wp[1], wp[2]);
232 HepPoint3D wireBackwardPosition(wb[0], wb[1], wb[2]);
233 w.wirePosition(link.positionOnTrack().z(),
234 xw,
235 wireBackwardPosition,
236 dir);
237 v[0] = dir.x();
238 v[1] = dir.y();
239 v[2] = dir.z();
240 wp[0] = xw.x();
241 wp[1] = xw.y();
242 wp[2] = xw.z();
243 wb[0] = wireBackwardPosition.x();
244 wb[1] = wireBackwardPosition.y();
245 wb[2] = wireBackwardPosition.z();
246 }
247 */
248 // ...Cal. dPhi to rotate...
249 const HepPoint3D& xc = _helix.center();
250 double xt[3];
251 _helix.x( 0., xt );
252 double x0 = -xc.x();
253 double y0 = -xc.y();
254 double x1 = wp[0] + x0;
255 double y1 = wp[1] + y0;
256 x0 += xt[0];
257 y0 += xt[1];
258 // std::cout<<" x0 is: "<<x0<<" y0 is: "<<y0<<std::endl;
259 // std::cout<<" x1 is: "<<x1<<" y1 is: "<<y1<<std::endl;
260 // std::cout<<" xt[0] is: "<<xt[0]<<" xt[1] is: "<<xt[1]<<std::endl;
261
262 double dPhi = atan2( x0 * y1 - y0 * x1, x0 * x1 + y0 * y1 );
263 // std::cout<<" x0 * y1 - y0 * x1 is: "<<(x0 * y1 - y0 * x1)<<std::endl;
264 // std::cout<<" x0 * x1 + y0 * y1 is: "<<(x0 * x1 + y0 * y1)<<std::endl;
265 // std::cout<<" before loop dPhi is "<<dPhi<<std::endl;
266 //...Setup...
267 double kappa = _helix.kappa();
268 double phi0 = _helix.phi0();
269
270 //...Axial case...
271 /* if (!w.stereo()) {
272 positionOnTrack = _helix.x(dPhi);
273 HepPoint3D x(wp[0], wp[1], wp[2]);
274 x.setZ(positionOnTrack.z());
275 positionOnWire = x;
276 //link.dPhi(dPhi);
277 std::cout<<" in axial wire : positionOnTrack is "<<positionOnTrack
278 <<" positionOnWire is "<<positionOnWire<<std::endl;
279 return (positionOnTrack - positionOnWire).mag();
280 }
281 */
282 double firstdfdphi = 0.;
283 static bool first = true;
284 if ( first )
285 {
286 // extern BelleTupleManager * BASF_Histogram;
287 // BelleTupleManager * m = BASF_Histogram;
288 // h_nTrial = m->histogram("TTrack::approach nTrial", 100, 0., 100.);
289 }
290 // #endif
291
292 //...Stereo case...
293 double rho = Helix::ConstantAlpha / kappa;
294 double tanLambda = _helix.tanl();
295 static HepPoint3D x;
296 double t_x[3];
297 double t_dXdPhi[3];
298 const double convergence = 1.0e-5;
299 double l;
300 unsigned nTrial = 0;
301 while ( nTrial < 100 )
302 {
303
304 // x = link.positionOnTrack(_helix->x(dPhi));
305 positionOnTrack = _helix.x( dPhi );
306 x = _helix.x( dPhi );
307 t_x[0] = x[0];
308 t_x[1] = x[1];
309 t_x[2] = x[2];
310
311 l = v[0] * t_x[0] + v[1] * t_x[1] + v[2] * t_x[2] - v[0] * wb[0] - v[1] * wb[1] -
312 v[2] * wb[2];
313
314 double rcosPhi = rho * cos( phi0 + dPhi );
315 double rsinPhi = rho * sin( phi0 + dPhi );
316 t_dXdPhi[0] = rsinPhi;
317 t_dXdPhi[1] = -rcosPhi;
318 t_dXdPhi[2] = -rho * tanLambda;
319
320 //...f = d(Distance) / d phi...
321 double t_d2Xd2Phi[2];
322 t_d2Xd2Phi[0] = rcosPhi;
323 t_d2Xd2Phi[1] = rsinPhi;
324
325 //...iw new...
326 double n[3];
327 n[0] = t_x[0] - wb[0];
328 n[1] = t_x[1] - wb[1];
329 n[2] = t_x[2] - wb[2];
330
331 double a[3];
332 a[0] = n[0] - l * v[0];
333 a[1] = n[1] - l * v[1];
334 a[2] = n[2] - l * v[2];
335 double dfdphi = a[0] * t_dXdPhi[0] + a[1] * t_dXdPhi[1] + a[2] * t_dXdPhi[2];
336
337 if ( nTrial == 0 )
338 {
339 // break;
340 firstdfdphi = dfdphi;
341 }
342
343 //...Check bad case...
344 if ( nTrial > 3 )
345 {
346 // std::cout<<" BAD CASE!!, calculate approach ntrial = "<<nTrial<< endl;
347 }
348 //...Is it converged?...
349 if ( fabs( dfdphi ) < convergence ) break;
350
351 double dv = v[0] * t_dXdPhi[0] + v[1] * t_dXdPhi[1] + v[2] * t_dXdPhi[2];
352 double t0 =
353 t_dXdPhi[0] * t_dXdPhi[0] + t_dXdPhi[1] * t_dXdPhi[1] + t_dXdPhi[2] * t_dXdPhi[2];
354 double d2fd2phi = t0 - dv * dv + a[0] * t_d2Xd2Phi[0] + a[1] * t_d2Xd2Phi[1];
355 // + a[2] * t_d2Xd2Phi[2];
356
357 dPhi -= dfdphi / d2fd2phi;
358 ++nTrial;
359 }
360 // std::cout<<" dPhi is: "<<dPhi<<std::endl;
361 //...Cal. positions...
362 positionOnWire[0] = wb[0] + l * v[0];
363 positionOnWire[1] = wb[1] + l * v[1];
364 positionOnWire[2] = wb[2] + l * v[2];
365
366 // std::cout<<"wb[0] is: "<<wb[0]<<" l is: "<<l<<" v[0] is: "<<v[0]<<std::endl;
367 // std::cout<<"wb[1] is: "<<wb[1]<<" v[1] is: "<<v[1]<<std::endl;
368 // std::cout<<"wb[2] is: "<<wb[2]<<" v[2] is: "<<v[2]<<std::endl;
369
370 // std::cout<<" positionOnTrack is "<<positionOnTrack
371 // <<" positionOnWire is "<<positionOnWire<<std::endl;
372
373 return ( positionOnTrack - positionOnWire ).mag();
374 // link.dPhi(dPhi);
375 // return nTrial;
376}
HepGeom::Point3D< double > HepPoint3D
const Int_t n
Double_t x[10]
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35
static const double ConstantAlpha
Constant alpha for uniform field.
HepPoint3D x(double dPhi=0.) const
returns position after rotating angle dPhi in phi direction.
Helix(const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
Constructor with pivot, helix parameter a, and its error matrix.
Index first(Pair i)

◆ approach() [2/6]

double KalmanFit::Helix::approach ( HepPoint3D pfwd,
HepPoint3D pbwd,
bool doSagCorrection ) const

◆ approach() [3/6]

double KalmanFit::Helix::approach ( HepPoint3D pfwd,
HepPoint3D pbwd,
bool doSagCorrection ) const

◆ approach() [4/6]

double Helix::approach ( KalFitHitMdc & hit,
bool doSagCorrection ) const

Definition at line 13 of file KalFitDoca.cxx.

13 {
14 //...Cal. dPhi to rotate...
15 // const TMDCWire & w = * link.wire();
16 HepPoint3D positionOnWire, positionOnTrack;
17 HepPoint3D pv = pivot();
18 // std::cout<<"the track pivot in approach is "<<pv<<std::endl;
19 HepVector Va = a();
20 // std::cout<<"the track parameters is "<<Va<<std::endl;
21 HepSymMatrix Ma = Ea();
22 // std::cout<<"the error matrix is "<<Ma<<std::endl;
23
24 Helix _helix( pv, Va, Ma );
25 //_helix.pivot(IP);
26 const KalFitWire& w = hit.wire();
27 Hep3Vector Wire = w.fwd() - w.bck();
28 // xyPosition(), returns middle position of a wire. z componet is 0.
29 // w.xyPosition(wp);
30 double wp[3];
31 wp[0] = 0.5 * ( w.fwd() + w.bck() ).x();
32 wp[1] = 0.5 * ( w.fwd() + w.bck() ).y();
33 wp[2] = 0.;
34 double wb[3];
35 // w.backwardPosition(wb);
36 wb[0] = w.bck().x();
37 wb[1] = w.bck().y();
38 wb[2] = w.bck().z();
39 double v[3];
40 v[0] = Wire.unit().x();
41 v[1] = Wire.unit().y();
42 v[2] = Wire.unit().z();
43 // std::cout<<"Wire.unit() is "<<Wire.unit()<<std::endl;
44
45 //...Sag correction...
46 /* if (doSagCorrection) {
47 HepVector3D dir = w.direction();
48 HepPoint3D xw(wp[0], wp[1], wp[2]);
49 HepPoint3D wireBackwardPosition(wb[0], wb[1], wb[2]);
50 w.wirePosition(link.positionOnTrack().z(),
51 xw,
52 wireBackwardPosition,
53 dir);
54 v[0] = dir.x();
55 v[1] = dir.y();
56 v[2] = dir.z();
57 wp[0] = xw.x();
58 wp[1] = xw.y();
59 wp[2] = xw.z();
60 wb[0] = wireBackwardPosition.x();
61 wb[1] = wireBackwardPosition.y();
62 wb[2] = wireBackwardPosition.z();
63 }
64 */
65 //...Cal. dPhi to rotate...
66 const HepPoint3D& xc = _helix.center();
67
68 // std::cout<<" helix center: "<<xc<<std::endl;
69
70 double xt[3];
71 _helix.x( 0., xt );
72 double x0 = -xc.x();
73 double y0 = -xc.y();
74 double x1 = wp[0] + x0;
75 double y1 = wp[1] + y0;
76 x0 += xt[0];
77 y0 += xt[1];
78 double dPhi = atan2( x0 * y1 - y0 * x1, x0 * x1 + y0 * y1 );
79
80 // std::cout<<"dPhi is "<<dPhi<<std::endl;
81
82 //...Setup...
83 double kappa = _helix.kappa();
84 double phi0 = _helix.phi0();
85
86 //...Axial case...
87 /* if (!w.stereo()) {
88 positionOnTrack = _helix.x(dPhi);
89 HepPoint3D x(wp[0], wp[1], wp[2]);
90 x.setZ(positionOnTrack.z());
91 positionOnWire = x;
92 //link.dPhi(dPhi);
93 std::cout<<" in axial wire : positionOnTrack is "<<positionOnTrack
94 <<" positionOnWire is "<<positionOnWire<<std::endl;
95 return (positionOnTrack - positionOnWire).mag();
96 }
97 */
98 double firstdfdphi = 0.;
99 static bool first = true;
100 if ( first )
101 {
102 // extern BelleTupleManager * BASF_Histogram;
103 // BelleTupleManager * m = BASF_Histogram;
104 // h_nTrial = m->histogram("TTrack::approach nTrial", 100, 0., 100.);
105 }
106 // #endif
107
108 //...Stereo case...
109 double rho = Helix::ConstantAlpha / kappa;
110 double tanLambda = _helix.tanl();
111 static HepPoint3D x;
112 double t_x[3];
113 double t_dXdPhi[3];
114 const double convergence = 1.0e-5;
115 double l;
116 unsigned nTrial = 0;
117 while ( nTrial < 100 )
118 {
119
120 // x = link.positionOnTrack(_helix->x(dPhi));
121 positionOnTrack = _helix.x( dPhi );
122 x = _helix.x( dPhi );
123 t_x[0] = x[0];
124 t_x[1] = x[1];
125 t_x[2] = x[2];
126
127 l = v[0] * t_x[0] + v[1] * t_x[1] + v[2] * t_x[2] - v[0] * wb[0] - v[1] * wb[1] -
128 v[2] * wb[2];
129
130 double rcosPhi = rho * cos( phi0 + dPhi );
131 double rsinPhi = rho * sin( phi0 + dPhi );
132 t_dXdPhi[0] = rsinPhi;
133 t_dXdPhi[1] = -rcosPhi;
134 t_dXdPhi[2] = -rho * tanLambda;
135
136 //...f = d(Distance) / d phi...
137 double t_d2Xd2Phi[2];
138 t_d2Xd2Phi[0] = rcosPhi;
139 t_d2Xd2Phi[1] = rsinPhi;
140
141 //...iw new...
142 double n[3];
143 n[0] = t_x[0] - wb[0];
144 n[1] = t_x[1] - wb[1];
145 n[2] = t_x[2] - wb[2];
146
147 double a[3];
148 a[0] = n[0] - l * v[0];
149 a[1] = n[1] - l * v[1];
150 a[2] = n[2] - l * v[2];
151 double dfdphi = a[0] * t_dXdPhi[0] + a[1] * t_dXdPhi[1] + a[2] * t_dXdPhi[2];
152
153 // #ifdef TRKRECO_DEBUG
154 if ( nTrial == 0 )
155 {
156 // break;
157 firstdfdphi = dfdphi;
158 }
159
160 //...Check bad case...
161 if ( nTrial > 3 )
162 { std::cout << " bad case, calculate approach ntrial = " << nTrial << std::endl; }
163 // #endif
164
165 //...Is it converged?...
166 if ( fabs( dfdphi ) < convergence ) break;
167
168 double dv = v[0] * t_dXdPhi[0] + v[1] * t_dXdPhi[1] + v[2] * t_dXdPhi[2];
169 double t0 =
170 t_dXdPhi[0] * t_dXdPhi[0] + t_dXdPhi[1] * t_dXdPhi[1] + t_dXdPhi[2] * t_dXdPhi[2];
171 double d2fd2phi = t0 - dv * dv + a[0] * t_d2Xd2Phi[0] + a[1] * t_d2Xd2Phi[1];
172 // + a[2] * t_d2Xd2Phi[2];
173
174 dPhi -= dfdphi / d2fd2phi;
175
176 // cout << "nTrial=" << nTrial << endl;
177 // cout << "iw f,df,dphi=" << dfdphi << "," << d2fd2phi << "," << dPhi << endl;
178
179 ++nTrial;
180 }
181 //...Cal. positions...
182 positionOnWire[0] = wb[0] + l * v[0];
183 positionOnWire[1] = wb[1] + l * v[1];
184 positionOnWire[2] = wb[2] + l * v[2];
185
186 // std::cout<<" positionOnTrack is "<<positionOnTrack
187 // <<" positionOnWire is "<<positionOnWire<<std::endl;
188 return ( positionOnTrack - positionOnWire ).mag();
189
190 // link.dPhi(dPhi);
191
192 // #ifdef TRKRECO_DEBUG
193 // h_nTrial->accumulate((float) nTrial + .5);
194 // #endif
195 // return nTrial;
196}
double w

Referenced by approach().

◆ approach() [5/6]

double KalmanFit::Helix::approach ( KalFitHitMdc & hit,
bool doSagCorrection ) const

◆ approach() [6/6]

double KalmanFit::Helix::approach ( KalFitHitMdc & hit,
bool doSagCorrection ) const

◆ bFieldZ() [1/6]

double Helix::bFieldZ ( double a)
inline

sets/returns z componet of the magnetic field.

Definition at line 215 of file InstallArea/x86_64-el9-gcc13-dbg/include/KalFitAlg/helix/Helix.h.

215 {
216 m_bField = a;
217 m_alpha = 10000. / 2.99792458 / m_bField;
218
219 // std::cout<<"m_alpha: "<<m_alpha<<std::endl;
220 updateCache();
221 return m_bField;
222 }

Referenced by KalFitAlg::kalman_fitting_anal(), KalFitAlg::kalman_fitting_calib(), KalFitAlg::kalman_fitting_csmalign(), and KalFitAlg::kalman_fitting_MdcxReco_Csmc_Sew().

◆ bFieldZ() [2/6]

double KalmanFit::Helix::bFieldZ ( double )

sets/returns z componet of the magnetic field.

◆ bFieldZ() [3/6]

double KalmanFit::Helix::bFieldZ ( double )

sets/returns z componet of the magnetic field.

◆ bFieldZ() [4/6]

double Helix::bFieldZ ( void ) const
inline

Definition at line 226 of file InstallArea/x86_64-el9-gcc13-dbg/include/KalFitAlg/helix/Helix.h.

226{ return m_bField; }

◆ bFieldZ() [5/6]

double KalmanFit::Helix::bFieldZ ( void ) const

◆ bFieldZ() [6/6]

double KalmanFit::Helix::bFieldZ ( void ) const

◆ center() [1/3]

◆ center() [2/3]

const HepPoint3D & KalmanFit::Helix::center ( void ) const

returns position of helix center(z = 0.);

◆ center() [3/3]

const HepPoint3D & KalmanFit::Helix::center ( void ) const

returns position of helix center(z = 0.);

◆ cosPhi0() [1/3]

double Helix::cosPhi0 ( void ) const
inline

Definition at line 230 of file InstallArea/x86_64-el9-gcc13-dbg/include/KalFitAlg/helix/Helix.h.

230{ return m_cp; }

◆ cosPhi0() [2/3]

double KalmanFit::Helix::cosPhi0 ( void ) const

◆ cosPhi0() [3/3]

double KalmanFit::Helix::cosPhi0 ( void ) const

◆ curv() [1/3]

double Helix::curv ( void ) const
inline

Definition at line 201 of file InstallArea/x86_64-el9-gcc13-dbg/include/KalFitAlg/helix/Helix.h.

201{ return m_r; }

◆ curv() [2/3]

double KalmanFit::Helix::curv ( void ) const

◆ curv() [3/3]

double KalmanFit::Helix::curv ( void ) const

◆ del4MDelA() [1/3]

HepMatrix Helix::del4MDelA ( double phi,
double mass ) const

Definition at line 557 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

557 {
558 //
559 // Calculate Jacobian (@4m/@a)
560 // Vector a is helix parameters and phi is internal parameter.
561 // Vector 4m is 4 momentum.
562 //
563
564 HepMatrix d4MDA( 4, 5, 0 );
565
566 double phi0 = m_ac[1];
567 double cpa = m_ac[2];
568 double tnl = m_ac[4];
569
570 double cosf0phi = cos( phi0 + phi );
571 double sinf0phi = sin( phi0 + phi );
572
573 double rho;
574 if ( cpa != 0. ) rho = 1. / cpa;
575 else rho = ( DBL_MAX );
576
577 double charge = 1.;
578 if ( cpa < 0. ) charge = -1.;
579
580 double E = sqrt( rho * rho * ( 1. + tnl * tnl ) + mass * mass );
581
582 d4MDA[0][1] = -fabs( rho ) * cosf0phi;
583 d4MDA[0][2] = charge * rho * rho * sinf0phi;
584
585 d4MDA[1][1] = -fabs( rho ) * sinf0phi;
586 d4MDA[1][2] = -charge * rho * rho * cosf0phi;
587
588 d4MDA[2][2] = -charge * rho * rho * tnl;
589 d4MDA[2][4] = fabs( rho );
590
591 if ( cpa != 0.0 && E != 0.0 )
592 {
593 d4MDA[3][2] = ( -1. - tnl * tnl ) / ( cpa * cpa * cpa * E );
594 d4MDA[3][4] = tnl / ( cpa * cpa * E );
595 }
596 else
597 {
598 d4MDA[3][2] = ( DBL_MAX );
599 d4MDA[3][4] = ( DBL_MAX );
600 }
601 return d4MDA;
602 }
double mass

Referenced by momentum().

◆ del4MDelA() [2/3]

HepMatrix KalmanFit::Helix::del4MDelA ( double phi,
double mass ) const

◆ del4MDelA() [3/3]

HepMatrix KalmanFit::Helix::del4MDelA ( double phi,
double mass ) const

◆ del4MXDelA() [1/3]

HepMatrix Helix::del4MXDelA ( double phi,
double mass ) const

Definition at line 604 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

604 {
605 //
606 // Calculate Jacobian (@4mx/@a)
607 // Vector a is helix parameters and phi is internal parameter.
608 // Vector 4xm is 4 momentum and position.
609 //
610
611 HepMatrix d4MXDA( 7, 5, 0 );
612
613 const double& dr = m_ac[0];
614 const double& phi0 = m_ac[1];
615 const double& cpa = m_ac[2];
616 const double& dz = m_ac[3];
617 const double& tnl = m_ac[4];
618
619 double cosf0phi = cos( phi0 + phi );
620 double sinf0phi = sin( phi0 + phi );
621
622 double rho;
623 if ( cpa != 0. ) rho = 1. / cpa;
624 else rho = ( DBL_MAX );
625
626 double charge = 1.;
627 if ( cpa < 0. ) charge = -1.;
628
629 double E = sqrt( rho * rho * ( 1. + tnl * tnl ) + mass * mass );
630
631 d4MXDA[0][1] = -fabs( rho ) * cosf0phi;
632 d4MXDA[0][2] = charge * rho * rho * sinf0phi;
633
634 d4MXDA[1][1] = -fabs( rho ) * sinf0phi;
635 d4MXDA[1][2] = -charge * rho * rho * cosf0phi;
636
637 d4MXDA[2][2] = -charge * rho * rho * tnl;
638 d4MXDA[2][4] = fabs( rho );
639
640 if ( cpa != 0.0 && E != 0.0 )
641 {
642 d4MXDA[3][2] = ( -1. - tnl * tnl ) / ( cpa * cpa * cpa * E );
643 d4MXDA[3][4] = tnl / ( cpa * cpa * E );
644 }
645 else
646 {
647 d4MXDA[3][2] = ( DBL_MAX );
648 d4MXDA[3][4] = ( DBL_MAX );
649 }
650
651 d4MXDA[4][0] = m_cp;
652 d4MXDA[4][1] = -dr * m_sp + m_r * ( -m_sp + sinf0phi );
653 if ( cpa != 0.0 ) { d4MXDA[4][2] = -( m_r / cpa ) * ( m_cp - cosf0phi ); }
654 else { d4MXDA[4][2] = ( DBL_MAX ); }
655
656 d4MXDA[5][0] = m_sp;
657 d4MXDA[5][1] = dr * m_cp + m_r * ( m_cp - cosf0phi );
658 if ( cpa != 0.0 )
659 {
660 d4MXDA[5][2] = -( m_r / cpa ) * ( m_sp - sinf0phi );
661
662 d4MXDA[6][2] = ( m_r / cpa ) * tnl * phi;
663 }
664 else
665 {
666 d4MXDA[5][2] = ( DBL_MAX );
667
668 d4MXDA[6][2] = ( DBL_MAX );
669 }
670
671 d4MXDA[6][3] = 1.;
672 d4MXDA[6][4] = -m_r * phi;
673
674 return d4MXDA;
675 }
double dr(void) const
returns an element of parameters.

Referenced by momentum().

◆ del4MXDelA() [2/3]

HepMatrix KalmanFit::Helix::del4MXDelA ( double phi,
double mass ) const

◆ del4MXDelA() [3/3]

HepMatrix KalmanFit::Helix::del4MXDelA ( double phi,
double mass ) const

◆ delApDelA() [1/3]

HepMatrix Helix::delApDelA ( const HepVector & ap) const

Definition at line 425 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

425 {
426 //
427 // Calculate Jacobian (@ap/@a)
428 // Vector ap is new helix parameters and a is old helix parameters.
429 //
430
431 HepMatrix dApDA( 5, 5, 0 );
432
433 const double& dr = m_ac[0];
434 const double& phi0 = m_ac[1];
435 const double& cpa = m_ac[2];
436 const double& dz = m_ac[3];
437 const double& tnl = m_ac[4];
438
439 double drp = ap[0];
440 double phi0p = ap[1];
441 double cpap = ap[2];
442 double dzp = ap[3];
443 double tnlp = ap[4];
444
445 double rdr = m_r + dr;
446 double rdrpr;
447 if ( ( m_r + drp ) != 0.0 ) { rdrpr = 1. / ( m_r + drp ); }
448 else { rdrpr = ( DBL_MAX ); }
449 // double csfd = cos(phi0)*cos(phi0p) + sin(phi0)*sin(phi0p);
450 // double snfd = cos(phi0)*sin(phi0p) - sin(phi0)*cos(phi0p);
451 double csfd = cos( phi0p - phi0 );
452 double snfd = sin( phi0p - phi0 );
453 double phid = fmod( phi0p - phi0 + M_PI8, M_PI2 );
454 if ( phid > M_PI ) phid = phid - M_PI2;
455
456 dApDA[0][0] = csfd;
457 dApDA[0][1] = rdr * snfd;
458 if ( cpa != 0.0 ) { dApDA[0][2] = ( m_r / cpa ) * ( 1.0 - csfd ); }
459 else { dApDA[0][2] = ( DBL_MAX ); }
460
461 dApDA[1][0] = -rdrpr * snfd;
462 dApDA[1][1] = rdr * rdrpr * csfd;
463 if ( cpa != 0.0 ) { dApDA[1][2] = ( m_r / cpa ) * rdrpr * snfd; }
464 else { dApDA[1][2] = ( DBL_MAX ); }
465
466 dApDA[2][2] = 1.0;
467
468 dApDA[3][0] = m_r * rdrpr * tnl * snfd;
469 dApDA[3][1] = m_r * tnl * ( 1.0 - rdr * rdrpr * csfd );
470 if ( cpa != 0.0 ) { dApDA[3][2] = ( m_r / cpa ) * tnl * ( phid - m_r * rdrpr * snfd ); }
471 else { dApDA[3][2] = ( DBL_MAX ); }
472 dApDA[3][3] = 1.0;
473 dApDA[3][4] = -m_r * phid;
474
475 dApDA[4][4] = 1.0;
476
477 return dApDA;
478 }
const double M_PI8
#define M_PI
Definition TConstant.h:4

Referenced by pivot(), KalFitTrack::pivot_numf(), and KalFitTrack::pivot_numf().

◆ delApDelA() [2/3]

HepMatrix KalmanFit::Helix::delApDelA ( const HepVector & ap) const

◆ delApDelA() [3/3]

HepMatrix KalmanFit::Helix::delApDelA ( const HepVector & ap) const

◆ delMDelA() [1/3]

HepMatrix Helix::delMDelA ( double phi) const

Definition at line 522 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

522 {
523 //
524 // Calculate Jacobian (@m/@a)
525 // Vector a is helix parameters and phi is internal parameter.
526 // Vector m is momentum.
527 //
528
529 HepMatrix dMDA( 3, 5, 0 );
530
531 const double& phi0 = m_ac[1];
532 const double& cpa = m_ac[2];
533 const double& tnl = m_ac[4];
534
535 double cosf0phi = cos( phi0 + phi );
536 double sinf0phi = sin( phi0 + phi );
537
538 double rho;
539 if ( cpa != 0. ) rho = 1. / cpa;
540 else rho = ( DBL_MAX );
541
542 double charge = 1.;
543 if ( cpa < 0. ) charge = -1.;
544
545 dMDA[0][1] = -fabs( rho ) * cosf0phi;
546 dMDA[0][2] = charge * rho * rho * sinf0phi;
547
548 dMDA[1][1] = -fabs( rho ) * sinf0phi;
549 dMDA[1][2] = -charge * rho * rho * cosf0phi;
550
551 dMDA[2][2] = -charge * rho * rho * tnl;
552 dMDA[2][4] = fabs( rho );
553
554 return dMDA;
555 }

Referenced by momentum().

◆ delMDelA() [2/3]

HepMatrix KalmanFit::Helix::delMDelA ( double phi) const

◆ delMDelA() [3/3]

HepMatrix KalmanFit::Helix::delMDelA ( double phi) const

◆ delXDelA() [1/3]

HepMatrix Helix::delXDelA ( double phi) const

Definition at line 480 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

480 {
481 //
482 // Calculate Jacobian (@x/@a)
483 // Vector a is helix parameters and phi is internal parameter
484 // which specifys the point to be calculated for Ex(phi).
485 //
486
487 HepMatrix dXDA( 3, 5, 0 );
488
489 const double& dr = m_ac[0];
490 const double& phi0 = m_ac[1];
491 const double& cpa = m_ac[2];
492 const double& dz = m_ac[3];
493 const double& tnl = m_ac[4];
494
495 double cosf0phi = cos( phi0 + phi );
496 double sinf0phi = sin( phi0 + phi );
497
498 dXDA[0][0] = m_cp;
499 dXDA[0][1] = -dr * m_sp + m_r * ( -m_sp + sinf0phi );
500 if ( cpa != 0.0 ) { dXDA[0][2] = -( m_r / cpa ) * ( m_cp - cosf0phi ); }
501 else { dXDA[0][2] = ( DBL_MAX ); }
502 // dXDA[0][3] = 0.0;
503 // dXDA[0][4] = 0.0;
504
505 dXDA[1][0] = m_sp;
506 dXDA[1][1] = dr * m_cp + m_r * ( m_cp - cosf0phi );
507 if ( cpa != 0.0 ) { dXDA[1][2] = -( m_r / cpa ) * ( m_sp - sinf0phi ); }
508 else { dXDA[1][2] = ( DBL_MAX ); }
509 // dXDA[1][3] = 0.0;
510 // dXDA[1][4] = 0.0;
511
512 // dXDA[2][0] = 0.0;
513 // dXDA[2][1] = 0.0;
514 if ( cpa != 0.0 ) { dXDA[2][2] = ( m_r / cpa ) * tnl * phi; }
515 else { dXDA[2][2] = ( DBL_MAX ); }
516 dXDA[2][3] = 1.0;
517 dXDA[2][4] = -m_r * phi;
518
519 return dXDA;
520 }

Referenced by x().

◆ delXDelA() [2/3]

HepMatrix KalmanFit::Helix::delXDelA ( double phi) const

◆ delXDelA() [3/3]

HepMatrix KalmanFit::Helix::delXDelA ( double phi) const

◆ direction() [1/3]

Hep3Vector Helix::direction ( double dPhi = 0.) const
inline

returns direction vector after rotating angle dPhi in phi direction.

Definition at line 189 of file InstallArea/x86_64-el9-gcc13-dbg/include/KalFitAlg/helix/Helix.h.

189{ return momentum( phi ).unit(); }
**********INTEGER nmxhep !maximum number of particles DOUBLE PRECISION vhep INTEGER jdahep COMMON hepevt $ !serial number $ !number of particles $ !status code $ !particle ident KF $ !parent particles $ !childreen particles $ !four momentum

◆ direction() [2/3]

Hep3Vector KalmanFit::Helix::direction ( double dPhi = 0.) const

returns direction vector after rotating angle dPhi in phi direction.

◆ direction() [3/3]

Hep3Vector KalmanFit::Helix::direction ( double dPhi = 0.) const

returns direction vector after rotating angle dPhi in phi direction.

◆ dr() [1/3]

double Helix::dr ( void ) const
inline

◆ dr() [2/3]

double KalmanFit::Helix::dr ( void ) const

returns an element of parameters.

◆ dr() [3/3]

double KalmanFit::Helix::dr ( void ) const

returns an element of parameters.

◆ dz() [1/3]

◆ dz() [2/3]

double KalmanFit::Helix::dz ( void ) const

◆ dz() [3/3]

double KalmanFit::Helix::dz ( void ) const

◆ Ea() [1/6]

const HepSymMatrix & Helix::Ea ( const HepSymMatrix & newdA)
inline

sets helix paramters and error matrix.

Definition at line 213 of file InstallArea/x86_64-el9-gcc13-dbg/include/KalFitAlg/helix/Helix.h.

213{ return m_Ea = i; }

◆ Ea() [2/6]

const HepSymMatrix & KalmanFit::Helix::Ea ( const HepSymMatrix & newdA)

sets helix paramters and error matrix.

◆ Ea() [3/6]

const HepSymMatrix & KalmanFit::Helix::Ea ( const HepSymMatrix & newdA)

sets helix paramters and error matrix.

◆ Ea() [4/6]

◆ Ea() [5/6]

const HepSymMatrix & KalmanFit::Helix::Ea ( void ) const

returns error matrix.

◆ Ea() [6/6]

const HepSymMatrix & KalmanFit::Helix::Ea ( void ) const

returns error matrix.

◆ ignoreErrorMatrix() [1/3]

void Helix::ignoreErrorMatrix ( void )

unsets error matrix. Error calculations will be ignored after this function call until an error matrix be set again. 0 matrix will be return as a return value for error matrix when you call functions which returns an error matrix.

Definition at line 677 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

677 {
678 m_matrixValid = false;
679 m_Ea *= 0.;
680 }

Referenced by KalFitTrack::chi2_next(), KalFitTrack::chi2_next(), KalFitAlg::filter_fwd_anal(), KalFitAlg::filter_fwd_calib(), KalFitTrack::order_wirhit(), KalFitTrack::pivot_numf(), KalFitAlg::smoother_anal(), and KalFitAlg::smoother_calib().

◆ ignoreErrorMatrix() [2/3]

void KalmanFit::Helix::ignoreErrorMatrix ( void )

unsets error matrix. Error calculations will be ignored after this function call until an error matrix be set again. 0 matrix will be return as a return value for error matrix when you call functions which returns an error matrix.

◆ ignoreErrorMatrix() [3/3]

void KalmanFit::Helix::ignoreErrorMatrix ( void )

unsets error matrix. Error calculations will be ignored after this function call until an error matrix be set again. 0 matrix will be return as a return value for error matrix when you call functions which returns an error matrix.

◆ kappa() [1/3]

◆ kappa() [2/3]

double KalmanFit::Helix::kappa ( void ) const

◆ kappa() [3/3]

double KalmanFit::Helix::kappa ( void ) const

◆ momentum() [1/15]

HepLorentzVector Helix::momentum ( double dPhi,
double mass ) const

returns 4momentum vector after rotating angle dPhi in phi direction.

Definition at line 214 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

214 {
215 //
216 // Calculate momentum.
217 //
218 // Pt = | 1/kappa | (GeV/c)
219 //
220 // Px = -Pt * sin(phi0 + phi)
221 // Py = Pt * cos(phi0 + phi)
222 // Pz = Pt * tan(lambda)
223 //
224 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
225
226 double pt = fabs( m_pt );
227 double px = -pt * sin( m_ac[1] + phi );
228 double py = pt * cos( m_ac[1] + phi );
229 double pz = pt * m_ac[4];
230 double E = sqrt( pt * pt * ( 1. + m_ac[4] * m_ac[4] ) + mass * mass );
231
232 return HepLorentzVector( px, py, pz, E );
233 }

◆ momentum() [2/15]

HepLorentzVector KalmanFit::Helix::momentum ( double dPhi,
double mass ) const

returns 4momentum vector after rotating angle dPhi in phi direction.

◆ momentum() [3/15]

HepLorentzVector KalmanFit::Helix::momentum ( double dPhi,
double mass ) const

returns 4momentum vector after rotating angle dPhi in phi direction.

◆ momentum() [4/15]

HepLorentzVector Helix::momentum ( double dPhi,
double mass,
HepPoint3D & x,
HepSymMatrix & Emx ) const

returns 4momentum vector after rotating angle dPhi in phi direction.

Definition at line 259 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

260 {
261 //
262 // Calculate momentum.
263 //
264 // Pt = | 1/kappa | (GeV/c)
265 //
266 // Px = -Pt * sin(phi0 + phi)
267 // Py = Pt * cos(phi0 + phi)
268 // Pz = Pt * tan(lambda)
269 //
270 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
271
272 double pt = fabs( m_pt );
273 double px = -pt * sin( m_ac[1] + phi );
274 double py = pt * cos( m_ac[1] + phi );
275 double pz = pt * m_ac[4];
276 double E = sqrt( pt * pt * ( 1. + m_ac[4] * m_ac[4] ) + mass * mass );
277
278 x.setX( m_pivot.x() + m_ac[0] * m_cp + m_r * ( m_cp - cos( m_ac[1] + phi ) ) );
279 x.setY( m_pivot.y() + m_ac[0] * m_sp + m_r * ( m_sp - sin( m_ac[1] + phi ) ) );
280 x.setZ( m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi );
281
282 if ( m_matrixValid ) Emx = m_Ea.similarity( del4MXDelA( phi, mass ) );
283 else Emx = m_Ea;
284
285 return HepLorentzVector( px, py, pz, E );
286 }
HepMatrix del4MXDelA(double phi, double mass) const

◆ momentum() [5/15]

HepLorentzVector KalmanFit::Helix::momentum ( double dPhi,
double mass,
HepPoint3D & x,
HepSymMatrix & Emx ) const

returns 4momentum vector after rotating angle dPhi in phi direction.

◆ momentum() [6/15]

HepLorentzVector KalmanFit::Helix::momentum ( double dPhi,
double mass,
HepPoint3D & x,
HepSymMatrix & Emx ) const

returns 4momentum vector after rotating angle dPhi in phi direction.

◆ momentum() [7/15]

HepLorentzVector Helix::momentum ( double dPhi,
double mass,
HepSymMatrix & Em ) const

returns 4momentum vector after rotating angle dPhi in phi direction.

Definition at line 235 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

235 {
236 //
237 // Calculate momentum.
238 //
239 // Pt = | 1/kappa | (GeV/c)
240 //
241 // Px = -Pt * sin(phi0 + phi)
242 // Py = Pt * cos(phi0 + phi)
243 // Pz = Pt * tan(lambda)
244 //
245 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
246
247 double pt = fabs( m_pt );
248 double px = -pt * sin( m_ac[1] + phi );
249 double py = pt * cos( m_ac[1] + phi );
250 double pz = pt * m_ac[4];
251 double E = sqrt( pt * pt * ( 1. + m_ac[4] * m_ac[4] ) + mass * mass );
252
253 if ( m_matrixValid ) Em = m_Ea.similarity( del4MDelA( phi, mass ) );
254 else Em = m_Ea;
255
256 return HepLorentzVector( px, py, pz, E );
257 }
HepMatrix del4MDelA(double phi, double mass) const

◆ momentum() [8/15]

HepLorentzVector KalmanFit::Helix::momentum ( double dPhi,
double mass,
HepSymMatrix & Em ) const

returns 4momentum vector after rotating angle dPhi in phi direction.

◆ momentum() [9/15]

HepLorentzVector KalmanFit::Helix::momentum ( double dPhi,
double mass,
HepSymMatrix & Em ) const

returns 4momentum vector after rotating angle dPhi in phi direction.

◆ momentum() [10/15]

Hep3Vector Helix::momentum ( double dPhi,
HepSymMatrix & Em ) const

returns momentum vector after rotating angle dPhi in phi direction.

Definition at line 192 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

192 {
193 //
194 // Calculate momentum.
195 //
196 // Pt = | 1/kappa | (GeV/c)
197 //
198 // Px = -Pt * sin(phi0 + phi)
199 // Py = Pt * cos(phi0 + phi)
200 // Pz = Pt * tan(lambda)
201 //
202
203 double pt = fabs( m_pt );
204 double px = -pt * sin( m_ac[1] + phi );
205 double py = pt * cos( m_ac[1] + phi );
206 double pz = pt * m_ac[4];
207
208 if ( m_matrixValid ) Em = m_Ea.similarity( delMDelA( phi ) );
209 else Em = m_Ea;
210
211 return Hep3Vector( px, py, pz );
212 }

◆ momentum() [11/15]

Hep3Vector KalmanFit::Helix::momentum ( double dPhi,
HepSymMatrix & Em ) const

returns momentum vector after rotating angle dPhi in phi direction.

◆ momentum() [12/15]

Hep3Vector KalmanFit::Helix::momentum ( double dPhi,
HepSymMatrix & Em ) const

returns momentum vector after rotating angle dPhi in phi direction.

◆ momentum() [13/15]

Hep3Vector Helix::momentum ( double dPhi = 0.) const

returns momentum vector after rotating angle dPhi in phi direction.

Definition at line 173 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

173 {
174 //
175 // Calculate momentum.
176 //
177 // Pt = | 1/kappa | (GeV/c)
178 //
179 // Px = -Pt * sin(phi0 + phi)
180 // Py = Pt * cos(phi0 + phi)
181 // Pz = Pt * tan(lambda)
182 //
183
184 double pt = fabs( m_pt );
185 double px = -pt * sin( m_ac[1] + phi );
186 double py = pt * cos( m_ac[1] + phi );
187 double pz = pt * m_ac[4];
188
189 return Hep3Vector( px, py, pz );
190 }

Referenced by KalFitAlg::complete_track(), KalFitAlg::complete_track(), KalFitAlg::filter_fwd_anal(), KalFitAlg::filter_fwd_calib(), Helix(), KalFitAlg::smoother_anal(), and KalFitAlg::smoother_calib().

◆ momentum() [14/15]

Hep3Vector KalmanFit::Helix::momentum ( double dPhi = 0.) const

returns momentum vector after rotating angle dPhi in phi direction.

◆ momentum() [15/15]

Hep3Vector KalmanFit::Helix::momentum ( double dPhi = 0.) const

returns momentum vector after rotating angle dPhi in phi direction.

◆ operator=() [1/3]

Helix & Helix::operator= ( const Helix & i)

Copy operator.

Definition at line 365 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

365 {
366 if ( this == &i ) return *this;
367
368 m_bField = i.m_bField;
369 m_alpha = i.m_alpha;
370 m_pivot = i.m_pivot;
371 m_a = i.m_a;
372 m_Ea = i.m_Ea;
373 m_matrixValid = i.m_matrixValid;
374
375 m_center = i.m_center;
376 m_cp = i.m_cp;
377 m_sp = i.m_sp;
378 m_pt = i.m_pt;
379 m_r = i.m_r;
380 m_ac[0] = i.m_ac[0];
381 m_ac[1] = i.m_ac[1];
382 m_ac[2] = i.m_ac[2];
383 m_ac[3] = i.m_ac[3];
384 m_ac[4] = i.m_ac[4];
385
386 return *this;
387 }

◆ operator=() [2/3]

Helix & KalmanFit::Helix::operator= ( const Helix & )

Copy operator.

◆ operator=() [3/3]

Helix & KalmanFit::Helix::operator= ( const Helix & )

Copy operator.

◆ phi0() [1/3]

◆ phi0() [2/3]

double KalmanFit::Helix::phi0 ( void ) const

◆ phi0() [3/3]

double KalmanFit::Helix::phi0 ( void ) const

◆ pivot() [1/6]

const HepPoint3D & Helix::pivot ( const HepPoint3D & newPivot)

sets pivot position.

Definition at line 288 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

288 {
289
290 // std::cout<<" in Helix::pivot:"<<std::endl;
291 // std::cout<<" m_alpha: "<<m_alpha<<std::endl;
292
293 const double& dr = m_ac[0];
294 const double& phi0 = m_ac[1];
295 const double& kappa = m_ac[2];
296 const double& dz = m_ac[3];
297 const double& tanl = m_ac[4];
298
299 double rdr = dr + m_r;
300 double phi = fmod( phi0 + M_PI4, M_PI2 );
301 double csf0 = cos( phi );
302 double snf0 = ( 1. - csf0 ) * ( 1. + csf0 );
303 snf0 = sqrt( ( snf0 > 0. ) ? snf0 : 0. );
304 if ( phi > M_PI ) snf0 = -snf0;
305
306 double xc = m_pivot.x() + rdr * csf0;
307 double yc = m_pivot.y() + rdr * snf0;
308 double csf, snf;
309 if ( m_r != 0.0 )
310 {
311 csf = ( xc - newPivot.x() ) / m_r;
312 snf = ( yc - newPivot.y() ) / m_r;
313 double anrm = sqrt( csf * csf + snf * snf );
314 if ( anrm != 0.0 )
315 {
316 csf /= anrm;
317 snf /= anrm;
318 phi = atan2( snf, csf );
319 }
320 else
321 {
322 csf = 1.0;
323 snf = 0.0;
324 phi = 0.0;
325 }
326 }
327 else
328 {
329 csf = 1.0;
330 snf = 0.0;
331 phi = 0.0;
332 }
333 double phid = fmod( phi - phi0 + M_PI8, M_PI2 );
334 if ( phid > M_PI ) phid = phid - M_PI2;
335 double drp = ( m_pivot.x() + dr * csf0 + m_r * ( csf0 - csf ) - newPivot.x() ) * csf +
336 ( m_pivot.y() + dr * snf0 + m_r * ( snf0 - snf ) - newPivot.y() ) * snf;
337 double dzp = m_pivot.z() + dz - m_r * tanl * phid - newPivot.z();
338
339 HepVector ap( 5 );
340 ap[0] = drp;
341 ap[1] = fmod( phi + M_PI4, M_PI2 );
342 ap[2] = kappa;
343 ap[3] = dzp;
344 ap[4] = tanl;
345
346 // if (m_matrixValid) m_Ea.assign(delApDelA(ap) * m_Ea * delApDelA(ap).T());
347 if ( m_matrixValid ) m_Ea = m_Ea.similarity( delApDelA( ap ) );
348
349 m_a = ap;
350 m_pivot = newPivot;
351
352 //...Are these needed?...iw...
353 updateCache();
354 return m_pivot;
355 }
HepMatrix delApDelA(const HepVector &ap) const

◆ pivot() [2/6]

const HepPoint3D & KalmanFit::Helix::pivot ( const HepPoint3D & newPivot)

sets pivot position.

◆ pivot() [3/6]

const HepPoint3D & KalmanFit::Helix::pivot ( const HepPoint3D & newPivot)

sets pivot position.

◆ pivot() [4/6]

◆ pivot() [5/6]

const HepPoint3D & KalmanFit::Helix::pivot ( void ) const

returns pivot position.

◆ pivot() [6/6]

const HepPoint3D & KalmanFit::Helix::pivot ( void ) const

returns pivot position.

◆ radius() [1/3]

◆ radius() [2/3]

double KalmanFit::Helix::radius ( void ) const

returns radious of helix.

◆ radius() [3/3]

double KalmanFit::Helix::radius ( void ) const

returns radious of helix.

◆ set() [1/3]

void Helix::set ( const HepPoint3D & pivot,
const HepVector & a,
const HepSymMatrix & Ea )

sets helix pivot position, parameters, and error matrix.

Definition at line 357 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

357 {
358 m_pivot = pivot;
359 m_a = a;
360 m_Ea = Ea;
361 m_matrixValid = true;
362 updateCache();
363 }

◆ set() [2/3]

void KalmanFit::Helix::set ( const HepPoint3D & pivot,
const HepVector & a,
const HepSymMatrix & Ea )

sets helix pivot position, parameters, and error matrix.

◆ set() [3/3]

void KalmanFit::Helix::set ( const HepPoint3D & pivot,
const HepVector & a,
const HepSymMatrix & Ea )

sets helix pivot position, parameters, and error matrix.

◆ sinPhi0() [1/3]

double Helix::sinPhi0 ( void ) const
inline

Definition at line 228 of file InstallArea/x86_64-el9-gcc13-dbg/include/KalFitAlg/helix/Helix.h.

228{ return m_sp; }

◆ sinPhi0() [2/3]

double KalmanFit::Helix::sinPhi0 ( void ) const

◆ sinPhi0() [3/3]

double KalmanFit::Helix::sinPhi0 ( void ) const

◆ tanl() [1/3]

◆ tanl() [2/3]

double KalmanFit::Helix::tanl ( void ) const

◆ tanl() [3/3]

double KalmanFit::Helix::tanl ( void ) const

◆ x() [1/9]

double * Helix::x ( double dPhi,
double p[3] ) const

Definition at line 137 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

137 {
138 //
139 // Calculate position (x,y,z) along helix.
140 //
141 // x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi))
142 // y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi))
143 // z = z0 + dz - (alpha / kappa) * tan(lambda) * phi
144 //
145
146 p[0] = m_pivot.x() + m_ac[0] * m_cp + m_r * ( m_cp - cos( m_ac[1] + phi ) );
147 p[1] = m_pivot.y() + m_ac[0] * m_sp + m_r * ( m_sp - sin( m_ac[1] + phi ) );
148 p[2] = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
149
150 return p;
151 }

◆ x() [2/9]

double * KalmanFit::Helix::x ( double dPhi,
double p[3] ) const

◆ x() [3/9]

double * KalmanFit::Helix::x ( double dPhi,
double p[3] ) const

◆ x() [4/9]

HepPoint3D Helix::x ( double dPhi,
HepSymMatrix & Ex ) const

returns position and convariance matrix(Ex) after rotation.

Definition at line 153 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

153 {
154 double x = m_pivot.x() + m_ac[0] * m_cp + m_r * ( m_cp - cos( m_ac[1] + phi ) );
155 double y = m_pivot.y() + m_ac[0] * m_sp + m_r * ( m_sp - sin( m_ac[1] + phi ) );
156 double z = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
157
158 //
159 // Calculate position error matrix.
160 // Ex(phi) = (@x/@a)(Ea)(@x/@a)^T, phi is deflection angle to specify the
161 // point to be calcualted.
162 //
163 // HepMatrix dXDA(3, 5, 0);
164 // dXDA = delXDelA(phi);
165 // Ex.assign(dXDA * m_Ea * dXDA.T());
166
167 if ( m_matrixValid ) Ex = m_Ea.similarity( delXDelA( phi ) );
168 else Ex = m_Ea;
169
170 return HepPoint3D( x, y, z );
171 }

◆ x() [5/9]

HepPoint3D KalmanFit::Helix::x ( double dPhi,
HepSymMatrix & Ex ) const

returns position and convariance matrix(Ex) after rotation.

◆ x() [6/9]

HepPoint3D KalmanFit::Helix::x ( double dPhi,
HepSymMatrix & Ex ) const

returns position and convariance matrix(Ex) after rotation.

◆ x() [7/9]

HepPoint3D Helix::x ( double dPhi = 0.) const

returns position after rotating angle dPhi in phi direction.

Definition at line 121 of file Reconstruction/KalFitAlg/src/helix/Helix.cxx.

121 {
122 //
123 // Calculate position (x,y,z) along helix.
124 //
125 // x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi))
126 // y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi))
127 // z = z0 + dz - (alpha / kappa) * tan(lambda) * phi
128 //
129
130 double x = m_pivot.x() + m_ac[0] * m_cp + m_r * ( m_cp - cos( m_ac[1] + phi ) );
131 double y = m_pivot.y() + m_ac[0] * m_sp + m_r * ( m_sp - sin( m_ac[1] + phi ) );
132 double z = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
133
134 return HepPoint3D( x, y, z );
135 }

Referenced by approach(), approach(), KalFitTrack::chi2_next(), KalFitTrack::chi2_next(), KalFitAlg::complete_track(), KalFitAlg::complete_track(), KalFitAlg::fillTds_back(), KalFitAlg::filter_fwd_anal(), KalFitAlg::filter_fwd_calib(), KalFitCylinder::intersect(), KalFitCylinder::intersect(), KalFitTrack::intersect_yz_plane(), VertexExtrapolate::KalFitExt(), KalFitTrack::KalFitTrack(), KalFitAlg::kalman_fitting_anal(), KalFitAlg::kalman_fitting_calib(), KalFitAlg::kalman_fitting_csmalign(), KalFitAlg::kalman_fitting_MdcxReco_Csmc_Sew(), KalFitTrack::LR(), momentum(), KalFitTrack::order_wirhit(), KalFitAlg::smoother_anal(), KalFitAlg::smoother_calib(), x(), and x().

◆ x() [8/9]

HepPoint3D KalmanFit::Helix::x ( double dPhi = 0.) const

returns position after rotating angle dPhi in phi direction.

◆ x() [9/9]

HepPoint3D KalmanFit::Helix::x ( double dPhi = 0.) const

returns position after rotating angle dPhi in phi direction.

Member Data Documentation

◆ ConstantAlpha

const double Helix::ConstantAlpha = 333.564095
static

Constant alpha for uniform field.

Definition at line 153 of file InstallArea/x86_64-el9-gcc13-dbg/include/KalFitAlg/helix/Helix.h.

Referenced by approach(), approach(), and del4MXDelA().


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