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

#include <PndCATrackParam.h>

Classes

struct  PndCATrackFitParam
 

Public Member Functions

 PndCATrackParam ()
 
 PndCATrackParam (const TrackParamVector &v, int i)
 
float X () const
 
float Y () const
 
float Z () const
 
float SinPhi () const
 
float DzDs () const
 
float QPt () const
 
float QMomentum () const
 
float SignCosPhi () const
 
float Chi2 () const
 
int NDF () const
 
float Err2Y () const
 
float Err2Z () const
 
float Err2SinPhi () const
 
float Err2DzDs () const
 
float Err2QPt () const
 
float Angle () const
 
int ISec () const
 
float GetX () const
 
float GetY () const
 
float GetZ () const
 
float GetSinPhi () const
 
float GetDzDs () const
 
float GetQPt () const
 
float GetSignCosPhi () const
 
float GetChi2 () const
 
int GetNDF () const
 
float GetKappa (float Bz) const
 
float GetCosPhiPositive () const
 
float GetCosPhi () const
 
float GetErr2Y () const
 
float GetErr2Z () const
 
float GetErr2SinPhi () const
 
float GetErr2DzDs () const
 
float GetErr2QPt () const
 
float Err2X1 () const
 
float Err2X2 () const
 
float Err2QMomentum () const
 
const float * Par () const
 
const float * Cov () const
 
const float * GetPar () const
 
const float * GetCov () const
 
void SetPar (int i, float v)
 
void SetCov (int i, float v)
 
void SetX (float v)
 
void SetY (float v)
 
void SetZ (float v)
 
void SetSinPhi (float v)
 
void SetDzDs (float v)
 
void SetQPt (float v)
 
void SetSignCosPhi (float v)
 
void SetChi2 (float v)
 
void SetNDF (int v)
 
void SetAngle (float v)
 
void SetISec (int v)
 
void SetErr2QPt (float v)
 
void InitDirection (float r0, float r1, float r2)
 
float GetDist2 (const PndCATrackParam &t) const
 
float GetDistXZ2 (const PndCATrackParam &t) const
 
float GetS (float x, float y, float Bz) const
 
void GetDCAPoint (float x, float y, float z, float &px, float &py, float &pz, float Bz) const
 
bool TransportToX (float x, float Bz, float maxSinPhi=.999)
 
bool TransportToXWithMaterial (float x, float Bz, float maxSinPhi=.999)
 
bool TransportToX (float x, PndCATrackLinearisation &t0, float Bz, float maxSinPhi=.999, float *DL=0)
 
bool TransportToX (float x, float sinPhi0, float cosPhi0, float Bz, float maxSinPhi=.999)
 
bool TransportToXWithMaterial (float x, PndCATrackLinearisation &t0, PndCATrackFitParam &par, float Bz, float maxSinPhi=.999)
 
bool TransportToXWithMaterial (float x, PndCATrackFitParam &par, float Bz, float maxSinPhi=.999)
 
void CalculateFitParameters (PndCATrackFitParam &par, float mass=0.13957)
 
bool CorrectForMeanMaterial (float xOverX0, float xTimesRho, const PndCATrackFitParam &par)
 
bool Rotate (float alpha, float maxSinPhi=.999)
 
bool Rotate (float alpha, PndCATrackLinearisation &t0, float maxSinPhi=.999)
 
void RotateXY (float alpha, float &x, float &y, float &sin) const
 
bool Filter (float y, float z, float err2Y, float errYZ, float err2Z, float maxSinPhi=.999)
 
void Print () const
 
void ResetCovMatrix ()
 
PndCATrackParam GetGlobalParam (float alpha) const
 
void Reset ()
 
bool Transport (const PndCAHit &hit, float Bz)
 
bool Filter (const PndCAHit &hit)
 
bool IsValid () const
 
void SetAsInvalid ()
 

Static Public Member Functions

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

Private Attributes

float fX
 
float fSignCosPhi
 
float fP [5]
 
float fC [15]
 
float fChi2
 
int fNDF
 
float fAlpha
 
int fISec
 

Detailed Description

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

Definition at line 28 of file PndCATrackParam.h.

Constructor & Destructor Documentation

PndCATrackParam::PndCATrackParam ( )
inline

Definition at line 34 of file PndCATrackParam.h.

References Reset().

34 { Reset();}
PndCATrackParam::PndCATrackParam ( const TrackParamVector v,
int  i 
)
inline

Definition at line 35 of file PndCATrackParam.h.

References PndCATrackParamVector::Cov(), fC, fP, i, and PndCATrackParamVector::Par().

36  : fX( v.X()[i] ),
37  fSignCosPhi( v.SignCosPhi()[i] ),
38  fChi2( v.Chi2()[i] ),
39  fNDF( v.NDF()[i] ),
40  fAlpha( v.Angle()[i] ),
41  fISec( v.ISec()[i] )
42  {
43  for ( int j = 0; j < 5; ++j ) fP[j] = v.Par()[j][i];
44  for ( int j = 0; j < 15; ++j ) fC[j] = v.Cov()[j][i];
45  }
const float_v & Cov(int i) const
Int_t i
Definition: run_full.C:25
const float_v & Par(int i) const

Member Function Documentation

float PndCATrackParam::Angle ( ) const
inline

Definition at line 81 of file PndCATrackParam.h.

References fAlpha.

Referenced by PndCATracking::CATrackParToFairTrackParP().

81 { return fAlpha; }
float PndCATrackParam::ApproximateBetheBloch ( float  beta2)
inlinestatic

Definition at line 318 of file PndCATrackParam.h.

References log().

Referenced by CalculateFitParameters().

319 {
320  //------------------------------------------------------------------
321  // This is an approximation of the Bethe-Bloch formula with
322  // the density effect taken into account at beta*gamma > 3.5
323  // (the approximation is reasonable only for solid materials)
324  //------------------------------------------------------------------
325  if ( beta2 >= 1 )
326  return 0;
327  else {
328  const float beta2_beta21i = beta2 / ( 1 - beta2 );
329  if ( beta2_beta21i > 12.25 ) // 3.5^2 = 12.25
330  return 0.153e-3 / beta2 * ( 9.94223 + 0.5 * log( beta2_beta21i ) - beta2 ); // log( 3.5*5940 ) = 9.94223
331  else
332  return 0.153e-3 / beta2 * ( 8.6895 + log( beta2_beta21i ) - beta2 ); // log( 5940 ) = 8.6895
333  }
334 }
friend F32vec4 log(const F32vec4 &a)
Definition: P4_F32vec4.h:110
float PndCATrackParam::BetheBlochGas ( float  bg)
static

Definition at line 262 of file PndCATrackParam.cxx.

References BetheBlochGeant(), and x0.

263 {
264  //------------------------------------------------------------------
265  // This is an approximation of the Bethe-Bloch formula,
266  // reasonable for gas materials.
267  // All the parameters are, in fact, for Ne.
268  // The returned value is in [GeV]
269  //------------------------------------------------------------------
270 
271  const float rho = 0.9e-3;
272  const float x0 = 2.;
273  const float x1 = 4.;
274  const float mI = 140.e-9;
275  const float mZA = 0.49555;
276 
277  return BetheBlochGeant( bg, rho, x0, x1, mI, mZA );
278 }
Double_t x0
Definition: checkhelixhit.C:70
static float BetheBlochGeant(float bg, float kp0=2.33, float kp1=0.20, float kp2=3.00, float kp3=173e-9, float kp4=0.49848)
float PndCATrackParam::BetheBlochGeant ( float  bg,
float  kp0 = 2.33,
float  kp1 = 0.20,
float  kp2 = 3.00,
float  kp3 = 173e-9,
float  kp4 = 0.49848 
)
static

Definition at line 206 of file PndCATrackParam.cxx.

References CAMath::Log(), me, mK, r, CAMath::Sqrt(), x, and x0.

Referenced by BetheBlochGas(), and BetheBlochSolid().

212 {
213  //
214  // This is the parameterization of the Bethe-Bloch formula inspired by Geant.
215  //
216  // bg2 - (beta*gamma)^2
217  // kp0 - density [g/cm^3]
218  // kp1 - density effect first junction point
219  // kp2 - density effect second junction point
220  // kp3 - mean excitation energy [GeV]
221  // kp4 - mean Z/A
222  //
223  // The default values for the kp* parameters are for silicon.
224  // The returned value is in [GeV/(g/cm^2)].
225  //
226 
227  const float mK = 0.307075e-3; // [GeV*cm^2/g]
228  const float me = 0.511e-3; // [GeV/c^2]
229  const float rho = kp0;
230  const float x0 = kp1 * 2.303;
231  const float x1 = kp2 * 2.303;
232  const float mI = kp3;
233  const float mZA = kp4;
234  const float maxT = 2 * me * bg2; // neglecting the electron mass
235 
236  //*** Density effect
237  float d2 = 0.;
238  const float x = 0.5 * CAMath::Log( bg2 );
239  const float lhwI = CAMath::Log( 28.816 * 1e-9 * CAMath::Sqrt( rho * mZA ) / mI );
240  if ( x > x1 ) {
241  d2 = lhwI + x - 0.5;
242  } else if ( x > x0 ) {
243  const float r = ( x1 - x ) / ( x1 - x0 );
244  d2 = lhwI + x - 0.5 + ( 0.5 - lhwI - x0 ) * r * r * r;
245  }
246 
247  return mK*mZA*( 1 + bg2 ) / bg2*( 0.5*CAMath::Log( 2*me*bg2*maxT / ( mI*mI ) ) - bg2 / ( 1 + bg2 ) - d2 );
248 }
Double_t x0
Definition: checkhelixhit.C:70
double mK
double r
Definition: RiemannTest.C:14
static const double me
Definition: mzparameters.h:12
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
Double_t x
static T Log(const T &x)
Definition: PndCAMath.h:40
float PndCATrackParam::BetheBlochSolid ( float  bg)
static

Definition at line 250 of file PndCATrackParam.cxx.

References BetheBlochGeant().

251 {
252  //------------------------------------------------------------------
253  // This is an approximation of the Bethe-Bloch formula,
254  // reasonable for solid materials.
255  // All the parameters are, in fact, for Si.
256  // The returned value is in [GeV]
257  //------------------------------------------------------------------
258 
259  return BetheBlochGeant( bg );
260 }
static float BetheBlochGeant(float bg, float kp0=2.33, float kp1=0.20, float kp2=3.00, float kp3=173e-9, float kp4=0.49848)
void PndCATrackParam::CalculateFitParameters ( PndCATrackFitParam par,
float  mass = 0.13957 
)
inline

Definition at line 336 of file PndCATrackParam.h.

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

Referenced by Transport(), and TransportToXWithMaterial().

337 {
338  const float p2 = ( 1. + fP[3] * fP[3] );
339  const float k2 = fP[4] * fP[4];
340  const float mass2 = mass * mass;
341 
342  const float beta2 = p2 / ( p2 + mass2 * k2 );
343 
344  const float pp2 = ( k2 > 1.e-8 ) ? p2 / k2 : 10000; // impuls 2
345 
346  //par.fBethe = BetheBlochGas( pp2/mass2);
347  par.fBethe = ApproximateBetheBloch( pp2 / mass2 );
348  par.fE = CAMath::Sqrt( pp2 + mass2 );
349  par.fTheta2 = 198.81e-6 / ( beta2 * pp2 ); // 14.1^2 * 1e-6
350  par.fEP2 = par.fE / pp2; // have tried reduce number of "/", but it was slower. (may be bacause of additional of constants = memory)
351 
352  // Approximate energy loss fluctuation (M.Ivanov)
353 
354  const float knst = 0.07; // To be tuned.
355  par.fSigmadE2 = knst * par.fEP2 * fP[4];
356  par.fSigmadE2 = par.fSigmadE2 * par.fSigmadE2;
357 
358  par.fK22 = p2;
359  par.fK33 = par.fK22 * par.fK22;
360  par.fK43 = fP[3] * fP[4] * par.fK22;
361  par.fK44 = (p2 - 1.f) * k2;
362 
363 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
Double_t par[3]
TPad * p2
Definition: hist-t7.C:117
static float ApproximateBetheBloch(float beta2)
float PndCATrackParam::Chi2 ( ) const
inline

Definition at line 72 of file PndCATrackParam.h.

References fChi2.

Referenced by PndCAGBTracker::CreateTracks(), and PndCATrack::Fit().

72 { return fChi2; }
bool PndCATrackParam::CorrectForMeanMaterial ( float  xOverX0,
float  xTimesRho,
const PndCATrackFitParam par 
)
inline

Definition at line 501 of file PndCATrackParam.h.

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

502 {
503  //------------------------------------------------------------------
504  // This function corrects the track parameters for the crossed material.
505  // "xOverX0" - X/X0, the thickness in units of the radiation length.
506  // "xTimesRho" - is the product length*density (g/cm^2).
507  //------------------------------------------------------------------
508  // float &fC22 = fC[5];
509  // float &fC33 = fC[9];
510  // float &fC40 = fC[10];
511  // float &fC41 = fC[11];
512  // float &fC42 = fC[12];
513  // float &fC43 = fC[13];
514  // float &fC44 = fC[14];
515 
516  //Energy losses************************
517 
518  const float dE = par.fBethe * xTimesRho;
519  if ( CAMath::Abs( dE ) > 0.3 * par.fE ) return 0; //30% energy loss is too much!
520  const float corr = ( 1. - par.fEP2 * dE );
521  if ( corr < 0.3 || corr > 1.3 ) return 0;
522 
523  fP[4] *= corr;
524  fC[10] *= corr;
525  fC[11] *= corr;
526  fC[12] *= corr;
527  fC[13] *= corr;
528  fC[14] *= corr * corr;
529  fC[14] += par.fSigmadE2 * CAMath::Abs( dE );
530 // std::cout << "dE "<<dE<<" corr "<<corr<<" fBethe " <<par.fBethe<<" XxRo "<<xTimesRho<<std::endl;
531 
532  //Multiple scattering******************
533 
534  const float theta2 = par.fTheta2 * CAMath::Abs( xOverX0 );
535  fC[5] += theta2 * par.fK22 * ( 1. - fP[2] * fP[2] );
536  fC[9] += theta2 * par.fK33;
537  fC[13] += theta2 * par.fK43;
538  fC[14] += theta2 * par.fK44;
539 
540  return 1;
541 }
PndPidCorrelator * corr
Double_t par[3]
Double_t dE
Definition: anasim.C:58
static T Abs(const T &x)
Definition: PndCAMath.h:39
const float* PndCATrackParam::Cov ( ) const
inline

Definition at line 109 of file PndCATrackParam.h.

References fC.

Referenced by PndCATracking::CATrackParToFairTrackParP(), and PndCAGBTracker::Merge().

109 { return fC; }
float PndCATrackParam::DzDs ( ) const
inline

Definition at line 63 of file PndCATrackParam.h.

References fP.

Referenced by PndCATracking::CATrackParToFairTrackParP(), PndFTSCADisplay::DrawTrackParam(), and TransportToX().

63 { return fP[3]; }
float PndCATrackParam::Err2DzDs ( ) const
inline

Definition at line 78 of file PndCATrackParam.h.

References fC.

78 { return fC[9]; }
float PndCATrackParam::Err2QMomentum ( ) const
inline

Definition at line 106 of file PndCATrackParam.h.

References fC.

Referenced by PndCANPlet::QMomentumErr(), and PndCANPlet::QMomentumErr2().

106 { return fC[14]; }
float PndCATrackParam::Err2QPt ( ) const
inline

Definition at line 79 of file PndCATrackParam.h.

References fC.

79 { return fC[14]; }
float PndCATrackParam::Err2SinPhi ( ) const
inline

Definition at line 77 of file PndCATrackParam.h.

References fC.

77 { return fC[5]; }
float PndCATrackParam::Err2X1 ( ) const
inline

Definition at line 104 of file PndCATrackParam.h.

References fC.

104 { return fC[0]; }
float PndCATrackParam::Err2X2 ( ) const
inline

Definition at line 105 of file PndCATrackParam.h.

References fC.

105 { return fC[2]; }
float PndCATrackParam::Err2Y ( ) const
inline

Definition at line 75 of file PndCATrackParam.h.

References fC.

75 { return fC[0]; }
float PndCATrackParam::Err2Z ( ) const
inline

Definition at line 76 of file PndCATrackParam.h.

References fC.

76 { return fC[2]; }
bool PndCATrackParam::Filter ( float  y,
float  z,
float  err2Y,
float  errYZ,
float  err2Z,
float  maxSinPhi = .999 
)
inline

Definition at line 237 of file PndCATrackParam.h.

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

Referenced by Filter().

238 {
239  assert( maxSinPhi > 0.f );
240  //* Add the y,z measurement with the Kalman filter
241 
242  const float c00 = fC[0];
243  const float c10 = fC[1];
244  const float c11 = fC[2];
245  const float c20 = fC[3];
246  const float c21 = fC[4];
247 // float c22 = fC[5];
248  const float c30 = fC[6];
249  const float c31 = fC[7];
250 // float c32 = fC[8];
251 // float c33 = fC[9];
252  const float c40 = fC[10];
253  const float c41 = fC[11];
254 // float c42 = fC[12];
255 // float c43 = fC[13];
256 // float c44 = fC[14];
257 
258  float d = 1.f / ( err2Y*err2Z + err2Y*c11 + err2Z*c00 + c00*c11 - c10*c10 - 2*errYZ*c10 - errYZ*errYZ );
259  err2Y += c00;
260  err2Z += c11;
261  errYZ += c10;
262 
263  const float
264  z0 = y - fP[0],
265  z1 = z - fP[1];
266 
267  if ( ISUNLIKELY( err2Y < 1.e-8f ) || ISUNLIKELY( err2Z < 1.e-8f ) ) return 0;
268 
269  const float mS0 = err2Z*d;
270  const float mS1 = -errYZ*d;
271  const float mS2 = err2Y*d;
272 
273  // K = CHtS
274 
275  const float
276  k00 = c00 * mS0 + c10*mS1, k01 = c00 * mS1 + c10*mS2,
277  k10 = c10 * mS0 + c11*mS1, k11 = c10 * mS1 + c11*mS2,
278  k20 = c20 * mS0 + c21*mS1, k21 = c20 * mS1 + c21*mS2,
279  k30 = c30 * mS0 + c31*mS1, k31 = c30 * mS1 + c31*mS2,
280  k40 = c40 * mS0 + c41*mS1, k41 = c40 * mS1 + c41*mS2;
281 
282  const float sinPhi = fP[2] + k20 * z0 + k21 * z1;
283 
284  if ( ISUNLIKELY( CAMath::Abs( sinPhi ) >= maxSinPhi ) ) return 0;
285 
286  fNDF += 2;
287  fChi2 += mS0 * z0 * z0 + mS2 * z1 * z1 + 2 * z0 * z1 * mS1;
288 
289  fP[ 0] += k00 * z0 + k01 * z1;
290  fP[ 1] += k10 * z0 + k11 * z1;
291  fP[ 2] = sinPhi ;
292  fP[ 3] += k30 * z0 + k31 * z1;
293  fP[ 4] += k40 * z0 + k41 * z1;
294 
295  fC[ 0] -= (k00 * c00 + k01 * c10); //c00
296 
297  fC[ 1] -= (k10 * c00 + k11 * c10); //c10
298  fC[ 2] -= (k10 * c10 + k11 * c11); //c11
299 
300  fC[ 3] -= (k20 * c00 + k21 * c10); //c20
301  fC[ 4] -= (k20 * c10 + k21 * c11); //c21
302  fC[ 5] -= (k20 * c20 + k21 * c21); //c22
303 
304  fC[ 6] -= (k30 * c00 + k31 * c10); //c30
305  fC[ 7] -= (k30 * c10 + k31 * c11); //c31
306  fC[ 8] -= (k30 * c20 + k31 * c21); //c32
307  fC[ 9] -= (k30 * c30 + k31 * c31); //c33
308 
309  fC[10] -= (k40 * c00 + k41 * c10); //c40
310  fC[11] -= (k40 * c10 + k41 * c11); //c41
311  fC[12] -= (k40 * c20 + k41 * c21); //c42
312  fC[13] -= (k40 * c30 + k41 * c31); //c43
313  fC[14] -= (k40 * c40 + k41 * c41); //c44
314 
315  return 1;
316 }
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
#define ISUNLIKELY(x)
Definition: PndCADef.h:122
Double_t y
bool PndCATrackParam::Filter ( const PndCAHit hit)
inline

Definition at line 582 of file PndCATrackParam.h.

References PndCAHit::Err2X1(), PndCAHit::Err2X2(), PndCAHit::ErrX12(), Filter(), PndCAHit::X1(), and PndCAHit::X2().

583 {
584  return Filter( hit.X1(), hit.X2(), hit.Err2X1(), hit.ErrX12(), hit.Err2X2(), 0.999f );
585 }
bool Filter(float y, float z, float err2Y, float errYZ, float err2Z, float maxSinPhi=.999)
float X2() const
Definition: PndCAHits.h:36
float X1() const
Definition: PndCAHits.h:35
float Err2X1() const
Definition: PndCAHits.h:38
float Err2X2() const
Definition: PndCAHits.h:40
float ErrX12() const
Definition: PndCAHits.h:39
float PndCATrackParam::GetChi2 ( ) const
inline

Definition at line 91 of file PndCATrackParam.h.

References fChi2.

91 { return fChi2; }
float PndCATrackParam::GetCosPhi ( ) const
inline

Definition at line 96 of file PndCATrackParam.h.

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

Referenced by PndCATracking::CATrackParToFairTrackParP(), GetDCAPoint(), GetS(), Rotate(), and RotateXY().

96 { return fSignCosPhi*CAMath::Sqrt( 1 - SinPhi()*SinPhi() ); }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
float SinPhi() const
float PndCATrackParam::GetCosPhiPositive ( ) const
inline

Definition at line 95 of file PndCATrackParam.h.

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

95 { return CAMath::Sqrt( 1 - SinPhi()*SinPhi() ); }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
float SinPhi() const
const float* PndCATrackParam::GetCov ( ) const
inline

Definition at line 112 of file PndCATrackParam.h.

References fC.

112 { return fC; }
void PndCATrackParam::GetDCAPoint ( float  x,
float  y,
float  z,
float &  px,
float &  py,
float &  pz,
float  Bz 
) const

Definition at line 73 of file PndCATrackParam.cxx.

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

76 {
77  //* Get the track point closest to the (x,y,z)
78 
79  float x0 = GetX();
80  float y0 = GetY();
81  float k = GetKappa( Bz );
82  float ex = GetCosPhi();
83  float ey = GetSinPhi();
84  float dx = x - x0;
85  float dy = y - y0;
86  float ax = dx * k + ey;
87  float ay = dy * k - ex;
88  float a = sqrt( ax * ax + ay * ay );
89  xp = x0 + ( dx - ey * ( ( dx * dx + dy * dy ) * k - 2 * ( -dx * ey + dy * ex ) ) / ( a + 1 ) ) / a;
90  yp = y0 + ( dy + ex * ( ( dx * dx + dy * dy ) * k - 2 * ( -dx * ey + dy * ex ) ) / ( a + 1 ) ) / a;
91  float s = GetS( x, y, Bz );
92  zp = GetZ() + GetDzDs() * s;
93  if ( CAMath::Abs( k ) > 1.e-2 ) {
94  float dZ = CAMath::Abs( GetDzDs() * CAMath::TwoPi() / k );
95  if ( dZ > .1 ) {
96  zp += CAMath::Nint( ( z - zp ) / dZ ) * dZ;
97  }
98  }
99 }
Double_t x0
Definition: checkhelixhit.C:70
double dy
float GetKappa(float Bz) const
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
float GetX() const
TLorentzVector s
Definition: Pnd2DStar.C:50
float GetY() const
float GetSinPhi() const
static T Abs(const T &x)
Definition: PndCAMath.h:39
Int_t a
Definition: anaLmdDigi.C:126
float GetZ() const
Double_t y0
Definition: checkhelixhit.C:71
float GetS(float x, float y, float Bz) const
Double_t z
double dx
Double_t x
static float TwoPi()
Definition: PndCAMath.h:61
float GetCosPhi() const
Double_t y
float GetDzDs() const
int Nint(float x)
Definition: PndCAMath.h:117
float PndCATrackParam::GetDist2 ( const PndCATrackParam t) const

Definition at line 39 of file PndCATrackParam.cxx.

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

40 {
41  // get squared distance between tracks
42 
43  float dx = GetX() - t.GetX();
44  float dy = GetY() - t.GetY();
45  float dz = GetZ() - t.GetZ();
46  return dx*dx + dy*dy + dz*dz;
47 }
double dy
float GetX() const
float GetY() const
float GetZ() const
double dx
float PndCATrackParam::GetDistXZ2 ( const PndCATrackParam t) const

Definition at line 49 of file PndCATrackParam.cxx.

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

50 {
51  // get squared distance between tracks in X&Z
52 
53  float dx = GetX() - t.GetX();
54  float dz = GetZ() - t.GetZ();
55  return dx*dx + dz*dz;
56 }
float GetX() const
float GetZ() const
double dx
float PndCATrackParam::GetDzDs ( ) const
inline

Definition at line 88 of file PndCATrackParam.h.

References fP.

Referenced by GetDCAPoint(), and Print().

88 { return fP[3]; }
float PndCATrackParam::GetErr2DzDs ( ) const
inline

Definition at line 101 of file PndCATrackParam.h.

References fC.

Referenced by Print().

101 { return fC[9]; }
float PndCATrackParam::GetErr2QPt ( ) const
inline

Definition at line 102 of file PndCATrackParam.h.

References fC.

Referenced by Print().

102 { return fC[14]; }
float PndCATrackParam::GetErr2SinPhi ( ) const
inline

Definition at line 100 of file PndCATrackParam.h.

References fC.

Referenced by Print().

100 { return fC[5]; }
float PndCATrackParam::GetErr2Y ( ) const
inline

Definition at line 98 of file PndCATrackParam.h.

References fC.

Referenced by Print().

98 { return fC[0]; }
float PndCATrackParam::GetErr2Z ( ) const
inline

Definition at line 99 of file PndCATrackParam.h.

References fC.

Referenced by Print().

99 { return fC[2]; }
PndCATrackParam PndCATrackParam::GetGlobalParam ( float  alpha) const

Definition at line 492 of file PndCATrackParam.cxx.

References r, and Rotate().

493 {
494  PndCATrackParam r = *this;
495  r.Rotate( -alpha );
496  return r;
497 }
double r
Definition: RiemannTest.C:14
bool Rotate(float alpha, float maxSinPhi=.999)
double alpha
Definition: f_Init.h:9
float PndCATrackParam::GetKappa ( float  Bz) const
inline

Definition at line 94 of file PndCATrackParam.h.

References fP.

Referenced by GetDCAPoint(), and GetS().

94 { return fP[4]*Bz; }
int PndCATrackParam::GetNDF ( ) const
inline

Definition at line 92 of file PndCATrackParam.h.

References fNDF.

92 { return fNDF; }
const float* PndCATrackParam::GetPar ( ) const
inline

Definition at line 111 of file PndCATrackParam.h.

References fP.

111 { return fP; }
float PndCATrackParam::GetQPt ( ) const
inline

Definition at line 89 of file PndCATrackParam.h.

References fP.

Referenced by Print().

89 { return fP[4]; }
float PndCATrackParam::GetS ( float  x,
float  y,
float  Bz 
) const

Definition at line 59 of file PndCATrackParam.cxx.

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

Referenced by GetDCAPoint().

60 {
61  //* Get XY path length to the given point
62 
63  float k = GetKappa( Bz );
64  float ex = GetCosPhi();
65  float ey = GetSinPhi();
66  x -= GetX();
67  y -= GetY();
68  float dS = x * ex + y * ey;
69  if ( CAMath::Abs( k ) > 1.e-4 ) dS = CAMath::ATan2( k * dS, 1 + k * ( x * ey - y * ex ) ) / k;
70  return dS;
71 }
float GetKappa(float Bz) const
float GetX() const
float GetY() const
float GetSinPhi() const
static T Abs(const T &x)
Definition: PndCAMath.h:39
static T ATan2(const T &y, const T &x)
Double_t x
float GetCosPhi() const
Double_t y
float PndCATrackParam::GetSignCosPhi ( ) const
inline

Definition at line 90 of file PndCATrackParam.h.

References fSignCosPhi.

Referenced by Print().

90 { return fSignCosPhi; }
float PndCATrackParam::GetSinPhi ( ) const
inline

Definition at line 87 of file PndCATrackParam.h.

References fP.

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

87 { return fP[2]; }
float PndCATrackParam::GetX ( ) const
inline

Definition at line 84 of file PndCATrackParam.h.

References fX.

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

84 { return fX; }
float PndCATrackParam::GetY ( ) const
inline

Definition at line 85 of file PndCATrackParam.h.

References fP.

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

85 { return fP[0]; }
float PndCATrackParam::GetZ ( ) const
inline

Definition at line 86 of file PndCATrackParam.h.

References fP.

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

86 { return fP[1]; }
void PndCATrackParam::InitDirection ( float  r0,
float  r1,
float  r2 
)
inline

Definition at line 132 of file PndCATrackParam.h.

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

133  {
134  const float r = sqrt( r0*r0+r1*r1 );
135  SetSinPhi( r1/r );
136  SetSignCosPhi( sign(r0) );
137  SetDzDs( r2/r );
138  }
double r
Definition: RiemannTest.C:14
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
void SetSignCosPhi(float v)
double r1
void SetSinPhi(float v)
void SetDzDs(float v)
int sign(T val)
Definition: PndCADef.h:48
double r2
int PndCATrackParam::ISec ( ) const
inline

Definition at line 82 of file PndCATrackParam.h.

References fISec.

82 { return fISec; }
bool PndCATrackParam::IsValid ( ) const
inline

Definition at line 207 of file PndCATrackParam.h.

References fChi2.

207 { return fChi2 != -1; }
int PndCATrackParam::NDF ( ) const
inline

Definition at line 73 of file PndCATrackParam.h.

References fNDF.

Referenced by PndCATrack::Fit().

73 { return fNDF; }
const float* PndCATrackParam::Par ( ) const
inline

Definition at line 108 of file PndCATrackParam.h.

References fP.

Referenced by PndCAGBTracker::Merge().

108 { return fP; }
void PndCATrackParam::Print ( ) const

Definition at line 457 of file PndCATrackParam.cxx.

References GetDzDs(), GetErr2DzDs(), GetErr2QPt(), GetErr2SinPhi(), GetErr2Y(), GetErr2Z(), GetQPt(), GetSignCosPhi(), GetSinPhi(), GetX(), GetY(), and GetZ().

458 {
459  //* print parameters
460 
461 #if !defined(HLTCA_GPUCODE)
462  std::cout << "track: x=" << GetX() << " c=" << GetSignCosPhi() << ", P= " << GetY() << " " << GetZ() << " " << GetSinPhi() << " " << GetDzDs() << " " << GetQPt() << std::endl;
463  std::cout << "errs2: " << GetErr2Y() << " " << GetErr2Z() << " " << GetErr2SinPhi() << " " << GetErr2DzDs() << " " << GetErr2QPt() << std::endl;
464 #endif
465 }
float GetErr2SinPhi() const
float GetX() const
float GetErr2Z() const
float GetY() const
float GetSignCosPhi() const
float GetErr2DzDs() const
float GetSinPhi() const
float GetQPt() const
float GetErr2Y() const
float GetZ() const
float GetErr2QPt() const
float GetDzDs() const
float PndCATrackParam::QMomentum ( ) const
inline

Definition at line 65 of file PndCATrackParam.h.

References fP.

Referenced by PndCANPlet::QMomentum().

65 { return fP[4]; }
float PndCATrackParam::QPt ( ) const
inline

Definition at line 64 of file PndCATrackParam.h.

References fP.

Referenced by PndCATracking::CATrackParToFairTrackParP(), and TransportToX().

64 { return fP[4]; }
void PndCATrackParam::Reset ( )
inline

Definition at line 202 of file PndCATrackParam.h.

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

Referenced by PndCATrackParam().

202 { fX = 0; fSignCosPhi = 0; for(int i=0; i<5; i++) fP[i] = 0; for(int i=0; i<15; i++) fC[i] = 0; fChi2 = 0; fNDF = 0; fISec=0;}
Int_t i
Definition: run_full.C:25
void PndCATrackParam::ResetCovMatrix ( )
inline

Definition at line 191 of file PndCATrackParam.h.

References fC.

192  {
193  fC[0] = 10.f;
194  fC[1] = 0.f; fC[2] = 10.f;
195  fC[3] = 0.f; fC[4] = 0.f; fC[5] = 1.f;
196  fC[6] = 0.f; fC[7] = 0.f; fC[8] = 0.f; fC[9] = 1.f;
197  fC[10] = 0.f; fC[11] = 0.f; fC[12] = 0.f; fC[13] = 0.f; fC[14] = 10.f;
198  }
bool PndCATrackParam::Rotate ( float  alpha,
float  maxSinPhi = .999 
)

Definition at line 290 of file PndCATrackParam.cxx.

References CAMath::Abs(), alpha, CAMath::Cos(), fabs(), fAlpha, fC, GetCosPhi(), SetSignCosPhi(), SetSinPhi(), SetX(), SetY(), CAMath::Sin(), SinPhi(), X(), x, Y(), and y.

Referenced by GetGlobalParam(), and Transport().

291 {
292  //* Rotate the coordinate system in XY on the angle alpha
293 
294  const float cA = CAMath::Cos( alpha );
295  const float sA = CAMath::Sin( alpha );
296  const float x = X(), y = Y(), sP = SinPhi(), cP = GetCosPhi();
297  const float cosPhi = cP * cA + sP * sA;
298  const float sinPhi = -cP * sA + sP * cA;
299 
300  if ( CAMath::Abs( sinPhi ) > maxSinPhi || CAMath::Abs( cosPhi ) < 1.e-2 || CAMath::Abs( cP ) < 1.e-2 ) return 0;
301 
302  if ( fabs(alpha) > 3.1415 * 0.25 ) return 0; // allow turn by 45 degree only
303 
304  const float j0 = cP / cosPhi;
305  const float j2 = cosPhi / cP;
306 
307  SetX( x*cA + y*sA );
308  SetY( -x*sA + y*cA );
309  SetSignCosPhi( CAMath::Abs(cosPhi)/cosPhi );
310  SetSinPhi( sinPhi );
311 
312 
313  //float J[5][5] = { { j0, 0, 0, 0, 0 }, // Y
314  // { 0, 1, 0, 0, 0 }, // Z
315  // { 0, 0, j2, 0, 0 }, // SinPhi
316  // { 0, 0, 0, 1, 0 }, // DzDs
317  // { 0, 0, 0, 0, 1 } }; // Kappa
318  //cout<<"alpha="<<alpha<<" "<<x<<" "<<y<<" "<<sP<<" "<<cP<<" "<<j0<<" "<<j2<<endl;
319  //cout<<" "<<fC[0]<<" "<<fC[1]<<" "<<fC[6]<<" "<<fC[10]<<" "<<fC[4]<<" "<<fC[5]<<" "<<fC[8]<<" "<<fC[12]<<endl;
320  fC[0] *= j0 * j0;
321  fC[1] *= j0;
322  fC[3] *= j0;
323  fC[6] *= j0;
324  fC[10] *= j0;
325 
326  fC[3] *= j2;
327  fC[4] *= j2;
328  fC[5] *= j2 * j2;
329  fC[8] *= j2;
330  fC[12] *= j2;
331  //cout<<" "<<fC[0]<<" "<<fC[1]<<" "<<fC[6]<<" "<<fC[10]<<" "<<fC[4]<<" "<<fC[5]<<" "<<fC[8]<<" "<<fC[12]<<endl;
332 
333  fAlpha += alpha;
334 
335  return 1;
336 }
static T Sin(const T &x)
Definition: PndCAMath.h:42
void SetSignCosPhi(float v)
void SetX(float v)
static T Cos(const T &x)
Definition: PndCAMath.h:43
static T Abs(const T &x)
Definition: PndCAMath.h:39
void SetSinPhi(float v)
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
Double_t x
float GetCosPhi() const
Double_t y
double alpha
Definition: f_Init.h:9
float SinPhi() const
void SetY(float v)
float X() const
float Y() const
bool PndCATrackParam::Rotate ( float  alpha,
PndCATrackLinearisation t0,
float  maxSinPhi = .999 
)

Definition at line 338 of file PndCATrackParam.cxx.

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

339 {
340  //* Rotate the coordinate system in XY on the angle alpha
341 
342  const float cA = CAMath::Cos( alpha );
343  const float sA = CAMath::Sin( alpha );
344  const float x0 = X(), y0 = Y(), sP = t0.SinPhi(), cP = t0.CosPhi();
345  const float cosPhi = cP * cA + sP * sA;
346  const float sinPhi = -cP * sA + sP * cA;
347 
348  if ( CAMath::Abs( sinPhi ) > maxSinPhi || CAMath::Abs( cosPhi ) < 1.e-2 || CAMath::Abs( cP ) < 1.e-2 ) return 0;
349 
350  if ( fabs(alpha) > 3.1415 * 0.25 ) return 0; // allow turn by 45 degree only
351 
352  //float J[5][5] = { { j0, 0, 0, 0, 0 }, // Y
353  // { 0, 1, 0, 0, 0 }, // Z
354  // { 0, 0, j2, 0, 0 }, // SinPhi
355  // { 0, 0, 0, 1, 0 }, // DzDs
356  // { 0, 0, 0, 0, 1 } }; // Kappa
357 
358  const float j0 = cP / cosPhi;
359  const float j2 = cosPhi / cP;
360  const float d[2] = {Y() - y0, SinPhi() - sP};
361 
362  SetX( x0*cA + y0*sA );
363  SetY( -x0*sA + y0*cA + j0*d[0] );
364  t0.SetCosPhi( cosPhi );
365  t0.SetSinPhi( sinPhi );
366 
367  SetSinPhi( sinPhi + j2*d[1] );
368 
369  fC[0] *= j0 * j0;
370  fC[1] *= j0;
371  fC[3] *= j0;
372  fC[6] *= j0;
373  fC[10] *= j0;
374 
375  fC[3] *= j2;
376  fC[4] *= j2;
377  fC[5] *= j2 * j2;
378  fC[8] *= j2;
379  fC[12] *= j2;
380 
381  fAlpha += alpha;
382 
383  return 1;
384 }
Double_t x0
Definition: checkhelixhit.C:70
TObjArray * d
static T Sin(const T &x)
Definition: PndCAMath.h:42
void SetX(float v)
static T Cos(const T &x)
Definition: PndCAMath.h:43
static T Abs(const T &x)
Definition: PndCAMath.h:39
void SetSinPhi(float v)
Double_t y0
Definition: checkhelixhit.C:71
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
double alpha
Definition: f_Init.h:9
float SinPhi() const
void SetY(float v)
float X() const
float Y() const
void PndCATrackParam::RotateXY ( float  alpha,
float &  x,
float &  y,
float &  sin 
) const
inline

Definition at line 224 of file PndCATrackParam.h.

References CAMath::Cos(), GetCosPhi(), CAMath::Sin(), SinPhi(), X(), and Y().

225 {
226  //* Rotate the coordinate system in XY on the angle alpha
227 
228  const float cA = CAMath::Cos( alpha );
229  const float sA = CAMath::Sin( alpha );
230 
231  x = ( X()*cA + Y()*sA );
232  y = ( -X()*sA + Y()*cA );
233  sin = -GetCosPhi() * sA + SinPhi() * cA;
234 
235 }
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
Double_t x
float GetCosPhi() const
Double_t y
double alpha
Definition: f_Init.h:9
float SinPhi() const
float X() const
float Y() const
void PndCATrackParam::SetAngle ( float  v)
inline

Definition at line 127 of file PndCATrackParam.h.

References fAlpha, and v.

127 { fAlpha = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParam::SetAsInvalid ( )
inline

Definition at line 208 of file PndCATrackParam.h.

References fChi2.

208 { fChi2 = -1; }
void PndCATrackParam::SetChi2 ( float  v)
inline

Definition at line 124 of file PndCATrackParam.h.

References fChi2, and v.

124 { fChi2 = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParam::SetCov ( int  i,
float  v 
)
inline

Definition at line 115 of file PndCATrackParam.h.

References fC, i, and v.

115 { fC[i] = v; }
Int_t i
Definition: run_full.C:25
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParam::SetDzDs ( float  v)
inline

Definition at line 121 of file PndCATrackParam.h.

References fP, and v.

Referenced by InitDirection().

121 { fP[3] = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParam::SetErr2QPt ( float  v)
inline

Definition at line 130 of file PndCATrackParam.h.

References fC, and v.

130 { fC[14] = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParam::SetISec ( int  v)
inline

Definition at line 128 of file PndCATrackParam.h.

References fISec, and v.

128 { fISec = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParam::SetNDF ( int  v)
inline

Definition at line 125 of file PndCATrackParam.h.

References fNDF, and v.

125 { fNDF = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParam::SetPar ( int  i,
float  v 
)
inline

Definition at line 114 of file PndCATrackParam.h.

References fP, i, and v.

114 { fP[i] = v; }
Int_t i
Definition: run_full.C:25
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParam::SetQPt ( float  v)
inline

Definition at line 122 of file PndCATrackParam.h.

References fP, and v.

122 { fP[4] = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParam::SetSignCosPhi ( float  v)
inline

Definition at line 123 of file PndCATrackParam.h.

References fSignCosPhi, and v.

Referenced by InitDirection(), and Rotate().

123 { fSignCosPhi = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParam::SetSinPhi ( float  v)
inline

Definition at line 120 of file PndCATrackParam.h.

References fP, and v.

Referenced by InitDirection(), and Rotate().

120 { fP[2] = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParam::SetX ( float  v)
inline

Definition at line 117 of file PndCATrackParam.h.

References fX, and v.

Referenced by Rotate().

117 { fX = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParam::SetY ( float  v)
inline

Definition at line 118 of file PndCATrackParam.h.

References fP, and v.

Referenced by Rotate().

118 { fP[0] = v; }
__m128 v
Definition: P4_F32vec4.h:4
void PndCATrackParam::SetZ ( float  v)
inline

Definition at line 119 of file PndCATrackParam.h.

References fP, and v.

119 { fP[1] = v; }
__m128 v
Definition: P4_F32vec4.h:4
float PndCATrackParam::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 71 of file PndCATrackParam.h.

References fSignCosPhi.

71 { return fSignCosPhi; }
float PndCATrackParam::SinPhi ( ) const
inline
bool PndCATrackParam::Transport ( const PndCAHit hit,
float  Bz 
)
inline

Definition at line 569 of file PndCATrackParam.h.

References PndCAHit::Angle(), CalculateFitParameters(), fAlpha, Rotate(), TransportToXWithMaterial(), and PndCAHit::X0().

Referenced by PndCAGBTracker::Merge().

570 {
571  // TODO material. See Vector part
572  PndCATrackFitParam fitPar;
573  CalculateFitParameters( fitPar );
574  PndCATrackLinearisation tR( *this );
575  const bool rotated = Rotate( -fAlpha + hit.Angle(), tR, .999f );
576  PndCATrackLinearisation tE( *this );
577  const bool transported = TransportToXWithMaterial( hit.X0(), tE, fitPar, Bz, 0.999f );
578  return rotated & transported;
579 }
float Angle() const
Definition: PndCAHits.h:51
float X0() const
Definition: PndCAHits.h:34
bool Rotate(float alpha, float maxSinPhi=.999)
bool TransportToXWithMaterial(float x, float Bz, float maxSinPhi=.999)
void CalculateFitParameters(PndCATrackFitParam &par, float mass=0.13957)
bool PndCATrackParam::TransportToX ( float  x,
float  Bz,
float  maxSinPhi = .999 
)

Definition at line 182 of file PndCATrackParam.cxx.

References t0.

Referenced by TransportToXWithMaterial().

183 {
184  //* Transport the track parameters to X=x
185 
186  PndCATrackLinearisation t0( *this );
187 
188  return TransportToX( x, t0, Bz, maxSinPhi );
189 }
Int_t t0
Definition: hist-t7.C:106
Double_t x
bool TransportToX(float x, float Bz, float maxSinPhi=.999)
bool PndCATrackParam::TransportToX ( float  x,
PndCATrackLinearisation t0,
float  Bz,
float  maxSinPhi = .999,
float *  DL = 0 
)
inline

Definition at line 369 of file PndCATrackParam.h.

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

370 {
371  //* Transport the track parameters to X=x, using linearization at t0, and the field value Bz
372  //* maxSinPhi is the max. allowed value for |t0.SinPhi()|
373  //* linearisation of trajectory t0 is also transported to X=x,
374  //* returns 1 if OK
375  //*
376 
377  const float ex = t0.CosPhi();
378  const float ey = t0.SinPhi();
379  const float k = t0.QPt() * Bz;
380  const float dx = x - X();
381 
382  const float ey1 = k * dx + ey;
383 
384  // check for intersection with X=x
385 
386  if ( CAMath::Abs( ey1 ) > maxSinPhi ) return 0;
387 
388  float ex1 = CAMath::Sqrt( 1.f - ey1 * ey1 );
389  if ( ex < 0 ) ex1 = -ex1;
390 
391  const float dx2 = dx * dx;
392  const float ss = ey + ey1;
393  const float cc = ex + ex1;
394 
395  if ( ( CAMath::Abs( cc ) < 1.e-4 || CAMath::Abs( ex ) < 1.e-4 || CAMath::Abs( ex1 ) < 1.e-4 ) ) return 0;
396 
397  const float cci = 1.f / cc;
398  const float exi = 1.f / ex;
399  const float ex1i = 1.f / ex1;
400 
401  const float tg = ss * cci; // tan((phi1+phi)/2)
402 
403  const float dy = dx * tg;
404  float dl = dx * CAMath::Sqrt( 1.f + tg * tg );
405 
406  if ( cc < 0 ) dl = -dl;
407  float dSin = dl * k * 0.5;
408  if ( dSin > 1.f ) dSin = 1.f;
409  if ( dSin < -1.f ) dSin = -1.f;
410  const float dS = ( CAMath::Abs( k ) > 1.e-4 ) ? ( 2 * CAMath::ASin( dSin ) / k ) : dl;
411  const float dz = dS * t0.DzDs();
412 
413  if ( DL ) *DL = -dS * CAMath::Sqrt( 1.f + t0.DzDs() * t0.DzDs() );
414 
415 
416  const float d[3] = { fP[2] - t0.SinPhi(), fP[3] - t0.DzDs(), fP[4] - t0.QPt() };
417 
418  //float H0[5] = { 1,0, h2, 0, h4 };
419  //float H1[5] = { 0, 1, 0, dS, 0 };
420  //float H2[5] = { 0, 0, 1, 0, dxBz };
421  //float H3[5] = { 0, 0, 0, 1, 0 };
422  //float H4[5] = { 0, 0, 0, 0, 1 };
423 
424  const float h2 = dx * ( 1.f + ey * ey1 + ex * ex1 ) * exi * ex1i * cci;
425  const float h4 = dx2 * ( cc + ss * ey1 * ex1i ) * cci * cci * Bz;
426  const float dxBz = dx * Bz;
427 
428  t0.SetCosPhi( ex1 );
429  t0.SetSinPhi( ey1 );
430 
431  fX = X() + dx;
432  fP[0] = Y() + dy + h2 * d[0] + h4 * d[2];
433  fP[1] = Z() + dz + dS * d[1];
434  fP[2] = t0.SinPhi() + d[0] + dxBz * d[2];
435  if(CAMath::Abs(fP[2]) > maxSinPhi) fP[2] = t0.SinPhi();
436 
437 #if 1
438  const float c00 = fC[0];
439  const float c10 = fC[1];
440  const float c11 = fC[2];
441  const float c20 = fC[3];
442  const float c21 = fC[4];
443  const float c22 = fC[5];
444  const float c30 = fC[6];
445  const float c31 = fC[7];
446  const float c32 = fC[8];
447  const float c33 = fC[9];
448  const float c40 = fC[10];
449  const float c41 = fC[11];
450  const float c42 = fC[12];
451  const float c43 = fC[13];
452  const float c44 = fC[14];
453 
454  fC[0] = ( c00 + h2 * h2 * c22 + h4 * h4 * c44
455  + 2.f * ( h2 * c20 + h4 * c40 + h2 * h4 * c42 ) );
456 
457  fC[1] = c10 + h2 * c21 + h4 * c41 + dS * ( c30 + h2 * c32 + h4 * c43 );
458  fC[2] = c11 + 2.f * dS * c31 + dS * dS * c33;
459 
460  fC[3] = c20 + h2 * c22 + h4 * c42 + dxBz * ( c40 + h2 * c42 + h4 * c44 );
461  fC[4] = c21 + dS * c32 + dxBz * ( c41 + dS * c43 );
462  fC[5] = c22 + 2.f * dxBz * c42 + dxBz * dxBz * c44;
463 
464  fC[6] = c30 + h2 * c32 + h4 * c43;
465  fC[7] = c31 + dS * c33;
466  fC[8] = c32 + dxBz * c43;
467  fC[9] = c33;
468 
469  fC[10] = c40 + h2 * c42 + h4 * c44;
470  fC[11] = c41 + dS * c43;
471  fC[12] = c42 + dxBz * c44;
472  fC[13] = c43;
473  fC[14] = c44;
474 #else
475  fC[0] = ( fC[0] + h2 * h2 * fC[5] + h4 * h4 * fC[14]
476  + 2 * ( h2 * fC[3] + h4 * fC[10] + h2 * h4 * fC[12] ) );
477 
478  fC[1] = fC[1] + h2 * fC[4] + h4 * fC[11] + dS * ( fC[6] + h2 * fC[8] + h4 * fC[13] );
479  fC[2] = fC[2] + 2 * dS * fC[7] + dS * dS * fC[9];
480 
481  fC[3] = fC[3] + h2 * fC[5] + h4 * fC[12] + dxBz * ( fC[10] + h2 * fC[12] + h4 * fC[14] );
482  fC[4] = fC[4] + dS * fC[8] + dxBz * ( fC[11] + dS * fC[13] );
483  fC[5] = fC[5] + 2 * dxBz * fC[12] + dxBz * dxBz * fC[14];
484 
485  fC[6] = fC[6] + h2 * fC[8] + h4 * fC[13];
486  fC[7] = fC[7] + dS * fC[9];
487  fC[8] = fC[8] + dxBz * fC[13];
488  fC[9] = fC[9];
489 
490  fC[10] = fC[10] + h2 * fC[12] + h4 * fC[14];
491  fC[11] = fC[11] + dS * fC[13];
492  fC[12] = fC[12] + dxBz * fC[14];
493  fC[13] = fC[13];
494  fC[14] = fC[14];
495 #endif
496 
497 //std::cout << fC[0] << " "<<fC1[0]<<" "<<fC[2] << " "<<fC1[2]<<" "<<fC[5] << " "<<fC1[5]<<" "<<fC[9] << " "<<fC1[9]<<" "<<fC[14] << " "<<fC1[14]<<std::endl;
498  return 1;
499 }
static T ASin(const T &x)
float Z() const
double dy
TCanvas * c11
TObjArray * d
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
TFile * f
Definition: bump_analys.C:12
double dx
TCanvas * c22
TCanvas * c20
Double_t x
float X() const
float Y() const
bool PndCATrackParam::TransportToX ( float  x,
float  sinPhi0,
float  cosPhi0,
float  Bz,
float  maxSinPhi = .999 
)

Definition at line 106 of file PndCATrackParam.cxx.

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

107 {
108  //* Transport the track parameters to X=x, using linearization at phi0 with 0 curvature,
109  //* and the field value Bz
110  //* maxSinPhi is the max. allowed value for |t0.SinPhi()|
111  //* linearisation of trajectory t0 is also transported to X=x,
112  //* returns 1 if OK
113  //*
114 
115  const float ex = cosPhi0;
116  const float ey = sinPhi0;
117  const float dx = x - X();
118 
119  if ( CAMath::Abs( ex ) < 1.e-4 ) return 0;
120  const float exi = 1. / ex;
121 
122  const float dxBz = dx * Bz;
123  const float dS = dx * exi;
124  const float h2 = dS * exi * exi;
125  const float h4 = .5 * h2 * dxBz;
126 
127  //const float H0[5] = { 1,0, h2, 0, h4 };
128  //const float H1[5] = { 0, 1, 0, dS, 0 };
129  //const float H2[5] = { 0, 0, 1, 0, dxBz };
130  //const float H3[5] = { 0, 0, 0, 1, 0 };
131  //const float H4[5] = { 0, 0, 0, 0, 1 };
132 
133  const float sinPhi = SinPhi() + dxBz * QPt();
134  if ( maxSinPhi > 0 && CAMath::Abs( sinPhi ) > maxSinPhi ) return 0;
135 
136  fX = X() + dx;
137  fP[0] += dS * ey + h2 * ( SinPhi() - ey ) + h4 * QPt();
138  fP[1] += dS * DzDs();
139  fP[2] = sinPhi;
140 
141  const float c00 = fC[0];
142  const float c10 = fC[1];
143  const float c11 = fC[2];
144  const float c20 = fC[3];
145  const float c21 = fC[4];
146  const float c22 = fC[5];
147  const float c30 = fC[6];
148  const float c31 = fC[7];
149  const float c32 = fC[8];
150  const float c33 = fC[9];
151  const float c40 = fC[10];
152  const float c41 = fC[11];
153  const float c42 = fC[12];
154  const float c43 = fC[13];
155  const float c44 = fC[14];
156 
157 
158  fC[0] = ( c00 + h2 * h2 * c22 + h4 * h4 * c44
159  + 2 * ( h2 * c20 + h4 * c40 + h2 * h4 * c42 ) );
160 
161  fC[1] = c10 + h2 * c21 + h4 * c41 + dS * ( c30 + h2 * c32 + h4 * c43 );
162  fC[2] = c11 + 2 * dS * c31 + dS * dS * c33;
163 
164  fC[3] = c20 + h2 * c22 + h4 * c42 + dxBz * ( c40 + h2 * c42 + h4 * c44 );
165  fC[4] = c21 + dS * c32 + dxBz * ( c41 + dS * c43 );
166  fC[5] = c22 + 2 * dxBz * c42 + dxBz * dxBz * c44;
167 
168  fC[6] = c30 + h2 * c32 + h4 * c43;
169  fC[7] = c31 + dS * c33;
170  fC[8] = c32 + dxBz * c43;
171  fC[9] = c33;
172 
173  fC[10] = c40 + h2 * c42 + h4 * c44;
174  fC[11] = c41 + dS * c43;
175  fC[12] = c42 + dxBz * c44;
176  fC[13] = c43;
177  fC[14] = c44;
178 
179  return 1;
180 }
TCanvas * c11
float QPt() const
float DzDs() const
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
float SinPhi() const
float X() const
bool PndCATrackParam::TransportToXWithMaterial ( float  x,
float  Bz,
float  maxSinPhi = .999 
)

Definition at line 191 of file PndCATrackParam.cxx.

References CalculateFitParameters(), and par.

Referenced by Transport(), and TransportToXWithMaterial().

192 {
193  //* Transport the track parameters to X=x taking into account material budget
194 
195  PndCATrackFitParam par;
196  CalculateFitParameters( par );
197  return TransportToXWithMaterial( x, par, Bz, maxSinPhi );
198 }
Double_t par[3]
bool TransportToXWithMaterial(float x, float Bz, float maxSinPhi=.999)
Double_t x
void CalculateFitParameters(PndCATrackFitParam &par, float mass=0.13957)
bool PndCATrackParam::TransportToXWithMaterial ( float  x,
PndCATrackLinearisation t0,
PndCATrackFitParam par,
float  Bz,
float  maxSinPhi = .999 
)
inline

Definition at line 543 of file PndCATrackParam.h.

References TransportToX().

544 {
545  //* Transport the track parameters to X=x taking into account material budget
546 
547  const float kRho = 1.54e-3;//1.025e-3 ;//0.9e-3;
548 // const float kRadLen = 29.532;//28.94;
549  //const float kRhoOverRadLen = kRho / kRadLen;
550  const float kRhoOverRadLen = 7.68e-5;
551  float dl;
552 
553  if ( !TransportToX( x, t0, Bz, maxSinPhi, &dl ) ) return 0;
554 
555  UNUSED_PARAM3(kRho, kRhoOverRadLen, par);//TODO
556  // CorrectForMeanMaterial( dl*kRhoOverRadLen, dl*kRho, par );
557  return 1;
558 }
Double_t par[3]
Double_t x
bool TransportToX(float x, float Bz, float maxSinPhi=.999)
bool PndCATrackParam::TransportToXWithMaterial ( float  x,
PndCATrackFitParam par,
float  Bz,
float  maxSinPhi = .999 
)
inline

Definition at line 560 of file PndCATrackParam.h.

References t0, and TransportToXWithMaterial().

561 {
562  //* Transport the track parameters to X=x taking into account material budget
563 
564  PndCATrackLinearisation t0( *this );
565  return TransportToXWithMaterial( x, t0, par, Bz, maxSinPhi );
566 }
Double_t par[3]
bool TransportToXWithMaterial(float x, float Bz, float maxSinPhi=.999)
Int_t t0
Definition: hist-t7.C:106
Double_t x
float PndCATrackParam::X ( ) const
inline
float PndCATrackParam::Y ( ) const
inline

Definition at line 60 of file PndCATrackParam.h.

References fP.

Referenced by PndCATracking::CATrackParToFairTrackParP(), PndFTSCADisplay::DrawTrackParam(), Rotate(), RotateXY(), and TransportToX().

60 { return fP[0]; }
float PndCATrackParam::Z ( ) const
inline

Definition at line 61 of file PndCATrackParam.h.

References fP.

Referenced by PndCATracking::CATrackParToFairTrackParP(), PndFTSCADisplay::DrawTrackParam(), and TransportToX().

61 { return fP[1]; }

Member Data Documentation

float PndCATrackParam::fAlpha
private

Definition at line 220 of file PndCATrackParam.h.

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

float PndCATrackParam::fC[15]
private
float PndCATrackParam::fChi2
private

Definition at line 217 of file PndCATrackParam.h.

Referenced by Chi2(), Filter(), GetChi2(), IsValid(), Reset(), SetAsInvalid(), and SetChi2().

int PndCATrackParam::fISec
private

Definition at line 221 of file PndCATrackParam.h.

Referenced by ISec(), Reset(), and SetISec().

int PndCATrackParam::fNDF
private

Definition at line 218 of file PndCATrackParam.h.

Referenced by Filter(), GetNDF(), NDF(), Reset(), and SetNDF().

float PndCATrackParam::fP[5]
private
float PndCATrackParam::fSignCosPhi
private

Definition at line 214 of file PndCATrackParam.h.

Referenced by GetCosPhi(), GetSignCosPhi(), Reset(), SetSignCosPhi(), and SignCosPhi().

float PndCATrackParam::fX
private

Definition at line 213 of file PndCATrackParam.h.

Referenced by GetX(), Reset(), SetX(), TransportToX(), and X().


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