Fork me on GitHub

Changeset e9023b9 in git for modules/Isolation.cc


Ignore:
Timestamp:
Nov 4, 2013, 1:14:33 PM (11 years ago)
Author:
pavel <pavel@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
4ad7b96
Parents:
e9065e7
Message:

fix loop in JetPileUpSubtractor and add rho eta ranges for Isolation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/Isolation.cc

    re9065e7 re9023b9  
    6969Isolation::Isolation() :
    7070  fClassifier(0), fFilter(0),
    71   fItIsolationInputArray(0), fItCandidateInputArray(0)
     71  fItIsolationInputArray(0), fItCandidateInputArray(0),
     72  fItRhoInputArray(0)
    7273{
    7374  fClassifier = new IsolationClassifier;
     
    110111  {
    111112    fRhoInputArray = ImportArray(rhoInputArrayName);
     113    fItRhoInputArray = fRhoInputArray->MakeIterator();
    112114  }
    113115  else
     
    125127void Isolation::Finish()
    126128{
     129  if(fItRhoInputArray) delete fItRhoInputArray;
    127130  if(fFilter) delete fFilter;
    128131  if(fItCandidateInputArray) delete fItCandidateInputArray;
     
    134137void Isolation::Process()
    135138{
    136   Candidate *candidate, *isolation;
     139  Candidate *candidate, *isolation, *object;
    137140  TObjArray *isolationArray;
    138141  Double_t sum, ratio;
    139142  Int_t counter;
     143  Double_t eta = 0.0;
    140144  Double_t rho = 0.0;
    141145
     
    159163  {
    160164    const TLorentzVector &candidateMomentum = candidate->Momentum;
     165    eta = TMath::Abs(candidateMomentum.Eta());
    161166
    162167    // loop over all input tracks
     
    176181    }
    177182
     183    // find rho
     184    rho = 0.0;
     185    if(fRhoInputArray)
     186    {
     187      fItRhoInputArray->Reset();
     188      while((object = static_cast<Candidate*>(fItRhoInputArray->Next())))
     189      {
     190        if(eta >= object->Edges[0] && eta < object->Edges[1])
     191        {
     192          rho = object->Momentum.Pt();
     193        }
     194      }
     195    }
     196
    178197    // correct sum for pile-up contamination
    179     sum = sum - rho*fDeltaRMax*fDeltaRMax*TMath::Pi(); 
     198    sum = sum - rho*fDeltaRMax*fDeltaRMax*TMath::Pi();
    180199
    181200    ratio = sum/candidateMomentum.Pt();
Note: See TracChangeset for help on using the changeset viewer.