ATLAS Offline Software
TruthSelectionTtres.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 #include "TopEvent/EventTools.h"
8 
9 namespace top {
11  }
12 
14  int p = (int) std::fabs(mc.pdgId());
15  int s = mc.status();
16 
17  // secondary particles
18  if (HepMC::generations(&mc) > 0) return false;
19 
20  if (p == 11 || p == 13) {
21  if (!MC::isStable(&mc)) // only final electrons and muons for e-in-jet and isolation performance eval.
22  return false;
23 
24  return true;
25  }
26 
27  if (p == 6) {
28  if (s != 3) // tops after radiation for mtt reconstruction
29  return false;
30 
31  return true;
32  }
33 
34  if (isBhadron(p) || isChadron(p)) {
35  if (s != 3) // b and c hadrons with status 3 to match with jets
36  return false;
37 
38  return true;
39  }
40 
41  if (p == 12 || p == 14 || p == 16) {
42  if (s != 1) // only final neutrinos for m_tt reconstruction
43  return false;
44 
45  return true;
46  }
47 
48  // veto everything else
49  return false;
50  }
51 
52  void TruthSelectionTtres::print(std::ostream& os) const {
53  os << "TruthSelectionTtres\n"
54  << " * keep final electrons and muons\n"
55  << " * keep top quarks after radiation\n"
56  << " * keep b and c hadrons\n"
57  << " * keep final neutrinos\n"
58  ;
59  }
60 }
top::TruthSelectionBase::isBhadron
bool isBhadron(int pid) const
Definition: TruthSelectionBase.cxx:16
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TruthSelectionTtres.h
top::TruthSelectionTtres::print
void print(std::ostream &os) const override final
Print the cuts to the ostream.
Definition: TruthSelectionTtres.cxx:52
EventTools.h
A few functions for doing operations on particles / events. Currently holds code for dR,...
mc
Definition: mc.PG_single_nu_valid.py:1
top::TruthSelectionTtres::TruthSelectionTtres
TruthSelectionTtres()
Definition: TruthSelectionTtres.cxx:10
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
top::TruthSelectionBase::isChadron
bool isChadron(int pid) const
Definition: TruthSelectionBase.cxx:25
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
MC::isStable
bool isStable(const T &p)
Definition: HepMCHelpers.h:30
HepMC::generations
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (TODO migrate to be...
Definition: MagicNumbers.h:302
HepMCHelpers.h
top::TruthSelectionTtres::passSelection
bool passSelection(const xAOD::TruthParticle &mc) const override final
The cuts (per object) are implemented in here.
Definition: TruthSelectionTtres.cxx:13