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

#include <PndFTSCATrackParam.h>

Public Member Functions

 PndFTSCATrackParam ()
 
 PndFTSCATrackParam (const TrackParamVector &v, int i)
 
float X0 () const
 
float X1 () const
 
float X2 () const
 
float X () const
 
float Y () const
 
float Z () const
 
float SinPhi () const
 
float DzDs () const
 
float QPt () const
 
float QP () const
 
float QMomentum () const
 
float SignCosPhi () const
 
float Chi2 () const
 
int NDF () const
 
float Err2X1 () const
 
float Err2X2 () const
 
float Err2Y () const
 
float Err2Z () const
 
float Err2SinPhi () const
 
float Err2DzDs () const
 
float Err2QPt () const
 
float Angle () const
 
float Kappa (float Bz) const
 
float CosPhi () const
 
float Err2QMomentum () const
 
const float * Par () const
 
const float * Cov () const
 
bool GetXYZPxPyPzQ (float &x, float &y, float &z, float &px, float &py, float &pz, int &q, float cov[21]) const
 
void SetSinPhi (float v)
 
void GetDCAPoint (float x, float y, float z, float &px, float &py, float &pz, float Bz) const
 
bool TransportToX0 (float x, float Bz, float maxSinPhi=.999)
 
bool Rotate (float alpha, float maxSinPhi=.999)
 
bool Transport (const FTSCAHit &hit, const PndFTSCAParam &param)
 
bool IsValid () const
 
void SetAsInvalid ()
 

Private Member Functions

void Reset ()
 
float S (float x, float y, float Bz) const
 

Private Attributes

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

Friends

std::istreamoperator>> (std::istream &, PndFTSCATrackParam &)
 
std::ostreamoperator<< (std::ostream &, const PndFTSCATrackParam &)
 

Detailed Description

Definition at line 245 of file PndFTSCATrackParam.h.

Constructor & Destructor Documentation

PndFTSCATrackParam::PndFTSCATrackParam ( )
inline

Definition at line 251 of file PndFTSCATrackParam.h.

References Reset().

251 { Reset();}
PndFTSCATrackParam::PndFTSCATrackParam ( const TrackParamVector v,
int  i 
)
inline

Definition at line 252 of file PndFTSCATrackParam.h.

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

253  : fX( v.X()[i] ),
254  fSignCosPhi( v.SignCosPhi()[i] ),
255  fChi2( v.Chi2()[i] ),
256  fNDF( v.NDF()[i] ),
257  fAlpha( v.Angle()[i] )
258  {
259  for ( int j = 0; j < 5; ++j ) fP[j] = v.Par()[j][i];
260  for ( int j = 0; j < 15; ++j ) fC[j] = v.Cov()[j][i];
261  }
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 PndFTSCATrackParam::Angle ( ) const
inline
float PndFTSCATrackParam::Chi2 ( ) const
inline
float PndFTSCATrackParam::CosPhi ( ) const
inline
const float* PndFTSCATrackParam::Cov ( ) const
inline
float PndFTSCATrackParam::DzDs ( ) const
inline
float PndFTSCATrackParam::Err2DzDs ( ) const
inline

Definition at line 286 of file PndFTSCATrackParam.h.

References fC.

286 { return fC[9]; }
float PndFTSCATrackParam::Err2QMomentum ( ) const
inline

Definition at line 294 of file PndFTSCATrackParam.h.

References fC.

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

294 { return fC[14]; }
float PndFTSCATrackParam::Err2QPt ( ) const
inline

Definition at line 287 of file PndFTSCATrackParam.h.

References fC.

287 { return fC[14]; }
float PndFTSCATrackParam::Err2SinPhi ( ) const
inline

Definition at line 285 of file PndFTSCATrackParam.h.

References fC.

285 { return fC[5]; }
float PndFTSCATrackParam::Err2X1 ( ) const
inline

Definition at line 280 of file PndFTSCATrackParam.h.

References Err2Y().

280 { return Err2Y(); }
float PndFTSCATrackParam::Err2X2 ( ) const
inline

Definition at line 281 of file PndFTSCATrackParam.h.

References Err2Z().

281 { return Err2Z(); }
float PndFTSCATrackParam::Err2Y ( ) const
inline

Definition at line 283 of file PndFTSCATrackParam.h.

References fC.

Referenced by Err2X1().

283 { return fC[0]; }
float PndFTSCATrackParam::Err2Z ( ) const
inline

Definition at line 284 of file PndFTSCATrackParam.h.

References fC.

Referenced by Err2X2().

284 { return fC[2]; }
void PndFTSCATrackParam::GetDCAPoint ( float  x,
float  y,
float  z,
float &  px,
float &  py,
float &  pz,
float  Bz 
) const

Definition at line 92 of file PndFTSCATrackParam.cxx.

References a, CAMath::Abs(), CosPhi(), dx, dy, DzDs(), Kappa(), CAMath::Nint(), s, S(), SinPhi(), sqrt(), CAMath::TwoPi(), X(), x0, Y(), y0, and Z().

Referenced by PndFTSCADisplay::DrawGBTrackFast().

95 {
96  //* Get the track point closest to the (x,y,z)
97 
98  float x0 = X();
99  float y0 = Y();
100  float k = Kappa( Bz );
101  float ex = CosPhi();
102  float ey = SinPhi();
103  float dx = x - x0;
104  float dy = y - y0;
105  float ax = dx * k + ey;
106  float ay = dy * k - ex;
107  float a = sqrt( ax * ax + ay * ay );
108  xp = x0 + ( dx - ey * ( ( dx * dx + dy * dy ) * k - 2 * ( -dx * ey + dy * ex ) ) / ( a + 1 ) ) / a;
109  yp = y0 + ( dy + ex * ( ( dx * dx + dy * dy ) * k - 2 * ( -dx * ey + dy * ex ) ) / ( a + 1 ) ) / a;
110  float s = S( x, y, Bz );
111  zp = Z() + DzDs() * s;
112  if ( CAMath::Abs( k ) > 1.e-2 ) {
113  float dZ = CAMath::Abs( DzDs() * CAMath::TwoPi() / k );
114  if ( dZ > .1 ) {
115  zp += CAMath::Nint( ( z - zp ) / dZ ) * dZ;
116  }
117  }
118 }
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
static T Abs(const T &x)
Definition: PndCAMath.h:39
Int_t a
Definition: anaLmdDigi.C:126
Double_t y0
Definition: checkhelixhit.C:71
Double_t z
double dx
Double_t x
static float TwoPi()
Definition: PndCAMath.h:61
float S(float x, float y, float Bz) const
Double_t y
int Nint(float x)
Definition: PndCAMath.h:117
float Kappa(float Bz) const
bool PndFTSCATrackParam::GetXYZPxPyPzQ ( float &  x,
float &  y,
float &  z,
float &  px,
float &  py,
float &  pz,
int &  q,
float  cov[21] 
) const

Definition at line 198 of file PndFTSCATrackParam.cxx.

References CAMath::Abs(), alpha, Angle(), ASSERT, cos(), CosPhi(), Cov(), DzDs(), f, fabs(), i, ok, pt(), QPt(), sin(), SinPhi(), x, X(), y, Y(), and Z().

199 {
200  { // -- convert parameters
201 
202  x = X();
203  y = Y();
204  z = Z();
205 
206  const float pt = CAMath::Abs( 1.f / QPt() );
207  q = -( QPt() >=0 ? 1 : -1 );
208 
209  const float cosL = DzDs();
210  px = pt * CosPhi();
211  py = pt * SinPhi();
212  pz = pt * cosL;
213 
214  // -- convert cov matrix
215  // get jacobian
216  float J[6][6];
217  for (int i = 0; i < 6; i++)
218  for (int j = 0; j < 6; j++)
219  J[i][j] = 0;
220  J[0][0] = 1; // x -> x
221  J[1][1] = 1; // y -> y
222  J[2][2] = 1; // z -> z
223  J[3][3] = pt * CosPhi() / SinPhi();
224  J[3][5] = - q * pt * pt * CosPhi(); // q/pt -> px
225  J[4][3] = pt; // sinPhi -> py
226  J[4][5] = - q* pt * pt * SinPhi(); // q/pt -> py
227  J[5][4] = pt; // dz/ds -> pz
228  J[5][5] = - q* pt * pt * cosL; // q/pt -> pz
229 
230  float CovIn[6][6]; // triangular -> symmetric matrix
231  {
232  CovIn[0][0] = .000001f*.00001f; // dx. From nowhere. TODO
233  for (int i = 1; i < 6; i++) {
234  CovIn[i][0] = 0;
235  CovIn[0][i] = 0;
236  }
237  int k = 0;
238  for (int i = 1; i < 6; i++) {
239  for (int j = 1; j <= i; j++, k++) {
240  CovIn[i][j] = Cov()[k];
241  CovIn[j][i] = Cov()[k];
242  }
243  }
244  }
245 
246  float CovInJ[6][6]; // CovInJ = CovIn * J^t
247  for (int i = 0; i < 6; i++)
248  for (int j = 0; j < 6; j++) {
249  CovInJ[i][j] = 0;
250  for (int k = 0; k < 6; k++) {
251  CovInJ[i][j] += CovIn[i][k] * J[j][k];
252  }
253  }
254 
255  float CovOut[6][6]; // CovOut = J * CovInJ
256  for (int i = 0; i < 6; i++)
257  for (int j = 0; j < 6; j++) {
258  CovOut[i][j] = 0;
259  for (int k = 0; k < 6; k++) {
260  CovOut[i][j] += J[i][k] * CovInJ[k][j];
261  }
262  }
263 
264  // symmetric matrix -> triangular
265  {
266  int k = 0;
267  for (int i = 0; i < 6; i++) {
268  for (int j = 0; j <= i; j++, k++) {
269  cov[k] = CovOut[i][j];
270  ASSERT( !finite(CovOut[i][j]) || CovOut[i][j] == 0 || fabs( 1. - CovOut[j][i]/CovOut[i][j] ) <= 0.05,
271  "CovOut[" << i << "][" << j << "] == CovOut[" << j << "][" << i << "] : " << CovOut[i][j] << " == " << CovOut[j][i]);
272  }
273  }
274  }
275 
276  { // check cov matrix
277  bool ok = true;
278  int k = 0;
279  for (int i = 0; i < 6; i++) {
280  for (int j = 0; j <= i; j++, k++) {
281  ok &= finite( cov[k] );
282  }
283  ok &= ( cov[k-1] > 0 );
284  }
285  if (!ok) return false;
286  }
287  }
288 
289  // Rotate in XY plane to convert to global
290  {
291  const float alpha = Angle();
292 
293 #if defined(PANDA_STT) || defined(PANDA_FTS)
294  assert(0); // different coordinate transform for panda
295 #endif
296  const float cA = cos( alpha );
297  const float sA = sin( alpha );
298 
299  //float J[6][6] = { { cA, sA, 0, 0, 0, 0 }, // X
300  // { -sA, cA, 0, 0, 0, 0 }, // Y
301  // { 0, 0, 1, 0, 0, 0 }, // Z
302  // { 0, 0, 0, cA, sA, 0 }, // Px
303  // { 0, 0, 0, -sA, cA, 0 }, // Py
304  // { 0, 0, 0, 0, 0, 1 } }; // Pz
305 
306  float J[2][2] = { { cA, sA },
307  { -sA, cA } };
308 
309  { // convert x, y TODO optimize
310  const float xt = x, yt = y;
311  x = xt*cA + yt*sA;
312  y = -xt*sA + yt*cA;
313 
314  float Cov1[2][2]; // triangular -> symmetric matrix
315  Cov1[0][0] = cov[0];
316  Cov1[0][1] = cov[1];
317  Cov1[1][0] = cov[1];
318  Cov1[1][1] = cov[2];
319 
320  float Cov2[2][2]; // Cov2 = Cov1 * J^t
321  for (int i = 0; i < 2; i++)
322  for (int j = 0; j < 2; j++) {
323  Cov2[i][j] = 0;
324  for (int k = 0; k < 2; k++) {
325  Cov2[i][j] += Cov1[i][k] * J[j][k];
326  }
327  }
328 
329  // Cov1 = J * Cov2
330  for (int i = 0; i < 2; i++)
331  for (int j = 0; j < 2; j++) {
332  Cov1[i][j] = 0;
333  for (int k = 0; k < 2; k++) {
334  Cov1[i][j] += J[i][k] * Cov2[k][j];
335  }
336  }
337 
338  // symmetric matrix -> triangular
339  cov[0] = Cov1[0][0];
340  cov[1] = Cov1[0][1];
341  cov[2] = Cov1[1][1];
342  }
343 
344  { // convert Px, Py TODO optimize
345  const float xt = px, yt = py;
346  px = xt*cA + yt*sA;
347  py = -xt*sA + yt*cA;
348 
349  float Cov1[2][2]; // triangular -> symmetric matrix
350  Cov1[0][0] = cov[9];
351  Cov1[0][1] = cov[13];
352  Cov1[1][0] = cov[13];
353  Cov1[1][1] = cov[14];
354 
355 
356  float Cov2[2][2]; // Cov2 = Cov1 * J^t
357  for (int i = 0; i < 2; i++)
358  for (int j = 0; j < 2; j++) {
359  Cov2[i][j] = 0;
360  for (int k = 0; k < 2; k++) {
361  Cov2[i][j] += Cov1[i][k] * J[j][k];
362  }
363  }
364 
365  // Cov1 = J * Cov2
366  for (int i = 0; i < 2; i++)
367  for (int j = 0; j < 2; j++) {
368  Cov1[i][j] = 0;
369  for (int k = 0; k < 2; k++) {
370  Cov1[i][j] += J[i][k] * Cov2[k][j];
371  }
372  }
373 
374  // symmetric matrix -> triangular
375 
376  cov[9] = Cov1[0][0];
377  cov[13] = Cov1[0][1];
378  cov[14] = Cov1[1][1];
379  }
380  }
381 
382  return true;
383 }
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
Int_t i
Definition: run_full.C:25
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
TString pt(TString pts, TString exts="px py pz")
Definition: invexp.C:133
static T Abs(const T &x)
Definition: PndCAMath.h:39
const float * Cov() const
float_m ok
TFile * f
Definition: bump_analys.C:12
Double_t z
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
Double_t x
#define ASSERT(v, msg)
Definition: PndCADef.h:56
Double_t y
double alpha
Definition: f_Init.h:9
double pz[39]
Definition: pipisigmas.h:14
bool PndFTSCATrackParam::IsValid ( ) const
inline

Definition at line 313 of file PndFTSCATrackParam.h.

References fChi2.

313 { return fChi2 != -1; }
float PndFTSCATrackParam::Kappa ( float  Bz) const
inline

Definition at line 291 of file PndFTSCATrackParam.h.

References fP.

Referenced by PndFTSCADisplay::DrawGBTrackFast(), GetDCAPoint(), and S().

291 { return fP[4]*Bz; }
int PndFTSCATrackParam::NDF ( ) const
inline

Definition at line 278 of file PndFTSCATrackParam.h.

References fNDF.

Referenced by FTSCATrack::Fit(), FTSCATrack::Fit2Times(), PndFTSTopoReconstructor::Init(), and operator<<().

278 { return fNDF; }
const float* PndFTSCATrackParam::Par ( ) const
inline

Definition at line 296 of file PndFTSCATrackParam.h.

References fP.

Referenced by operator<<().

296 { return fP; }
float PndFTSCATrackParam::QMomentum ( ) const
inline

Definition at line 274 of file PndFTSCATrackParam.h.

References QPt().

Referenced by FTSCANPlet::QMomentum().

274 { return QPt(); }
float PndFTSCATrackParam::QP ( ) const
inline

Definition at line 273 of file PndFTSCATrackParam.h.

References DzDs(), QPt(), and sqrt().

Referenced by PndFtsCATracking::CATrackParToFairTrackParP(), FTSCATrack::Fit(), and PndFTSCAGBTracker::Merge().

273 { return QPt() / sqrt(DzDs()*DzDs() + 1); }
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
float PndFTSCATrackParam::QPt ( ) const
inline
void PndFTSCATrackParam::Reset ( )
inlineprivate

Definition at line 317 of file PndFTSCATrackParam.h.

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

Referenced by PndFTSCATrackParam().

317  {
318  fX = 0;
319  fSignCosPhi = 0;
320  for(int i=0; i < 5; i++) fP[i] = 0;
321  for(int i=0; i < 15; i++) fC[i] = 0;
322  fChi2 = 0;
323  fNDF = 0;
324  }
Int_t i
Definition: run_full.C:25
bool PndFTSCATrackParam::Rotate ( float  alpha,
float  maxSinPhi = .999 
)

Definition at line 120 of file PndFTSCATrackParam.cxx.

References CAMath::Abs(), alpha, CAMath::Cos(), CosPhi(), fabs(), fAlpha, fC, fP, fSignCosPhi, fX, CAMath::Sin(), SinPhi(), x, X(), y, and Y().

Referenced by PndFTSCADisplay::DrawGBHits(), PndFTSCADisplay::DrawTrack(), and Transport().

121 {
122  //* Rotate the coordinate system in XY on the angle alpha
123 
124  const float cA = CAMath::Cos( alpha );
125  const float sA = CAMath::Sin( alpha );
126  const float x = X(), y = Y(), sP = SinPhi(), cP = CosPhi();
127  const float cosPhi = cP * cA + sP * sA;
128  const float sinPhi = -cP * sA + sP * cA;
129 
130  if ( CAMath::Abs( sinPhi ) > maxSinPhi || CAMath::Abs( cosPhi ) < 1.e-2 || CAMath::Abs( cP ) < 1.e-2 ) return 0;
131 
132  if ( fabs(alpha) > 3.1415 * 0.25 ) return 0; // allow turn by 45 degree only
133 
134  const float j0 = cP / cosPhi;
135  const float j2 = cosPhi / cP;
136 
137  fX = x*cA + y*sA;
138  fP[0] = -x*sA + y*cA;
139  fSignCosPhi = CAMath::Abs(cosPhi) / cosPhi;
140  fP[2] = sinPhi;
141 
142  // float J[5][5] = { { j0, 0, 0, 0, 0 }, // Y
143  // { 0, 1, 0, 0, 0 }, // Z
144  // { 0, 0, j2, 0, 0 }, // SinPhi
145  // { 0, 0, 0, 1, 0 }, // DzDs
146  // { 0, 0, 0, 0, 1 } }; // Kappa
147  fC[0] *= j0 * j0;
148  fC[1] *= j0;
149  fC[3] *= j0;
150  fC[6] *= j0;
151  fC[10] *= j0;
152 
153  fC[3] *= j2;
154  fC[4] *= j2;
155  fC[5] *= j2 * j2;
156  fC[8] *= j2;
157  fC[12] *= j2;
158 
159  fAlpha += alpha;
160 
161  return 1;
162 }
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
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
Double_t x
Double_t y
double alpha
Definition: f_Init.h:9
float PndFTSCATrackParam::S ( float  x,
float  y,
float  Bz 
) const
private

Definition at line 78 of file PndFTSCATrackParam.cxx.

References CAMath::Abs(), CAMath::ATan2(), CosPhi(), Kappa(), SinPhi(), X(), and Y().

Referenced by GetDCAPoint().

79 {
80  //* Get XY path length to the given point
81 
82  float k = Kappa( Bz );
83  float ex = CosPhi();
84  float ey = SinPhi();
85  x -= X();
86  y -= Y();
87  float dS = x * ex + y * ey;
88  if ( CAMath::Abs( k ) > 1.e-4 ) dS = CAMath::ATan2( k * dS, 1 + k * ( x * ey - y * ex ) ) / k;
89  return dS;
90 }
static T Abs(const T &x)
Definition: PndCAMath.h:39
static T ATan2(const T &y, const T &x)
Double_t x
Double_t y
float Kappa(float Bz) const
void PndFTSCATrackParam::SetAsInvalid ( )
inline

Definition at line 314 of file PndFTSCATrackParam.h.

References fChi2.

Referenced by PndFTSCAGBTracker::FitTracks().

314 { fChi2 = -1; }
void PndFTSCATrackParam::SetSinPhi ( float  v)
inline

Definition at line 301 of file PndFTSCATrackParam.h.

References fP, and v.

Referenced by PndFTSCADisplay::DrawTrack().

301 { fP[2] = v; }
__m128 v
Definition: P4_F32vec4.h:4
float PndFTSCATrackParam::SignCosPhi ( ) const
inline

Definition at line 276 of file PndFTSCATrackParam.h.

References fSignCosPhi.

Referenced by PndFTSCADisplay::DrawRecoTrack(), and operator<<().

276 { return fSignCosPhi; }
float PndFTSCATrackParam::SinPhi ( ) const
inline
bool PndFTSCATrackParam::Transport ( const FTSCAHit hit,
const PndFTSCAParam param 
)

Definition at line 165 of file PndFTSCATrackParam.cxx.

References FTSCAHit::Angle(), PndFTSCAParam::cBz(), fAlpha, Rotate(), TransportToX0(), and FTSCAHit::X0().

Referenced by PndFTSCAGBTracker::Merge().

166 {
167  const bool rotated = Rotate( -fAlpha + hit.Angle() );
168  const bool transported = TransportToX0( hit.X0(), param.cBz() );
169  return rotated & transported;
170 }
bool Rotate(float alpha, float maxSinPhi=.999)
float Angle() const
Definition: FTSCAHits.h:71
float X0() const
Definition: FTSCAHits.h:41
float cBz() const
Definition: PndFTSCAParam.h:49
bool TransportToX0(float x, float Bz, float maxSinPhi=.999)
bool PndFTSCATrackParam::TransportToX0 ( float  x,
float  Bz,
float  maxSinPhi = .999 
)
inline

Definition at line 337 of file PndFTSCATrackParam.h.

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

Referenced by PndFTSCADisplay::DrawGBHits(), PndFTSTopoReconstructor::GetChiToPrimVertex(), PndFTSTopoReconstructor::Init(), and Transport().

338 {
339  //* Transport the track parameters to X=x, using linearization at t0, and the field value Bz
340  //* maxSinPhi is the max. allowed value for |t0.SinPhi()|
341  //* linearisation of trajectory t0 is also transported to X=x,
342  //* returns 1 if OK
343  //*
344 
345  const float ex = CosPhi();
346  const float ey = SinPhi();
347  const float k = QPt() * Bz;
348  const float dx = x - X();
349 
350  const float ey1 = k * dx + ey;
351 
352  // check for intersection with X=x
353 
354  if ( CAMath::Abs( ey1 ) > maxSinPhi ) return 0;
355 
356  float ex1 = CAMath::Sqrt( 1.f - ey1 * ey1 );
357  if ( ex < 0 ) ex1 = -ex1;
358 
359  const float dx2 = dx * dx;
360  const float ss = ey + ey1;
361  const float cc = ex + ex1;
362 
363  if ( ( CAMath::Abs( cc ) < 1.e-4 || CAMath::Abs( ex ) < 1.e-4 || CAMath::Abs( ex1 ) < 1.e-4 ) ) return 0;
364 
365  const float cci = 1.f / cc;
366  const float exi = 1.f / ex;
367  const float ex1i = 1.f / ex1;
368 
369  const float tg = ss * cci; // tan((phi1+phi)/2)
370 
371  const float dy = dx * tg;
372  float dl = dx * CAMath::Sqrt( 1.f + tg * tg );
373 
374  if ( cc < 0 ) dl = -dl;
375  float dSin = dl * k * 0.5;
376  if ( dSin > 1.f ) dSin = 1.f;
377  if ( dSin < -1.f ) dSin = -1.f;
378  const float dS = ( CAMath::Abs( k ) > 1.e-4 ) ? ( 2 * CAMath::ASin( dSin ) / k ) : dl;
379  const float dz = dS * DzDs();
380 
381 
382  //float H0[5] = { 1,0, h2, 0, h4 };
383  //float H1[5] = { 0, 1, 0, dS, 0 };
384  //float H2[5] = { 0, 0, 1, 0, dxBz };
385  //float H3[5] = { 0, 0, 0, 1, 0 };
386  //float H4[5] = { 0, 0, 0, 0, 1 };
387 
388  const float h2 = dx * ( 1.f + ey * ey1 + ex * ex1 ) * exi * ex1i * cci;
389  const float h4 = dx2 * ( cc + ss * ey1 * ex1i ) * cci * cci * Bz;
390  const float dxBz = dx * Bz;
391 
392  fX = X() + dx;
393  fP[0] = Y() + dy;
394  fP[1] = Z() + dz;
395  fP[2] = ey1;
396 
397 #if 1
398  const float c00 = fC[0];
399  const float c10 = fC[1];
400  const float c11 = fC[2];
401  const float c20 = fC[3];
402  const float c21 = fC[4];
403  const float c22 = fC[5];
404  const float c30 = fC[6];
405  const float c31 = fC[7];
406  const float c32 = fC[8];
407  const float c33 = fC[9];
408  const float c40 = fC[10];
409  const float c41 = fC[11];
410  const float c42 = fC[12];
411  const float c43 = fC[13];
412  const float c44 = fC[14];
413 
414  fC[0] = ( c00 + h2 * h2 * c22 + h4 * h4 * c44
415  + 2.f * ( h2 * c20 + h4 * c40 + h2 * h4 * c42 ) );
416 
417  fC[1] = c10 + h2 * c21 + h4 * c41 + dS * ( c30 + h2 * c32 + h4 * c43 );
418  fC[2] = c11 + 2.f * dS * c31 + dS * dS * c33;
419 
420  fC[3] = c20 + h2 * c22 + h4 * c42 + dxBz * ( c40 + h2 * c42 + h4 * c44 );
421  fC[4] = c21 + dS * c32 + dxBz * ( c41 + dS * c43 );
422  fC[5] = c22 + 2.f * dxBz * c42 + dxBz * dxBz * c44;
423 
424  fC[6] = c30 + h2 * c32 + h4 * c43;
425  fC[7] = c31 + dS * c33;
426  fC[8] = c32 + dxBz * c43;
427  fC[9] = c33;
428 
429  fC[10] = c40 + h2 * c42 + h4 * c44;
430  fC[11] = c41 + dS * c43;
431  fC[12] = c42 + dxBz * c44;
432  fC[13] = c43;
433  fC[14] = c44;
434 #else
435  fC[0] = ( fC[0] + h2 * h2 * fC[5] + h4 * h4 * fC[14]
436  + 2 * ( h2 * fC[3] + h4 * fC[10] + h2 * h4 * fC[12] ) );
437 
438  fC[1] = fC[1] + h2 * fC[4] + h4 * fC[11] + dS * ( fC[6] + h2 * fC[8] + h4 * fC[13] );
439  fC[2] = fC[2] + 2 * dS * fC[7] + dS * dS * fC[9];
440 
441  fC[3] = fC[3] + h2 * fC[5] + h4 * fC[12] + dxBz * ( fC[10] + h2 * fC[12] + h4 * fC[14] );
442  fC[4] = fC[4] + dS * fC[8] + dxBz * ( fC[11] + dS * fC[13] );
443  fC[5] = fC[5] + 2 * dxBz * fC[12] + dxBz * dxBz * fC[14];
444 
445  fC[6] = fC[6] + h2 * fC[8] + h4 * fC[13];
446  fC[7] = fC[7] + dS * fC[9];
447  fC[8] = fC[8] + dxBz * fC[13];
448  fC[9] = fC[9];
449 
450  fC[10] = fC[10] + h2 * fC[12] + h4 * fC[14];
451  fC[11] = fC[11] + dS * fC[13];
452  fC[12] = fC[12] + dxBz * fC[14];
453  fC[13] = fC[13];
454  fC[14] = fC[14];
455 #endif
456 
457  return 1;
458 }
static T ASin(const T &x)
double dy
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
TFile * f
Definition: bump_analys.C:12
double dx
TCanvas * c22
TCanvas * c20
Double_t x
float PndFTSCATrackParam::X ( ) const
inline
float PndFTSCATrackParam::X0 ( ) const
inline

Definition at line 263 of file PndFTSCATrackParam.h.

References fX.

263 { return fX; }
float PndFTSCATrackParam::X1 ( ) const
inline

Definition at line 264 of file PndFTSCATrackParam.h.

References Y().

264 { return Y(); }
float PndFTSCATrackParam::X2 ( ) const
inline

Definition at line 265 of file PndFTSCATrackParam.h.

References Z().

265 { return Z(); }
float PndFTSCATrackParam::Y ( ) const
inline
float PndFTSCATrackParam::Z ( ) const
inline

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream ,
const PndFTSCATrackParam  
)
friend

Definition at line 184 of file PndFTSCATrackParam.cxx.

185 {
186  out << t.X() << " "
187  << t.SignCosPhi() << " "
188  << t.Chi2() << " "
189  << t.NDF()
190  << '\n';
191  for ( int i = 0; i < 5; i++ ) out << t.Par()[i] << " ";
192  out << '\n';
193  for ( int i = 0; i < 15; i++ ) out << t.Cov()[i] << " ";
194  out << '\n';
195  return out;
196 }
Int_t i
Definition: run_full.C:25
float SignCosPhi() const
const float * Par() const
const float * Cov() const
TFile * out
Definition: reco_muo.C:20
std::istream& operator>> ( std::istream ,
PndFTSCATrackParam  
)
friend

Definition at line 173 of file PndFTSCATrackParam.cxx.

174 {
175  in >> t.fX;
176  in >> t.fSignCosPhi;
177  in >> t.fChi2;
178  in >> t.fNDF;
179  for ( int i = 0; i < 5; i++ ) in >> t.fP[i];
180  for ( int i = 0; i < 15; i++ ) in >> t.fC[i];
181  return in;
182 }
Int_t i
Definition: run_full.C:25

Member Data Documentation

float PndFTSCATrackParam::fAlpha
private

Definition at line 334 of file PndFTSCATrackParam.h.

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

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

Definition at line 331 of file PndFTSCATrackParam.h.

Referenced by Chi2(), IsValid(), operator>>(), Reset(), and SetAsInvalid().

int PndFTSCATrackParam::fNDF
private

Definition at line 332 of file PndFTSCATrackParam.h.

Referenced by NDF(), operator>>(), and Reset().

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

Definition at line 328 of file PndFTSCATrackParam.h.

Referenced by CosPhi(), operator>>(), Reset(), Rotate(), and SignCosPhi().

float PndFTSCATrackParam::fX
private

Definition at line 327 of file PndFTSCATrackParam.h.

Referenced by operator>>(), Reset(), Rotate(), TransportToX0(), X(), and X0().


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