Changes in modules/TrackSmearing.cc [cde9f31:9fccf4f] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/TrackSmearing.cc
rcde9f31 r9fccf4f 61 61 void TrackSmearing::Init() 62 62 { 63 fBz = GetDouble("Bz", 0.0);64 65 63 // read resolution formula 66 64 … … 160 158 Double_t pt, eta, d0, d0Error, trueD0, dz, dzError, trueDZ, p, pError, trueP, ctgTheta, ctgThetaError, trueCtgTheta, phi, phiError, truePhi; 161 159 Double_t x, y, z, t, px, py, pz, theta; 162 Double_t q, r;163 Double_t x_c, y_c, r_c, phi_0;164 Double_t rcu, rc2, xd, yd, zd;165 const Double_t c_light = 2.99792458E8;166 160 TProfile2D *d0ErrorHist = NULL, 167 161 *dzErrorHist = NULL, … … 355 349 y = candidate->InitialPosition.Y (); 356 350 candidate->InitialPosition.SetZ (z + ((pz * (px * (x - beamSpotPosition.X ()) + py * (y - beamSpotPosition.Y ())) + pt * pt * (dz - z)) / (pt * pt))); 357 z = candidate->InitialPosition.Z (); 358 351 359 352 candidate->InitialPosition.SetT(t); 360 361 // update closest approach 362 x *= 1.0E-3; 363 y *= 1.0E-3; 364 z *= 1.0E-3; 365 366 q = candidate->Charge; 367 368 r = pt / (q * fBz) * 1.0E9/c_light; // in [m] 369 phi_0 = TMath::ATan2(py, px); // [rad] in [-pi, pi] 370 371 // 2. helix axis coordinates 372 x_c = x + r*TMath::Sin(phi_0); 373 y_c = y - r*TMath::Cos(phi_0); 374 r_c = TMath::Hypot(x_c, y_c); 375 376 rcu = TMath::Abs(r); 377 rc2 = r_c*r_c; 378 379 // calculate coordinates of closest approach to track circle in transverse plane xd, yd, zd 380 xd = x_c*x_c*x_c - x_c*rcu*r_c + x_c*y_c*y_c; 381 xd = (rc2 > 0.0) ? xd / rc2 : -999; 382 yd = y_c*(-rcu*r_c + rc2); 383 yd = (rc2 > 0.0) ? yd / rc2 : -999; 384 zd = z + (TMath::Sqrt(xd*xd + yd*yd) - TMath::Sqrt(x*x + y*y))*pz/pt; 385 386 candidate->Xd = xd*1.0E3; 387 candidate->Yd = yd*1.0E3; 388 candidate->Zd = zd*1.0E3; 389 353 390 354 if (fApplyToPileUp || !candidate->IsPU) 391 355 {
Note:
See TracChangeset
for help on using the changeset viewer.