Changeset 70b9632 in git for modules/ParticlePropagator.cc
- Timestamp:
- Aug 25, 2016, 2:04:58 PM (8 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 629e819
- Parents:
- 7bb13cd (diff), 1408174 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/ParticlePropagator.cc
r7bb13cd r70b9632 67 67 } 68 68 69 69 70 //------------------------------------------------------------------------------ 70 71 … … 91 92 fItInputArray = fInputArray->MakeIterator(); 92 93 94 // import beamspot 95 try 96 { 97 fBeamSpotInputArray = ImportArray(GetString("BeamSpotInputArray", "BeamSpotFilter/beamSpotParticle")); 98 } 99 catch(runtime_error &e) 100 { 101 fBeamSpotInputArray = 0; 102 } 93 103 // create output arrays 94 104 … … 111 121 { 112 122 Candidate *candidate, *mother; 113 TLorentzVector candidatePosition, candidateMomentum ;123 TLorentzVector candidatePosition, candidateMomentum, beamSpotPosition; 114 124 Double_t px, py, pz, pt, pt2, e, q; 115 125 Double_t x, y, z, t, r, phi; … … 120 130 Double_t tmp, discr, discr2; 121 131 Double_t delta, gammam, omega, asinrho; 122 Double_t rcu, rc2, dxy, xd, yd, zd; 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; 123 135 124 136 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 else 141 { 142 Candidate &beamSpotCandidate = *((Candidate *) fBeamSpotInputArray->At(0)); 143 beamSpotPosition = beamSpotCandidate.Position; 144 } 125 145 126 146 fItInputArray->Reset(); … … 132 152 y = candidatePosition.Y()*1.0E-3; 133 153 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 134 159 q = candidate->Charge; 135 160 … … 182 207 z_t = z + pz*t; 183 208 209 l = TMath::Sqrt( (x_t - x)*(x_t - x) + (y_t - y)*(y_t - y) + (z_t - z)*(z_t - z)); 210 184 211 mother = candidate; 185 212 candidate = static_cast<Candidate*>(candidate->Clone()); 186 213 214 candidate->InitialPosition = candidatePosition; 187 215 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; 188 217 189 218 candidate->Momentum = candidateMomentum; … … 239 268 zd = z + (TMath::Sqrt(xd*xd + yd*yd) - TMath::Sqrt(x*x + y*y))*pz/pt; 240 269 241 // calculate impact paramater 242 dxy = (xd*py - yd*px)/pt; 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 243 287 244 288 // 3. time evaluation t = TMath::Min(t_r, t_z) … … 287 331 r_t = TMath::Hypot(x_t, y_t); 288 332 333 334 // compute path length for an helix 335 336 alpha = pz*1.0E9 / c_light / gammam; 337 l = t * TMath::Sqrt(alpha*alpha + r*r*omega*omega); 338 289 339 if(r_t > 0.0) 290 340 { 341 342 // store these variables before cloning 343 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 291 350 mother = candidate; 292 351 candidate = static_cast<Candidate*>(candidate->Clone()); 293 352 353 candidate->InitialPosition = candidatePosition; 294 354 candidate->Position.SetXYZT(x_t*1.0E3, y_t*1.0E3, z_t*1.0E3, candidatePosition.T() + t*c_light*1.0E3); 295 355 296 356 candidate->Momentum = candidateMomentum; 297 candidate->Dxy = dxy*1.0E3; 298 candidate->Xd = xd*1.0E3; 357 358 candidate->L = l*1.0E3; 359 360 candidate->Xd = xd*1.0E3; 299 361 candidate->Yd = yd*1.0E3; 300 362 candidate->Zd = zd*1.0E3;
Note:
See TracChangeset
for help on using the changeset viewer.