Fork me on GitHub

Changeset d77b51d in git for modules/Isolation.cc


Ignore:
Timestamp:
Sep 29, 2015, 2:08:10 PM (9 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
a98c7ef
Parents:
d870fc5 (diff), 06ec139 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'upstream/master'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/Isolation.cc

    rd870fc5 rd77b51d  
    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 */
     
    153153  Candidate *candidate, *isolation, *object;
    154154  TObjArray *isolationArray;
    155   Double_t sum, ratio;
     155  Double_t sumCharged, sumNeutral, sumAllParticles, sumChargedPU, sumDBeta, ratioDBeta, sumRhoCorr, ratioRhoCorr;
    156156  Int_t counter;
    157157  Double_t eta = 0.0;
    158158  Double_t rho = 0.0;
    159 
    160   if(fRhoInputArray && fRhoInputArray->GetEntriesFast() > 0)
    161   {
    162     candidate = static_cast<Candidate*>(fRhoInputArray->At(0));
    163     rho = candidate->Momentum.Pt();
    164   }
    165159
    166160  // select isolation objects
     
    178172    const TLorentzVector &candidateMomentum = candidate->Momentum;
    179173    eta = TMath::Abs(candidateMomentum.Eta());
    180 
    181     // loop over all input tracks
    182     sum = 0.0;
    183     counter = 0;
    184     itIsolationArray.Reset();
    185     while((isolation = static_cast<Candidate*>(itIsolationArray.Next())))
    186     {
    187       const TLorentzVector &isolationMomentum = isolation->Momentum;
    188 
    189       if(candidateMomentum.DeltaR(isolationMomentum) <= fDeltaRMax &&
    190          candidate->GetUniqueID() != isolation->GetUniqueID())
    191       {
    192         sum += isolationMomentum.Pt();
    193         ++counter;
    194       }
    195     }
    196174
    197175    // find rho
     
    209187    }
    210188
    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 
     189    // loop over all input tracks
     190   
     191    sumNeutral = 0.0;
     192    sumCharged = 0.0;
     193    sumChargedPU = 0.0;
     194    sumAllParticles = 0.0;
     195   
     196    counter = 0;
     197    itIsolationArray.Reset();
     198   
     199    while((isolation = static_cast<Candidate*>(itIsolationArray.Next())))
     200    {
     201      const TLorentzVector &isolationMomentum = isolation->Momentum;
     202
     203      if(candidateMomentum.DeltaR(isolationMomentum) <= fDeltaRMax &&
     204         candidate->GetUniqueID() != isolation->GetUniqueID())
     205      {
     206        sumAllParticles += isolationMomentum.Pt();
     207        if(isolation->Charge !=0)
     208        {
     209          sumCharged += isolationMomentum.Pt();
     210          if(isolation->IsRecoPU != 0) sumChargedPU += isolationMomentum.Pt();
     211        }
     212        else
     213        {
     214          sumNeutral += isolationMomentum.Pt();
     215        }
     216        ++counter;
     217      }
     218    }
     219
     220    // find rho
     221    rho = 0.0;
     222    if(fRhoInputArray)
     223    {
     224      fItRhoInputArray->Reset();
     225      while((object = static_cast<Candidate*>(fItRhoInputArray->Next())))
     226      {
     227        if(eta >= object->Edges[0] && eta < object->Edges[1])
     228        {
     229          rho = object->Momentum.Pt();
     230        }
     231      }
     232    }
     233
     234     // correct sum for pile-up contamination
     235    sumDBeta = sumCharged + TMath::Max(sumNeutral-0.5*sumChargedPU,0.0);
     236    sumRhoCorr = sumCharged + TMath::Max(sumNeutral-TMath::Max(rho,0.0)*fDeltaRMax*fDeltaRMax*TMath::Pi(),0.0);
     237    ratioDBeta = sumDBeta/candidateMomentum.Pt();
     238    ratioRhoCorr = sumRhoCorr/candidateMomentum.Pt();
     239   
     240    candidate->IsolationVar = ratioDBeta;
     241    candidate->IsolationVarRhoCorr = ratioRhoCorr;
     242    candidate->SumPtCharged = sumCharged;
     243    candidate->SumPtNeutral = sumNeutral;
     244    candidate->SumPtChargedPU = sumChargedPU;
     245    candidate->SumPt = sumAllParticles;
     246
     247    if((fUsePTSum && sumDBeta > fPTSumMax) || (!fUsePTSum && ratioDBeta > fPTRatioMax)) continue;
    217248    fOutputArray->Add(candidate);
    218249  }
Note: See TracChangeset for help on using the changeset viewer.