Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/ParticlePropagator.cc

    re55f5b0 r764f12a0  
    6666{
    6767}
    68 
    6968
    7069//------------------------------------------------------------------------------
     
    9291  fItInputArray = fInputArray->MakeIterator();
    9392
    94   // import beamspot
    95   try
    96   {
    97     fBeamSpotInputArray = ImportArray(GetString("BeamSpotInputArray", "BeamSpotFilter/beamSpotParticle"));
    98   }
    99   catch(runtime_error &e)
    100   {
    101     fBeamSpotInputArray = 0;
    102   }
    10393  // create output arrays
    10494
     
    121111{
    122112  Candidate *candidate, *mother;
    123   TLorentzVector candidatePosition, candidateMomentum, beamSpotPosition;
     113  TLorentzVector candidatePosition, candidateMomentum;
    124114  Double_t px, py, pz, pt, pt2, e, q;
    125115  Double_t x, y, z, t, r, phi;
     
    130120  Double_t tmp, discr, discr2;
    131121  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;
    135123
    136124  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   }
    145125
    146126  fItInputArray->Reset();
     
    152132    y = candidatePosition.Y()*1.0E-3;
    153133    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 
    159134    q = candidate->Charge;
    160135
     
    207182      z_t = z + pz*t;
    208183
    209       l = TMath::Sqrt( (x_t - x)*(x_t - x) + (y_t - y)*(y_t - y) + (z_t - z)*(z_t - z));
    210 
    211184      mother = candidate;
    212185      candidate = static_cast<Candidate*>(candidate->Clone());
    213186
    214       candidate->InitialPosition = candidatePosition;
    215187      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;
    217188
    218189      candidate->Momentum = candidateMomentum;
     
    268239      zd = z + (TMath::Sqrt(xd*xd + yd*yd) - TMath::Sqrt(x*x + y*y))*pz/pt;
    269240
    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;
    287243
    288244      // 3. time evaluation t = TMath::Min(t_r, t_z)
     
    331287      r_t = TMath::Hypot(x_t, y_t);
    332288
    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 
    339289      if(r_t > 0.0)
    340290      {
    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 
    350291        mother = candidate;
    351292        candidate = static_cast<Candidate*>(candidate->Clone());
    352293
    353         candidate->InitialPosition = candidatePosition;
    354294        candidate->Position.SetXYZT(x_t*1.0E3, y_t*1.0E3, z_t*1.0E3, candidatePosition.T() + t*c_light*1.0E3);
    355295
    356296        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;
    361299        candidate->Yd = yd*1.0E3;
    362300        candidate->Zd = zd*1.0E3;
Note: See TracChangeset for help on using the changeset viewer.