Fork me on GitHub

Changeset b594101 in git


Ignore:
Timestamp:
Dec 19, 2014, 11:39:10 PM (10 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
764f12a0
Parents:
c59be54
Message:

remove unneeded variables and fix formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/ParticlePropagator.cc

    rc59be54 rb594101  
    120120  Double_t tmp, discr, discr2;
    121121  Double_t delta, gammam, omega, asinrho;
    122   Double_t ang_mom, rcu, rc2, dxy, xd, yd, zd;
    123  
     122  Double_t rcu, rc2, dxy, xd, yd, zd;
     123
    124124  const Double_t c_light = 2.99792458E8;
    125125
     
    158158      discr2 = pt2*fRadius2 - tmp*tmp;
    159159
    160       if(discr2 < 0)
     160      if(discr2 < 0.0)
    161161      {
    162162        // no solutions
     
    168168      t1 = (-tmp + discr)/pt2;
    169169      t2 = (-tmp - discr)/pt2;
    170       t = (t1 < 0) ? t2 : t1;
     170      t = (t1 < 0.0) ? t2 : t1;
    171171
    172172      z_t = z + pz*t;
     
    175175        t3 = (+fHalfLength - z) / pz;
    176176        t4 = (-fHalfLength - z) / pz;
    177         t = (t3 < 0) ? t4 : t3;
     177        t = (t3 < 0.0) ? t4 : t3;
    178178      }
    179179
     
    209209    {
    210210
    211       // 1.  initial transverse momentum p_{T0} : Part->pt
    212       //     initial transverse momentum direction \phi_0 = -atan(p_X0/p_Y0)
    213       //     relativistic gamma : gamma = E/mc² ; gammam = gamma \times m
    214       //     giration frequency \omega = q/(gamma m) fBz
    215       //     helix radius r = p_T0 / (omega gamma m)
    216 
    217       gammam = e*1.0E9 / (c_light*c_light);      // gammam in [eV/c²]
    218       omega = q * fBz / (gammam);                // omega is here in [ 89875518 / s]
     211      // 1.  initial transverse momentum p_{T0}: Part->pt
     212      //     initial transverse momentum direction phi_0 = -atan(p_X0/p_Y0)
     213      //     relativistic gamma: gamma = E/mc^2; gammam = gamma * m
     214      //     gyration frequency omega = q/(gamma m) fBz
     215      //     helix radius r = p_{T0} / (omega gamma m)
     216
     217      gammam = e*1.0E9 / (c_light*c_light);      // gammam in [eV/c^2]
     218      omega = q * fBz / (gammam);                // omega is here in [89875518/s]
    219219      r = pt / (q * fBz) * 1.0E9/c_light;        // in [m]
    220220
    221       phi_0 = TMath::ATan2(py, px); // [rad] in [-pi; pi]
     221      phi_0 = TMath::ATan2(py, px); // [rad] in [-pi, pi]
    222222
    223223      // 2. helix axis coordinates
     
    231231      rcu = TMath::Abs(r);
    232232      rc2 = r_c*r_c;
    233      
     233
    234234      // calculate coordinates of closest approach to track circle in transverse plane xd, yd, zd
    235       xd = x_c*x_c*x_c - x_c*rcu*r_c + x_c*y_c*y_c; 
    236       xd  = ( rc2 > 0.0 ) ? xd / rc2 : -999;
    237       yd  = y_c*(-rcu*r_c + rc2);
    238       yd  = ( rc2 > 0.0 ) ? yd / rc2 : -999;
    239       zd  = z + (TMath::Sqrt(xd*xd+yd*yd) - TMath::Sqrt(x*x+y*y))*pz/pt;
     235      xd = x_c*x_c*x_c - x_c*rcu*r_c + x_c*y_c*y_c;
     236      xd = (rc2 > 0.0) ? xd / rc2 : -999;
     237      yd = y_c*(-rcu*r_c + rc2);
     238      yd = (rc2 > 0.0) ? yd / rc2 : -999;
     239      zd = z + (TMath::Sqrt(xd*xd + yd*yd) - TMath::Sqrt(x*x + y*y))*pz/pt;
    240240
    241241      // calculate impact paramater
    242       ang_mom = (xd*py - yd*px);
    243       dxy = ang_mom/pt;
    244    
    245          
     242      dxy = (xd*py - yd*px)/pt;
     243
    246244      // 3. time evaluation t = TMath::Min(t_r, t_z)
    247245      //    t_r : time to exit from the sides
     
    270268        t6 = (delta - TMath::Pi() + asinrho) / omega;
    271269
    272         if(t1 < 0) t1 = 1.0E99;
    273         if(t2 < 0) t2 = 1.0E99;
    274         if(t3 < 0) t3 = 1.0E99;
    275         if(t4 < 0) t4 = 1.0E99;
    276         if(t5 < 0) t5 = 1.0E99;
    277         if(t6 < 0) t6 = 1.0E99;
     270        if(t1 < 0.0) t1 = 1.0E99;
     271        if(t2 < 0.0) t2 = 1.0E99;
     272        if(t3 < 0.0) t3 = 1.0E99;
     273        if(t4 < 0.0) t4 = 1.0E99;
     274        if(t5 < 0.0) t5 = 1.0E99;
     275        if(t6 < 0.0) t6 = 1.0E99;
    278276
    279277        t_ra = TMath::Min(t1, TMath::Min(t2, t3));
     
    297295
    298296        candidate->Momentum = candidateMomentum;
    299         candidate->Xd = xd*1.0E3;
    300         candidate->Yd = yd*1.0E3;
     297        candidate->Xd = xd*1.0E3;
     298        candidate->Yd = yd*1.0E3;
    301299        candidate->Zd = zd*1.0E3;
    302        
    303         candidate->AddCandidate(mother);
     300
     301        candidate->AddCandidate(mother);
    304302
    305303        fOutputArray->Add(candidate);
Note: See TracChangeset for help on using the changeset viewer.