Fork me on GitHub

Changeset 7f9ae0a in git for modules


Ignore:
Timestamp:
Jan 26, 2015, 2:34:50 PM (10 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
b62c2da
Parents:
e2d3977
Message:

Isolation modified inspired by rgerosa implementation

Location:
modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/Isolation.cc

    re2d3977 r7f9ae0a  
    2525 *  the transverse momenta fraction within (PTRatioMin, PTRatioMax].
    2626 *
    27  *  \author P. Demin - UCL, Louvain-la-Neuve
     27 *  \author P. Demin, M. Selvaggi, R. Gerosa - UCL, Louvain-la-Neuve
    2828 *
    2929 */
     
    109109  fUsePTSum = GetBool("UsePTSum", false);
    110110
     111  fVetoLeptons = GetBool("VetoLeptons", true); 
     112 
    111113  fClassifier->fPTMin = GetDouble("PTMin", 0.5);
     114
    112115
    113116  // import input array(s)
     
    153156  Candidate *candidate, *isolation, *object;
    154157  TObjArray *isolationArray;
    155   Double_t sum, ratio;
     158  Double_t sumCharged, sumNeutral, sumAllParticles, sumChargedPU, sumDBeta, ratioDBeta, sumRhoCorr, ratioRhoCorr;
    156159  Int_t counter;
    157160  Double_t eta = 0.0;
     
    180183
    181184    // loop over all input tracks
    182     sum = 0.0;
     185   
     186    sumCharged = 0.0;
     187    sumChargedPU = 0.0;
     188    sumAllParticles = 0.0;
     189   
    183190    counter = 0;
    184191    itIsolationArray.Reset();
     192   
    185193    while((isolation = static_cast<Candidate*>(itIsolationArray.Next())))
    186194    {
     
    188196
    189197      if(candidateMomentum.DeltaR(isolationMomentum) <= fDeltaRMax &&
    190          candidate->GetUniqueID() != isolation->GetUniqueID())
     198         candidate->GetUniqueID() != isolation->GetUniqueID() &&
     199         ( !fVetoLeptons || (TMath::Abs(candidate->PID) != 11 && (TMath::Abs(candidate->PID) != 13)) ) )
    191200      {
    192         sum += isolationMomentum.Pt();
     201     
     202        sumAllParticles += isolationMomentum.Pt();
     203        if(isolation->Charge !=0)
     204        {
     205          sumCharged += isolationMomentum.Pt();
     206          if(isolation->IsRecoPU != 0) sumChargedPU += isolationMomentum.Pt();
     207        }
     208 
     209        else sumNeutral += isolationMomentum.Pt();
     210 
    193211        ++counter;
    194212      }
     
    209227    }
    210228
    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 
     229       
     230     // correct sum for pile-up contamination
     231    sumDBeta = sumCharged + TMath::Max(sumNeutral-0.5*sumChargedPU,0.0);
     232    sumRhoCorr = sumCharged + TMath::Max(sumNeutral-TMath::Max(rho,0.0)*fDeltaRMax*fDeltaRMax*TMath::Pi(),0.0);
     233    ratioDBeta = sumDBeta/candidateMomentum.Pt();
     234    ratioRhoCorr = sumRhoCorr/candidateMomentum.Pt();
     235   
     236    candidate->IsolationVarDBeta = ratioDBeta;
     237    candidate->IsolationVarRhoCorr = ratioRhoCorr;
     238    candidate->chargedEnergy = sumChargedHadron;
     239    candidate->neutralEnergy = sumNeutral;
     240    candidate->chargedPUEnergy = sumChargedPU;
     241    candidate->allParticleEnergy = sumAllParticles;
     242
     243    if((fUsePTSum && sumDBeta > fPTSumMax) || ratioDBeta > fPTRatioMax) continue;
    217244    fOutputArray->Add(candidate);
    218245  }
  • modules/Isolation.h

    re2d3977 r7f9ae0a  
    5959  Bool_t fUsePTSum;
    6060
     61  Bool_t fVetoLeptons; 
     62 
    6163  IsolationClassifier *fClassifier; //!
    6264
Note: See TracChangeset for help on using the changeset viewer.