Fork me on GitHub

Changeset fd4b326 in git for modules/EnergySmearing.cc


Ignore:
Timestamp:
Mar 17, 2021, 4:19:54 PM (4 years ago)
Author:
michele <michele.selvaggi@…>
Branches:
master
Children:
9cc5aeb
Parents:
b8a6aa3
Message:

tracks have now montecarlo mass

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/EnergySmearing.cc

    rb8a6aa3 rfd4b326  
    9595{
    9696  Candidate *candidate, *mother;
    97   Double_t pt, energy, eta, phi;
     97  Double_t pt, energy, eta, phi, m;
    9898
    9999  fItInputArray->Reset();
     
    107107    phi = candidatePosition.Phi();
    108108    energy = candidateMomentum.E();
     109    m = candidateMomentum.M();
    109110
    110111    // apply smearing formula
     
    117118    eta = candidateMomentum.Eta();
    118119    phi = candidateMomentum.Phi();
    119     candidate->Momentum.SetPtEtaPhiE(energy / TMath::CosH(eta), eta, phi, energy);
     120    pt = (energy > m) ? TMath::Sqrt(energy*energy - m*m)/TMath::CosH(eta) : 0;
     121    candidate->Momentum.SetPtEtaPhiE(pt, eta, phi, energy);
    120122    candidate->TrackResolution = fFormula->Eval(pt, eta, phi, energy) / candidateMomentum.E();
    121123    candidate->AddCandidate(mother);
Note: See TracChangeset for help on using the changeset viewer.