Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/Isolation.cc

    r3db5282 rdf35033  
    2525 *  the transverse momenta fraction within (PTRatioMin, PTRatioMax].
    2626 *
    27  *  \author P. Demin, M. Selvaggi, R. Gerosa - UCL, Louvain-la-Neuve
     27 *  \author P. Demin - UCL, Louvain-la-Neuve
    2828 *
    2929 */
     
    109109  fUsePTSum = GetBool("UsePTSum", false);
    110110
    111   fVetoLeptons = GetBool("VetoLeptons", true); 
    112  
    113111  fClassifier->fPTMin = GetDouble("PTMin", 0.5);
    114 
    115112
    116113  // import input array(s)
     
    156153  Candidate *candidate, *isolation, *object;
    157154  TObjArray *isolationArray;
    158   Double_t sumCharged, sumNeutral, sumAllParticles, sumChargedPU, sumDBeta, ratioDBeta, sumRhoCorr, ratioRhoCorr;
     155  Double_t sum, ratio;
    159156  Int_t counter;
    160157  Double_t eta = 0.0;
     
    183180
    184181    // loop over all input tracks
    185    
    186     sumNeutral = 0.0;
    187     sumCharged = 0.0;
    188     sumChargedPU = 0.0;
    189     sumAllParticles = 0.0;
    190    
     182    sum = 0.0;
    191183    counter = 0;
    192184    itIsolationArray.Reset();
    193    
    194185    while((isolation = static_cast<Candidate*>(itIsolationArray.Next())))
    195186    {
     
    197188
    198189      if(candidateMomentum.DeltaR(isolationMomentum) <= fDeltaRMax &&
    199          candidate->GetUniqueID() != isolation->GetUniqueID() &&
    200          ( !fVetoLeptons || (TMath::Abs(candidate->PID) != 11 && (TMath::Abs(candidate->PID) != 13)) ) )
     190         candidate->GetUniqueID() != isolation->GetUniqueID())
    201191      {
    202      
    203         sumAllParticles += isolationMomentum.Pt();
    204         if(isolation->Charge !=0)
    205         {
    206           sumCharged += isolationMomentum.Pt();
    207           if(isolation->IsRecoPU != 0) sumChargedPU += isolationMomentum.Pt();
    208         }
    209  
    210         else sumNeutral += isolationMomentum.Pt();
    211  
     192        sum += isolationMomentum.Pt();
    212193        ++counter;
    213194      }
     
    228209    }
    229210
    230        
    231      // correct sum for pile-up contamination
    232     sumDBeta = sumCharged + TMath::Max(sumNeutral-0.5*sumChargedPU,0.0);
    233     sumRhoCorr = sumCharged + TMath::Max(sumNeutral-TMath::Max(rho,0.0)*fDeltaRMax*fDeltaRMax*TMath::Pi(),0.0);
    234     ratioDBeta = sumDBeta/candidateMomentum.Pt();
    235     ratioRhoCorr = sumRhoCorr/candidateMomentum.Pt();
    236    
    237     candidate->IsolationVar = ratioDBeta;
    238     candidate->IsolationVarRhoCorr = ratioRhoCorr;
    239     candidate->SumPtCharged = sumCharged;
    240     candidate->SumPtNeutral = sumNeutral;
    241     candidate->SumPtChargedPU = sumChargedPU;
    242     candidate->SumPt = sumAllParticles;
    243 
    244     if((fUsePTSum && sumDBeta > fPTSumMax) || ratioDBeta > fPTRatioMax) continue;
     211    // correct sum for pile-up contamination
     212    sum = sum - rho*fDeltaRMax*fDeltaRMax*TMath::Pi();
     213
     214    ratio = sum/candidateMomentum.Pt();
     215    if((fUsePTSum && sum > fPTSumMax) || ratio > fPTRatioMax) continue;
     216
    245217    fOutputArray->Add(candidate);
    246218  }
Note: See TracChangeset for help on using the changeset viewer.