Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/EnergySmearing.cc

    r341014c 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.