Fork me on GitHub

Changeset 4de073b in git


Ignore:
Timestamp:
Jan 25, 2017, 2:49:28 PM (8 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
d759c46
Parents:
d6ce231
Message:

fix TrackPileUpSubtractor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/TrackPileUpSubtractor.cc

    rd6ce231 r4de073b  
    5353//------------------------------------------------------------------------------
    5454
    55 TrackPileUpSubtractor::TrackPileUpSubtractor()
     55TrackPileUpSubtractor::TrackPileUpSubtractor() :
     56fFormula(0)
    5657{
     58  fFormula = new DelphesFormula;
    5759}
    5860
     
    6163TrackPileUpSubtractor::~TrackPileUpSubtractor()
    6264{
     65  if(fFormula) delete fFormula;
    6366}
    6467
     
    7275  fItVertexInputArray = fVertexInputArray->MakeIterator();
    7376
    74   fZVertexResolution  = GetDouble("ZVertexResolution", 0.005)*1.0E3;
     77  // read resolution formula in m
     78  fFormula->Compile(GetString("ZVertexResolution", "0.001"));
    7579
    7680  fPTMin = GetDouble("PTMin", 0.);
     
    119123  TObjArray *array;
    120124  Double_t z, zvtx=0;
     125  Double_t pt, eta, phi, e;
    121126
    122127
     
    144149    {
    145150      particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0));
     151      const TLorentzVector &candidateMomentum = particle->Momentum;
     152
     153      eta = candidateMomentum.Eta();
     154      pt = candidateMomentum.Pt();
     155      phi = candidateMomentum.Phi();
     156      e = candidateMomentum.E();
     157     
    146158      z = particle->Position.Z();
    147159
     
    149161      // assume perfect pile-up subtraction for tracks outside fZVertexResolution
    150162
    151       if(candidate->Charge !=0 && TMath::Abs(z-zvtx) > fZVertexResolution)
     163      if(candidate->Charge !=0 && TMath::Abs(z-zvtx) > fFormula->Eval(pt, eta, phi, e)* 1.0e3)
    152164      {
    153165        candidate->IsRecoPU = 1;
     
    161173  }
    162174}
    163 
    164 //------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.