Changes in modules/ParticlePropagator.cc [e55f5b0:764f12a0] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/ParticlePropagator.cc
re55f5b0 r764f12a0 66 66 { 67 67 } 68 69 68 70 69 //------------------------------------------------------------------------------ … … 92 91 fItInputArray = fInputArray->MakeIterator(); 93 92 94 // import beamspot95 try96 {97 fBeamSpotInputArray = ImportArray(GetString("BeamSpotInputArray", "BeamSpotFilter/beamSpotParticle"));98 }99 catch(runtime_error &e)100 {101 fBeamSpotInputArray = 0;102 }103 93 // create output arrays 104 94 … … 121 111 { 122 112 Candidate *candidate, *mother; 123 TLorentzVector candidatePosition, candidateMomentum , beamSpotPosition;113 TLorentzVector candidatePosition, candidateMomentum; 124 114 Double_t px, py, pz, pt, pt2, e, q; 125 115 Double_t x, y, z, t, r, phi; … … 130 120 Double_t tmp, discr, discr2; 131 121 Double_t delta, gammam, omega, asinrho; 132 Double_t rcu, rc2, xd, yd, zd; 133 Double_t l, d0, dz, p, ctgTheta, phip, etap, alpha; 134 Double_t bsx, bsy, bsz; 122 Double_t rcu, rc2, dxy, xd, yd, zd; 135 123 136 124 const Double_t c_light = 2.99792458E8; 137 138 if (!fBeamSpotInputArray || fBeamSpotInputArray->GetSize () == 0)139 beamSpotPosition.SetXYZT(0.0, 0.0, 0.0, 0.0);140 else141 {142 Candidate &beamSpotCandidate = *((Candidate *) fBeamSpotInputArray->At(0));143 beamSpotPosition = beamSpotCandidate.Position;144 }145 125 146 126 fItInputArray->Reset(); … … 152 132 y = candidatePosition.Y()*1.0E-3; 153 133 z = candidatePosition.Z()*1.0E-3; 154 155 bsx = beamSpotPosition.X()*1.0E-3;156 bsy = beamSpotPosition.Y()*1.0E-3;157 bsz = beamSpotPosition.Z()*1.0E-3;158 159 134 q = candidate->Charge; 160 135 … … 207 182 z_t = z + pz*t; 208 183 209 l = TMath::Sqrt( (x_t - x)*(x_t - x) + (y_t - y)*(y_t - y) + (z_t - z)*(z_t - z));210 211 184 mother = candidate; 212 185 candidate = static_cast<Candidate*>(candidate->Clone()); 213 186 214 candidate->InitialPosition = candidatePosition;215 187 candidate->Position.SetXYZT(x_t*1.0E3, y_t*1.0E3, z_t*1.0E3, candidatePosition.T() + t*e*1.0E3); 216 candidate->L = l*1.0E3;217 188 218 189 candidate->Momentum = candidateMomentum; … … 268 239 zd = z + (TMath::Sqrt(xd*xd + yd*yd) - TMath::Sqrt(x*x + y*y))*pz/pt; 269 240 270 // use perigee momentum rather than original particle 271 // momentum, since the orignal particle momentum isn't known 272 273 px = TMath::Sign(1.0,r) * pt * (-y_c / r_c); 274 py = TMath::Sign(1.0,r) * pt * (x_c / r_c); 275 etap = candidateMomentum.Eta(); 276 phip = TMath::ATan2(py, px); 277 278 candidateMomentum.SetPtEtaPhiE(pt, etap, phip, candidateMomentum.E()); 279 280 // calculate additional track parameters (correct for beamspot position) 281 282 d0 = ( (x - bsx) * py - (y - bsy) * px) / pt; 283 dz = z - ((x - bsx) * px + (y - bsy) * py) / pt * (pz / pt); 284 p = candidateMomentum.P(); 285 ctgTheta = 1.0 / TMath::Tan (candidateMomentum.Theta ()); 286 241 // calculate impact paramater 242 dxy = (xd*py - yd*px)/pt; 287 243 288 244 // 3. time evaluation t = TMath::Min(t_r, t_z) … … 331 287 r_t = TMath::Hypot(x_t, y_t); 332 288 333 334 // compute path length for an helix335 336 alpha = pz*1.0E9 / c_light / gammam;337 l = t * TMath::Sqrt(alpha*alpha + r*r*omega*omega);338 339 289 if(r_t > 0.0) 340 290 { 341 342 // store these variables before cloning343 candidate->D0 = d0*1.0E3;344 candidate->DZ = dz*1.0E3;345 candidate->P = p;346 candidate->PT = pt;347 candidate->CtgTheta = ctgTheta;348 candidate->Phi = phip;349 350 291 mother = candidate; 351 292 candidate = static_cast<Candidate*>(candidate->Clone()); 352 293 353 candidate->InitialPosition = candidatePosition;354 294 candidate->Position.SetXYZT(x_t*1.0E3, y_t*1.0E3, z_t*1.0E3, candidatePosition.T() + t*c_light*1.0E3); 355 295 356 296 candidate->Momentum = candidateMomentum; 357 358 candidate->L = l*1.0E3; 359 360 candidate->Xd = xd*1.0E3; 297 candidate->Dxy = dxy*1.0E3; 298 candidate->Xd = xd*1.0E3; 361 299 candidate->Yd = yd*1.0E3; 362 300 candidate->Zd = zd*1.0E3;
Note:
See TracChangeset
for help on using the changeset viewer.