ATLAS Offline Software
Loading...
Searching...
No Matches
TauEfficiencyCorrectionsTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// EDM include(s):
8
9// Local include(s):
13
15
16namespace TauAnalysisTools
17{
18
19//______________________________________________________________________________
21 : asg::AsgMetadataTool( sName )
22 , m_bIsData(false)
23 , m_bIsConfigured(false)
24 , m_iRunNumber(0)
25{}
26
27//______________________________________________________________________________
30
31//______________________________________________________________________________
33{
34 ATH_MSG_INFO( "Initializing TauEfficiencyCorrectionsTool" );
35
37
39 ATH_MSG_WARNING("Truth match check will be skipped. This is ONLY FOR TESTING PURPOSE!");
40
41 // check efficiency correction type
43 {
44 ATH_MSG_ERROR("Could not retrieve any EfficiencyCorrectionType");
45 return StatusCode::FAILURE;
46 }
47
48 if(m_sRecommendationTag == "2025-prerec") {
50 } else {
51 ATH_MSG_ERROR("Unknown RecommendationTag " << m_sRecommendationTag);
52 return StatusCode::FAILURE;
53 }
54
55 // Add the affecting systematics to the global registry
57 if (!registry.registerSystematics(*this))
58 {
59 ATH_MSG_ERROR ("Unable to register the systematics");
60 return StatusCode::FAILURE;
61 }
62
64
65 return StatusCode::SUCCESS;
66}
67
69{
70 return StatusCode::SUCCESS;
71}
72
74{
75 if (!m_bIsConfigured)
76 {
77 const xAOD::EventInfo* xEventInfo = nullptr;
78 ATH_CHECK(evtStore()->retrieve(xEventInfo,"EventInfo"));
80 m_bIsConfigured = true;
81 }
82
83 if (!m_firstEvent){
85 m_firstEvent = true;
86
87 }
89 return StatusCode::SUCCESS;
90
91 const xAOD::EventInfo* xEventInfo = nullptr;
92 ATH_CHECK(evtStore()->retrieve(xEventInfo, "EventInfo"));
93
95 {
96 // Reset the number at the beginning of event
97 m_iRunNumber = 0;
98 }
99
100 return StatusCode::SUCCESS;
101}
102
103//______________________________________________________________________________
105{
106 ATH_MSG_DEBUG( "TauEfficiencyCorrectionsTool with name " << name() << " is configured as follows:" );
107 for (auto iEfficiencyCorrectionType : m_vEfficiencyCorrectionTypes) {
108 ATH_MSG_DEBUG( " EfficiencyCorrectionTypes " << iEfficiencyCorrectionType );
109 }
110 ATH_MSG_DEBUG( " InputFilePathRecoHadTau " << m_sInputFilePathRecoHadTau );
111 ATH_MSG_DEBUG( " InputFilePathEleIDHadTau " << m_sInputFilePathEleIDHadTau );
112 ATH_MSG_DEBUG( " InputFilePathEleIDElectron " << m_sInputFilePathEleIDElectron );
113 ATH_MSG_DEBUG( " InputFilePathJetIDHadTau " << m_sInputFilePathJetIDHadTau );
114 ATH_MSG_DEBUG( " InputFilePathDecayModeHadTau " << m_sInputFilePathDecayModeHadTau );
115 ATH_MSG_DEBUG( " InputFilePathTriggerHadTau " << m_sInputFilePathTriggerHadTau );
116 ATH_MSG_DEBUG( " RecommendationTag " << m_sRecommendationTag );
117 ATH_MSG_DEBUG( " TriggerName " << m_sTriggerName );
118 ATH_MSG_DEBUG( " UseTauSubstructure " << m_bUseTauSubstructure );
119 ATH_MSG_DEBUG( " JetIDLevel " << m_iJetIDLevel );
120 ATH_MSG_DEBUG( " EleIDLevel " << m_iEleIDLevel );
121 ATH_MSG_DEBUG( " Campaign " << m_sCampaign );
122 ATH_MSG_DEBUG( " useFastSim " << m_useFastSim);
123}
124
125//______________________________________________________________________________
127 double& eff, unsigned int /*iRunNumber*/)
128{
129 eff = 1.;
130
131 if (m_bIsData && !m_applyToData)
133
136
137 if(!(m_tTool->isSupportedRunNumber(m_iRunNumber)))
139
140 double dToolEff = 1.;
141 CP::CorrectionCode tmpCorrectionCode = m_tTool->getEfficiencyScaleFactor(xTau, dToolEff, m_iRunNumber);
142 if (tmpCorrectionCode != CP::CorrectionCode::Ok)
143 return tmpCorrectionCode;
144
145 eff *= dToolEff;
146
148}
149
150//______________________________________________________________________________
152{
153 if (m_bIsData && !m_applyToData)
155
158
159 CP::CorrectionCode tmpCorrectionCode = m_tTool->applyEfficiencyScaleFactor(xTau, m_iRunNumber);
160 if (tmpCorrectionCode != CP::CorrectionCode::Ok)
161 return tmpCorrectionCode;
162
164}
165
167//______________________________________________________________________________
169{
170 if (m_tTool->isAffectedBySystematic(systematic))
171 return true;
172
173 return false;
174}
175
177//______________________________________________________________________________
179{
180 CP::SystematicSet sAffectingSystematics;
181 sAffectingSystematics.insert(m_tTool->affectingSystematics());
182 return sAffectingSystematics;
183}
184
186//______________________________________________________________________________
188{
189 CP::SystematicSet sRecommendedSystematics;
190 sRecommendedSystematics.insert(m_tTool->recommendedSystematics());
191 return sRecommendedSystematics;
192}
193
194//______________________________________________________________________________
196{
197 ATH_CHECK(m_tTool->applySystematicVariation(sSystematicSet));
198 return StatusCode::SUCCESS;
199}
200
201//=================================PRIVATE-PART=================================
203{
204 std::string sDirectory = "TauAnalysisTools/" + std::string(sSharedFilesVersion) + "/EfficiencyCorrections/";
205 for (auto iEfficiencyCorrectionType : m_vEfficiencyCorrectionTypes){
206
207 if (iEfficiencyCorrectionType == SFJetIDHadTau)
208 {
209 if (m_sInputFilePathJetIDHadTau.empty()) {
210
211 if(m_useGNTau){
212 if(m_sCampaign=="mc23"){
213 m_sInputFilePathJetIDHadTau = sDirectory + "GNTauID_TrueHadTau_Run3.root";
214 } else {
215 ATH_MSG_ERROR("GNTau ID correction not supported for campaign "<< m_sCampaign);
216 return StatusCode::FAILURE;
217 }
218 } else {
219
220 if(m_sCampaign=="mc23"){
221 m_sInputFilePathJetIDHadTau = m_useFastSim ? sDirectory + "RNNID_TrueHadTau_mc23_v2_incl_AF3.root" : sDirectory + "RNNID_TrueHadTau_mc23_v2.root";
222 } else if (m_sCampaign=="mc20"){
223 m_sInputFilePathJetIDHadTau = m_useFastSim ? sDirectory + "RNNID_TrueHadTau_mc20_v1_incl_AF3.root" : sDirectory + "RNNID_TrueHadTau_mc20_v1.root";
224 }
225 }
226 }
227 m_sVarName = "TauScaleFactorJetIDHadTau";
228
229 std::string sJetIDWP = ConvertJetIDToString(m_iJetIDLevel);
230 if (sJetIDWP.empty()) {
231 ATH_MSG_WARNING("Could not find valid ID working point. Skip ID efficiency corrections.");
232 continue;
233 }
234
235 if (m_tTool.empty()){
236 asg::AsgToolConfig config("TauAnalysisTools::CommonEfficiencyTool/JetIDHadTauTool_tauID_"+sJetIDWP);
237 ATH_CHECK(config.setProperty("InputFilePath", m_sInputFilePathJetIDHadTau));
238 ATH_CHECK(config.setProperty("VarName", m_sVarName));
239 ATH_CHECK(config.setProperty("SkipTruthMatchCheck", m_bSkipTruthMatchCheck));
240 ATH_CHECK(config.setProperty("WP", sJetIDWP));
241 ATH_CHECK(config.setProperty("ApplyToData", m_applyToData));
242 ATH_CHECK(config.makePrivateTool(m_tTool));
243 }
244 ATH_CHECK(m_tTool.retrieve());
245 }
246 else if (iEfficiencyCorrectionType == SFRecoHadTau)
247 {
248 if (m_sInputFilePathRecoHadTau.empty()) m_sInputFilePathRecoHadTau = sDirectory + "Reco_TrueHadTau_2026_v0.root";
249 m_sVarName = "TauScaleFactorReconstructionHadTau";
250
251 if (m_tTool.empty()){
252 asg::AsgToolConfig config("TauAnalysisTools::CommonEfficiencyTool/RecoHadTauTool");
253 ATH_CHECK(config.setProperty("InputFilePath", m_sInputFilePathRecoHadTau));
254 ATH_CHECK(config.setProperty("VarName", m_sVarName));
255 ATH_CHECK(config.setProperty("SkipTruthMatchCheck", m_bSkipTruthMatchCheck));
256 ATH_CHECK(config.setProperty("ApplyToData", m_applyToData));
257 ATH_CHECK(config.makePrivateTool(m_tTool));
258 }
259 ATH_CHECK(m_tTool.retrieve());
260 }
261 else if (iEfficiencyCorrectionType == SFEleIDHadTau)
262 {
263 if (m_sInputFilePathEleIDHadTau.empty()) {
264 if( m_iEleIDLevel == static_cast<int>(ELEIDRNNLOOSE)){
265 m_sInputFilePathEleIDHadTau = sDirectory + "EleRNN_TrueHadTau_2026_eRNNLoose.root";
266 } else if( m_iEleIDLevel == static_cast<int>(ELEIDRNNMEDIUM)){
267 m_sInputFilePathEleIDHadTau = sDirectory + "EleRNN_TrueHadTau_2026_eRNNMedium.root";
268 } else {
269 ATH_MSG_ERROR("SFEleIDHadTau correction not supported for EleIDLevel="<<m_iEleIDLevel);
270 return StatusCode::FAILURE;
271 }
272 }
273 m_sVarName = "TauScaleFactorEleIDHadTau";
274 std::string ele_wp = ConvertEleIDToString(m_iEleIDLevel);
275
276 if (m_tTool.empty()){
277 asg::AsgToolConfig config("TauAnalysisTools::CommonEfficiencyTool/EleIDHadTauTool_eRNN_"+ele_wp);
278 ATH_CHECK(config.setProperty("InputFilePath", m_sInputFilePathEleIDHadTau));
279 ATH_CHECK(config.setProperty("VarName", m_sVarName));
280 ATH_CHECK(config.setProperty("SkipTruthMatchCheck", m_bSkipTruthMatchCheck));
281 ATH_CHECK(config.setProperty("WP", ele_wp));
282 ATH_CHECK(config.setProperty("UseTauSubstructure", false));
283 ATH_CHECK(config.setProperty("ApplyToData", m_applyToData));
284 ATH_CHECK(config.makePrivateTool(m_tTool));
285 }
286 ATH_CHECK(m_tTool.retrieve());
287 }
288 else if (iEfficiencyCorrectionType == SFEleIDElectron)
289 {
290 // the path must be updated once RNN eVeto SFs are available
291 if (m_sInputFilePathEleIDElectron.empty()) {
292 if(m_useFastSim) {
293 ATH_MSG_WARNING("No fast-sim recommendation for tau electron veto, using full sim");
294 }
295
296 if(m_sCampaign=="mc23"){
297 if(m_useGNTau){
298 if( m_iJetIDLevel == static_cast<int>(JETIDGNTAULOOSE)){
299 m_sInputFilePathEleIDElectron = sDirectory + "EleRNN_TrueElectron_2026_looseGNTauID_1p.root";
300 } else if( m_iJetIDLevel == static_cast<int>(JETIDGNTAUMEDIUM)){
301 m_sInputFilePathEleIDElectron = sDirectory + "EleRNN_TrueElectron_2026_mediumGNTauID_1p.root";
302 }
303 else {
304 ATH_MSG_ERROR("SFEleIDElectron correction not supported for JetIDLevel="<<m_iJetIDLevel);
305 return StatusCode::FAILURE;
306 }
307 } else {
308 if( m_iJetIDLevel == static_cast<int>(JETIDRNNLOOSE)){
309 m_sInputFilePathEleIDElectron = sDirectory + "EleRNN_TrueElectron_2022_looseRNNTauID_1p.root";
310 } else if( m_iJetIDLevel == static_cast<int>(JETIDRNNMEDIUM)){
311 m_sInputFilePathEleIDElectron = sDirectory + "EleRNN_TrueElectron_2022_mediumRNNTauID_1p.root";
312 }
313 else {
314 ATH_MSG_ERROR("SFEleIDElectron correction not supported for JetIDLevel="<<m_iJetIDLevel);
315 return StatusCode::FAILURE;
316 }
317 }
318 } else if(m_sCampaign=="mc20"){
319 if(m_useGNTau){
320 ATH_MSG_ERROR("Eveto with GNTau ID correction not supported for campaign "<< m_sCampaign);
321 return StatusCode::FAILURE;
322 } else {
323 if( m_iJetIDLevel == static_cast<int>(JETIDRNNLOOSE)){
324 m_sInputFilePathEleIDElectron = sDirectory + "EleRNN_TrueElectron_Run2_looseRNNTauID_1p.root";
325 } else if( m_iJetIDLevel == static_cast<int>(JETIDRNNMEDIUM)){
326 m_sInputFilePathEleIDElectron = sDirectory + "EleRNN_TrueElectron_Run2_mediumRNNTauID_1p_v1.root";
327 }
328 else {
329 ATH_MSG_ERROR("SFEleIDElectron correction not supported for JetIDLevel="<<m_iJetIDLevel);
330 return StatusCode::FAILURE;
331 }
332 }
333 }
334 }
335 m_sVarName = "TauScaleFactorEleIDElectron";
336 std::string ele_wp = ConvertEleIDToString(m_iEleIDLevel);
337 std::string sJetIDWP = ConvertJetIDToString(m_iJetIDLevel);
338
339 if (m_tTool.empty()){
340 asg::AsgToolConfig config("TauAnalysisTools::CommonEfficiencyTool/EleIDHadTauTool_eRNN_"+ele_wp);
341 ATH_CHECK(config.setProperty("InputFilePath", m_sInputFilePathEleIDElectron));
342 ATH_CHECK(config.setProperty("VarName", m_sVarName));
343 ATH_CHECK(config.setProperty("SkipTruthMatchCheck", m_bSkipTruthMatchCheck));
344 ATH_CHECK(config.setProperty("WP", ele_wp));
345 ATH_CHECK(config.setProperty("UseTauSubstructure", false));
346 ATH_CHECK(config.setProperty("ApplyToData", m_applyToData));
347 ATH_CHECK(config.makePrivateTool(m_tTool));
348 }
349 ATH_CHECK(m_tTool.retrieve());
350
351 } else if (iEfficiencyCorrectionType == SFTriggerHadTau){
352
353 if (m_sTriggerName.empty()) {
354 ATH_MSG_ERROR("Property \"Trigger\" was not set, please provide a trigger name.");
355 return StatusCode::FAILURE;
356 }
357 if (m_sInputFilePathTriggerHadTau.empty()) {
358 // Determine the input file name from the given trigger name.
359 if(m_sCampaign=="mc23a"){
360 if (m_sTriggerName.value().find("mediumRNN_tracktwoMVA") != std::string::npos) {
361 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN/Trigger_TrueHadTau_data2022"+GetTriggerSFMeasurementString()+m_sTriggerName+".root";
362 }
363 else {
364 ATH_MSG_ERROR("Trigger " << m_sTriggerName << " is not supported for " << m_sCampaign << " campaign. Please fix \"TriggerName\" property. In case of doubt please consult with TauTrigger coordinators");
365 return StatusCode::FAILURE;
366 }
367 } else if(m_sCampaign=="mc23d"){
368 if (m_sTriggerName.value().find("mediumRNN_tracktwoMVA") != std::string::npos) {
369 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN/Trigger_TrueHadTau_data2023"+GetTriggerSFMeasurementString()+m_sTriggerName+".root";
370 }
371 else {
372 ATH_MSG_ERROR("Trigger " << m_sTriggerName << " is not supported for " << m_sCampaign << " campaign. Please fix \"TriggerName\" property. In case of doubt please consult with TauTrigger coordinators");
373 return StatusCode::FAILURE;
374 }
375 } else if(m_sCampaign=="mc20"){
376 if (m_sTriggerName.value().find("tracktwoEF") != std::string::npos) {
377 // check explicitly tau160 as the root file for this trigger was renamed
378 if (m_sTriggerName.value().find("tau160") != std::string::npos) {
379 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN_R22/Trigger_TrueHadTau_data2018_comb_HLT_tau160L1TAU100_medium1_tracktwoEF_v1.root";
380 } else {
381 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN_R22/Trigger_TrueHadTau_data2018"+GetTriggerSFMeasurementString()+m_sTriggerName+".root";
382 }
383 } else if (m_sTriggerName.value().find("tracktwo") != std::string::npos) {
384 // check explicitly tau160 as the root file for this trigger was renamed
385 if (m_sTriggerName.value().find("tau160") != std::string::npos) {
386 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN_R22/Trigger_TrueHadTau_data161718_comb_HLT_tau160_medium1_tracktwo_v1.root";
387 } else if (m_sTriggerName.value().find("tau125") != std::string::npos) {
388 // fall back to R21 recommendations for tau125 as currently SFs are not available for this trigger
389 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN/Trigger_TrueHadTau_2019-summer_data161718_comb_HLT_tau125_medium1_tracktwo.root";
390 } else if (m_sTriggerName.value().find("tau60") != std::string::npos) {
391 // SFs for tau60 are only for partial period
392 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN_R22/Trigger_TrueHadTau_data1718"+GetTriggerSFMeasurementString()+m_sTriggerName+".root";
393 } else {
394 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN_R22/Trigger_TrueHadTau_data161718"+GetTriggerSFMeasurementString()+m_sTriggerName+".root";
395 }
396 } else {
397 ATH_MSG_ERROR("Trigger " << m_sTriggerName << " is not supported. Please fix \"TriggerName\" property. If this is correct, then please contact the tau trigger coordinators");
398 return StatusCode::FAILURE;
399 }
400 } else {
401 ATH_MSG_ERROR("SFs are not available for " << m_sCampaign << " campaign. If the config is correct, then please contact the tau trigger coordinators");
402 return StatusCode::FAILURE;
403 }
404 }
405 m_sVarName = "TauScaleFactorTriggerHadTau";
406 std::string sJetIDWP = ConvertTriggerIDToString(m_iJetIDLevel);
407
408 if (m_tTool.empty()){
409 asg::AsgToolConfig config("TauAnalysisTools::CommonEfficiencyTool/TriggerHadTauTool_"+m_sTriggerName+"_tauID_"+sJetIDWP);
410 ATH_CHECK(config.setProperty("InputFilePath", m_sInputFilePathTriggerHadTau));
411 ATH_CHECK(config.setProperty("VarName", m_sVarName));
412 ATH_CHECK(config.setProperty("SkipTruthMatchCheck", m_bSkipTruthMatchCheck));
413 ATH_CHECK(config.setProperty("WP", sJetIDWP));
414 ATH_CHECK(config.setProperty("DoTauTrig", true));
415 ATH_CHECK(config.setProperty("ApplyToData", m_applyToData));
416 ATH_CHECK(config.makePrivateTool(m_tTool));
417 }
418 ATH_CHECK(m_tTool.retrieve());
419 }
420 else {
421 ATH_MSG_WARNING("unsupported EfficiencyCorrectionsType with enum " << iEfficiencyCorrectionType);
422 }
423 }
424
425 return StatusCode::SUCCESS;
426}
427
428// auto detection of simulation flavour, used to cross check configuration of tool
429//______________________________________________________________________________
431{
432 if (inputMetaStore()->contains<xAOD::FileMetaData>("FileMetaData")) {
433 const xAOD::FileMetaData* fmd = nullptr;
434 ATH_CHECK( inputMetaStore()->retrieve( fmd, "FileMetaData" ) );
435 std::string simType("");
436 bool result = fmd->value( xAOD::FileMetaData::simFlavour , simType );
437 // if no result -> no simFlavor metadata, so must be data
438 if(result) std::transform(simType.begin(), simType.end(), simType.begin(), ::toupper);
439
440 if( simType.find("ATLFAST3") != std::string::npos && !m_useFastSim){
441 ATH_MSG_WARNING("Input file is AF3 sample but you are _not_ using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"true\"");
442 } else if (simType.find("FULLG4")!=std::string::npos && m_useFastSim){
443 ATH_MSG_WARNING("Input file is full simulation but you are using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"false\"");
444 }
445 }
446
447 return StatusCode::SUCCESS;
448}
449
450//______________________________________________________________________________
451std::string TauEfficiencyCorrectionsTool::ConvertJetIDToString(const int iLevel) const
452{
453 switch(iLevel)
454 {
455 case JETIDNONE:
456 return "none";
457 case JETIDRNNVERYLOOSE:
458 ATH_MSG_WARNING("Efficiency corrections for JETIDRNNVERYLOOSE working point are not supported.");
459 return "";
460 case JETIDRNNLOOSE:
461 return "jetrnnsigloose";
462 case JETIDRNNMEDIUM:
463 return "jetrnnsigmedium";
464 case JETIDRNNTIGHT:
465 return "jetrnnsigtight";
467 ATH_MSG_WARNING("Efficiency corrections for JETIDGNTAUVERYLOOSE working point are not supported.");
468 return "";
469 case JETIDGNTAULOOSE:
470 return "jetgntausigloose";
471 case JETIDGNTAUMEDIUM:
472 return "jetgntausigmedium";
473 case JETIDGNTAUTIGHT:
474 return "jetgntausigtight";
475 default:
476 ATH_MSG_WARNING("No valid JetID level passed.");
477 return "";
478 }
479}
480
481std::string TauEfficiencyCorrectionsTool::ConvertEleIDToString(const int iLevel) const
482{
483 switch(iLevel)
484 {
485 case ELEIDRNNTIGHT:
486 return "eleRNNTight";
487 case ELEIDRNNMEDIUM:
488 return "eleRNNMedium";
489 case ELEIDRNNLOOSE:
490 return "eleRNNLoose";
491 default:
492 ATH_MSG_WARNING("No valid EleID level passed.");
493 return "";
494 }
495}
496
497//______________________________________________________________________________
499{
500 switch(iLevel)
501 {
502 case JETIDRNNLOOSE:
503 return "loose";
504 case JETIDRNNMEDIUM:
505 return "medium";
506 case JETIDRNNTIGHT:
507 return "tight";
508 default:
509 ATH_MSG_WARNING("No valid TriggerID level passed.");
510 return "";
511 }
512}
513
514//______________________________________________________________________________
516{
517 std::string sMeasurement = "_comb_";
518
519 if (m_sTriggerSFMeasurement == "Ztautau")
520 sMeasurement = "_Ztt_";
521 else if (m_sTriggerSFMeasurement == "ttbar")
522 sMeasurement = "_ttbar_";
523 else if (m_sTriggerSFMeasurement != "combined")
524 ATH_MSG_WARNING("Trigger scale factor measurement \'" << m_sTriggerSFMeasurement << "\' is not supported. \'combined\' is used instead.");
525
526 return sMeasurement;
527}
528
530{
531 // read the random run rumber from the EventInfo
533 {
534 static const SG::ConstAccessor<unsigned int> acc_rnd("RandomRunNumber");
535 const xAOD::EventInfo* eventInfo = nullptr;
536 if (!evtStore()->contains<xAOD::EventInfo>("EventInfo") || !evtStore()->retrieve(eventInfo, "EventInfo").isSuccess())
537 {
538 ANA_MSG_ERROR("Could not retrieve EventInfo");
539 return StatusCode::FAILURE;
540 }
541
542 if (!acc_rnd.isAvailable(*eventInfo))
543 {
544 ANA_MSG_ERROR("Failed to find the RandomRunNumber decoration. Call the apply() method from the PileupReweightingTool beforehand to get period dependent SFs.");
545 return StatusCode::FAILURE;
546 }
547
548 m_iRunNumber = acc_rnd(*eventInfo);
549
550 ANA_MSG_VERBOSE("Read RandomRunNumber as " << m_iRunNumber);
551 }
552
553 return StatusCode::SUCCESS;
554}
555
556} // namespace TauAnalysisTools
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_MSG_VERBOSE(xmsg)
Macro printing verbose messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
#define ANA_CHECK_SET_TYPE(TYPE)
set the type for ANA_CHECK to report failures
static const char *const sSharedFilesVersion
Version of the calibration files.
ServiceHandle< StoreGateSvc > & evtStore()
Return value from object correction CP tools.
@ Ok
The correction was done successfully.
This module implements the central registry for handling systematic uncertainties with CP tools.
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
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
virtual StatusCode initialize()
Function initialising the tool.
virtual bool isAffectedBySystematic(const CP::SystematicVariation &systematic) const
returns: whether this tool is affected by the given systematics
virtual void printConfig() const
Print tool configuration.
virtual CP::SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by
TauEfficiencyCorrectionsTool(const std::string &sName)
Create a proper constructor for Athena.
virtual StatusCode beginInputFile()
Function called when a new input file is opened.
virtual CP::SystematicSet recommendedSystematics() const
returns: the list of all systematics this tool recommends to use
Gaudi::Property< std::vector< int > > m_vecEfficiencyCorrectionTypes
virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::TauJet &xTau, double &eff, unsigned int iRunNumber=0)
Get the tau efficiency scale factor.
StatusCode beginEvent()
Function called when a new events is loaded.
ToolHandle< ITauEfficiencyCorrectionsTool > m_tTool
virtual CP::CorrectionCode applyEfficiencyScaleFactor(const xAOD::TauJet &xTau, unsigned int iRunNumber=0)
Decorate the tau with its efficiency scale factor.
virtual StatusCode applySystematicVariation(const CP::SystematicSet &systConfig)
effects: configure this tool for the given list of systematic variations.
AsgMetadataTool(const std::string &name)
Normal ASG tool constructor with a name.
MetaStorePtr_t inputMetaStore() const
Accessor for the input metadata store.
an object that can create a AsgTool
bool eventType(EventType type) const
Check for one particular bitmask value.
@ IS_SIMULATION
true: simulation, false: data
@ simFlavour
Fast or Full sim [string].
bool value(MetaDataType type, std::string &val) const
Get a pre-defined string value out of the object.
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:116
EventInfo_v1 EventInfo
Definition of the latest event info version.
TauJet_v3 TauJet
Definition of the current "tau version".
Definition TauJet.h:17
FileMetaData_v1 FileMetaData
Declare the latest version of the class.