Fork me on GitHub

Changeset 1317 in svn for trunk


Ignore:
Timestamp:
Nov 4, 2013, 1:14:33 PM (11 years ago)
Author:
Pavel Demin
Message:

fix loop in JetPileUpSubtractor and add rho eta ranges for Isolation

Location:
trunk/modules
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/Isolation.cc

    r1267 r1317  
    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();
  • trunk/modules/Isolation.h

    r1267 r1317  
    5353  TIterator *fItCandidateInputArray; //!
    5454
     55  TIterator *fItRhoInputArray; //!
     56
    5557  const TObjArray *fIsolationInputArray; //!
    5658
  • trunk/modules/JetPileUpSubtractor.cc

    r1315 r1317  
    8383void JetPileUpSubtractor::Process()
    8484{
    85   Candidate *candidate;
     85  Candidate *candidate, *object;
    8686  TLorentzVector momentum, area;
    8787  Double_t eta = 0.0;
    8888  Double_t rho = 0.0;
    89 
    90   if(!fRhoInputArray) return;
    9189
    9290  // loop over all input candidates
     
    10098    // find rho
    10199    rho = 0.0;
    102     while((candidate = static_cast<Candidate*>(fItRhoInputArray->Next())))
     100    if(fRhoInputArray)
    103101    {
    104       if(eta >= candidate->Edges[0] && eta < candidate->Edges[1])
     102      fItRhoInputArray->Reset();
     103      while((object = static_cast<Candidate*>(fItRhoInputArray->Next())))
    105104      {
    106         rho = candidate->Momentum.Pt();
     105        if(eta >= object->Edges[0] && eta < object->Edges[1])
     106        {
     107          rho = object->Momentum.Pt();
     108        }
    107109      }
    108     } 
     110    }
    109111
    110112    // apply pile-up correction
     
    112114
    113115    momentum -= rho * area;
    114  
     116
    115117    if(momentum.Pt() <= fJetPTMin) continue;
    116118
Note: See TracChangeset for help on using the changeset viewer.