Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/MomentumSmearing.cc

    r341014c r27197df  
    7878  fItInputArray = fInputArray->MakeIterator();
    7979
     80  // switch to compute momentum smearing based on momentum vector eta, phi
     81  fUseMomentumVector = GetBool("UseMomentumVector", false);
     82
    8083  // create output array
    8184
     
    9598{
    9699  Candidate *candidate, *mother;
    97   Double_t pt, eta, phi, e, res;
     100  Double_t pt, eta, phi, e, m, res;
    98101
    99102  fItInputArray->Reset();
     
    104107    eta = candidatePosition.Eta();
    105108    phi = candidatePosition.Phi();
     109
     110    if (fUseMomentumVector){
     111      eta = candidateMomentum.Eta();
     112      phi = candidateMomentum.Phi();
     113    }
     114
    106115    pt = candidateMomentum.Pt();
    107116    e = candidateMomentum.E();
    108     res = fFormula->Eval(pt, eta, phi, e);
     117    m = candidateMomentum.M();
     118    res = fFormula->Eval(pt, eta, phi, e, candidate);
    109119
    110120    // apply smearing formula
     
    121131    eta = candidateMomentum.Eta();
    122132    phi = candidateMomentum.Phi();
    123     candidate->Momentum.SetPtEtaPhiE(pt, eta, phi, pt * TMath::CosH(eta));
     133    candidate->Momentum.SetPtEtaPhiM(pt, eta, phi, m);
    124134    //candidate->TrackResolution = fFormula->Eval(pt, eta, phi, e);
    125135    candidate->TrackResolution = res;
Note: See TracChangeset for help on using the changeset viewer.