Fork me on GitHub

Changeset 00f0ac8 in git for modules/TauTagging.cc


Ignore:
Timestamp:
Feb 28, 2015, 8:38:41 PM (10 years ago)
Author:
Pavel Demin <pavel-demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
2b3ef28, 5d622b2
Parents:
8ab9694 (diff), 69bf964 (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 pull request #10 from misho104/tautagging

tau-tagging should be applied also to events without tau

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/TauTagging.cc

    r8ab9694 r00f0ac8  
    203203  tauArray = fFilter->GetSubArray(fClassifier, 0);
    204204
    205   if(tauArray == 0) return;
    206 
    207   TIter itTauArray(tauArray);
    208 
    209205  // loop over all input jets
    210206  fItJetInputArray->Reset();
     
    219215
    220216    // loop over all input taus
    221     itTauArray.Reset();
    222     while((tau = static_cast<Candidate *>(itTauArray.Next())))
    223     {
    224       if(tau->D1 < 0) continue;
    225 
    226       if(tau->D1 >= fParticleInputArray->GetEntriesFast() ||
    227          tau->D2 >= fParticleInputArray->GetEntriesFast())
     217    if(tauArray){
     218      TIter itTauArray(tauArray);
     219      while((tau = static_cast<Candidate *>(itTauArray.Next())))
    228220      {
    229         throw runtime_error("tau's daughter index is greater than the ParticleInputArray size");
    230       }
    231 
    232       tauMomentum.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
    233 
    234       for(i = tau->D1; i <= tau->D2; ++i)
    235       {
    236         daughter = static_cast<Candidate *>(fParticleInputArray->At(i));
    237         if(TMath::Abs(daughter->PID) == 16) continue;
    238         tauMomentum += daughter->Momentum;
    239       }
    240 
    241       if(jetMomentum.DeltaR(tauMomentum) <= fDeltaR)
    242       {
    243         pdgCode = 15;
    244         charge = tau->Charge;
     221        if(tau->D1 < 0) continue;
     222
     223        if(tau->D1 >= fParticleInputArray->GetEntriesFast() ||
     224           tau->D2 >= fParticleInputArray->GetEntriesFast())
     225        {
     226          throw runtime_error("tau's daughter index is greater than the ParticleInputArray size");
     227        }
     228
     229        tauMomentum.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
     230
     231        for(i = tau->D1; i <= tau->D2; ++i)
     232        {
     233          daughter = static_cast<Candidate *>(fParticleInputArray->At(i));
     234          if(TMath::Abs(daughter->PID) == 16) continue;
     235          tauMomentum += daughter->Momentum;
     236        }
     237
     238        if(jetMomentum.DeltaR(tauMomentum) <= fDeltaR)
     239        {
     240          pdgCode = 15;
     241          charge = tau->Charge;
     242        }
    245243      }
    246244    }
Note: See TracChangeset for help on using the changeset viewer.