ATLAS Offline Software
JetObjectCollectionMaker.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id: JetObjectCollectionMaker.h 809674 2017-08-23 14:10:24Z iconnell $
6 #ifndef ANALYSISTOP_TOPSYSTEMATICOBJECTMAKER_JETOBJECTCOLLECTIONMAKER_H
7 #define ANALYSISTOP_TOPSYSTEMATICOBJECTMAKER_JETOBJECTCOLLECTIONMAKER_H
8 
27 // system include(s):
28 #include <memory>
29 #include <set>
30 #include <list>
31 #include <unordered_map>
32 
33 
34 // Framework include(s):
35 #include "AsgTools/AsgTool.h"
36 #include "AsgTools/ToolHandle.h"
38 
39 // Systematic include(s):
41 
42 // CP Tool include(s):
48 
50 
54 
55 // Forward declaration(s):
56 namespace top {
57  class TopConfig;
58 }
59 
60 namespace top {
61  class JetObjectCollectionMaker final: public asg::AsgTool {
62  using systMap = std::unordered_map<CP::SystematicSet, CP::SystematicSet>;
63  public:
64  explicit JetObjectCollectionMaker(const std::string& name);
66 
67  // Delete Standard constructors
71 
73 
74  StatusCode executeJets(bool);
77 
80 
81  // return specific Systematic
82  inline virtual const std::list<CP::SystematicSet>& specifiedSystematics() const {return m_specifiedSystematics;}
83  inline virtual const std::list<CP::SystematicSet>& specifiedSystematicsLargeR() const {
85  }
86 
87  // return all recommendedSystematics
88  inline const std::list<CP::SystematicSet>& recommendedSystematics() const {return m_recommendedSystematics;}
89  protected:
90 
91  // Function will return prefix which will be added to systematic names obtained from tools
92  virtual std::string getLargeRModName(const std::string& NPModel) const;
93  // specify Systematic
94  virtual void addSystematics(const std::set<std::string>& specifiedSystematics,
95  const CP::SystematicSet& recommendedSysts,
96  std::unordered_map<CP::SystematicSet, CP::SystematicSet>& map,
97  const std::string& modName, bool isLargeR = false,
98  bool onlyJER = false,
99  bool isPseudoData = false);
100 
101  StatusCode execute(const bool isLargeR, bool executeNominal);
102 
103  StatusCode calibrate(const bool isLargeR);
104  virtual StatusCode applySystematic(ToolHandle<ICPJetUncertaintiesTool>& tool,
105  const std::unordered_map<CP::SystematicSet, CP::SystematicSet>& map,
106  bool isLargeR = false);
107 
109 
110 
111  StatusCode printout(const bool isLargeR);
112 
113  private:
114  std::shared_ptr<top::TopConfig> m_config;
119  bool m_isMC;
121  bool m_do_fjvt = false;
122 
123  std::list<CP::SystematicSet> m_specifiedSystematics;
124  std::list<CP::SystematicSet> m_specifiedSystematicsLargeR;
125  std::list<CP::SystematicSet> m_specifiedSystematicsTrackJets;
126  std::list<CP::SystematicSet> m_recommendedSystematics;
128 
129  ToolHandle<IJetCalibrationTool> m_jetCalibrationTool;
130  ToolHandle<IJetCalibrationTool> m_jetCalibrationToolLargeR;
131 
132  ToolHandle<ICPJetUncertaintiesTool> m_jetUncertaintiesTool;
133  ToolHandle<ICPJetUncertaintiesTool> m_jetUncertaintiesToolPseudoData;
134  ToolHandle<ICPJetUncertaintiesTool> m_jetUncertaintiesToolReducedNPScenario1;
135  ToolHandle<ICPJetUncertaintiesTool> m_jetUncertaintiesToolReducedNPScenario2;
136  ToolHandle<ICPJetUncertaintiesTool> m_jetUncertaintiesToolReducedNPScenario3;
137  ToolHandle<ICPJetUncertaintiesTool> m_jetUncertaintiesToolReducedNPScenario4;
138 
139  ToolHandle<ICPJetUncertaintiesTool> m_jetUncertaintiesToolLargeR;
140  ToolHandle<ICPJetUncertaintiesTool> m_jetUncertaintiesToolLargeRPseudoData;
141  std::unordered_map<std::string, ToolHandle<ICPJetUncertaintiesTool> > m_tagSFuncertTool;
142  std::unordered_map<std::string, std::vector<CP::SystematicSet>> m_tagSFUncorrelatedSystematics; // Uncertainties name fo
143  std::unordered_map<std::string, std::vector<std::string>> m_tagSFSysNames;
144  ToolHandle<ICPJetCorrectionTool> m_FFJetSmearingTool;
145 
146  // do decorate the large-R jets with the boosted-tagging flags
147  // and decorate jets with TAccept object containing detailed tag result informaiton
148  // https://twiki.cern.ch/twiki/bin/view/AtlasProtected/BoostedJetTaggingRecommendation2017#TAcceptUsageSection
149  std::unordered_map<std::string, ToolHandle<IJetDecorator> > m_boostedJetTaggers;
150 
151  ToolHandle<IJetUpdateJvt> m_jetUpdateJvtTool;
152  ToolHandle<CP::IJetJvtEfficiency> m_jetJvtEfficiencyTool;
153  ToolHandle<IJetModifier> m_jetSelectfJvtTool;
154 
155  std::string m_truthJetCollForHS;
156 
157  std::unique_ptr<top::TopJetSubstructure> m_jetSubstructure;
158 
167 
168  typedef std::unordered_map<CP::SystematicSet, CP::SystematicSet>::const_iterator Itr;
169 
175 
177  std::unique_ptr<JetTruthLabelingTool> m_jetTruthLabelingTool;
178 
179  // DL1 decoration
180  std::unordered_map<std::string, ToolHandle<IBTaggingSelectionTool> > m_btagSelToolsDL1Decor;
181  std::unordered_map<std::string, ToolHandle<IBTaggingSelectionTool> > m_btagSelToolsDL1Decor_trkJet;
182  StatusCode decorateDL1(bool trackJets = false);
183 
184  std::unordered_map<std::string, SG::AuxElement::Decorator<float>> DLx;
185  };
186 } // namespace
187 #endif
top::JetObjectCollectionMaker::m_recommendedSystematics
std::list< CP::SystematicSet > m_recommendedSystematics
Definition: JetObjectCollectionMaker.h:126
top::JetObjectCollectionMaker::execute
StatusCode execute(const bool isLargeR, bool executeNominal)
Definition: JetObjectCollectionMaker.cxx:342
top::JetObjectCollectionMaker::calibrate
StatusCode calibrate(const bool isLargeR)
Definition: JetObjectCollectionMaker.cxx:408
top::JetObjectCollectionMaker::executeTrackJets
StatusCode executeTrackJets(bool)
Definition: JetObjectCollectionMaker.cxx:753
top::JetObjectCollectionMaker::m_doFull_JER_largeR
bool m_doFull_JER_largeR
Definition: JetObjectCollectionMaker.h:117
top::JetObjectCollectionMaker::m_jetUncertaintiesToolLargeRPseudoData
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesToolLargeRPseudoData
Definition: JetObjectCollectionMaker.h:140
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
top::JetObjectCollectionMaker::addSystematics
virtual void addSystematics(const std::set< std::string > &specifiedSystematics, const CP::SystematicSet &recommendedSysts, std::unordered_map< CP::SystematicSet, CP::SystematicSet > &map, const std::string &modName, bool isLargeR=false, bool onlyJER=false, bool isPseudoData=false)
Definition: JetObjectCollectionMaker.cxx:819
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::JetObjectCollectionMaker::m_jetUncertaintiesTool
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesTool
Definition: JetObjectCollectionMaker.h:132
top::JetObjectCollectionMaker::JetObjectCollectionMaker
JetObjectCollectionMaker(const JetObjectCollectionMaker &rhs)=delete
top::JetObjectCollectionMaker::~JetObjectCollectionMaker
virtual ~JetObjectCollectionMaker()
Definition: JetObjectCollectionMaker.h:65
top::JetObjectCollectionMaker::executeLargeRJets
StatusCode executeLargeRJets(bool)
Definition: JetObjectCollectionMaker.cxx:336
top::JetObjectCollectionMaker::applyTaggingSFSystematic
virtual StatusCode applyTaggingSFSystematic()
Definition: JetObjectCollectionMaker.cxx:569
top::JetObjectCollectionMaker::JetObjectCollectionMaker
JetObjectCollectionMaker(const std::string &name)
Definition: JetObjectCollectionMaker.cxx:26
top::JetObjectCollectionMaker::tagLargeRJets
StatusCode tagLargeRJets(const xAOD::JetContainer &jet)
Definition: JetObjectCollectionMaker.cxx:884
top::JetObjectCollectionMaker::m_btagSelToolsDL1Decor_trkJet
std::unordered_map< std::string, ToolHandle< IBTaggingSelectionTool > > m_btagSelToolsDL1Decor_trkJet
Definition: JetObjectCollectionMaker.h:181
SystematicSet.h
top::JetObjectCollectionMaker::m_tagSFUncorrelatedSystematics
std::unordered_map< std::string, std::vector< CP::SystematicSet > > m_tagSFUncorrelatedSystematics
Definition: JetObjectCollectionMaker.h:142
top::JetObjectCollectionMaker::m_jetJvtEfficiencyTool
ToolHandle< CP::IJetJvtEfficiency > m_jetJvtEfficiencyTool
Definition: JetObjectCollectionMaker.h:152
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
top::JetObjectCollectionMaker::printoutJets
StatusCode printoutJets()
Definition: JetObjectCollectionMaker.cxx:785
JetConstituentVector.h
This file defines helper classes to deal with jet constituents.
top::JetObjectCollectionMaker::m_do_fjvt
bool m_do_fjvt
Definition: JetObjectCollectionMaker.h:121
top::JetObjectCollectionMaker::initialize
StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: JetObjectCollectionMaker.cxx:88
top::JetObjectCollectionMaker::systMap
std::unordered_map< CP::SystematicSet, CP::SystematicSet > systMap
Definition: JetObjectCollectionMaker.h:62
IJetDecorator.h
top::JetObjectCollectionMaker::m_systMap_JERPseudo
systMap m_systMap_JERPseudo
Definition: JetObjectCollectionMaker.h:160
top::JetObjectCollectionMaker::m_config
std::shared_ptr< top::TopConfig > m_config
Definition: JetObjectCollectionMaker.h:114
top::JetObjectCollectionMaker::m_FFJetSmearingTool
ToolHandle< ICPJetCorrectionTool > m_FFJetSmearingTool
Definition: JetObjectCollectionMaker.h:144
IJetCalibrationTool.h
top::JetObjectCollectionMaker::getLargeRModName
virtual std::string getLargeRModName(const std::string &NPModel) const
Definition: JetObjectCollectionMaker.cxx:814
top::JetObjectCollectionMaker::m_jetUncertaintiesToolReducedNPScenario3
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesToolReducedNPScenario3
Definition: JetObjectCollectionMaker.h:136
top::JetObjectCollectionMaker::decorateMatchedTruth
StatusCode decorateMatchedTruth()
Definition: JetObjectCollectionMaker.cxx:944
top::JetObjectCollectionMaker::m_specifiedSystematicsLargeR
std::list< CP::SystematicSet > m_specifiedSystematicsLargeR
Definition: JetObjectCollectionMaker.h:124
top::JetObjectCollectionMaker::specifiedSystematicsLargeR
virtual const std::list< CP::SystematicSet > & specifiedSystematicsLargeR() const
Definition: JetObjectCollectionMaker.h:83
top::JetObjectCollectionMaker::m_jetSubstructure
std::unique_ptr< top::TopJetSubstructure > m_jetSubstructure
Definition: JetObjectCollectionMaker.h:157
top::JetObjectCollectionMaker::applySystematic
virtual StatusCode applySystematic(ToolHandle< ICPJetUncertaintiesTool > &tool, const std::unordered_map< CP::SystematicSet, CP::SystematicSet > &map, bool isLargeR=false)
Definition: JetObjectCollectionMaker.cxx:627
top::JetObjectCollectionMaker::m_jetUncertaintiesToolPseudoData
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesToolPseudoData
Definition: JetObjectCollectionMaker.h:133
top::JetObjectCollectionMaker::m_jetCalibrationTool
ToolHandle< IJetCalibrationTool > m_jetCalibrationTool
Definition: JetObjectCollectionMaker.h:129
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
IBTaggingSelectionTool.h
top::JetObjectCollectionMaker::m_systMap_LargeR
systMap m_systMap_LargeR
Definition: JetObjectCollectionMaker.h:165
top::JetObjectCollectionMaker::printout
StatusCode printout(const bool isLargeR)
Definition: JetObjectCollectionMaker.cxx:797
top::JetObjectCollectionMaker::m_nominalSystematicSet
CP::SystematicSet m_nominalSystematicSet
Definition: JetObjectCollectionMaker.h:127
top::JetObjectCollectionMaker::m_systMap_ReducedNPScenario3
systMap m_systMap_ReducedNPScenario3
Definition: JetObjectCollectionMaker.h:163
top::JetObjectCollectionMaker::m_jetUncertaintiesToolReducedNPScenario4
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesToolReducedNPScenario4
Definition: JetObjectCollectionMaker.h:137
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
top::JetObjectCollectionMaker::m_truthJetCollForHS
std::string m_truthJetCollForHS
Definition: JetObjectCollectionMaker.h:155
top::JetObjectCollectionMaker::decorateBJets
StatusCode decorateBJets(xAOD::Jet &jet)
Definition: JetObjectCollectionMaker.cxx:903
top::JetObjectCollectionMaker::m_systMap_ReducedNPScenario2
systMap m_systMap_ReducedNPScenario2
Definition: JetObjectCollectionMaker.h:162
top::JetObjectCollectionMaker::recommendedSystematics
const std::list< CP::SystematicSet > & recommendedSystematics() const
Definition: JetObjectCollectionMaker.h:88
top::JetObjectCollectionMaker::m_tagSFSysNames
std::unordered_map< std::string, std::vector< std::string > > m_tagSFSysNames
Definition: JetObjectCollectionMaker.h:143
JetTruthLabelingTool.h
top::JetObjectCollectionMaker::m_jetUncertaintiesToolReducedNPScenario2
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesToolReducedNPScenario2
Definition: JetObjectCollectionMaker.h:135
top::JetObjectCollectionMaker::decorateHSJets
StatusCode decorateHSJets()
Definition: JetObjectCollectionMaker.cxx:915
top::JetObjectCollectionMaker::m_jetTruthLabelingTool
std::unique_ptr< JetTruthLabelingTool > m_jetTruthLabelingTool
– Large R jet truth labeling –///
Definition: JetObjectCollectionMaker.h:177
top::JetObjectCollectionMaker::m_systMap_AllNP
systMap m_systMap_AllNP
Definition: JetObjectCollectionMaker.h:159
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
top::JetObjectCollectionMaker::m_doFull_JER_largeR_Pseudodata
bool m_doFull_JER_largeR_Pseudodata
Definition: JetObjectCollectionMaker.h:118
top::JetObjectCollectionMaker::m_systMap_ReducedNPScenario4
systMap m_systMap_ReducedNPScenario4
Definition: JetObjectCollectionMaker.h:164
ICPJetCorrectionTool.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
top::JetObjectCollectionMaker::m_boostedJetTaggers
std::unordered_map< std::string, ToolHandle< IJetDecorator > > m_boostedJetTaggers
Definition: JetObjectCollectionMaker.h:149
top::JetObjectCollectionMaker::m_jetSelectfJvtTool
ToolHandle< IJetModifier > m_jetSelectfJvtTool
Definition: JetObjectCollectionMaker.h:153
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
ICPJetUncertaintiesTool.h
top::JetObjectCollectionMaker::operator=
JetObjectCollectionMaker & operator=(const JetObjectCollectionMaker &rhs)=delete
top::JetObjectCollectionMaker::m_doMultipleJES
bool m_doMultipleJES
Definition: JetObjectCollectionMaker.h:120
top::JetObjectCollectionMaker::m_jetCalibrationToolLargeR
ToolHandle< IJetCalibrationTool > m_jetCalibrationToolLargeR
Definition: JetObjectCollectionMaker.h:130
top::JetObjectCollectionMaker::m_doFull_JER
bool m_doFull_JER
Definition: JetObjectCollectionMaker.h:115
top::JetObjectCollectionMaker::m_jetUpdateJvtTool
ToolHandle< IJetUpdateJvt > m_jetUpdateJvtTool
Definition: JetObjectCollectionMaker.h:151
top::JetObjectCollectionMaker::tagNominalLargeRJets
StatusCode tagNominalLargeRJets()
Definition: JetObjectCollectionMaker.cxx:873
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
top::JetObjectCollectionMaker::m_specifiedSystematicsTrackJets
std::list< CP::SystematicSet > m_specifiedSystematicsTrackJets
Definition: JetObjectCollectionMaker.h:125
top::JetObjectCollectionMaker::specifiedSystematics
virtual const std::list< CP::SystematicSet > & specifiedSystematics() const
Definition: JetObjectCollectionMaker.h:82
top::JetObjectCollectionMaker::JetObjectCollectionMaker
JetObjectCollectionMaker(JetObjectCollectionMaker &&rhs)=delete
top::JetObjectCollectionMaker::m_tagSFuncertTool
std::unordered_map< std::string, ToolHandle< ICPJetUncertaintiesTool > > m_tagSFuncertTool
Definition: JetObjectCollectionMaker.h:141
BchCleanup.modName
modName
Definition: BchCleanup.py:201
IJetUpdateJvt.h
top::JetObjectCollectionMaker::m_jetUncertaintiesToolReducedNPScenario1
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesToolReducedNPScenario1
Definition: JetObjectCollectionMaker.h:134
top::JetObjectCollectionMaker::m_btagSelToolsDL1Decor
std::unordered_map< std::string, ToolHandle< IBTaggingSelectionTool > > m_btagSelToolsDL1Decor
Definition: JetObjectCollectionMaker.h:180
top::JetObjectCollectionMaker::m_systMap_ReducedNPScenario1
systMap m_systMap_ReducedNPScenario1
Definition: JetObjectCollectionMaker.h:161
top::JetObjectCollectionMaker::DLx
std::unordered_map< std::string, SG::AuxElement::Decorator< float > > DLx
Definition: JetObjectCollectionMaker.h:184
top::JetObjectCollectionMaker::m_doFull_JER_Pseudodata
bool m_doFull_JER_Pseudodata
Definition: JetObjectCollectionMaker.h:116
TopJetSubstructure.h
ToolHandle.h
top::JetObjectCollectionMaker::executeJets
StatusCode executeJets(bool)
Definition: JetObjectCollectionMaker.cxx:330
top::JetObjectCollectionMaker::m_isMC
bool m_isMC
Definition: JetObjectCollectionMaker.h:119
AsgTool.h
top::JetObjectCollectionMaker::Itr
std::unordered_map< CP::SystematicSet, CP::SystematicSet >::const_iterator Itr
Definition: JetObjectCollectionMaker.h:168
top::JetObjectCollectionMaker::m_specifiedSystematics
std::list< CP::SystematicSet > m_specifiedSystematics
Definition: JetObjectCollectionMaker.h:123
top::JetObjectCollectionMaker::decorateDL1
StatusCode decorateDL1(bool trackJets=false)
Definition: JetObjectCollectionMaker.cxx:990
top::JetObjectCollectionMaker
Definition: JetObjectCollectionMaker.h:61
IJetJvtEfficiency.h
top::JetObjectCollectionMaker::printoutLargeRJets
StatusCode printoutLargeRJets()
Definition: JetObjectCollectionMaker.cxx:791
top::JetObjectCollectionMaker::m_systMap_LargeR_JERPseudo
systMap m_systMap_LargeR_JERPseudo
Definition: JetObjectCollectionMaker.h:166
top::JetObjectCollectionMaker::m_jetUncertaintiesToolLargeR
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesToolLargeR
Definition: JetObjectCollectionMaker.h:139