25{
26 bool isLargeR = false;
27 if (argc == 2)
28 isLargeR = TString(argv[1]).EqualTo("true",TString::kIgnoreCase) || TString(argv[1]).EqualTo("largeR",TString::kIgnoreCase) || TString(argv[1]).EqualTo("large-R",TString::kIgnoreCase);
29
30 StatusCode::enableFailure();
31
33
34 if (!isLargeR &&
tool->setProperty(
"JetDefinition",
"AntiKt4EMTopo").isFailure())
36 if (isLargeR &&
tool->setProperty(
"JetDefinition",
"AntiKt10LCTopoTrimmedPtFrac5SmallR20").isFailure())
38
39 if (
tool->setProperty(
"MCType",
"MC15").isFailure())
41
42
43 if (!isLargeR &&
tool->setProperty(
"ConfigFile",
"JES_2015/Moriond2016/JES2015_AllNuisanceParameters.config").isFailure())
45
46 if (isLargeR &&
tool->setProperty(
"ConfigFile",
"UJ_2015/Moriond2016/UJ2015_WZTagging_medium.config").isFailure())
48
49 if (
tool->setScaleToGeV().isFailure())
51 if (
tool->initialize().isFailure())
53
54
55
62
63
68
69
70
71
72
73
74
75
76
77
78
79
80 std::vector<std::string>
categories =
tool->getComponentCategories();
81 for (
size_t iCat = 0; iCat <
categories.size(); ++iCat)
82 {
83 printf(
"Category %s:\n",
categories.at(iCat).c_str());
84 std::vector<std::string> compInCategory =
tool->getComponentNamesInCategory(
categories.at(iCat));
85 for (size_t iComp = 0; iComp < compInCategory.size(); ++iComp)
86 printf("\t\t%s\n",compInCategory.at(iComp).c_str());
87 }
88
89
90
94 printf(
"\nRecommended systematics (%zux2+1=%zu%s):\n",recommendedSystematics.
size(),sysList.size(),recommendedSystematics.
size()*2+1==sysList.size()?
"":
" FAILED");
95 for (size_t iSyst = 0; iSyst < sysList.size(); ++iSyst)
96 if (sysList.at(iSyst).name() == "")
97 printf("\t%40s\n","NOMINAL");
98 else
99 printf("\t%40s%s",sysList.at(iSyst).name().c_str(),iSyst%2==0?"\n":"");
100 printf("\n");
101
102
103
104 if (!isLargeR)
105 {
106
107
108 printf(
"Recognizes JET_Flavor_Response__continuous: %s\n",
tool->isAffectedBySystematic(
CP::SystematicVariation(
"JET_Flavor_Response__continuous"))?
"true":
"false");
109 printf(
"Recognizes JET_Flavor_Response: %s\n",
tool->isAffectedBySystematic(
CP::SystematicVariation(
"JET_Flavor_Response"))?
"true":
"false");
110
111
112
113
114
115
116
120 IsBjet(*
jet) =
false;
121
122
126 NPV(*eInfo) = 11;
127
128
129
130
131 printf("Trying (Flavor_Response)x(-1.5) + (PunchThrough_MC15)x(+1.5)\n");
135 if (
tool->applySystematicVariation(*syst) != StatusCode::SUCCESS)
137
138
140 printf(
"%20s: (pT,eta) = (%.0f,%.1f)",
"below eta boundary",
jet->pt(),
jet->eta());
143 printf(
" --> (%.0f,%.1f)\n",
jet->pt(),
jet->eta());
144
145
146 delete syst;
150 if (
tool->applySystematicVariation(*syst) != StatusCode::SUCCESS)
152
153
155 printf(
"%20s: (pT,eta) = (%.0f,%.1f)",
"(Flavor)x(+1.5)",
jet->pt(),
jet->eta());
158 printf(
" --> (%.0f,%.1f)\n",
jet->pt(),
jet->eta());
159
160
162 printf(
"%20s: (pT,eta) = (%.0f,%.1f)",
"exact eta boundary",
jet->pt(),
jet->eta());
165 printf(
" --> (%.0f,%.1f)\n",
jet->pt(),
jet->eta());
166
167
169 printf(
"%20s: (pT,eta) = (%.0f,%.1f)",
"Nsegments=0",
jet->pt(),
jet->eta());
172 printf(
" --> (%.0f,%.1f)\n",
jet->pt(),
jet->eta());
173
174
176 Nsegments(*
jet) = 20;
177 printf(
"%20s: (pT,eta) = (%.0f,%.1f)",
"Nsegments=20",
jet->pt(),
jet->eta());
181 printf(
" --> (%.0f,%.1f)\n",
jet->pt(),
jet->eta());
182 }
183
184 else
185 {
186
187 printf(
"Recognizes JET_Rtrk_Baseline__continuous: %s\n",
tool->isAffectedBySystematic(
CP::SystematicVariation(
"JET_Rtrk_Baseline__continuous"))?
"true":
"false");
188 printf(
"Recognizes JET_Rtrk_Baseline: %s\n",
tool->isAffectedBySystematic(
CP::SystematicVariation(
"JET_Rtrk_Baseline"))?
"true":
"false");
189
190
191
192
193 printf("Trying (Rtrk_Baseline)x(-1.5) + (Rtrk_Modelling)x(+1.5)\n");
197 if (
tool->applySystematicVariation(*syst) != StatusCode::SUCCESS)
199
200
201
204
205
207 printf(
"%20s: (pT,eta,phi,m,D2) = (%.0f,%.1f,%.1f,%.0f,%.1f)",
"Normal W/Z jet",
jet->pt(),
jet->eta(),
jet->phi(),
jet->m(),accD2(*
jet));
210 printf(
" --> (%.0f,%.1f,%.1f,%.0f,%0.1f)\n",
jet->pt(),
jet->eta(),
jet->phi(),
jet->m(),accD2(*
jet));
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227 printf("\n");
229 printf(
"Validity of (pT,eta,phi,m,D2) = (%.0f,%.1f,%.1f,%.0f,%.1f) : %s\n",
jet->pt(),
jet->eta(),
jet->phi(),
jet->m(),accD2(*
jet), (
tool->applyCorrection(*
jet,*eInfo) ==
CP::CorrectionCode::Ok) ?
"ok" : (
tool->applyCorrection(*
jet,*eInfo) ==
CP::CorrectionCode::OutOfValidityRange) ?
"invalid" :
"ERROR");
231 printf(
"Validity of (pT,eta,phi,m,D2) = (%.0f,%.1f,%.1f,%.0f,%.1f) : %s\n",
jet->pt(),
jet->eta(),
jet->phi(),
jet->m(),accD2(*
jet), (
tool->applyCorrection(*
jet,*eInfo) ==
CP::CorrectionCode::Ok) ?
"ok" : (
tool->applyCorrection(*
jet,*eInfo) ==
CP::CorrectionCode::OutOfValidityRange) ?
"invalid" :
"ERROR");
233 printf(
"Validity of (pT,eta,phi,m,D2) = (%.0f,%.1f,%.1f,%.0f,%.1f) : %s\n",
jet->pt(),
jet->eta(),
jet->phi(),
jet->m(),accD2(*
jet), (
tool->applyCorrection(*
jet,*eInfo) ==
CP::CorrectionCode::Ok) ?
"ok" : (
tool->applyCorrection(*
jet,*eInfo) ==
CP::CorrectionCode::OutOfValidityRange) ?
"invalid" :
"ERROR");
235 printf(
"Validity of (pT,eta,phi,m,D2) = (%.0f,%.1f,%.1f,%.0f,%.1f) : %s\n",
jet->pt(),
jet->eta(),
jet->phi(),
jet->m(),accD2(*
jet), (
tool->applyCorrection(*
jet,*eInfo) ==
CP::CorrectionCode::Ok) ?
"ok" : (
tool->applyCorrection(*
jet,*eInfo) ==
CP::CorrectionCode::OutOfValidityRange) ?
"invalid" :
"ERROR");
237 printf(
"Validity of (pT,eta,phi,m,D2) = (%.0f,%.1f,%.1f,%.0f,%.1f) : %s\n",
jet->pt(),
jet->eta(),
jet->phi(),
jet->m(),accD2(*
jet), (
tool->applyCorrection(*
jet,*eInfo) ==
CP::CorrectionCode::Ok) ?
"ok" : (
tool->applyCorrection(*
jet,*eInfo) ==
CP::CorrectionCode::OutOfValidityRange) ?
"invalid" :
"ERROR");
239 printf(
"Validity of (pT,eta,phi,m,D2) = (%.0f,%.1f,%.1f,%.0f,%.1f) : %s\n",
jet->pt(),
jet->eta(),
jet->phi(),
jet->m(),accD2(*
jet), (
tool->applyCorrection(*
jet,*eInfo) ==
CP::CorrectionCode::Ok) ?
"ok" : (
tool->applyCorrection(*
jet,*eInfo) ==
CP::CorrectionCode::OutOfValidityRange) ?
"invalid" :
"ERROR");
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254 }
255
256 return 0;
257}
@ OutOfValidityRange
Input object is out of validity range.
@ Ok
The correction was done successfully.
This module implements the central registry for handling systematic uncertainties with CP tools.
const SystematicSet & recommendedSystematics() const
returns: the recommended set of systematics
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Class to wrap a set of SystematicVariations.
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
size_t size() const
returns: size of the set
const T * at(size_type n) const
Access an element, as an rvalue.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::Accessor< T, ALLOC > Accessor
Tool for accessing xAOD files outside of Athena.
A relatively simple transient store for objects created in analysis.
std::vector< CP::SystematicSet > make_systematics_vector(const SystematicSet &systematics)
utility functions for working with systematics
Jet_v1 Jet
Definition of the current "jet version".
EventInfoContainer_v1 EventInfoContainer
Define the latest version of the container.
EventInfo_v1 EventInfo
Definition of the latest event info version.
EventInfoAuxContainer_v1 EventInfoAuxContainer
Define the latest version of the auxiliary container.
JetAuxContainer_v1 JetAuxContainer
Definition of the current jet auxiliary container.
JetContainer_v1 JetContainer
Definition of the current "jet container version".
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.