Fork me on GitHub

Changeset 2a3eb22 in git for modules


Ignore:
Timestamp:
Jun 24, 2016, 3:33:25 PM (9 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
734b267, 90ccc5d
Parents:
5c402f7
Message:

fix track momentum in TreeWriter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/TreeWriter.cc

    r5c402f7 r2a3eb22  
    317317  Candidate *particle = 0;
    318318  Track *entry = 0;
    319   Double_t pt, signz, cosTheta, eta, rapidity;
     319  Double_t pt, signz, cosTheta, eta, rapidity, p, ctgTheta, phi;
    320320  const Double_t c_light = 2.99792458E8;
    321321
     
    354354    entry->DZ            = candidate->DZ;
    355355    entry->ErrorDZ       = candidate->ErrorDZ;
    356     entry->P             = candidate->P;
     356
    357357    entry->ErrorP        = candidate->ErrorP;
    358     entry->PT            = candidate->PT;
    359358    entry->ErrorPT       = candidate->ErrorPT;
    360     entry->CtgTheta      = candidate->CtgTheta;
    361359    entry->ErrorCtgTheta = candidate->ErrorCtgTheta;
    362     entry->Phi           = candidate->Phi;
    363360    entry->ErrorPhi      = candidate->ErrorPhi;
    364361
     
    370367
    371368    pt = momentum.Pt();
     369    p = momentum.P();
     370    phi = momentum.Phi();
     371    ctgTheta = (TMath::Tan(momentum.Theta()) != 0) ? 1/TMath::Tan(momentum.Theta()) : 1e10;
     372
    372373    cosTheta = TMath::Abs(momentum.CosTheta());
    373374    signz = (momentum.Pz() >= 0.0) ? 1.0 : -1.0;
     
    375376    rapidity = (cosTheta == 1.0 ? signz*999.9 : momentum.Rapidity());
    376377
     378    entry->PT  = pt;
    377379    entry->Eta = eta;
     380    entry->Phi = phi;
     381    entry->CtgTheta = ctgTheta;
    378382
    379383    particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0));
Note: See TracChangeset for help on using the changeset viewer.