ATLAS Offline Software
TruthSelectionBase.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 
7 #include "TopEvent/EventTools.h"
8 
9 #include <cmath>
10 #include <iostream>
11 
12 namespace top {
14  }
15 
17  pid = (int) std::fabs(pid);
18  if ((pid >= 511 && pid <= 545) || (pid >= 10511 && pid <= 10545) || (pid >= 20511 && pid <= 20545) ||
19  (pid >= 5112 && pid <= 5554)) { // check if it's a B-hadron
20  return true;
21  }
22  return false;
23  }
24 
26  pid = (int) std::fabs(pid);
27  if ((pid >= 400 && pid < 500 && pid != 443) || (pid >= 4000 && pid < 5000) || (pid >= 10411 && pid <= 10455) ||
28  (pid >= 20411 && pid <= 20445)) { // check if it's a C-hadron
29  return true;
30  }
31  return false;
32  }
33 }
34 
35 std::ostream& operator << (std::ostream& os, const top::TruthSelectionBase& selection) {
36  selection.print(os);
37  return os;
38 }
top::TruthSelectionBase::isBhadron
bool isBhadron(int pid) const
Definition: TruthSelectionBase.cxx:16
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
EventTools.h
A few functions for doing operations on particles / events. Currently holds code for dR,...
top::TruthSelectionBase::TruthSelectionBase
TruthSelectionBase()
Definition: TruthSelectionBase.cxx:13
TruthSelectionBase.h
top::TruthSelectionBase
Definition: TruthSelectionBase.h:19
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
top::TruthSelectionBase::isChadron
bool isChadron(int pid) const
Definition: TruthSelectionBase.cxx:25
selection
std::string selection
Definition: fbtTestBasics.cxx:73
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
operator<<
std::ostream & operator<<(std::ostream &os, const top::TruthSelectionBase &selection)
Definition: TruthSelectionBase.cxx:35