~ma5/madanalysis5/madanalysis-development

« back to all changes in this revision

Viewing changes to tools/SampleAnalyzer/Process/JetClustering/bTagger.cpp

  • Committer: Benjamin Fuks
  • Date: 2018-05-04 10:44:49 UTC
  • mfrom: (115.1.81 v1.6beta)
  • Revision ID: fuks@cern.ch-20180504104449-60h8a00loxgr8zg0
Releasing v1.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
// SampleAnalyzer headesr
26
26
#include "SampleAnalyzer/Commons/Service/RandomService.h"
27
27
#include "SampleAnalyzer/Process/JetClustering/bTagger.h"
28
 
 
 
28
#include <cmath>
29
29
 
30
30
using namespace MA5;
31
31
 
143
143
      MCParticleFormat* particle = & myEvent.mc()->particles()[N];
144
144
      while (!b)
145
145
      {
146
 
        if (particle==0)
 
146
        if (particle==0)
147
147
        {
148
148
          INFO << "No particle" << endmsg;
149
149
          break;
150
150
        }
151
151
 
152
 
        if (particle->statuscode()==3) break;
 
152
  if (particle->statuscode()==3) break;
153
153
 
154
154
        if (PHYSICS->Id->IsBHadron(particle->pdgid()) && IsLastBHadron(particle, myEvent))
155
155
        {
158
158
          break;
159
159
        }
160
160
 
161
 
        if (particle->mother2()!=0 && particle->mother2()!=particle->mother1()) break;
 
161
        if (particle->mothers().size()>1 && particle->mothers()[1]!=particle->mothers()[0]) break;
162
162
 
163
 
        particle = particle->mother1();
 
163
        particle = particle->mothers()[0];
164
164
      }
165
165
 
166
166
      if (b) break;
219
219
      MCParticleFormat* particle = & myEvent.mc()->particles()[N];
220
220
      while (!b)
221
221
      {
222
 
        if (particle==0)
 
222
       if (particle==0)
223
223
        {
224
224
          INFO << "No particle" << endmsg;
225
225
          break;
226
226
        }
227
227
 
228
 
        if (particle->statuscode()==3) break;
 
228
  if (particle->statuscode()==3) break;
229
229
 
230
230
        if (PHYSICS->Id->IsBHadron(particle->pdgid()) && IsLastBHadron(particle, myEvent))
231
231
        {
234
234
          break;
235
235
        }
236
236
 
237
 
        if (particle->mother2()!=0 && particle->mother2()!=particle->mother1()) break;
 
237
        if (particle->mothers().size()>1 && particle->mothers()[1]!=particle->mothers()[0]) break;
238
238
 
239
 
        particle = particle->mother1();
 
239
        particle = particle->mothers()[0];
240
240
      }
241
241
 
242
242
      if (b) break;
248
248
  // b-tagging using method 1
249
249
  for (unsigned int i=0;i<myEvent.mc()->particles().size();i++)
250
250
  {
251
 
    if (fabs(myEvent.mc()->particles()[i].pdgid())!=5) continue;
 
251
    if (std::abs(myEvent.mc()->particles()[i].pdgid())!=5) continue;
252
252
 
253
253
    if (!IsLast(&myEvent.mc()->particles()[i], myEvent)) continue;
254
254
 
289
289
{
290
290
  for (unsigned int i=0; i<myEvent.mc()->particles().size(); i++)
291
291
  {
292
 
    if (myEvent.mc()->particles()[i].mother1()== part)
 
292
    if (myEvent.mc()->particles()[i].mothers()[0]== part)
293
293
    {
294
294
      if (PHYSICS->Id->IsBHadron(myEvent.mc()->particles()[i].pdgid())) return false;
295
295
    }