FairRoot/PandaRoot
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Friends | List of all members
PndCATrackParamVector Class Reference

#include <PndCATrackParamVector.h>

Classes

struct  PndCATrackFitParam
 

Public Member Functions

 PndCATrackParamVector ()
 
void Reset ()
 
void InitCovMatrix (float_v d2QMom=0.f)
 
void InitByTarget (const PndCATarget &target)
 
void InitByHit (const PndCAHitV &hit, const PndCAParam &param, const float_v &dQMom)
 
void InitDirection (float_v r0, float_v r1, float_v r2)
 
float_v X () const
 
float_v Y () const
 
float_v Z () const
 
float_v SinPhi () const
 
float_v DzDs () const
 
float_v QPt () const
 
float_v Angle () const
 
int_v ISec () const
 
float_v X0 () const
 
float_v X1 () const
 
float_v X2 () const
 
float_v Tx1 () const
 
float_v Tx2 () const
 
float_v QMomentum () const
 
float_v SignCosPhi () const
 
float_v Chi2 () const
 
int_v NDF () const
 
float_v Err2Y () const
 
float_v Err2Z () const
 
float_v Err2SinPhi () const
 
float_v Err2DzDs () const
 
float_v Err2QPt () const
 
float_v GetX () const
 
float_v GetY () const
 
float_v GetZ () const
 
float_v GetSinPhi () const
 
float_v GetDzDs () const
 
float_v GetQPt () const
 
float_v GetSignCosPhi () const
 
float_v GetChi2 () const
 
int_v GetNDF () const
 
float_v GetKappa (const float_v &Bz) const
 
float_v GetCosPhiPositive () const
 
float_v GetCosPhi () const
 
float_v Err2X1 () const
 
float_v Err2X2 () const
 
float_v Err2QMomentum () const
 
const float_v & Par (int i) const
 
const float_v & Cov (int i) const
 
void SetTrackParam (const PndCATrackParamVector &param, const float_m &m=float_m(true))
 
void SetTrackParam (const PndCATrackParamVector &p, int k, int m)
 
void SetPar (int i, const float_v &v)
 
void SetPar (int i, const float_v &v, const float_m &m)
 
void SetCov (int i, const float_v &v)
 
void SetCov (int i, const float_v &v, const float_m &m)
 
void SetX (const float_v &v)
 
void SetY (const float_v &v)
 
void SetZ (const float_v &v)
 
void SetX (const float_v &v, const float_m &m)
 
void SetY (const float_v &v, const float_m &m)
 
void SetZ (const float_v &v, const float_m &m)
 
void SetSinPhi (const float_v &v)
 
void SetSinPhi (const float_v &v, const float_m &m)
 
void SetDzDs (const float_v &v)
 
void SetDzDs (const float_v &v, const float_m &m)
 
void SetQPt (const float_v &v)
 
void SetQMomentum (const float_v &v)
 
void SetQPt (const float_v &v, const float_m &m)
 
void SetSignCosPhi (const float_v &v)
 
void SetSignCosPhi (const float_v &v, const float_m &m)
 
void SetChi2 (const float_v &v)
 
void SetChi2 (const float_v &v, const float_m &m)
 
void SetNDF (int v)
 
void SetNDF (const int_v &v)
 
void SetNDF (const int_v &v, const int_m &m)
 
void SetAngle (const float_v &v)
 
void SetAngle (const float_v &v, const float_m &m)
 
void SetISec (const int_v &v)
 
void SetISec (const int_v &v, const int_m &m)
 
void SetErr2Y (float_v v)
 
void SetErr2Z (float_v v)
 
void SetErr2QPt (float_v v)
 
float_v GetDist2 (const PndCATrackParamVector &t) const
 
float_v GetDistXZ2 (const PndCATrackParamVector &t) const
 
float_v GetS (const float_v &x, const float_v &y, const float_v &Bz) const
 
void GetDCAPoint (const float_v &x, const float_v &y, const float_v &z, float_v *px, float_v *py, float_v *pz, const float_v &Bz) const
 
float_m Transport0 (const int_v &ista, const PndCAParam &param, const float_m &mask=float_m(true))
 
float_m Transport0 (const PndCAHitV &hit, const PndCAParam &param, const float_m &mask=float_m(true))
 
float_m Transport0 (const PndCAHit &hit, const PndCAParam &p, const float_m &mask=float_m(true))
 
float_m TransportToXWithMaterial (const float_v &x, const float_v &XOverX0, const float_v &XThimesRho, const float_v &Bz, const float maxSinPhi=.999f)
 
float_m TransportToX (const float_v &x, const float_v &Bz, const float maxSinPhi=.999f, const float_m &mask=float_m(true))
 
float_m TransportToX (const float_v &x, PndCATrackLinearisationVector &t0, const float_v &Bz, const float maxSinPhi=.999f, float_v *DL=0, const float_m &mask=float_m(true))
 
float_m Transport0ToX (const float_v &x, const float_v &Bz, const float_m &mask)
 
float_m TransportToX (const float_v &x, const float_v &sinPhi0, const float_v &Bz, const float_v maxSinPhi=.999f, const float_m &mask=float_m(true))
 
float_m TransportToXWithMaterial (const float_v &x, PndCATrackLinearisationVector &t0, PndCATrackFitParam &par, const float_v &XOverX0, const float_v &XThimesRho, const float_v &Bz, const float maxSinPhi=.999f, const float_m &mask=float_m(true))
 
float_m TransportToXWithMaterial (const float_v &x, PndCATrackFitParam &par, const float_v &XOverX0, const float_v &XThimesRho, const float_v &Bz, const float maxSinPhi=.999f)
 
float_m Rotate (const float_v &alpha, PndCATrackLinearisationVector &t0, const float maxSinPhi=.999f, const float_m &mask=float_m(true))
 
float_m Rotate (const float_v &alpha, const float maxSinPhi=.999f, const float_m &mask=float_m(true))
 
void RotateXY (float_v alpha, float_v &x, float_v &y, float_v &sin, const float_m &mask=float_m(true)) const
 
float_m FilterWithMaterial (const float_v &y, const float_v &z, float_v err2Y, float_v errYZ, float_v err2Z, float maxSinPhi=0.999f, const float_m &mask=float_m(true), const int_v &hitNDF=int_v(2), const float_v &chi2Cut=10e10f)
 
float_m FilterWithMaterial (const float_v &y, const float_v &z, const PndCAStripInfo &info, float_v err2, float maxSinPhi=0.999f, const float_m &mask=float_m(true), const float_v &chi2Cut=10e10f)
 
void CalculateFitParameters (PndCATrackFitParam &par, const float_v &mass=0.13957f)
 
float_m CorrectForMeanMaterial (const float_v &xOverX0, const float_v &xTimesRho, const PndCATrackFitParam &par, const float_m &_mask)
 
float_m FilterVtx (const float_v &xV, const float_v &yV, const PndCAX1X2MeasurementInfo &info, float_v &extrDx, float_v &extrDy, float_v J[], const float_m &active=float_m(true))
 
float_m TransportJ0ToX0 (const float_v &x0, const float_v &cBz, float_v &extrDy, float_v &extrDz, float_v J[], const float_m &active=float_m(true))
 
float_m Transport (const int_v &ista, const PndCAParam &param, const float_m &mask=float_m(true))
 
float_m Transport (const PndCAHitV &hit, const PndCAParam &p, const float_m &mask=float_m(true))
 
float_m Filter (const PndCAHitV &hit, const PndCAParam &param, const float_m &mask=float_m(true), const float_v &chi2Cut=10e10f)
 
float_m Transport (const PndCAHit &hit, const PndCAParam &p, const float_m &mask=float_m(true))
 
float_m Filter (const PndCAHit &hit, const PndCAParam &param, const float_m &mask=float_m(true), const float_v &chi2Cut=10e10f)
 
float_m Accept (const PndCAHit &hit, const PndCAParam &param, const float_m &mask=float_m(true), const float_v &chi2Cut=10e10f) const
 
float_m AcceptWithMaterial (const float_v &y, const float_v &z, float_v err2Y, float_v errYZ, float_v err2Z, float maxSinPhi=0.999f, const float_m &mask=float_m(true), const int_v &hitNDF=int_v(2), const float_v &chi2Cut=10e10f) const
 
float_m AcceptWithMaterial (const float_v &y, const float_v &z, const PndCAStripInfo &info, float_v err2, float maxSinPhi=0.999f, const float_m &mask=float_m(true), const float_v &chi2Cut=10e10f) const
 
float_m AddTarget (const PndCATarget &target, const float_m &mask=float_m(true))
 

Static Public Member Functions

static float_v ApproximateBetheBloch (const float_v &beta2)
 
static float_v BetheBlochGeant (const float_v &bg, const float_v &kp0=2.33f, const float_v &kp1=0.20f, const float_v &kp2=3.00f, const float_v &kp3=173e-9f, const float_v &kp4=0.49848f)
 
static float_v BetheBlochSolid (const float_v &bg)
 
static float_v BetheBlochGas (const float_v &bg)
 

Public Attributes

float_v fX
 
float_v fSignCosPhi
 
float_v fP [5]
 
float_v fC [15]
 
float_v fChi2
 
int_v fNDF
 
float_v fAlpha
 
int_v fISec
 

Private Member Functions

const float_v * Par () const
 
const float_v * Cov () const
 
float_v * Par ()
 
float_v * Cov ()
 

Friends

class PndCATrackParam
 

Detailed Description

PndCATrackParamVector class describes the track parametrisation which is used by the PndCATracker slice tracker.

Definition at line 38 of file PndCATrackParamVector.h.

Constructor & Destructor Documentation

PndCATrackParamVector::PndCATrackParamVector ( )
inline

Definition at line 43 of file PndCATrackParamVector.h.

References fC, fP, and i.

44  : fX( Vc::Zero ),
46  fChi2( Vc::Zero ),
47  fNDF( Vc::Zero ),
49  {
50  for ( int i = 0; i < 5; ++i ) fP[i].setZero();
51  for ( int i = 0; i < 15; ++i ) fC[i].setZero();
52  }
Int_t i
Definition: run_full.C:25
static const fvec Zero

Member Function Documentation

float_m PndCATrackParamVector::Accept ( const PndCAHit hit,
const PndCAParam param,
const float_m &  mask = float_m( true ),
const float_v &  chi2Cut = 10e10f 
) const

Definition at line 1026 of file PndCATrackParamVector.cxx.

References AcceptWithMaterial(), PndCAHit::Err2R(), PndCAHit::Err2X1(), PndCAHit::Err2X2(), PndCAHit::ErrX12(), f, PndCAHit::IStation(), NDF(), PndCAParam::Station(), PndCAHit::X1(), PndCAHit::X1Corrected(), and PndCAHit::X2().

Referenced by PndCAGBTracker::PickUpHits().

1027 {
1028  if ( param.Station( hit.IStation() ).NDF == 1 ) {
1029  return AcceptWithMaterial( hit.X1Corrected(this->SinPhi()), hit.X2(), param.Station( hit.IStation() ).f, hit.Err2R(), 0.999f, mask, chi2Cut );
1030  }
1031  return AcceptWithMaterial( hit.X1(), hit.X2(), hit.Err2X1(), hit.ErrX12(), hit.Err2X2(), 0.999f, mask, int_v(param.Station( hit.IStation() ).NDF), chi2Cut );
1032 }
float X2() const
Definition: PndCAHits.h:36
const PndCAStation & Station(short i) const
Definition: PndCAParam.h:46
float X1() const
Definition: PndCAHits.h:35
float Err2X1() const
Definition: PndCAHits.h:38
float Err2X2() const
Definition: PndCAHits.h:40
TFile * f
Definition: bump_analys.C:12
float_v X1Corrected(float_v sinPhi) const
Definition: PndCAHits.h:84
float_m AcceptWithMaterial(const float_v &y, const float_v &z, float_v err2Y, float_v errYZ, float_v err2Z, float maxSinPhi=0.999f, const float_m &mask=float_m(true), const int_v &hitNDF=int_v(2), const float_v &chi2Cut=10e10f) const
float ErrX12() const
Definition: PndCAHits.h:39
char IStation() const
Definition: PndCAHits.h:28
float Err2R() const
Definition: PndCAHits.h:45
float_m PndCATrackParamVector::AcceptWithMaterial ( const float_v &  y,
const float_v &  z,
float_v  err2Y,
float_v  errYZ,
float_v  err2Z,
float  maxSinPhi = 0.999f,
const float_m &  mask = float_m( true ),
const int_v &  hitNDF = int_v(2),
const float_v &  chi2Cut = 10e10f 
) const

Definition at line 1034 of file PndCATrackParamVector.cxx.

References CAMath::Abs(), c10, c11, c20, c21, f, fC, fChi2, fP, mrfdata_8b_error::success, and z0.

Referenced by Accept().

1035 {
1036  assert( maxSinPhi > 0.f );
1037  //* Add the y,z measurement with the Kalman filter
1038 
1039  const float_v c00 = fC[0];
1040  const float_v c10 = fC[1];
1041  const float_v c11 = fC[2];
1042  const float_v c20 = fC[3];
1043  const float_v c21 = fC[4];
1044  const float_v
1045  z0 = y - fP[0],
1046  z1 = z - fP[1];
1047 
1048  err2Y += c00;
1049  err2Z += c11;
1050  errYZ += c10;
1051  float_v d1 = ( err2Y*err2Z - errYZ*errYZ );
1052 
1053  float_m success = mask;// if ( ISUNLIKELY( err2Y < 1.e-8f ) || ISUNLIKELY( err2Z < 1.e-8f ) ) return 0;
1054  success &= (err2Y > 1.e-8f ) && ( err2Z > 1.e-8f );
1055 
1056  const float_v mS0 = err2Z;
1057  const float_v mS1 = -errYZ;
1058  const float_v mS2 = err2Y;
1059 
1060  // K = CHtS
1061 
1062  const float_v k20 = (c20 * mS0 + c21*mS1), k21 = (c20 * mS1 + c21*mS2);
1063  const float_v sinPhi = d1*fP[2] + ( k20 * z0 + k21 * z1 );
1064  success &= CAMath::Abs( sinPhi ) < maxSinPhi*d1;
1065  float_v chi2 = ( mS0 * z0 * z0 + 2 * z0 * z1 * mS1 + mS2 * z1 * z1 );
1066  success &= chi2 < d1*(chi2Cut-fChi2);
1067  return success;
1068 }
Double_t z0
Definition: checkhelixhit.C:62
TCanvas * c11
TCanvas * c10
TCanvas * c21
static T Abs(const T &x)
Definition: PndCAMath.h:39
TFile * f
Definition: bump_analys.C:12
Double_t z
TCanvas * c20
Double_t y
float_m PndCATrackParamVector::AcceptWithMaterial ( const float_v &  y,
const float_v &  z,
const PndCAStripInfo info,
float_v  err2,
float  maxSinPhi = 0.999f,
const float_m &  mask = float_m( true ),
const float_v &  chi2Cut = 10e10f 
) const

Definition at line 1071 of file PndCATrackParamVector.cxx.

References c10, c11, f, mrfdata_8b_error::success, y, and z.

1074 {
1075  assert( maxSinPhi > 0.f );
1076  float_m success = mask;
1077  success &= ( err2 > 1.e-8f );
1078 
1079  const float_v& c00 = fC[0];
1080  const float_v& c10 = fC[1];
1081  const float_v& c11 = fC[2];
1082 
1083  const float_v& sb = info.sin;
1084  const float_v& cb = info.cos;
1085 
1086  const float_v u = cb*y + sb*z;
1087  const float_v zeta = cb*fP[0] + sb*fP[1] - u;
1088 
1089  // F = CH'
1090  const float_v F0 = cb*c00 + sb*c10;
1091  const float_v F1 = cb*c10 + sb*c11;
1092 
1093  const float_v HCH = ( F0*cb + F1*sb );
1094 
1095  const float_v w = ( err2 + HCH );
1096  success &= zeta*zeta < w*(chi2Cut - fChi2);
1097  return success;
1098 }
TCanvas * c11
TCanvas * c10
TFile * f
Definition: bump_analys.C:12
Double_t z
Double_t y
float_m PndCATrackParamVector::AddTarget ( const PndCATarget target,
const float_m &  mask = float_m( true ) 
)

Definition at line 870 of file PndCATrackParamVector.cxx.

References PndCATarget::B(), PndCATarget::Err2X1(), PndCATarget::Err2X2(), FilterVtx(), fNDF, PndCATarget::NDF(), TransportJ0ToX0(), PndCATarget::X0(), PndCATarget::X1(), and PndCATarget::X2().

871 {
872  float_m active = mask;
873 
874  float_v eY, eZ;
875  //float_v dz = target.X0() - X0();
876  float_v J[6];
877  // H = 1 0 J[0] J[1] J[2]
878  // 0 1 J[3] J[4] J[5]
879  active &= TransportJ0ToX0( target.X0(), static_cast<float_v>(target.B()), eY, eZ, J, active );
880  active &= FilterVtx( target.X1(), target.X2(), PndCAX1X2MeasurementInfo( target.Err2X1(), 0.f, target.Err2X2() ), eY, eZ, J, active );
881  fNDF (static_cast<int_m>(active)) += target.NDF();
882 
883  return active;
884 }
float_m FilterVtx(const float_v &xV, const float_v &yV, const PndCAX1X2MeasurementInfo &info, float_v &extrDx, float_v &extrDy, float_v J[], const float_m &active=float_m(true))
const PndCAFieldValue & B() const
Definition: PndCATarget.h:31
float_m TransportJ0ToX0(const float_v &x0, const float_v &cBz, float_v &extrDy, float_v &extrDz, float_v J[], const float_m &active=float_m(true))
int NDF() const
Definition: PndCATarget.h:32
float X2() const
Definition: PndCATarget.h:25
float X0() const
Definition: PndCATarget.h:23
float Err2X2() const
Definition: PndCATarget.h:28
float Err2X1() const
Definition: PndCATarget.h:27
float X1() const
Definition: PndCATarget.h:24
float_v PndCATrackParamVector::Angle ( ) const
inline

Definition at line 96 of file PndCATrackParamVector.h.

References fAlpha.

Referenced by PndCAGBTracker::PickUpHits().

96 { return fAlpha; }
float_v PndCATrackParamVector::ApproximateBetheBloch ( const float_v &  beta2)
static

Definition at line 471 of file PndCATrackParamVector.cxx.

References f, CAMath::Log(), and One.

Referenced by CalculateFitParameters().

472 {
473  //------------------------------------------------------------------
474  // This is an approximation of the Bethe-Bloch formula with
475  // the density effect taken into account at beta*gamma > 3.5
476  // (the approximation is reasonable only for solid materials)
477  //------------------------------------------------------------------
478 
479  const float_v &beta2_1subBeta2 = beta2 / ( float_v( Vc::One ) - beta2 ); // beta2 * CAMath::Reciprocal( float_v( Vc::One ) - beta2 );
480  const float_v &_0p000153_beta2 = 0.153e-3f / beta2;
481  const float log_3p5mul5940 = 9.942227380852058f; // log( 3.5 * 5940 )
482  const float log_5940 = 8.68946441235669f; // log( 5940 )
483  const float_v log_beta2_1subBeta2 = CAMath::Log( beta2_1subBeta2 );
484 
485  float_v ret = _0p000153_beta2 * ( log_5940 + log_beta2_1subBeta2 - beta2 );
486  ret( beta2_1subBeta2 > 3.5f*3.5f ) =
487  _0p000153_beta2 * ( log_3p5mul5940 + 0.5f * log_beta2_1subBeta2 - beta2 );
488  ret.setZero( beta2 >= float_v( Vc::One ) );
489  return ret;
490 }
TFile * f
Definition: bump_analys.C:12
static T Log(const T &x)
Definition: PndCAMath.h:40
static const fvec One
float_v PndCATrackParamVector::BetheBlochGas ( const float_v &  bg)
static

Definition at line 450 of file PndCATrackParamVector.cxx.

References BetheBlochGeant(), f, and x0.

451 {
452  //------------------------------------------------------------------
453  // This is an approximation of the Bethe-Bloch formula,
454  // reasonable for gas materials.
455  // All the parameters are, in fact, for Ne.
456  // The returned value is in [GeV]
457  //------------------------------------------------------------------
458 
459  const float_v rho = 0.9e-3f;
460  const float_v x0 = 2.f;
461  const float_v x1 = 4.f;
462  const float_v mI = 140.e-9f;
463  const float_v mZA = 0.49555f;
464 
465  return BetheBlochGeant( bg, rho, x0, x1, mI, mZA );
466 }
Double_t x0
Definition: checkhelixhit.C:70
static float_v BetheBlochGeant(const float_v &bg, const float_v &kp0=2.33f, const float_v &kp1=0.20f, const float_v &kp2=3.00f, const float_v &kp3=173e-9f, const float_v &kp4=0.49848f)
TFile * f
Definition: bump_analys.C:12
float_v PndCATrackParamVector::BetheBlochGeant ( const float_v &  bg,
const float_v &  kp0 = 2.33f,
const float_v &  kp1 = 0.20f,
const float_v &  kp2 = 3.00f,
const float_v &  kp3 = 173e-9f,
const float_v &  kp4 = 0.49848f 
)
static

Definition at line 397 of file PndCATrackParamVector.cxx.

References f, CAMath::Log(), mK, One, r, CAMath::Sqrt(), x, x0, and Zero.

Referenced by BetheBlochGas(), and BetheBlochSolid().

403 {
404  //
405  // This is the parameterization of the Bethe-Bloch formula inspired by Geant.
406  //
407  // bg2 - (beta*gamma)^2
408  // kp0 - density [g/cm^3]
409  // kp1 - density effect first junction point
410  // kp2 - density effect second junction point
411  // kp3 - mean excitation energy [GeV]
412  // kp4 - mean Z/A
413  //
414  // The default values for the kp* parameters are for silicon.
415  // The returned value is in [GeV/(g/cm^2)].
416  //
417 
418  const float mK = 0.307075e-3f; // [GeV*cm^2/g]
419  const float _2me = 1.022e-3f; // [GeV/c^2]
420  const float_v &rho = kp0;
421  const float_v &x0 = kp1 * 2.303f;
422  const float_v &x1 = kp2 * 2.303f;
423  const float_v &mI = kp3;
424  const float_v &mZA = kp4;
425  const float_v &maxT = _2me * bg2; // neglecting the electron mass
426 
427  //*** Density effect
428  float_v d2( Vc::Zero );
429  const float_v x = 0.5f * CAMath::Log( bg2 );
430  const float_v lhwI = CAMath::Log( 28.816f * 1e-9f * CAMath::Sqrt( rho * mZA ) / mI );
431  d2( x > x1 ) = lhwI + x - 0.5f;
432  const float_v &r = ( x1 - x ) / ( x1 - x0 );
433  d2( x > x0 && x <= x1 ) = lhwI + x - 0.5f + ( 0.5f - lhwI - x0 ) * r * r * r;
434 
435  return mK*mZA*( float_v( Vc::One ) + bg2 ) / bg2*( 0.5f*CAMath::Log( maxT * maxT / ( mI*mI ) ) - bg2 / ( float_v( Vc::One ) + bg2 ) - d2 );
436 }
Double_t x0
Definition: checkhelixhit.C:70
double mK
double r
Definition: RiemannTest.C:14
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
static const fvec Zero
TFile * f
Definition: bump_analys.C:12
Double_t x
static T Log(const T &x)
Definition: PndCAMath.h:40
static const fvec One
float_v PndCATrackParamVector::BetheBlochSolid ( const float_v &  bg)
static

Definition at line 438 of file PndCATrackParamVector.cxx.

References BetheBlochGeant().

439 {
440  //------------------------------------------------------------------
441  // This is an approximation of the Bethe-Bloch formula,
442  // reasonable for solid materials.
443  // All the parameters are, in fact, for Si.
444  // The returned value is in [GeV]
445  //------------------------------------------------------------------
446 
447  return BetheBlochGeant( bg );
448 }
static float_v BetheBlochGeant(const float_v &bg, const float_v &kp0=2.33f, const float_v &kp1=0.20f, const float_v &kp2=3.00f, const float_v &kp3=173e-9f, const float_v &kp4=0.49848f)
void PndCATrackParamVector::CalculateFitParameters ( PndCATrackFitParam par,
const float_v &  mass = 0.13957f 
)

Definition at line 493 of file PndCATrackParamVector.cxx.

References ApproximateBetheBloch(), f, PndCATrackParamVector::PndCATrackFitParam::fBethe, PndCATrackParamVector::PndCATrackFitParam::fE, PndCATrackParamVector::PndCATrackFitParam::fEP2, PndCATrackParamVector::PndCATrackFitParam::fK22, PndCATrackParamVector::PndCATrackFitParam::fK33, PndCATrackParamVector::PndCATrackFitParam::fK43, PndCATrackParamVector::PndCATrackFitParam::fK44, fP, PndCATrackParamVector::PndCATrackFitParam::fSigmadE2, PndCATrackParamVector::PndCATrackFitParam::fTheta2, One, p2, and CAMath::Sqrt().

Referenced by TransportToXWithMaterial().

494 {
495  //*!
496 
497  const float_v p2 = ( float_v( Vc::One ) + fP[3] * fP[3] );
498  const float_v k2 = fP[4] * fP[4];
499  const float_v mass2 = mass * mass;
500  const float_v beta2 = p2 / ( p2 + mass2 * k2 );
501 
502  float_v pp2 = 10000.f; pp2( k2 > 1.e-8f ) = p2 / k2; // impuls 2
503 
504  //par.fBethe = BetheBlochGas( pp2/mass2);
505  // par.fBethe = ApproximateBetheBloch( pp2 / mass2 ); Why pp2 / mass2?, should be beta2.
506  par.fBethe = ApproximateBetheBloch( beta2 );
507  par.fE = CAMath::Sqrt( pp2 + mass2 );
508  par.fTheta2 = 14.1f * 14.1f / ( beta2 * pp2 * 1.e6f );
509  par.fEP2 = par.fE / pp2;
510 
511  // Approximate energy loss fluctuation (M.Ivanov)
512 
513  const float knst = 0.07f; // To be tuned.
514  par.fSigmadE2 = knst * par.fEP2 * fP[4];
515  par.fSigmadE2 = par.fSigmadE2 * par.fSigmadE2;
516 
517  par.fK22 = ( float_v( Vc::One ) + fP[3] * fP[3] );
518  par.fK33 = par.fK22 * par.fK22;
519  par.fK43 = fP[3] * fP[4] * par.fK22;
520  par.fK44 = fP[3] * fP[3] * fP[4] * fP[4];
521 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
Double_t par[3]
static float_v ApproximateBetheBloch(const float_v &beta2)
TFile * f
Definition: bump_analys.C:12
TPad * p2
Definition: hist-t7.C:117
static const fvec One
float_v PndCATrackParamVector::Chi2 ( ) const
inline

Definition at line 111 of file PndCATrackParamVector.h.

References fChi2.

111 { return fChi2; }
float_m PndCATrackParamVector::CorrectForMeanMaterial ( const float_v &  xOverX0,
const float_v &  xTimesRho,
const PndCATrackFitParam par,
const float_m &  _mask 
)

Definition at line 524 of file PndCATrackParamVector.cxx.

References CAMath::Abs(), corr, dE, PndCATrackParamVector::PndCATrackFitParam::fBethe, fC, PndCATrackParamVector::PndCATrackFitParam::fE, PndCATrackParamVector::PndCATrackFitParam::fEP2, PndCATrackParamVector::PndCATrackFitParam::fK22, PndCATrackParamVector::PndCATrackFitParam::fK33, PndCATrackParamVector::PndCATrackFitParam::fK43, PndCATrackParamVector::PndCATrackFitParam::fK44, fP, PndCATrackParamVector::PndCATrackFitParam::fSigmadE2, PndCATrackParamVector::PndCATrackFitParam::fTheta2, and One.

Referenced by TransportToXWithMaterial().

525 {
526  //------------------------------------------------------------------
527  // This function corrects the track parameters for the crossed material.
528  // "xOverX0" - X/X0, the thickness in units of the radiation length.
529  // "xTimesRho" - is the product length*density (g/cm^2).
530  //------------------------------------------------------------------
531 
532  float_v &fC22 = fC[5];
533  float_v &fC33 = fC[9];
534  float_v &fC40 = fC[10];
535  float_v &fC41 = fC[11];
536  float_v &fC42 = fC[12];
537  float_v &fC43 = fC[13];
538  float_v &fC44 = fC[14];
539 
540  //Energy losses************************
541 
542  const float_v &dE = par.fBethe * xTimesRho;
543  assert( dE >= 0 );
544  float_m mask = _mask && dE <= 0.3f * par.fE; //30% energy loss is too much!
545  const float_v &corr = ( float_v( Vc::One ) - par.fEP2 * dE );
546  mask &= corr >= 0.3f && corr <= 1.3f;
547 
548  fP[4]( mask ) *= corr;
549  fC40 ( mask ) *= corr;
550  fC41 ( mask ) *= corr;
551  fC42 ( mask ) *= corr;
552  fC43 ( mask ) *= corr;
553  fC44 ( mask ) *= corr * corr;
554  fC44 ( mask ) += par.fSigmadE2 * CAMath::Abs( dE );
555 
556  //Multiple scattering******************
557 
558  assert( xOverX0 >= 0 );
559  const float_v &theta2 = par.fTheta2 * xOverX0;
560  fC22( mask ) += theta2 * par.fK22 * ( float_v( Vc::One ) - fP[2] * fP[2] );
561  fC33( mask ) += theta2 * par.fK33;
562  fC43( mask ) += theta2 * par.fK43;
563  fC44( mask ) += theta2 * par.fK44;
564 
565  return mask;
566 }
PndPidCorrelator * corr
Double_t par[3]
static T Abs(const T &x)
Definition: PndCAMath.h:39
Double_t dE
Definition: anasim.C:58
static const fvec One
const float_v& PndCATrackParamVector::Cov ( int  i) const
inline

Definition at line 141 of file PndCATrackParamVector.h.

References fC, and i.

Referenced by PndCATrackParam::PndCATrackParam(), PndFTSCATrackParam::PndFTSCATrackParam(), and SetTrackParam().

141 { return fC[i]; }
Int_t i
Definition: run_full.C:25
const float_v* PndCATrackParamVector::Cov ( ) const
inlineprivate

Definition at line 146 of file PndCATrackParamVector.h.

References fC.

146 { return fC; }
float_v* PndCATrackParamVector::Cov ( )
inlineprivate

Definition at line 148 of file PndCATrackParamVector.h.

References fC.

148 { return fC; }
float_v PndCATrackParamVector::DzDs ( ) const
inline

Definition at line 93 of file PndCATrackParamVector.h.

References fP.

Referenced by PndCAGBTracker::PickUpHits(), Transport0ToX(), TransportJ0ToX0(), TransportToX(), and Tx2().

93 { return fP[3]; }
float_v PndCATrackParamVector::Err2DzDs ( ) const
inline

Definition at line 117 of file PndCATrackParamVector.h.

References fC.

117 { return fC[9]; }
float_v PndCATrackParamVector::Err2QMomentum ( ) const
inline

Definition at line 138 of file PndCATrackParamVector.h.

References fC.

138 { return fC[14]; }
float_v PndCATrackParamVector::Err2QPt ( ) const
inline

Definition at line 118 of file PndCATrackParamVector.h.

References fC.

118 { return fC[14]; }
float_v PndCATrackParamVector::Err2SinPhi ( ) const
inline

Definition at line 116 of file PndCATrackParamVector.h.

References fC.

116 { return fC[5]; }
float_v PndCATrackParamVector::Err2X1 ( ) const
inline

Definition at line 134 of file PndCATrackParamVector.h.

References fC.

Referenced by PndCAGBTracker::PickUpHits().

134 { return fC[0]; }
float_v PndCATrackParamVector::Err2X2 ( ) const
inline

Definition at line 135 of file PndCATrackParamVector.h.

References fC.

Referenced by PndCAGBTracker::PickUpHits().

135 { return fC[2]; }
float_v PndCATrackParamVector::Err2Y ( ) const
inline

Definition at line 114 of file PndCATrackParamVector.h.

References fC.

114 { return fC[0]; }
float_v PndCATrackParamVector::Err2Z ( ) const
inline

Definition at line 115 of file PndCATrackParamVector.h.

References fC.

115 { return fC[2]; }
float_m PndCATrackParamVector::Filter ( const PndCAHitV hit,
const PndCAParam param,
const float_m &  mask = float_m( true ),
const float_v &  chi2Cut = 10e10f 
)

Definition at line 832 of file PndCATrackParamVector.cxx.

References PndCAHitV::Err2R(), PndCAHitV::Err2X1(), PndCAHitV::Err2X2(), PndCAHitV::ErrX12(), f, PndCAStation::f, FilterWithMaterial(), PndCAHitV::IStations(), PndCAHitV::IsValid(), m, PndCAStation::NDF, NDF(), PndCAParam::Station(), PndCAHitV::X1(), PndCAHitV::X1Corrected(), and PndCAHitV::X2().

Referenced by PndCAGBTracker::Create1Plets(), PndCAFunctionality::FitIteration(), and PndCAGBTracker::PickUpHits().

833 {
834  const int iSta = hit.IStations()[hit.IsValid().firstOne()];
835  if ( param.Station( iSta ).NDF == 1 ) {
836  float_m m = FilterWithMaterial( hit.X1Corrected(*this), hit.X2(), param.Station( iSta ).f, hit.Err2R(), 0.999f, mask, chi2Cut );
837  return m;
838  }
839  //SG!!
840  float_m m = FilterWithMaterial( hit.X1(), hit.X2(), float_v(3.f)*hit.Err2X1(), hit.ErrX12(), float_v(3.f)*hit.Err2X2(), 0.999f, mask, int_v(param.Station( hit.IStations()[0] ).NDF), chi2Cut );
841  return m;
842 }
float_m FilterWithMaterial(const float_v &y, const float_v &z, float_v err2Y, float_v errYZ, float_v err2Z, float maxSinPhi=0.999f, const float_m &mask=float_m(true), const int_v &hitNDF=int_v(2), const float_v &chi2Cut=10e10f)
__m128 m
Definition: P4_F32vec4.h:28
float_v Err2R() const
Definition: PndCAHitsV.h:55
float_v ErrX12() const
Definition: PndCAHitsV.h:48
const PndCAStation & Station(short i) const
Definition: PndCAParam.h:46
float_v Err2X1() const
Definition: PndCAHitsV.h:47
float_v X1() const
Definition: PndCAHitsV.h:44
PndCAStripInfo f
Definition: PndCAStation.h:21
float_m IsValid() const
Definition: PndCAHitsV.h:30
float_v Err2X2() const
Definition: PndCAHitsV.h:49
float_v X2() const
Definition: PndCAHitsV.h:45
TFile * f
Definition: bump_analys.C:12
int_v IStations() const
Definition: PndCAHitsV.h:37
float_v X1Corrected(const PndCATrackParamVector &p) const
Definition: PndCAHitsV.h:82
float_m PndCATrackParamVector::Filter ( const PndCAHit hit,
const PndCAParam param,
const float_m &  mask = float_m( true ),
const float_v &  chi2Cut = 10e10f 
)

Definition at line 862 of file PndCATrackParamVector.cxx.

References PndCAHit::Err2R(), PndCAHit::Err2X1(), PndCAHit::Err2X2(), PndCAHit::ErrX12(), f, FilterWithMaterial(), PndCAHit::IStation(), NDF(), PndCAParam::Station(), PndCAHit::X1(), PndCAHit::X1Corrected(), and PndCAHit::X2().

863 {
864  if ( param.Station( hit.IStation() ).NDF == 1 ) {
865  return FilterWithMaterial( hit.X1Corrected(this->SinPhi()), hit.X2(), param.Station( hit.IStation() ).f, hit.Err2R(), 0.999f, mask, chi2Cut );
866  }
867  return FilterWithMaterial( hit.X1(), hit.X2(), hit.Err2X1(), hit.ErrX12(), hit.Err2X2(), 0.999f, mask, int_v(param.Station( hit.IStation() ).NDF), chi2Cut );
868 }
float_m FilterWithMaterial(const float_v &y, const float_v &z, float_v err2Y, float_v errYZ, float_v err2Z, float maxSinPhi=0.999f, const float_m &mask=float_m(true), const int_v &hitNDF=int_v(2), const float_v &chi2Cut=10e10f)
float X2() const
Definition: PndCAHits.h:36
const PndCAStation & Station(short i) const
Definition: PndCAParam.h:46
float X1() const
Definition: PndCAHits.h:35
float Err2X1() const
Definition: PndCAHits.h:38
float Err2X2() const
Definition: PndCAHits.h:40
TFile * f
Definition: bump_analys.C:12
float_v X1Corrected(float_v sinPhi) const
Definition: PndCAHits.h:84
float ErrX12() const
Definition: PndCAHits.h:39
char IStation() const
Definition: PndCAHits.h:28
float Err2R() const
Definition: PndCAHits.h:45
float_m PndCATrackParamVector::FilterVtx ( const float_v &  xV,
const float_v &  yV,
const PndCAX1X2MeasurementInfo info,
float_v &  extrDx,
float_v &  extrDy,
float_v  J[],
const float_m &  active = float_m( true ) 
)
inline

Definition at line 456 of file PndCATrackParamVector.h.

References PndCAX1X2MeasurementInfo::C00(), PndCAX1X2MeasurementInfo::C10(), c10, PndCAX1X2MeasurementInfo::C11(), c11, c20, c21, c22, fC, fChi2, fP, Y(), and Z().

Referenced by AddTarget().

457 {
458  float_v zeta0, zeta1, S00, S10, S11, si;
459  float_v F00, F10, F20, F30, F40, F01, F11, F21, F31, F41 ;
460  float_v K00, K10, K20, K30, K40, K01, K11, K21, K31, K41;
461  float_v& c00 = fC[0];
462  float_v& c10 = fC[1];
463  float_v& c11 = fC[2];
464  float_v& c20 = fC[3];
465  float_v& c21 = fC[4];
466  float_v& c22 = fC[5];
467  float_v& c30 = fC[6];
468  float_v& c31 = fC[7];
469  float_v& c32 = fC[8];
470  float_v& c33 = fC[9];
471  float_v& c40 = fC[10];
472  float_v& c41 = fC[11];
473  float_v& c42 = fC[12];
474  float_v& c43 = fC[13];
475  float_v& c44 = fC[14];
476 
477  zeta0 = Y() + extrDy - yV;
478  zeta1 = Z() + extrDz - zV;
479 
480  // H = 1 0 J[0] J[1] J[2]
481  // 0 1 J[3] J[4] J[5]
482 
483  // F = CH'
484  F00 = c00; F01 = c10;
485  F10 = c10; F11 = c11;
486  F20 = J[0]*c22; F21 = J[3]*c22;
487  F30 = J[1]*c33; F31 = J[4]*c33;
488  F40 = J[2]*c44; F41 = J[5]*c44;
489 
490  S00 = info.C00() + F00 + J[0]*F20 + J[1]*F30 + J[2]*F40;
491  S10 = info.C10() + F10 + J[3]*F20 + J[4]*F30 + J[5]*F40;
492  S11 = info.C11() + F11 + J[3]*F21 + J[4]*F31 + J[5]*F41;
493 
494  si = 1.f/(S00*S11 - S10*S10);
495  float_v S00tmp = S00;
496  S00 = si*S11;
497  S10 = -si*S10;
498  S11 = si*S00tmp;
499 
500  fChi2(active) += zeta0*zeta0*S00 + 2.f*zeta0*zeta1*S10 + zeta1*zeta1*S11;
501 
502  K00 = F00*S00 + F01*S10; K01 = F00*S10 + F01*S11;
503  K10 = F10*S00 + F11*S10; K11 = F10*S10 + F11*S11;
504  K20 = F20*S00 + F21*S10; K21 = F20*S10 + F21*S11;
505  K30 = F30*S00 + F31*S10; K31 = F30*S10 + F31*S11;
506  K40 = F40*S00 + F41*S10; K41 = F40*S10 + F41*S11;
507 
508  fP[0](active) -= K00*zeta0 + K01*zeta1;
509  fP[1](active) -= K10*zeta0 + K11*zeta1;
510  fP[2](active) -= K20*zeta0 + K21*zeta1;
511  fP[3](active) -= K30*zeta0 + K31*zeta1;
512  fP[4](active) -= K40*zeta0 + K41*zeta1;
513 
514  c00(active) -= ( K00*F00 + K01*F01 );
515  c10(active) -= ( K10*F00 + K11*F01 );
516  c11(active) -= ( K10*F10 + K11*F11 );
517  c20(active) = -( K20*F00 + K21*F01 );
518  c21(active) = -( K20*F10 + K21*F11 );
519  c22(active) -= ( K20*F20 + K21*F21 );
520  c30(active) = -( K30*F00 + K31*F01 );
521  c31(active) = -( K30*F10 + K31*F11 );
522  c32(active) = -( K30*F20 + K31*F21 );
523  c33(active) -= ( K30*F30 + K31*F31 );
524  c40(active) = -( K40*F00 + K41*F01 );
525  c41(active) = -( K40*F10 + K41*F11 );
526  c42(active) = -( K40*F20 + K41*F21 );
527  c43(active) = -( K40*F30 + K41*F31 );
528  c44(active) -= ( K40*F40 + K41*F41 );
529 
530  return active;
531 }
TCanvas * c11
const float_v & C11() const
TCanvas * c10
TCanvas * c21
const float_v & C10() const
TCanvas * c22
TCanvas * c20
const float_v & C00() const
float_m PndCATrackParamVector::FilterWithMaterial ( const float_v &  y,
const float_v &  z,
float_v  err2Y,
float_v  errYZ,
float_v  err2Z,
float  maxSinPhi = 0.999f,
const float_m &  mask = float_m( true ),
const int_v &  hitNDF = int_v(2),
const float_v &  chi2Cut = 10e10f 
)

Definition at line 620 of file PndCATrackParamVector.cxx.

References CAMath::Abs(), c10, c11, c20, c21, d, f, fC, fChi2, fNDF, fP, One, mrfdata_8b_error::success, and z0.

Referenced by Filter().

621 {
622  assert( maxSinPhi > 0.f );
623  //* Add the y,z measurement with the Kalman filter
624 
625  const float_v c00 = fC[0];
626  const float_v c10 = fC[1];
627  const float_v c11 = fC[2];
628  const float_v c20 = fC[3];
629  const float_v c21 = fC[4];
630 // float c22 = fC[5];
631  const float_v c30 = fC[6];
632  const float_v c31 = fC[7];
633 // float c32 = fC[8];
634 // float c33 = fC[9];
635  const float_v c40 = fC[10];
636  const float_v c41 = fC[11];
637 // float c42 = fC[12];
638 // float c43 = fC[13];
639 // float c44 = fC[14];
640 
641 
642  const float_v
643  z0 = y - fP[0],
644  z1 = z - fP[1];
645 
646  // foreach_bit( int i, mask ) {
647  // cout << i << " e = " << err2Y[i] << " " << errYZ[i] << " " << err2Z[i] << " c = " << c00[i] << " " << c10[i] << " " << c11[i] << " z = " << z0[i] << " " << z1[i] << " chi2 = " << fChi2[i]<< endl;
648  // }
649 
650  err2Y += c00;
651  err2Z += c11;
652  errYZ += c10;
653  float_v d = float_v( Vc::One ) / ( err2Y*err2Z - errYZ*errYZ );
654 
655 
656  float_m success = mask;// if ( ISUNLIKELY( err2Y < 1.e-8f ) || ISUNLIKELY( err2Z < 1.e-8f ) ) return 0;
657  success &= (err2Y > 1.e-8f ) && ( err2Z > 1.e-8f );
658 
659  const float_v mS0 = err2Z*d;
660  const float_v mS1 = -errYZ*d;
661  const float_v mS2 = err2Y*d;
662 
663  // K = CHtS
664 
665  const float_v
666  k00 = c00 * mS0 + c10*mS1, k01 = c00 * mS1 + c10*mS2,
667  k10 = c10 * mS0 + c11*mS1, k11 = c10 * mS1 + c11*mS2,
668  k20 = c20 * mS0 + c21*mS1, k21 = c20 * mS1 + c21*mS2,
669  k30 = c30 * mS0 + c31*mS1, k31 = c30 * mS1 + c31*mS2,
670  k40 = c40 * mS0 + c41*mS1, k41 = c40 * mS1 + c41*mS2;
671 
672  const float_v sinPhi = fP[2] + k20 * z0 + k21 * z1;
673 
674  success &= CAMath::Abs( sinPhi ) < maxSinPhi;
675 
676  fNDF( static_cast<int_m>(success) ) += hitNDF;
677  fChi2(success) += mS0 * z0 * z0 + 2 * z0 * z1 * mS1 + mS2 * z1 * z1;
678  success &= fChi2 < chi2Cut;
679  if ( success.isEmpty() ) return success; // TODO move upper
680 
681  // foreach_bit( int i, success ) {
682  // cout << i << " " << mS0[i] << " " << mS1[i] << " " << mS2[i] << " " << (mS0 * z0 * z0)[i] << " " << (2 * z0 * z1 * mS1)[i] << " " << (mS2 * z1 * z1)[i] << " " << fChi2[i] << endl;
683  // }
684  // std::cout << success << std::endl;
685  fP[ 0](success) += k00 * z0 + k01 * z1;
686  fP[ 1](success) += k10 * z0 + k11 * z1;
687  fP[ 2](success) = sinPhi ;
688  fP[ 3](success) += k30 * z0 + k31 * z1;
689  fP[ 4](success) += k40 * z0 + k41 * z1;
690  fC[ 0](success) -= (k00 * c00 + k01 * c10); //c00
691 
692  fC[ 1](success) -= (k10 * c00 + k11 * c10); //c10
693  fC[ 2](success) -= (k10 * c10 + k11 * c11); //c11
694 
695  fC[ 3](success) -= (k20 * c00 + k21 * c10); //c20
696  fC[ 4](success) -= (k20 * c10 + k21 * c11); //c21
697  fC[ 5](success) -= (k20 * c20 + k21 * c21); //c22
698 
699  fC[ 6](success) -= (k30 * c00 + k31 * c10); //c30
700  fC[ 7](success) -= (k30 * c10 + k31 * c11); //c31
701  fC[ 8](success) -= (k30 * c20 + k31 * c21); //c32
702  fC[ 9](success) -= (k30 * c30 + k31 * c31); //c33
703 
704  fC[10](success) -= (k40 * c00 + k41 * c10); //c40
705  fC[11](success) -= (k40 * c10 + k41 * c11); //c41
706 // std::cout << fC[11] << " " << fC[10] << std::endl;
707 
708  fC[12](success) -= (k40 * c20 + k41 * c21); //c42
709  fC[13](success) -= (k40 * c30 + k41 * c31); //c43
710  fC[14](success) -= (k40 * c40 + k41 * c41); //c44
711 
712  return success;
713 }
Double_t z0
Definition: checkhelixhit.C:62
TCanvas * c11
TObjArray * d
TCanvas * c10
TCanvas * c21
static T Abs(const T &x)
Definition: PndCAMath.h:39
TFile * f
Definition: bump_analys.C:12
Double_t z
TCanvas * c20
Double_t y
static const fvec One
float_m PndCATrackParamVector::FilterWithMaterial ( const float_v &  y,
const float_v &  z,
const PndCAStripInfo info,
float_v  err2,
float  maxSinPhi = 0.999f,
const float_m &  mask = float_m( true ),
const float_v &  chi2Cut = 10e10f 
)

Definition at line 715 of file PndCATrackParamVector.cxx.

References CAMath::Abs(), c10, c11, c20, c21, PndCAStripInfo::cos, f, fC, fChi2, fNDF, fP, PndCAStripInfo::sin, mrfdata_8b_error::success, and z.

718 {
719  assert( maxSinPhi > 0.f );
720  float_m success = mask;
721  success &= ( err2 > 1.e-8f );
722 
723  const float_v& c00 = fC[0];
724  const float_v& c10 = fC[1];
725  const float_v& c11 = fC[2];
726 
727  const float_v& sb = info.sin;
728  const float_v& cb = info.cos;
729 
730  const float_v u = cb*y + sb*z;
731  const float_v zeta = cb*fP[0] + sb*fP[1] - u;
732 
733  // F = CH'
734  const float_v F0 = cb*c00 + sb*c10;
735  const float_v F1 = cb*c10 + sb*c11;
736 
737  const float_v HCH = ( F0*cb + F1*sb );
738 
739  const float_v wi = 1/( err2 + HCH );
740  const float_v zetawi = zeta *wi;
741 
742  fChi2(success) += zeta * zetawi;
743  success &= fChi2 < chi2Cut;
744  if ( success.isEmpty() ) return success;
745 
746  const float_v& c20 = fC[3];
747  const float_v& c21 = fC[4];
748  const float_v& c30 = fC[6];
749  const float_v& c31 = fC[7];
750  const float_v& c40 = fC[10];
751  const float_v& c41 = fC[11];
752 
753  const float_v F2 = cb*c20 + sb*c21;
754  const float_v F3 = cb*c30 + sb*c31;
755  const float_v F4 = cb*c40 + sb*c41;
756 
757 
758  const float_v K1 = F1*wi;
759  const float_v K2 = F2*wi;
760  const float_v K3 = F3*wi;
761  const float_v K4 = F4*wi;
762 
763 
764  const float_v sinPhi = fP[2] - F2*zetawi;
765 
766  success &= CAMath::Abs( sinPhi ) < maxSinPhi;
767 
768  fNDF( static_cast<int_m>(success) ) += 1; // TODO
769 
770  fP[ 0](success) -= F0*zetawi;
771  fP[ 1](success) -= F1*zetawi;
772  fP[ 2](success) = sinPhi ;
773  fP[ 3](success) -= F3*zetawi;
774  fP[ 4](success) -= F4*zetawi;
775 
776  fC[ 0](success) -= F0*F0*wi;
777 
778  fC[ 1](success) -= K1*F0;
779  fC[ 2](success) -= K1*F1;
780 
781  fC[ 3](success) -= K2*F0;
782  fC[ 4](success) -= K2*F1;
783  fC[ 5](success) -= K2*F2;
784 
785  fC[ 6](success) -= K3*F0;
786  fC[ 7](success) -= K3*F1;
787  fC[ 8](success) -= K3*F2;
788  fC[ 9](success) -= K3*F3;
789 
790  fC[10](success) -= K4*F0;
791  fC[11](success) -= K4*F1;
792 
793  fC[12](success) -= K4*F2;
794  fC[13](success) -= K4*F3;
795  fC[14](success) -= K4*F4;
796 
797  return success;
798 }
TCanvas * c11
TCanvas * c10
TCanvas * c21
static T Abs(const T &x)
Definition: PndCAMath.h:39
TFile * f
Definition: bump_analys.C:12
Double_t z
TCanvas * c20
Double_t y
float_v PndCATrackParamVector::GetChi2 ( ) const
inline

Definition at line 127 of file PndCATrackParamVector.h.

References fChi2.

Referenced by SetTrackParam().

127 { return fChi2; }
float_v PndCATrackParamVector::GetCosPhi ( ) const
inline

Definition at line 132 of file PndCATrackParamVector.h.

References fSignCosPhi, One, SinPhi(), and CAMath::Sqrt().

Referenced by GetDCAPoint(), GetS(), Rotate(), and RotateXY().

132 { return fSignCosPhi*CAMath::Sqrt( float_v( Vc::One ) - SinPhi()*SinPhi() ); }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
static const fvec One
float_v PndCATrackParamVector::GetCosPhiPositive ( ) const
inline

Definition at line 131 of file PndCATrackParamVector.h.

References One, SinPhi(), and CAMath::Sqrt().

131 { return CAMath::Sqrt( float_v( Vc::One ) - SinPhi()*SinPhi() ); }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
static const fvec One
void PndCATrackParamVector::GetDCAPoint ( const float_v &  x,
const float_v &  y,
const float_v &  z,
float_v *  px,
float_v *  py,
float_v *  pz,
const float_v &  Bz 
) const

Definition at line 190 of file PndCATrackParamVector.cxx.

References a, CAMath::Abs(), dx, dy, f, GetCosPhi(), GetDzDs(), GetKappa(), GetS(), GetSinPhi(), GetX(), GetY(), GetZ(), CAMath::Round(), s, sqrt(), CAMath::TwoPi(), x0, and y0.

192 {
193  //* Get the track point closest to the (x,y,z)
194 
195  const float_v &x0 = GetX();
196  const float_v &y0 = GetY();
197  const float_v &k = GetKappa( Bz );
198  const float_v &ex = GetCosPhi();
199  const float_v &ey = GetSinPhi();
200  const float_v &dx = x - x0;
201  const float_v &dy = y - y0;
202  const float_v &ax = dx * k + ey;
203  const float_v &ay = dy * k - ex;
204  const float_v &a = sqrt( ax * ax + ay * ay );
205  *xp = x0 + ( dx - ey * ( ( dx * dx + dy * dy ) * k - 2.f * ( -dx * ey + dy * ex ) ) / ( a + 1.f ) ) / a;
206  *yp = y0 + ( dy + ex * ( ( dx * dx + dy * dy ) * k - 2.f * ( -dx * ey + dy * ex ) ) / ( a + 1.f ) ) / a;
207  const float_v s = GetS( x, y, Bz );
208  *zp = GetZ() + GetDzDs() * s;
209  const float_v dZ = CAMath::Abs( GetDzDs() * CAMath::TwoPi() / k );
210  const float_m mask = CAMath::Abs( k ) > 1.e-2f && dZ > .1f;
211  ( *zp )( mask ) += CAMath::Round( ( z - *zp ) / dZ ) * dZ;
212 }
Double_t x0
Definition: checkhelixhit.C:70
double dy
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
TLorentzVector s
Definition: Pnd2DStar.C:50
float_v GetS(const float_v &x, const float_v &y, const float_v &Bz) const
static T Round(const T &x)
static T Abs(const T &x)
Definition: PndCAMath.h:39
Int_t a
Definition: anaLmdDigi.C:126
Double_t y0
Definition: checkhelixhit.C:71
TFile * f
Definition: bump_analys.C:12
Double_t z
double dx
Double_t x
static float TwoPi()
Definition: PndCAMath.h:61
float_v GetKappa(const float_v &Bz) const
Double_t y
float_v PndCATrackParamVector::GetDist2 ( const PndCATrackParamVector t) const

Definition at line 153 of file PndCATrackParamVector.cxx.

References dx, dy, dz, GetX(), GetY(), and GetZ().

154 {
155  // get squared distance between tracks
156 
157  const float_v &dx = GetX() - t.GetX();
158  const float_v &dy = GetY() - t.GetY();
159  const float_v &dz = GetZ() - t.GetZ();
160  return dx*dx + dy*dy + dz*dz;
161 }
double dy
double dx
float_v PndCATrackParamVector::GetDistXZ2 ( const PndCATrackParamVector t) const

Definition at line 163 of file PndCATrackParamVector.cxx.

References dx, dz, GetX(), and GetZ().

164 {
165  // get squared distance between tracks in X&Z
166 
167  const float_v &dx = GetX() - t.GetX();
168  const float_v &dz = GetZ() - t.GetZ();
169  return dx*dx + dz*dz;
170 }
double dx
float_v PndCATrackParamVector::GetDzDs ( ) const
inline

Definition at line 124 of file PndCATrackParamVector.h.

References fP.

Referenced by GetDCAPoint().

124 { return fP[3]; }
float_v PndCATrackParamVector::GetKappa ( const float_v &  Bz) const
inline

Definition at line 130 of file PndCATrackParamVector.h.

References fP.

Referenced by GetDCAPoint(), and GetS().

130 { return fP[4]*Bz; }
int_v PndCATrackParamVector::GetNDF ( ) const
inline

Definition at line 128 of file PndCATrackParamVector.h.

References fNDF.

Referenced by SetTrackParam().

128 { return fNDF; }
float_v PndCATrackParamVector::GetQPt ( ) const
inline

Definition at line 125 of file PndCATrackParamVector.h.

References fP.

125 { return fP[4]; }
float_v PndCATrackParamVector::GetS ( const float_v &  x,
const float_v &  y,
const float_v &  Bz 
) const

Definition at line 173 of file PndCATrackParamVector.cxx.

References CAMath::Abs(), CAMath::ATan2(), f, GetCosPhi(), GetKappa(), GetSinPhi(), GetX(), GetY(), x, and y.

Referenced by GetDCAPoint().

174 {
175  //* Get XY path length to the given point
176 
177  const float_v &k = GetKappa( Bz );
178  const float_v &ex = GetCosPhi();
179  const float_v &ey = GetSinPhi();
180  const float_v &x = _x - GetX();
181  const float_v &y = _y - GetY();
182  float_v dS = x * ex + y * ey;
183  const float_m &mask = CAMath::Abs( k ) > 1.e-4f;
184  if ( !mask.isEmpty() ) {
185  dS( mask ) = CAMath::ATan2( k * dS, 1 + k * ( x * ey - y * ex ) ) / k;
186  }
187  return dS;
188 }
static T Abs(const T &x)
Definition: PndCAMath.h:39
static T ATan2(const T &y, const T &x)
TFile * f
Definition: bump_analys.C:12
Double_t x
float_v GetKappa(const float_v &Bz) const
Double_t y
float_v PndCATrackParamVector::GetSignCosPhi ( ) const
inline

Definition at line 126 of file PndCATrackParamVector.h.

References fSignCosPhi.

126 { return fSignCosPhi; }
float_v PndCATrackParamVector::GetSinPhi ( ) const
inline

Definition at line 123 of file PndCATrackParamVector.h.

References fP.

Referenced by GetDCAPoint(), and GetS().

123 { return fP[2]; }
float_v PndCATrackParamVector::GetX ( ) const
inline

Definition at line 120 of file PndCATrackParamVector.h.

References fX.

Referenced by GetDCAPoint(), GetDist2(), GetDistXZ2(), and GetS().

120 { return fX; }
float_v PndCATrackParamVector::GetY ( ) const
inline

Definition at line 121 of file PndCATrackParamVector.h.

References fP.

Referenced by GetDCAPoint(), GetDist2(), and GetS().

121 { return fP[0]; }
float_v PndCATrackParamVector::GetZ ( ) const
inline

Definition at line 122 of file PndCATrackParamVector.h.

References fP.

Referenced by GetDCAPoint(), GetDist2(), and GetDistXZ2().

122 { return fP[1]; }
void PndCATrackParamVector::InitByHit ( const PndCAHitV hit,
const PndCAParam param,
const float_v &  dQMom 
)

Definition at line 105 of file PndCATrackParamVector.cxx.

References PndCAHitV::Angle(), PndCAHitV::Err2X1(), PndCAHitV::Err2X2(), f, SetAngle(), SetChi2(), SetCov(), SetDzDs(), SetNDF(), SetQPt(), SetSignCosPhi(), SetSinPhi(), SetX(), SetY(), SetZ(), PndCAHitV::X0(), PndCAHitV::X1(), and PndCAHitV::X2().

106 {
107  SetX( hit.X0() );
108  SetY( hit.X1() );
109  SetZ( hit.X2() );
110  SetSinPhi( 0.f );
111  SetSignCosPhi( 1.f );
112  SetDzDs( 0.f );
113  SetQPt( 0.f );
114  SetAngle( hit.Angle() );
115 
116  SetCov( 0, hit.Err2X1() );
117  SetCov( 1, 0.f );
118  SetCov( 2, hit.Err2X2() );
119  SetCov( 3, 0.f );
120  SetCov( 4, 0.f );
121  SetCov( 5, 1.f );
122  SetCov( 6, 0.f );
123  SetCov( 7, 0.f );
124  SetCov( 8, 0.f );
125  SetCov( 9, 1.f );
126  SetCov(10, 0.f );
127  SetCov(11, 0.f );
128  SetCov(12, 0.f );
129  SetCov(13, 0.f );
130  SetCov(14, dQMom*dQMom );
131 
132  SetChi2( 0.f );
133 
134  SetNDF( -3 );
135 
136  UNUSED_PARAM1(param);
137  // const int ista0 = hit.IStation();
138  // const PndCAStation sta0 = param.Station(ista0);
139 
140  // L1FieldValue B;
141  // sta0.fieldSlice.GetFieldValue( hit.X1(), hit.X2(), B );
142  // SetField( 1, B, sta0.z );
143 
144  // if ( ista0 > 0 ) {
145  // const L1Station staC = param.Station(ista0/2); // The field will be used to propaget to the target. Therefore take station in a middle between target and hit.
146  // const float_v tx1 = hit.X1()/hit.X0(); // suppose target is at 0
147  // const float_v tx2 = hit.X2()/hit.X0(); // suppose target is at 0
148  // staC.fieldSlice.GetFieldValue( tx1*staC.z, tx2*staC.z, B );
149  // SetField( 0, B, staC.z );
150  // }
151 }
void SetAngle(const float_v &v)
void SetSignCosPhi(const float_v &v)
void SetSinPhi(const float_v &v)
void SetChi2(const float_v &v)
float_v Err2X1() const
Definition: PndCAHitsV.h:47
float_v X1() const
Definition: PndCAHitsV.h:44
void SetQPt(const float_v &v)
float_v Err2X2() const
Definition: PndCAHitsV.h:49
void SetCov(int i, const float_v &v)
float_v X2() const
Definition: PndCAHitsV.h:45
TFile * f
Definition: bump_analys.C:12
void SetY(const float_v &v)
void SetX(const float_v &v)
float_v Angle() const
Definition: PndCAHitsV.h:59
void SetDzDs(const float_v &v)
float_v X0() const
Definition: PndCAHitsV.h:43
void SetZ(const float_v &v)
void PndCATrackParamVector::InitByTarget ( const PndCATarget target)

Definition at line 72 of file PndCATrackParamVector.cxx.

References PndCATarget::Err2QMom(), PndCATarget::Err2X1(), PndCATarget::Err2X2(), f, PndCATarget::NDF(), SetChi2(), SetCov(), SetDzDs(), SetNDF(), SetQPt(), SetSignCosPhi(), SetSinPhi(), SetX(), SetY(), SetZ(), PndCATarget::X0(), PndCATarget::X1(), and PndCATarget::X2().

Referenced by PndCAGBTracker::Create1Plets(), and PndCAFunctionality::FitIteration().

73 {
74  SetX( t.X0() );
75  SetY( t.X1() );
76  SetZ( t.X2() );
77  SetSinPhi( 1.f );
78  SetSignCosPhi( 0.f );
79  SetDzDs( 0.f );
80  SetQPt( 0.f );
81  SetCov( 0.f, t.Err2X1() );
82  SetCov( 1, 0.f );
83  SetCov( 2, t.Err2X2() );
84  SetCov( 3, 0.f );
85  SetCov( 4, 0.f );
86  SetCov( 5, 1.f );
87  SetCov( 6, 0.f );
88  SetCov( 7, 0.f );
89  SetCov( 8, 0.f );
90  SetCov( 9, 1.f );
91  SetCov(10, 0.f );
92  SetCov(11, 0.f );
93  SetCov(12, 0.f );
94  SetCov(13, 0.f );
95  SetCov(14, t.Err2QMom() );
96 
97  SetChi2( 0.f );
98 
99  SetNDF( -5 + t.NDF() );
100 
101  // SetField( 0, t.B(), t.X0() );
102 }
void SetSignCosPhi(const float_v &v)
void SetSinPhi(const float_v &v)
void SetChi2(const float_v &v)
void SetQPt(const float_v &v)
void SetCov(int i, const float_v &v)
TFile * f
Definition: bump_analys.C:12
void SetY(const float_v &v)
void SetX(const float_v &v)
void SetDzDs(const float_v &v)
TTree * t
Definition: bump_analys.C:13
void SetZ(const float_v &v)
void PndCATrackParamVector::InitCovMatrix ( float_v  d2QMom = 0.f)

Definition at line 49 of file PndCATrackParamVector.cxx.

References f, SetChi2(), SetCov(), and SetNDF().

Referenced by PndCAFunctionality::FitIteration().

50 {
51  SetCov( 0.f, 100.f );
52  SetCov( 1, 0.f );
53  SetCov( 2, 100.f );
54  SetCov( 3, 0.f );
55  SetCov( 4, 0.f );
56  SetCov( 5, 1.f );
57  SetCov( 6, 0.f );
58  SetCov( 7, 0.f );
59  SetCov( 8, 0.f );
60  SetCov( 9, 1.f );
61  SetCov(10, 0.f );
62  SetCov(11, 0.f );
63  SetCov(12, 0.f );
64  SetCov(13, 0.f );
65  SetCov(14, d2QMom );
66 
67  SetChi2( 0.f );
68 
69  SetNDF( -5 );
70 }
void SetChi2(const float_v &v)
void SetCov(int i, const float_v &v)
TFile * f
Definition: bump_analys.C:12
void PndCATrackParamVector::InitDirection ( float_v  r0,
float_v  r1,
float_v  r2 
)
inline

Definition at line 69 of file PndCATrackParamVector.h.

References f, r, SetDzDs(), SetSignCosPhi(), SetSinPhi(), and sqrt().

Referenced by PndCAGBTracker::Create1Plets(), and PndCAFunctionality::FitIteration().

70  {
71  const float_v r = sqrt( r0*r0+r1*r1 );
72  SetSinPhi( r1/r );
73  SetSignCosPhi( 1.f);// r0/abs(r0) );
74  SetDzDs( r2/r );
75  }
double r
Definition: RiemannTest.C:14
void SetSignCosPhi(const float_v &v)
void SetSinPhi(const float_v &v)
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
double r1
TFile * f
Definition: bump_analys.C:12
void SetDzDs(const float_v &v)
double r2
int_v PndCATrackParamVector::ISec ( ) const
inline

Definition at line 97 of file PndCATrackParamVector.h.

References fISec.

Referenced by PndCAGBTracker::PickUpHits().

97 { return fISec; }
int_v PndCATrackParamVector::NDF ( ) const
inline

Definition at line 112 of file PndCATrackParamVector.h.

References fNDF.

Referenced by Accept(), and Filter().

112 { return fNDF; }
const float_v& PndCATrackParamVector::Par ( int  i) const
inline

Definition at line 140 of file PndCATrackParamVector.h.

References fP, and i.

Referenced by PndCATrackParam::PndCATrackParam(), PndFTSCATrackParam::PndFTSCATrackParam(), and SetTrackParam().

140 { return fP[i]; }
Int_t i
Definition: run_full.C:25
const float_v* PndCATrackParamVector::Par ( ) const
inlineprivate

Definition at line 145 of file PndCATrackParamVector.h.

References fP.

145 { return fP; }
float_v* PndCATrackParamVector::Par ( )
inlineprivate

Definition at line 147 of file PndCATrackParamVector.h.

References fP.

147 { return fP; }
float_v PndCATrackParamVector::QMomentum ( ) const
inline

Definition at line 104 of file PndCATrackParamVector.h.

References QPt().

Referenced by PndCAFunctionality::Fit(), and PndCAFunctionality::FitIteration().

104 { return QPt(); } // used for triplets comparison
float_v PndCATrackParamVector::QPt ( ) const
inline

Definition at line 94 of file PndCATrackParamVector.h.

References fP.

Referenced by QMomentum(), and TransportToX().

94 { return fP[4]; }
void PndCATrackParamVector::Reset ( )
inline

Definition at line 54 of file PndCATrackParamVector.h.

References f, fC, fChi2, fNDF, fP, fSignCosPhi, fX, and i.

54  {
55  fX.setZero();
56  fSignCosPhi = float_v(1.f);
57  fChi2.setZero();
58  fNDF.setZero();
59  //fISec.setZero();
60  {
61  for ( int i = 0; i < 5; ++i ) fP[i].setZero();
62  for ( int i = 0; i < 15; ++i ) fC[i].setZero();
63  }
64  }
Int_t i
Definition: run_full.C:25
TFile * f
Definition: bump_analys.C:12
float_m PndCATrackParamVector::Rotate ( const float_v &  alpha,
PndCATrackLinearisationVector t0,
const float  maxSinPhi = .999f,
const float_m &  mask = float_m( true ) 
)

Definition at line 568 of file PndCATrackParamVector.cxx.

References CAMath::Abs(), alpha, CAMath::Cos(), PndCATrackLinearisationVector::CosPhi(), d, f, fAlpha, fC, PndCATrackLinearisationVector::SetCosPhi(), PndCATrackLinearisationVector::SetSinPhi(), SetSinPhi(), SetX(), SetY(), CAMath::Sin(), PndCATrackLinearisationVector::SinPhi(), SinPhi(), X(), x0, Y(), and y0.

Referenced by PndCAGBTracker::PickUpHits(), Transport(), and Transport0().

570 {
571  //* Rotate the coordinate system in XY on the angle alpha
572  if ( (CAMath::Abs(alpha) < 1e-6f || !mask).isFull() ) return mask;
573 
574  const float_v cA = CAMath::Cos( alpha );
575  const float_v sA = CAMath::Sin( alpha );
576  const float_v x0 = X(), y0 = Y(), sP = t0.SinPhi(), cP = t0.CosPhi();
577  const float_v cosPhi = cP * cA + sP * sA;
578  const float_v sinPhi = -cP * sA + sP * cA;
579 
580  float_m ReturnMask(mask);
581  ReturnMask &= (!( CAMath::Abs( sinPhi ) > maxSinPhi || CAMath::Abs( cosPhi ) < 1.e-4f || CAMath::Abs( cP ) < 1.e-4f ));
582 
583  float_v tmp = alpha*0.15915494f;// 1/(2.f*3.1415f);
584  ReturnMask &= abs(tmp - round(tmp)) < 0.167f; // allow turn by 60 degree only TODO scalar
585 
586  //float J[5][5] = { { j0, 0, 0, 0, 0 }, // Y
587  // { 0, 1, 0, 0, 0 }, // Z
588  // { 0, 0, j2, 0, 0 }, // SinPhi
589  // { 0, 0, 0, 1, 0 }, // DzDs
590  // { 0, 0, 0, 0, 1 } }; // Kappa
591 
592  const float_v j0 = cP / cosPhi;
593  const float_v j2 = cosPhi / cP;
594  const float_v d = SinPhi() - sP;
595 
596  SetX( x0*cA + y0*sA, ReturnMask );
597  SetY(-x0*sA + y0*cA, ReturnMask );
598  t0.SetCosPhi( cosPhi );
599  t0.SetSinPhi( sinPhi );
600 
601  SetSinPhi( sinPhi + j2*d, ReturnMask );
602 
603  fC[0](ReturnMask) *= j0 * j0;
604  fC[1](ReturnMask) *= j0;
605  fC[3](ReturnMask) *= j0;
606  fC[6](ReturnMask) *= j0;
607  fC[10](ReturnMask) *= j0;
608 
609  fC[3](ReturnMask) *= j2;
610  fC[4](ReturnMask) *= j2;
611  fC[5](ReturnMask) *= j2 * j2;
612  fC[8](ReturnMask) *= j2;
613  fC[12](ReturnMask) *= j2;
614 
615  fAlpha(ReturnMask) += alpha;
616 
617  return ReturnMask;
618 }
Double_t x0
Definition: checkhelixhit.C:70
TObjArray * d
void SetSinPhi(const float_v &v)
static T Sin(const T &x)
Definition: PndCAMath.h:42
static T Cos(const T &x)
Definition: PndCAMath.h:43
static T Abs(const T &x)
Definition: PndCAMath.h:39
Double_t y0
Definition: checkhelixhit.C:71
TFile * f
Definition: bump_analys.C:12
void SetY(const float_v &v)
void SetX(const float_v &v)
double alpha
Definition: f_Init.h:9
float_m PndCATrackParamVector::Rotate ( const float_v &  alpha,
const float  maxSinPhi = .999f,
const float_m &  mask = float_m( true ) 
)
inline

Definition at line 392 of file PndCATrackParamVector.h.

References CAMath::Abs(), alpha, CAMath::Cos(), d, f, fAlpha, fC, GetCosPhi(), SetSinPhi(), SetX(), SetY(), CAMath::Sin(), SinPhi(), X(), Y(), and y0.

394 {
395  // Rotate the coordinate system in XY on the angle alpha
396  if ( (CAMath::Abs(alpha) < 1e-6f || !mask).isFull() ) return mask;
397 
398  const float_v cA = CAMath::Cos( alpha );
399  const float_v sA = CAMath::Sin( alpha );
400  const float_v x0 = X(), y0 = Y(), sP = SinPhi(), cP = GetCosPhi();
401  const float_v cosPhi = cP * cA + sP * sA;
402  const float_v sinPhi = -cP * sA + sP * cA;
403 
404  float_m ReturnMask(mask);
405  ReturnMask &= (!( CAMath::Abs( sinPhi ) > maxSinPhi || CAMath::Abs( cosPhi ) < 1.e-4f || CAMath::Abs( cP ) < 1.e-4f ));
406 
407  float_v tmp = alpha*0.15915494f;// 1/(2.f*3.1415f);
408  ReturnMask &= abs(tmp - round(tmp)) < 0.167f; // allow turn by 60 degree only TODO scalar
409 
410  //float J[5][5] = { { j0, 0, 0, 0, 0 }, // Y
411  // { 0, 1, 0, 0, 0 }, // Z
412  // { 0, 0, j2, 0, 0 }, // SinPhi
413  // { 0, 0, 0, 1, 0 }, // DzDs
414  // { 0, 0, 0, 0, 1 } }; // Kappa
415 
416  const float_v j0 = cP / cosPhi;
417  const float_v j2 = cosPhi / cP;
418  const float_v d = SinPhi() - sP;
419 
420  SetX( x0*cA + y0*sA, ReturnMask );
421  SetY(-x0*sA + y0*cA, ReturnMask );
422 
423  SetSinPhi( sinPhi + j2*d, ReturnMask );
424 
425  fC[0](ReturnMask) *= j0 * j0;
426  fC[1](ReturnMask) *= j0;
427  fC[3](ReturnMask) *= j0;
428  fC[6](ReturnMask) *= j0;
429  fC[10](ReturnMask) *= j0;
430 
431  fC[3](ReturnMask) *= j2;
432  fC[4](ReturnMask) *= j2;
433  fC[5](ReturnMask) *= j2 * j2;
434  fC[8](ReturnMask) *= j2;
435  fC[12](ReturnMask) *= j2;
436 
437  fAlpha(ReturnMask) += alpha;
438 
439  return ReturnMask;
440 }
Double_t x0
Definition: checkhelixhit.C:70
TObjArray * d
void SetSinPhi(const float_v &v)
static T Sin(const T &x)
Definition: PndCAMath.h:42
static T Cos(const T &x)
Definition: PndCAMath.h:43
static T Abs(const T &x)
Definition: PndCAMath.h:39
Double_t y0
Definition: checkhelixhit.C:71
TFile * f
Definition: bump_analys.C:12
void SetY(const float_v &v)
void SetX(const float_v &v)
double alpha
Definition: f_Init.h:9
void PndCATrackParamVector::RotateXY ( float_v  alpha,
float_v &  x,
float_v &  y,
float_v &  sin,
const float_m &  mask = float_m( true ) 
) const
inline

Definition at line 442 of file PndCATrackParamVector.h.

References CAMath::Cos(), f, GetCosPhi(), CAMath::Sin(), sin(), SinPhi(), X(), x, Y(), and y.

443 {
444  //* Rotate the coordinate system in XY on the angle alpha
445  if ( (abs(alpha) < 1e-6f || !mask).isFull() ) return;
446 
447  const float_v cA = CAMath::Cos( alpha );
448  const float_v sA = CAMath::Sin( alpha );
449 
450  x(mask) = ( X()*cA + Y()*sA );
451  y(mask) = ( -X()*sA + Y()*cA );
452  sin(mask) = -GetCosPhi() * sA + SinPhi() * cA;
453 }
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
static T Sin(const T &x)
Definition: PndCAMath.h:42
static T Cos(const T &x)
Definition: PndCAMath.h:43
TFile * f
Definition: bump_analys.C:12
Double_t x
Double_t y
double alpha
Definition: f_Init.h:9
void PndCATrackParamVector::SetAngle ( const float_v &  v)
inline

Definition at line 200 of file PndCATrackParamVector.h.

References fAlpha, and v.

Referenced by PndCAGBTracker::Create1Plets(), PndCAFunctionality::FitIteration(), and InitByHit().

200 { fAlpha = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetAngle ( const float_v &  v,
const float_m &  m 
)
inline

Definition at line 201 of file PndCATrackParamVector.h.

References fAlpha, and v.

201 { fAlpha(m) = v; }
__m128 m
Definition: P4_F32vec4.h:28
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetChi2 ( const float_v &  v)
inline

Definition at line 194 of file PndCATrackParamVector.h.

References fChi2, and v.

Referenced by ConvertTrackParamToVector(), InitByHit(), InitByTarget(), and InitCovMatrix().

194 { fChi2 = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetChi2 ( const float_v &  v,
const float_m &  m 
)
inline

Definition at line 195 of file PndCATrackParamVector.h.

References fChi2, and v.

195 { fChi2(m) = v; }
__m128 m
Definition: P4_F32vec4.h:28
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetCov ( int  i,
const float_v &  v 
)
inline

Definition at line 176 of file PndCATrackParamVector.h.

References fC, i, and v.

Referenced by ConvertTrackParamToVector(), InitByHit(), InitByTarget(), and InitCovMatrix().

176 { fC[i] = v; }
Int_t i
Definition: run_full.C:25
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetCov ( int  i,
const float_v &  v,
const float_m &  m 
)
inline

Definition at line 177 of file PndCATrackParamVector.h.

References fC, i, and m.

177 { fC[i]( m ) = v; }
Int_t i
Definition: run_full.C:25
__m128 m
Definition: P4_F32vec4.h:28
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetDzDs ( const float_v &  v)
inline

Definition at line 187 of file PndCATrackParamVector.h.

References fP, and v.

Referenced by InitByHit(), InitByTarget(), and InitDirection().

187 { fP[3] = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetDzDs ( const float_v &  v,
const float_m &  m 
)
inline

Definition at line 188 of file PndCATrackParamVector.h.

References fP, and m.

188 { fP[3]( m ) = v; }
__m128 m
Definition: P4_F32vec4.h:28
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetErr2QPt ( float_v  v)
inline

Definition at line 208 of file PndCATrackParamVector.h.

References fC, and v.

208 { fC[14] = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetErr2Y ( float_v  v)
inline

Definition at line 206 of file PndCATrackParamVector.h.

References fC, and v.

206 { fC[0] = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetErr2Z ( float_v  v)
inline

Definition at line 207 of file PndCATrackParamVector.h.

References fC, and v.

207 { fC[2] = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetISec ( const int_v &  v)
inline

Definition at line 203 of file PndCATrackParamVector.h.

References fISec, and v.

Referenced by PndCAGBTracker::Create1Plets().

203 { fISec = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetISec ( const int_v &  v,
const int_m &  m 
)
inline

Definition at line 204 of file PndCATrackParamVector.h.

References fISec, and v.

204 { fISec(m) = v; }
__m128 m
Definition: P4_F32vec4.h:28
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetNDF ( int  v)
inline

Definition at line 196 of file PndCATrackParamVector.h.

References fNDF, and v.

Referenced by ConvertTrackParamToVector(), InitByHit(), InitByTarget(), and InitCovMatrix().

196 { fNDF = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetNDF ( const int_v &  v)
inline

Definition at line 197 of file PndCATrackParamVector.h.

References fNDF, and v.

197 { fNDF = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetNDF ( const int_v &  v,
const int_m &  m 
)
inline

Definition at line 198 of file PndCATrackParamVector.h.

References fNDF, and v.

198 { fNDF(m) = v; }
__m128 m
Definition: P4_F32vec4.h:28
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetPar ( int  i,
const float_v &  v 
)
inline

Definition at line 174 of file PndCATrackParamVector.h.

References fP, i, and v.

Referenced by ConvertTrackParamToVector().

174 { fP[i] = v; }
Int_t i
Definition: run_full.C:25
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetPar ( int  i,
const float_v &  v,
const float_m &  m 
)
inline

Definition at line 175 of file PndCATrackParamVector.h.

References fP, i, and m.

175 { fP[i]( m ) = v; }
Int_t i
Definition: run_full.C:25
__m128 m
Definition: P4_F32vec4.h:28
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetQMomentum ( const float_v &  v)
inline

Definition at line 190 of file PndCATrackParamVector.h.

References SetQPt().

Referenced by PndCAFunctionality::FitIteration().

190 { SetQPt(v); }
__m128 v
Definition: P4_F32vec4.h:4
void SetQPt(const float_v &v)
void PndCATrackParamVector::SetQPt ( const float_v &  v)
inline

Definition at line 189 of file PndCATrackParamVector.h.

References fP, and v.

Referenced by InitByHit(), InitByTarget(), and SetQMomentum().

189 { fP[4] = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetQPt ( const float_v &  v,
const float_m &  m 
)
inline

Definition at line 191 of file PndCATrackParamVector.h.

References fP, and m.

191 { fP[4]( m ) = v; }
__m128 m
Definition: P4_F32vec4.h:28
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetSignCosPhi ( const float_v &  v)
inline

Definition at line 192 of file PndCATrackParamVector.h.

References fSignCosPhi, and v.

Referenced by ConvertTrackParamToVector(), InitByHit(), InitByTarget(), and InitDirection().

192 { fSignCosPhi = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetSignCosPhi ( const float_v &  v,
const float_m &  m 
)
inline

Definition at line 193 of file PndCATrackParamVector.h.

References fSignCosPhi, and v.

193 { fSignCosPhi(m) = v; }
__m128 m
Definition: P4_F32vec4.h:28
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetSinPhi ( const float_v &  v)
inline

Definition at line 185 of file PndCATrackParamVector.h.

References fP, and v.

Referenced by InitByHit(), InitByTarget(), InitDirection(), and Rotate().

185 { fP[2] = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetSinPhi ( const float_v &  v,
const float_m &  m 
)
inline

Definition at line 186 of file PndCATrackParamVector.h.

References fP, and m.

186 { fP[2]( m ) = v; }
__m128 m
Definition: P4_F32vec4.h:28
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetTrackParam ( const PndCATrackParamVector param,
const float_m &  m = float_m( true ) 
)
inline

Definition at line 151 of file PndCATrackParamVector.h.

References Cov(), fC, fChi2, fISec, fNDF, fP, fSignCosPhi, fX, GetChi2(), GetNDF(), i, m, Par(), SignCosPhi(), and X().

Referenced by PndCAGBTracker::PickUpHits().

152  {
153  for(int i=0; i<5; i++) fP[i](m) = param.Par()[i];
154  for(int i=0; i<15; i++) fC[i](m) = param.Cov()[i];
155  fX(m) = param.X();
156  fSignCosPhi(m) = param.SignCosPhi();
157  fChi2(m) = param.GetChi2();
158  fNDF(static_cast<int_m>(m)) = param.GetNDF();
159  fISec(m) = param.fISec;
160  }
const float_v & Cov(int i) const
Int_t i
Definition: run_full.C:25
__m128 m
Definition: P4_F32vec4.h:28
const float_v & Par(int i) const
void PndCATrackParamVector::SetTrackParam ( const PndCATrackParamVector p,
int  k,
int  m 
)
inline

Definition at line 162 of file PndCATrackParamVector.h.

References Cov(), f, fAlpha, fC, fChi2, fISec, fNDF, fP, fSignCosPhi, fX, i, m, and Par().

163  {
164  fX[k]=p.fX[m];
165  fSignCosPhi = float_v(1.f);
166  for(int i=0; i<5; i++) fP[i][k] = p.Par()[i][m];
167  for(int i=0; i<15; i++) fC[i][k] = p.Cov()[i][m];
168  fChi2[k] = p.fChi2[m];
169  fNDF[k] = p.fNDF[m];
170  fAlpha[k] = p.fAlpha[m];
171  fISec[k] = p.fISec[m];
172  }
const float_v & Cov(int i) const
Int_t i
Definition: run_full.C:25
__m128 m
Definition: P4_F32vec4.h:28
TFile * f
Definition: bump_analys.C:12
const float_v & Par(int i) const
void PndCATrackParamVector::SetX ( const float_v &  v)
inline

Definition at line 179 of file PndCATrackParamVector.h.

References fX, and v.

Referenced by ConvertTrackParamToVector(), InitByHit(), InitByTarget(), and Rotate().

179 { fX = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetX ( const float_v &  v,
const float_m &  m 
)
inline

Definition at line 182 of file PndCATrackParamVector.h.

References fX, and v.

182 { fX( m ) = v; }
__m128 m
Definition: P4_F32vec4.h:28
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetY ( const float_v &  v)
inline

Definition at line 180 of file PndCATrackParamVector.h.

References fP, and v.

Referenced by InitByHit(), InitByTarget(), and Rotate().

180 { fP[0] = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetY ( const float_v &  v,
const float_m &  m 
)
inline

Definition at line 183 of file PndCATrackParamVector.h.

References fP, and m.

183 { fP[0]( m ) = v; }
__m128 m
Definition: P4_F32vec4.h:28
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetZ ( const float_v &  v)
inline

Definition at line 181 of file PndCATrackParamVector.h.

References fP, and v.

Referenced by InitByHit(), and InitByTarget().

181 { fP[1] = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParamVector::SetZ ( const float_v &  v,
const float_m &  m 
)
inline

Definition at line 184 of file PndCATrackParamVector.h.

References fP, and m.

184 { fP[1]( m ) = v; }
__m128 m
Definition: P4_F32vec4.h:28
__m128 v
Definition: P4_F32vec4.h:4
float_v PndCATrackParamVector::SignCosPhi ( ) const
inline

The sign of cos phi is always positive in the slice tracker. Only after coordinate transformation can the sign change to negative.

Definition at line 110 of file PndCATrackParamVector.h.

References fSignCosPhi.

Referenced by PndCATrackLinearisationVector::PndCATrackLinearisationVector(), SetTrackParam(), Tx1(), and Tx2().

110 { return fSignCosPhi; }
float_v PndCATrackParamVector::SinPhi ( ) const
inline
float_m PndCATrackParamVector::Transport ( const int_v &  ista,
const PndCAParam param,
const float_m &  mask = float_m( true ) 
)

Definition at line 800 of file PndCATrackParamVector.cxx.

References PndCAParam::cBz(), PndCAParam::GetR(), and TransportToX().

Referenced by PndCAFunctionality::FitIteration().

801 {
802  float_m active = mask;
803  PndCATrackLinearisationVector tE( *this );
804  active &= TransportToX( param.GetR( ista, active ), tE, param.cBz(), 0.999f, NULL, active );
805  //SG!!
806  /*
807  PndCATrackFitParam fitPar;
808  CalculateFitParameters( fitPar );
809  PndCATrackLinearisationVector tE( *this );
810  active &= TransportToXWithMaterial( param.GetR( ista, active ), tE, fitPar, param.GetXOverX0(int_v(ista),active), param.GetXTimesRho(int_v(ista),active), param.cBz(), 0.999f, active );
811  */
812  return active;
813 }
float_m TransportToX(const float_v &x, const float_v &Bz, const float maxSinPhi=.999f, const float_m &mask=float_m(true))
float GetR(short iSt) const
Definition: PndCAParam.h:63
float cBz() const
Definition: PndCAParam.h:49
float_m PndCATrackParamVector::Transport ( const PndCAHitV hit,
const PndCAParam p,
const float_m &  mask = float_m( true ) 
)

Definition at line 815 of file PndCATrackParamVector.cxx.

References CAMath::Abs(), PndCAHitV::Angle(), PndCAParam::cBz(), f, fAlpha, fX, PndCAHitV::IsValid(), Rotate(), TransportToX(), and PndCAHitV::X0().

816 {
817  if ( ((CAMath::Abs(-fAlpha + hit.Angle()) < 1e-6f && CAMath::Abs(-fX + hit.X0()) < 2e-4f) || !mask).isFull() ) return mask;
818  float_m active = mask & hit.IsValid();
819  PndCATrackLinearisationVector tR( *this );
820  active &= Rotate( -fAlpha + hit.Angle(), tR, .999f, active );
821  active &= TransportToX( hit.X0(), tR, param.cBz(), 0.999f, NULL, active );
822 
823  //SG!!
824  /*
825  PndCATrackFitParam fitPar;
826  CalculateFitParameters( fitPar );
827  active &= TransportToXWithMaterial( hit.X0(), tR, fitPar, param.GetXOverX0(hit.IStations(),active), param.GetXTimesRho(hit.IStations(),active), param.cBz(), 0.999f, active );
828  */
829  return active;
830 }
float_m Rotate(const float_v &alpha, PndCATrackLinearisationVector &t0, const float maxSinPhi=.999f, const float_m &mask=float_m(true))
float_m TransportToX(const float_v &x, const float_v &Bz, const float maxSinPhi=.999f, const float_m &mask=float_m(true))
static T Abs(const T &x)
Definition: PndCAMath.h:39
float_m IsValid() const
Definition: PndCAHitsV.h:30
TFile * f
Definition: bump_analys.C:12
float_v Angle() const
Definition: PndCAHitsV.h:59
float_v X0() const
Definition: PndCAHitsV.h:43
float_m PndCATrackParamVector::Transport ( const PndCAHit hit,
const PndCAParam p,
const float_m &  mask = float_m( true ) 
)

Definition at line 844 of file PndCATrackParamVector.cxx.

References CAMath::Abs(), PndCAHit::Angle(), PndCAParam::cBz(), f, fAlpha, fX, Rotate(), TransportToX(), and PndCAHit::X0().

845 {
846  if ( ((CAMath::Abs(-fAlpha + hit.Angle()) < 1e-6f && CAMath::Abs(-fX + hit.X0()) < 2e-4f) || !mask).isFull() ) return mask;
847 
848  float_m active = mask;
849 
850  PndCATrackLinearisationVector tR( *this );
851  active &= Rotate( -fAlpha + hit.Angle(), tR, .999f, active );
852 
853  active &= TransportToX( hit.X0(), tR, param.cBz(), 0.999f, NULL, active );
854  /*
855  PndCATrackFitParam fitPar;
856  CalculateFitParameters( fitPar );
857  active &= TransportToXWithMaterial( hit.X0(), tR, fitPar, param.GetXOverX0(hit.IStation()), param.GetXTimesRho(hit.IStation()), param.cBz(), 0.999f, active );
858  */
859  return active;
860 }
float Angle() const
Definition: PndCAHits.h:51
float_m Rotate(const float_v &alpha, PndCATrackLinearisationVector &t0, const float maxSinPhi=.999f, const float_m &mask=float_m(true))
float_m TransportToX(const float_v &x, const float_v &Bz, const float maxSinPhi=.999f, const float_m &mask=float_m(true))
float X0() const
Definition: PndCAHits.h:34
static T Abs(const T &x)
Definition: PndCAMath.h:39
TFile * f
Definition: bump_analys.C:12
float_m PndCATrackParamVector::Transport0 ( const int_v &  ista,
const PndCAParam param,
const float_m &  mask = float_m( true ) 
)
inline

Definition at line 565 of file PndCATrackParamVector.h.

References PndCAParam::cBz(), PndCAParam::GetR(), and Transport0ToX().

Referenced by PndCAGBTracker::PickUpHits().

566 {
567  float_m active = mask;
568  //PndCATrackLinearisationVector tE( *this );
569  //active &= TransportToX( param.GetR( ista, active ), tE, param.cBz(), 0.999f, NULL, active );
570  active &= Transport0ToX( param.GetR( ista, active ), param.cBz(), active);
571  return active;
572 }
float_m Transport0ToX(const float_v &x, const float_v &Bz, const float_m &mask)
float GetR(short iSt) const
Definition: PndCAParam.h:63
float cBz() const
Definition: PndCAParam.h:49
float_m PndCATrackParamVector::Transport0 ( const PndCAHitV hit,
const PndCAParam param,
const float_m &  mask = float_m( true ) 
)

Definition at line 1014 of file PndCATrackParamVector.cxx.

References PndCAHitV::Angle(), PndCAParam::cBz(), fAlpha, PndCAHitV::IsValid(), Rotate(), Transport0ToX(), and PndCAHitV::X0().

1015 {
1016  //if ( ((CAMath::Abs(-fAlpha + hit.Angle()) < 1e-6f && CAMath::Abs(-fX + hit.X0()) < 2e-4f) || !mask).isFull() ) return mask;
1017  float_m active = mask & hit.IsValid();
1018  active &= Rotate( -fAlpha + hit.Angle(), .999f, active );
1019  active &= Transport0ToX( hit.X0(), param.cBz(), active );
1020  return active;
1021 }
float_m Rotate(const float_v &alpha, PndCATrackLinearisationVector &t0, const float maxSinPhi=.999f, const float_m &mask=float_m(true))
float_m Transport0ToX(const float_v &x, const float_v &Bz, const float_m &mask)
float_m IsValid() const
Definition: PndCAHitsV.h:30
float cBz() const
Definition: PndCAParam.h:49
float_v Angle() const
Definition: PndCAHitsV.h:59
float_v X0() const
Definition: PndCAHitsV.h:43
float_m PndCATrackParamVector::Transport0 ( const PndCAHit hit,
const PndCAParam p,
const float_m &  mask = float_m( true ) 
)
inline

Definition at line 574 of file PndCATrackParamVector.h.

References CAMath::Abs(), PndCAHit::Angle(), PndCAParam::cBz(), f, fAlpha, fX, Rotate(), Transport0ToX(), and PndCAHit::X0().

575 {
576  if ( ((CAMath::Abs(-fAlpha + hit.Angle()) < 1e-6f && CAMath::Abs(-fX + hit.X0()) < 2e-4f) || !mask).isFull() ) return mask;
577  float_m active = mask;
578  //PndCATrackLinearisationVector tR( *this );
579  active &= Rotate( -fAlpha + hit.Angle(), .999f, active );
580  //active &= Rotate( -fAlpha + hit.Angle(), tR, .999f, active );
581  //active &= TransportToX( hit.X0(), tR, param.cBz(), 0.999f, NULL, active );
582  active &=Transport0ToX( hit.X0(), param.cBz(), active );
583  return active;
584 }
float Angle() const
Definition: PndCAHits.h:51
float_m Rotate(const float_v &alpha, PndCATrackLinearisationVector &t0, const float maxSinPhi=.999f, const float_m &mask=float_m(true))
float X0() const
Definition: PndCAHits.h:34
float_m Transport0ToX(const float_v &x, const float_v &Bz, const float_m &mask)
static T Abs(const T &x)
Definition: PndCAMath.h:39
TFile * f
Definition: bump_analys.C:12
float_m PndCATrackParamVector::Transport0ToX ( const float_v &  x,
const float_v &  Bz,
const float_m &  mask 
)

Definition at line 953 of file PndCATrackParamVector.cxx.

References CAMath::Abs(), c10, c11, c20, c21, c22, dx, DzDs(), fC, fP, fX, h2, h4, One, SinPhi(), CAMath::Sqrt(), and X().

Referenced by PndCAGBTracker::Create1Plets(), and Transport0().

954 {
955  //* Transport the track parameters to X=x, using linearization at t0, and the field value Bz
956  //* maxSinPhi is the max. allowed value for |t0.SinPhi()|
957  //* linearisation of trajectory t0 is also transported to X=x,
958  //* returns 1 if OK
959  //*
960 
961  const float_v ey = SinPhi();
962  const float_v ex = CAMath::Sqrt( float_v( Vc::One ) - ey*ey );
963  const float_v dx = x - X();
964 
965  float_m mask = _mask && CAMath::Abs( ey ) <= .999f;
966 
967  const float_v exi = 1.f / ex;
968  const float_v dS = dx * exi;
969  const float_v h2 = dx * exi * exi *exi;
970  const float_v h4 = 0.5f*dx* Bz * h2;
971  const float_v dxBz = dx * Bz;
972 
973  fX += dx;
974  fP[0] += dS*ey + h4 * fP[4];
975  fP[1] += dS * DzDs();
976  fP[2] += dxBz * fP[4];
977 
978  const float_v c00 = fC[0];
979  const float_v c10 = fC[1];
980  const float_v c11 = fC[2];
981  const float_v c20 = fC[3];
982  const float_v c21 = fC[4];
983  const float_v c22 = fC[5];
984  const float_v c30 = fC[6];
985  const float_v c31 = fC[7];
986  const float_v c32 = fC[8];
987  const float_v c33 = fC[9];
988  const float_v c40 = fC[10];
989  const float_v c41 = fC[11];
990  const float_v c42 = fC[12];
991  const float_v c43 = fC[13];
992  const float_v c44 = fC[14];
993 
994  fC[0] = ( c00 + h2 * h2 * c22 + h4 * h4 * c44
995  + 2.f * ( h2 * c20 + h4 * c40 + h2 * h4 * c42 ) );
996 
997  fC[1] = c10 + h2 * c21 + h4 * c41 + dS * ( c30 + h2 * c32 + h4 * c43 );
998  fC[2] = c11 + 2.f * dS * c31 + dS * dS * c33;
999 
1000  fC[3] = c20 + h2 * c22 + h4 * c42 + dxBz * ( c40 + h2 * c42 + h4 * c44 );
1001  fC[4] = c21 + dS * c32 + dxBz * ( c41 + dS * c43 );
1002  fC[5] = c22 + 2.f * dxBz * c42 + dxBz * dxBz * c44;
1003 
1004  fC[6] = c30 + h2 * c32 + h4 * c43;
1005  fC[7] = c31 + dS * c33;
1006  fC[8] = c32 + dxBz * c43;
1007 
1008  fC[10] = c40 + h2 * c42 + h4 * c44;
1009  fC[11] = c41 + dS * c43;
1010  fC[12] = c42 + dxBz * c44;
1011  return mask;
1012 }
TCanvas * c11
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
TH1F * h4
TCanvas * c10
TCanvas * c21
static T Abs(const T &x)
Definition: PndCAMath.h:39
double dx
TCanvas * c22
TCanvas * c20
Double_t x
static const fvec One
float_m PndCATrackParamVector::TransportJ0ToX0 ( const float_v &  x0,
const float_v &  cBz,
float_v &  extrDy,
float_v &  extrDz,
float_v  J[],
const float_m &  active = float_m( true ) 
)
inline

Definition at line 533 of file PndCATrackParamVector.h.

References CAMath::Abs(), dx, DzDs(), h2, h4, One, CAMath::RSqrt(), SinPhi(), and X().

Referenced by AddTarget().

534 {
535  const float_v &ey = SinPhi();
536  const float_v &dx = x - X();
537  const float_v &exi = CAMath::RSqrt( float_v( Vc::One ) - ey * ey ); // RSqrt
538 
539  const float_v &dxBz = dx * cBz;
540  const float_v &dS = dx * exi;
541  const float_v &h2 = dS * exi * exi;
542  const float_v &h4 = .5f * h2 * dxBz;
543 
544  float_m mask = active && CAMath::Abs( exi ) <= 1.e4f;
545 
546  extrDy(mask) = dS*ey;
547  extrDz(mask) = dS*DzDs();
548  J[0](mask) = dS;
549  J[1](mask) = 0;
550  J[2](mask) = h4;
551  J[3](mask) = dS;
552  J[4](mask) = dS;
553  J[5](mask) = 0;
554  return mask;
555 }
TH1F * h4
static T Abs(const T &x)
Definition: PndCAMath.h:39
static T RSqrt(const T &x)
Definition: PndCAMath.h:38
double dx
Double_t x
static const fvec One
float_m PndCATrackParamVector::TransportToX ( const float_v &  x,
const float_v &  Bz,
const float  maxSinPhi = .999f,
const float_m &  mask = float_m( true ) 
)

Definition at line 333 of file PndCATrackParamVector.cxx.

References t0.

Referenced by Transport(), and TransportToXWithMaterial().

335 {
336  //* Transport the track parameters to X=x
337 
338 // assert( ( x == 0 && mask ).isEmpty() );
339 
341 
342  return TransportToX( x, t0, Bz, maxSinPhi, 0, mask );
343 }
float_m TransportToX(const float_v &x, const float_v &Bz, const float maxSinPhi=.999f, const float_m &mask=float_m(true))
Int_t t0
Definition: hist-t7.C:106
Double_t x
float_m PndCATrackParamVector::TransportToX ( const float_v &  x,
PndCATrackLinearisationVector t0,
const float_v &  Bz,
const float  maxSinPhi = .999f,
float_v *  DL = 0,
const float_m &  mask = float_m( true ) 
)

Definition at line 220 of file PndCATrackParamVector.cxx.

References CAMath::Abs(), CAMath::ASin(), c10, c11, c20, c21, c22, PndCATrackLinearisationVector::CosPhi(), d, dx, dy, dz, PndCATrackLinearisationVector::DzDs(), f, fC, fP, fX, h2, h4, CAMath::Max(), CAMath::Min(), One, PndCATrackLinearisationVector::QPt(), PndCATrackLinearisationVector::SetCosPhi(), PndCATrackLinearisationVector::SetSinPhi(), PndCATrackLinearisationVector::SinPhi(), CAMath::Sqrt(), X(), Y(), Z(), and Zero.

221 {
222  //* Transport the track parameters to X=x, using linearization at t0, and the field value Bz
223  //* maxSinPhi is the max. allowed value for |t0.SinPhi()|
224  //* linearisation of trajectory t0 is also transported to X=x,
225  //* returns 1 if OK
226  //*
227 // std::cout << t0.QPt()[0] << " " << fP[4][0] << std::endl;
228  const float_v ex = t0.CosPhi();
229  const float_v ey = t0.SinPhi();
230  const float_v k = t0.QPt() * Bz;
231  const float_v dx = x - X();
232 
233  float_v ey1 = k * dx + ey;
234 
235  // check for intersection with X=x
236 
237  float_v ex1 = CAMath::Sqrt( 1.f - ey1 * ey1 );
238  ex1( ex < Vc::Zero ) = -ex1;
239 
240  const float_v dx2 = dx * dx;
241  const float_v ss = ey + ey1;
242  const float_v cc = ex + ex1;
243 
244  const float_v cci = 1.f / cc;
245  const float_v exi = 1.f / ex;
246  const float_v ex1i = 1.f / ex1;
247 
248  float_m mask = _mask && CAMath::Abs( ey1 ) <= maxSinPhi && CAMath::Abs( cc ) >= 1.e-4f && CAMath::Abs( ex ) >= 1.e-4f && CAMath::Abs( ex1 ) >= 1.e-4f;
249 
250  const float_v tg = ss * cci; // tan((phi1+phi)/2)
251 
252  const float_v dy = dx * tg;
253  float_v dl = dx * CAMath::Sqrt( 1.f + tg * tg );
254 
255  dl( cc < Vc::Zero ) = -dl;
256  const float_v dSin = CAMath::Max( float_v( -1.f ), CAMath::Min( float_v( Vc::One ), dl * k * 0.5f ) );
257  const float_v dS = ( CAMath::Abs( k ) > 1.e-4f ) ? ( 2 * CAMath::ASin( dSin ) / k ) : dl;
258  const float_v dz = dS * t0.DzDs();
259 
260  if ( DL ) {
261  ( *DL )( mask ) = -dS * CAMath::Sqrt( 1.f + t0.DzDs() * t0.DzDs() );
262  }
263 
264  const float_v d[3] = { fP[2] - t0.SinPhi(), fP[3] - t0.DzDs(), fP[4] - t0.QPt() };
265 
266  //float H0[5] = { 1,0, h2, 0, h4 };
267  //float H1[5] = { 0, 1, 0, dS, 0 };
268  //float H2[5] = { 0, 0, 1, 0, dxBz };
269  //float H3[5] = { 0, 0, 0, 1, 0 };
270  //float H4[5] = { 0, 0, 0, 0, 1 };
271 
272  const float_v h2 = dx * ( 1.f + ey * ey1 + ex * ex1 ) * exi * ex1i * cci;
273  const float_v h4 = dx2 * ( cc + ss * ey1 * ex1i ) * cci * cci * Bz;
274  const float_v dxBz = dx * Bz;
275 
276  ex1( !mask ) = ex;
277  ey1( !mask ) = ey;
278 
279 // std::cout << "QPt " << t0.QPt()[0] << " " << fP[4][0] <<
280 // " CosPhi " << t0.CosPhi()[0] << " " << ex1[0] << std::endl;
281 
282  t0.SetCosPhi( ex1 );
283  t0.SetSinPhi( ey1 );
284 
285  fX( mask ) = X() + dx;
286  fP[0]( mask ) = Y() + dy + h2 * d[0] + h4 * d[2];
287  fP[1]( mask ) = Z() + dz + dS * d[1];
288  fP[2]( mask ) = t0.SinPhi() + d[0] + dxBz * d[2];
289  fP[2]( CAMath::Abs(fP[2]) > maxSinPhi ) = t0.SinPhi();
290 
291  const float_v c00 = fC[0];
292  const float_v c10 = fC[1];
293  const float_v c11 = fC[2];
294  const float_v c20 = fC[3];
295  const float_v c21 = fC[4];
296  const float_v c22 = fC[5];
297  const float_v c30 = fC[6];
298  const float_v c31 = fC[7];
299  const float_v c32 = fC[8];
300  const float_v c33 = fC[9];
301  const float_v c40 = fC[10];
302  const float_v c41 = fC[11];
303  const float_v c42 = fC[12];
304  const float_v c43 = fC[13];
305  const float_v c44 = fC[14];
306 
307  fC[0]( mask ) = ( c00 + h2 * h2 * c22 + h4 * h4 * c44
308  + 2.f * ( h2 * c20 + h4 * c40 + h2 * h4 * c42 ) );
309 
310  fC[1]( mask ) = c10 + h2 * c21 + h4 * c41 + dS * ( c30 + h2 * c32 + h4 * c43 );
311  fC[2]( mask ) = c11 + 2.f * dS * c31 + dS * dS * c33;
312 
313  fC[3]( mask ) = c20 + h2 * c22 + h4 * c42 + dxBz * ( c40 + h2 * c42 + h4 * c44 );
314  fC[4]( mask ) = c21 + dS * c32 + dxBz * ( c41 + dS * c43 );
315  fC[5]( mask ) = c22 + 2.f * dxBz * c42 + dxBz * dxBz * c44;
316 
317  fC[6]( mask ) = c30 + h2 * c32 + h4 * c43;
318  fC[7]( mask ) = c31 + dS * c33;
319  fC[8]( mask ) = c32 + dxBz * c43;
320  fC[9]( mask ) = c33;
321 
322  fC[10]( mask ) = c40 + h2 * c42 + h4 * c44;
323  fC[11]( mask ) = c41 + dS * c43;
324  fC[12]( mask ) = c42 + dxBz * c44;
325  fC[13]( mask ) = c43;
326  fC[14]( mask ) = c44;
327 //std::cout << fC[10] << " " << fC[11] <<" " << h2 << " " << h4 << " " << c44 << " " << mask << " " << Bz << std::endl;
328  //debugKF() << mask << "\n" << *this << std::endl;
329  return mask;
330 }
static T ASin(const T &x)
double dy
TCanvas * c11
TObjArray * d
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
TH1F * h4
TCanvas * c10
TCanvas * c21
static const fvec Zero
static T Abs(const T &x)
Definition: PndCAMath.h:39
static T Min(const T &x, const T &y)
Definition: PndCAMath.h:35
TFile * f
Definition: bump_analys.C:12
double dx
TCanvas * c22
TCanvas * c20
static T Max(const T &x, const T &y)
Definition: PndCAMath.h:36
Double_t x
static const fvec One
float_m PndCATrackParamVector::TransportToX ( const float_v &  x,
const float_v &  sinPhi0,
const float_v &  Bz,
const float_v  maxSinPhi = .999f,
const float_m &  mask = float_m( true ) 
)
inline

mvz start 23.01.2010

mvz end 23.01.2010

Definition at line 313 of file PndCATrackParamVector.h.

References CAMath::Abs(), c20, c22, dx, DzDs(), f, fC, fP, fX, h2, h4, One, QPt(), CAMath::RSqrt(), SinPhi(), and X().

315 {
316  //* Transport the track parameters to X=x, using linearization at phi0 with 0 curvature,
317  //* and the field value Bz
318  //* maxSinPhi is the max. allowed value for |t0.SinPhi()|
319  //* linearisation of trajectory t0 is also transported to X=x,
320  //* returns 1 if OK
321  //*
322 
323  //debugKF() << "Start TransportToX(" << x << ", " << _mask << ")\n" << *this << std::endl;
324 
325  const float_v &ey = sinPhi0;
326  const float_v &dx = x - X();
327  const float_v &exi = float_v( Vc::One ) * CAMath::RSqrt( float_v( Vc::One ) - ey * ey ); // RSqrt
328 
329  const float_v &dxBz = dx * Bz;
330  const float_v &dS = dx * exi;
331  const float_v &h2 = dS * exi * exi;
332  const float_v &h4 = .5f * h2 * dxBz;
334 // const float_v &sinPhi = SinPhi() * (float_v( Vc::One ) - 0.5f * dxBz * QPt() *dxBz * QPt()/ ( float_v( Vc::One ) - SinPhi()*SinPhi() )) + dxBz * QPt();
335  const float_v &sinPhi = SinPhi() + dxBz * QPt();
337 
338  float_m mask = _mask && CAMath::Abs( exi ) <= 1.e4f;
339  mask &= ( (CAMath::Abs( sinPhi ) <= maxSinPhi) || (maxSinPhi <= 0.f) );
340 
341 
342  fX ( mask ) += dx;
343  fP[0]( mask ) += dS * ey + h2 * ( SinPhi() - ey ) + h4 * QPt();
344  fP[1]( mask ) += dS * DzDs();
345  fP[2]( mask ) = sinPhi;
346 
347 
348  //const float_v c00 = fC[0];
349  //const float_v c11 = fC[2];
350  const float_v c20 = fC[3];
351  //const float_v c21 = fC[4];
352  const float_v c22 = fC[5];
353  //const float_v c30 = fC[6];
354  const float_v c31 = fC[7];
355  //const float_v c32 = fC[8];
356  const float_v c33 = fC[9];
357  const float_v c40 = fC[10];
358  //const float_v c41 = fC[11];
359  const float_v c42 = fC[12];
360  //const float_v c43 = fC[13];
361  const float_v c44 = fC[14];
362 
363  const float_v two( 2.f );
364 
365  fC[0] ( mask ) += h2 * h2 * c22 + h4 * h4 * c44
366  + two * ( h2 * c20 + h4 * ( c40 + h2 * c42 ) );
367 
368  //fC[1] ( mask ) += h2 * c21 + h4 * c41 + dS * ( c30 + h2 * c32 + h4 * c43 );
369  fC[2] ( mask ) += dS * ( two * c31 + dS * c33 );
370 
371  fC[3] ( mask ) += h2 * c22 + h4 * c42 + dxBz * ( c40 + h2 * c42 + h4 * c44 );
372  //fC[4] ( mask ) += dS * c32 + dxBz * ( c41 + dS * c43 );
373  const float_v &dxBz_c44 = dxBz * c44;
374  fC[12]( mask ) += dxBz_c44;
375  fC[5] ( mask ) += dxBz * ( two * c42 + dxBz_c44 );
376 
377  //fC[6] ( mask ) += h2 * c32 + h4 * c43;
378  fC[7] ( mask ) += dS * c33;
379  //fC[8] ( mask ) += dxBz * c43;
380  //fC[9] ( mask ) = c33;
381 
382  fC[10]( mask ) += h2 * c42 + h4 * c44;
383  //fC[11]( mask ) += dS * c43;
384  //fC[13]( mask ) = c43;
385  //fC[14]( mask ) = c44;
386 
387  //debugKF() << mask << "\n" << *this << std::endl;
388  return mask;
389 }
TH1F * h4
static T Abs(const T &x)
Definition: PndCAMath.h:39
static T RSqrt(const T &x)
Definition: PndCAMath.h:38
TFile * f
Definition: bump_analys.C:12
double dx
TCanvas * c22
TCanvas * c20
Double_t x
static const fvec One
float_m PndCATrackParamVector::TransportToXWithMaterial ( const float_v &  x,
const float_v &  XOverX0,
const float_v &  XThimesRho,
const float_v &  Bz,
const float  maxSinPhi = .999f 
)

Definition at line 381 of file PndCATrackParamVector.cxx.

References CalculateFitParameters(), and par.

Referenced by TransportToXWithMaterial().

383 {
384  //* Transport the track parameters to X=x taking into account material budget
385 
386  PndCATrackFitParam par;
387  CalculateFitParameters( par );
388  return TransportToXWithMaterial( x, par, XOverX0, XThimesRho, Bz, maxSinPhi );
389 }
void CalculateFitParameters(PndCATrackFitParam &par, const float_v &mass=0.13957f)
Double_t par[3]
float_m TransportToXWithMaterial(const float_v &x, const float_v &XOverX0, const float_v &XThimesRho, const float_v &Bz, const float maxSinPhi=.999f)
Double_t x
float_m PndCATrackParamVector::TransportToXWithMaterial ( const float_v &  x,
PndCATrackLinearisationVector t0,
PndCATrackFitParam par,
const float_v &  XOverX0,
const float_v &  XThimesRho,
const float_v &  Bz,
const float  maxSinPhi = .999f,
const float_m &  mask = float_m( true ) 
)

Definition at line 347 of file PndCATrackParamVector.cxx.

References CorrectForMeanMaterial(), PndCATrackLinearisationVector::DzDs(), PndCATrackLinearisationVector::SinPhi(), sqrt(), and TransportToX().

349 {
350  //* Transport the track parameters to X=x taking into account material budget
351 // UNUSED_PARAM1(par);
352  // const float kRho = 1.025e-3f;//0.9e-3;
353 // const float kRadLen = 29.532f;//28.94;
354 // const float kRhoOverRadLen = kRho / kRadLen;
355  // const float kRhoOverRadLen = 7.68e-5;
356  float_v dl;
357 
358  float_m mask = mask_ && TransportToX( x, t0, Bz, maxSinPhi, &dl, mask_ );
359 // if ( !mask.isEmpty() ) {
360 // CorrectForMeanMaterial( dl * kRhoOverRadLen, dl * kRho, par, mask );
361 // }
362 
363  const float_v dzds2 = t0.DzDs()*t0.DzDs();
364  const float_v sphi2 = t0.SinPhi()*t0.SinPhi();
365  float_v koeff = sqrt( (1 + dzds2)*( 1 + sphi2 ) ); // = dr/dx
366  mask &= CorrectForMeanMaterial( XOverX0*koeff, XThimesRho*koeff, par, mask );
367 
368  return mask;
369 }
float_m TransportToX(const float_v &x, const float_v &Bz, const float maxSinPhi=.999f, const float_m &mask=float_m(true))
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
Double_t par[3]
float_m CorrectForMeanMaterial(const float_v &xOverX0, const float_v &xTimesRho, const PndCATrackFitParam &par, const float_m &_mask)
Double_t x
float_m PndCATrackParamVector::TransportToXWithMaterial ( const float_v &  x,
PndCATrackFitParam par,
const float_v &  XOverX0,
const float_v &  XThimesRho,
const float_v &  Bz,
const float  maxSinPhi = .999f 
)

Definition at line 372 of file PndCATrackParamVector.cxx.

References t0, and TransportToXWithMaterial().

374 {
375  //* Transport the track parameters to X=x taking into account material budget
376 
378  return TransportToXWithMaterial( x, t0, par, XOverX0, XThimesRho, Bz, maxSinPhi );
379 }
Double_t par[3]
float_m TransportToXWithMaterial(const float_v &x, const float_v &XOverX0, const float_v &XThimesRho, const float_v &Bz, const float maxSinPhi=.999f)
Int_t t0
Definition: hist-t7.C:106
Double_t x
float_v PndCATrackParamVector::Tx1 ( ) const
inline

Definition at line 102 of file PndCATrackParamVector.h.

References SignCosPhi(), SinPhi(), and sqrt().

102 { return SinPhi()/(SignCosPhi()*sqrt( 1 - SinPhi()*SinPhi() )); } // CHECKME
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
float_v PndCATrackParamVector::Tx2 ( ) const
inline

Definition at line 103 of file PndCATrackParamVector.h.

References DzDs(), SignCosPhi(), SinPhi(), and sqrt().

103 { return DzDs()/(SignCosPhi()*sqrt( 1 - SinPhi()*SinPhi() )); } // dx2/dx0 = dz/dx
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
float_v PndCATrackParamVector::X ( ) const
inline

Definition at line 89 of file PndCATrackParamVector.h.

References fX.

Referenced by Rotate(), RotateXY(), SetTrackParam(), Transport0ToX(), TransportJ0ToX0(), TransportToX(), and X0().

89 { return fX; }
float_v PndCATrackParamVector::X0 ( ) const
inline

Definition at line 99 of file PndCATrackParamVector.h.

References X().

99 { return X(); }
float_v PndCATrackParamVector::X1 ( ) const
inline

Definition at line 100 of file PndCATrackParamVector.h.

References Y().

Referenced by PndCAGBTracker::PickUpHits().

100 { return Y(); }
float_v PndCATrackParamVector::X2 ( ) const
inline

Definition at line 101 of file PndCATrackParamVector.h.

References Z().

Referenced by PndCAGBTracker::PickUpHits().

101 { return Z(); }
float_v PndCATrackParamVector::Y ( ) const
inline

Definition at line 90 of file PndCATrackParamVector.h.

References fP.

Referenced by FilterVtx(), PndCAGBTracker::PickUpHits(), Rotate(), RotateXY(), TransportToX(), and X1().

90 { return fP[0]; }
float_v PndCATrackParamVector::Z ( ) const
inline

Definition at line 91 of file PndCATrackParamVector.h.

References fP.

Referenced by FilterVtx(), PndCAGBTracker::PickUpHits(), TransportToX(), and X2().

91 { return fP[1]; }

Friends And Related Function Documentation

friend class PndCATrackParam
friend

Definition at line 144 of file PndCATrackParamVector.h.

Member Data Documentation

float_v PndCATrackParamVector::fAlpha

Definition at line 307 of file PndCATrackParamVector.h.

Referenced by Angle(), Rotate(), SetAngle(), SetTrackParam(), Transport(), and Transport0().

float_v PndCATrackParamVector::fC[15]
float_v PndCATrackParamVector::fChi2
int_v PndCATrackParamVector::fISec

Definition at line 308 of file PndCATrackParamVector.h.

Referenced by ISec(), PndCAGBTracker::PickUpHits(), SetISec(), and SetTrackParam().

int_v PndCATrackParamVector::fNDF
float_v PndCATrackParamVector::fP[5]
float_v PndCATrackParamVector::fSignCosPhi
float_v PndCATrackParamVector::fX

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