ATLAS Offline Software
JetFlavourInfo.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <vector>
8 #include <string>
9 
10 using xAOD::IParticle;
12 
13 int
15 
16  const std::string labelB = "GhostBHadronsFinal";
17  const std::string labelC = "GhostCHadronsFinal";
18  const std::string labelTau = "GhostTausFinal";
19 
20  std::vector<const IParticle*> ghostB;
21  if (jet->getAssociatedObjects<IParticle>(labelB, ghostB) && ghostB.size() > 0) return 5;
22  std::vector<const IParticle*> ghostC;
23  if (jet->getAssociatedObjects<IParticle>(labelC, ghostC) && ghostC.size() > 0) return 4;
24  std::vector<const IParticle*> ghostTau;
25  if (jet->getAssociatedObjects<IParticle>(labelTau, ghostTau) && ghostTau.size() > 0) return 15;
26  return 0;
27 }
28 
29 int
31 
32  const std::string labelB = "GhostBHadronsInitial";
33  const std::string labelC = "GhostCHadronsInitial";
34  const std::string labelTau = "GhostTausFinal";
35 
36  std::vector<const IParticle*> ghostB;
37  if (jet->getAssociatedObjects<IParticle>(labelB, ghostB) && ghostB.size() > 0) return 5;
38  std::vector<const IParticle*> ghostC;
39  if (jet->getAssociatedObjects<IParticle>(labelC, ghostC) && ghostC.size() > 0) return 4;
40  std::vector<const IParticle*> ghostTau;
41  if (jet->getAssociatedObjects<IParticle>(labelTau, ghostTau) && ghostTau.size() > 0) return 15;
42  return 0;
43 }
44 
45 int
47 
48  const std::string labelB = "GhostBQuarksFinal";
49  const std::string labelC = "GhostCQuarksFinal";
50  const std::string labelTau = "GhostTausFinal";
51 
52  std::vector<const IParticle*> ghostB;
53  if (jet->getAssociatedObjects<IParticle>(labelB, ghostB) && ghostB.size() > 0) return 5;
54  std::vector<const IParticle*> ghostC;
55  if (jet->getAssociatedObjects<IParticle>(labelC, ghostC) && ghostC.size() > 0) return 4;
56  std::vector<const IParticle*> ghostTau;
57  if (jet->getAssociatedObjects<IParticle>(labelTau, ghostTau) && ghostTau.size() > 0) return 15;
58  return 0;
59 }
60 
61 int
63  // default label means "invalid"
64  int label = -1;
65 
66  // We don't check the return value, as we would not be able to handle it gracefully anyway
67  jet->getAttribute("HadronConeExclTruthLabelID",label);
68  return label;
69 }
70 
71 int
73  // default label means "invalid"
74  int label = -1;
75 
76  // We don't check the return value, as we would not be able to handle it gracefully anyway
77  jet->getAttribute("HadronConeExclExtendedTruthLabelID",label);
78  return label;
79 }
80 
82 
83  switch (t) {
84  case GAFinalHadron: return GAFinalHadronFlavourLabel (jet); break;
85  case GAInitialHadron: return GAInitialHadronFlavourLabel (jet); break;
86  case GAFinalParton: return GAFinalPartonFlavourLabel (jet); break;
87  case ExclConeHadron: default: return ExclusiveConeHadronFlavourLabel (jet);
88  }
89 }
JetFlavourInfo.h
xAOD::GAFinalParton
@ GAFinalParton
Definition: JetFlavourInfo.h:31
xAOD::JetFlavourLabelType
JetFlavourLabelType
Definition: JetFlavourInfo.h:31
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
xAOD::GAInitialHadron
@ GAInitialHadron
Definition: JetFlavourInfo.h:31
xAOD::ExclusiveConeHadronFlavourLabel
int ExclusiveConeHadronFlavourLabel(const xAOD::Jet *jet)
Definition: JetFlavourInfo.cxx:62
xAOD::jetFlavourLabel
int jetFlavourLabel(const xAOD::Jet *jet, JetFlavourLabelType=ExclConeHadron)
Definition: JetFlavourInfo.cxx:81
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
xAOD::GAInitialHadronFlavourLabel
int GAInitialHadronFlavourLabel(const xAOD::Jet *jet)
Definition: JetFlavourInfo.cxx:30
xAOD::ExclusiveConeDoubleHadronFlavourLabel
int ExclusiveConeDoubleHadronFlavourLabel(const xAOD::Jet *jet)
Definition: JetFlavourInfo.cxx:72
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
xAOD::ExclConeHadron
@ ExclConeHadron
Definition: JetFlavourInfo.h:31
xAOD::GAFinalHadronFlavourLabel
int GAFinalHadronFlavourLabel(const xAOD::Jet *jet)
Definition: JetFlavourInfo.cxx:14
xAOD::GAFinalPartonFlavourLabel
int GAFinalPartonFlavourLabel(const xAOD::Jet *jet)
Definition: JetFlavourInfo.cxx:46
xAOD::GAFinalHadron
@ GAFinalHadron
Definition: JetFlavourInfo.h:31