Fork me on GitHub

Changeset 69bf964 in git


Ignore:
Timestamp:
Feb 28, 2015, 7:29:27 PM (10 years ago)
Author:
Sho Iwamoto <contact@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
00f0ac8
Parents:
8ab9694
Message:

tau-tagging should be applied also to events without tau

When an event has no taus, the classifier in TauTagging.cc returns 0 (null pointer).
Even though, tau-tagging should be run to consider mis-tagging of jets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/TauTagging.cc

    r8ab9694 r69bf964  
    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.