Fork me on GitHub

Ignore:
Timestamp:
Nov 4, 2013, 11:59:27 AM (11 years ago)
Author:
pavel <pavel@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
e9065e7
Parents:
498cda4
Message:

add eta ranges for rho

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/JetPileUpSubtractor.cc

    r498cda4 r8336b6e  
    3939
    4040JetPileUpSubtractor::JetPileUpSubtractor() :
    41   fItJetInputArray(0)
     41  fItJetInputArray(0), fItRhoInputArray(0)
    4242{
    4343
     
    6363
    6464  fRhoInputArray = ImportArray(GetString("RhoInputArray", "Rho/rho"));
     65  fItRhoInputArray = fRhoInputArray->MakeIterator();
    6566
    6667  // create output array(s)
     
    7475void JetPileUpSubtractor::Finish()
    7576{
     77  if(fItRhoInputArray) delete fItRhoInputArray;
    7678  if(fItJetInputArray) delete fItJetInputArray;
    7779}
     
    8385  Candidate *candidate;
    8486  TLorentzVector momentum, area;
     87  Double_t eta = 0.0;
    8588  Double_t rho = 0.0;
    8689
    87   if(fRhoInputArray && fRhoInputArray->GetEntriesFast() > 0)
    88   {
    89     candidate = static_cast<Candidate*>(fRhoInputArray->At(0));
    90     rho = candidate->Momentum.Pt();
    91   }
     90  if(!fRhoInputArray) return;
    9291
    9392  // loop over all input candidates
     
    9796    momentum = candidate->Momentum;
    9897    area = candidate->Area;
     98    eta = TMath::Abs(momentum.Eta());
     99
     100    // find rho
     101    rho = 0.0;
     102    while((candidate = static_cast<Candidate*>(fItRhoInputArray->Next())))
     103    {
     104      if(eta >= candidate->Edges[0] && eta < candidate->Edges[1])
     105      {
     106        rho = candidate->Momentum.Pt();
     107      }
     108    } 
    99109
    100110    // apply pile-up correction
Note: See TracChangeset for help on using the changeset viewer.