ATLAS Offline Software
Loading...
Searching...
No Matches
SUSYObjDef_xAOD.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// Local include(s):
7
8// For making the systematics list and looping through it
11
12#ifndef XAOD_STANDALONE // For now metadata is Athena-only
14#endif
15
16// Need path resolver for initialize()
18
20
21
22// Including all the abstract interfaces - for systematics functions
25
31
43
49
55
57//disable #include "IsolationSelection/IIsolationLowPtPLVTool.h"
60
64
69// Required to use some functions (see header explanation)
71
78
80
81// For reading metadata
83
84// For configuration -- TEnv uses THashList
85#include "THashList.h"
86
87// system includes
88#include <fstream>
89#include <regex>
90#include <string>
91
92namespace ST {
93
94using namespace std;
95
96using namespace Trig;
97using namespace TrigConf;
98using namespace xAOD;
99
100
104 m_jetInputType(xAOD::JetInput::Uncategorized),
105 m_force_noElId(false),
106 m_force_noMuId(false),
107 m_doTTVAsf(true),
110 m_useBtagging(false),
112 m_debug(false),
113 m_strictConfigCheck(false),
114 m_badJetCut(""),
116 m_fatJetUncVars(""),
117 m_WDecorName(""),
118 m_ZDecorName(""),
119 m_TopDecorName(""),
120 m_WtagConfig(""),
121 m_ZtagConfig(""),
122 m_ToptagConfig(""),
125 m_WTagUncConfig(""),
126 m_ZTagUncConfig(""),
129 m_tool_init(false),
130 m_subtool_init(false),
131 // set dummies for configuration
132 m_eleTerm(""),
133 m_gammaTerm(""),
134 m_tauTerm(""),
135 m_jetTerm(""),
136 m_muonTerm(""),
138 m_outMETTerm(""),
142 m_metUseGhostMuons(false),
143 m_metDoMuonEloss(false),
144 m_metGreedyPhotons(false),
147 m_trkMETsyst(true),
148 m_caloMETsyst(false),
149 m_softTermParam(-99),
150 m_treatPUJets(true),
151 m_doPhiReso(true),
152 m_autoconfigPRW(false),
158 m_mcCampaign(""),
159 m_mcChannel(-99),
160 m_useCommonPRWFiles(false),
168 m_prwDataSF(-99.),
169 m_prwDataSF_UP(-99.),
170 m_prwDataSF_DW(-99.),
173 m_eleId(""),
174 m_eleIdBaseline(""),
175 m_eleConfig(""),
178 m_eleIdExpert(false),
179 m_muId(static_cast<int>(xAOD::Muon::Quality(xAOD::Muon::VeryLoose))),
180 m_muIdBaseline(static_cast<int>(xAOD::Muon::Quality(xAOD::Muon::VeryLoose))),
181 m_photonId(""),
183 m_tauTagger(""),
184 m_tauId(""),
185 m_tauIdBaseline(""),
186 m_tauEleId(true),
187 m_tauEleIdBaseline(true),
188 m_tauMuOLR(false),
189 m_tauMuOLRBaseline(false),
190 m_eleIso_WP(""),
193 m_eleChID_WP(""),
194 m_eleLRT_strat(-99),
195 m_eleChIso(true),
196 m_eleChID_signal(false),
197 m_runECIS(false),
199 m_photonIso_WP(""),
202 m_muIso_WP(""),
206 m_muEffCorrForce1D(false),
207 m_BtagWP(""),
208 m_BtagTagger(""),
209 m_BtagMinPt(-99.),
215 m_BtagWP_trkJet(""),
217 m_BtagMinPt_trkJet(-99.),
219 //configurable cuts here
220 m_eleBaselinePt(-99.),
221 m_eleBaselineEta(-99.),
223 m_elePt(-99.),
224 m_eleEta(-99.),
225 m_eleCrackVeto(false),
226 m_eled0sig(-99.),
227 m_elez0(-99.),
228 m_elebaselined0sig(-99.),
229 m_elebaselinez0(-99),
232 //
233 m_muBaselinePt(-99.),
234 m_muBaselineEta(-99.),
235 m_muPt(-99.),
236 m_muEta(-99.),
237 m_mud0sig(-99.),
238 m_muz0(-99.),
239 m_mubaselined0sig(-99.),
240 m_mubaselinez0(-99.),
242 m_muCosmicz0(-99.),
243 m_muCosmicd0(-99.),
244 m_badmuQoverP(-99.),
246 //
247 m_photonBaselinePt(-99.),
249 m_photonEta(-99.),
250 m_photonPt(-99.),
252 m_photonCrackVeto(true),
253 m_photonAllowLate(false),
254 //
255 m_tauPrePtCut(-99.),
256 m_tauPt(-99.),
257 m_tauEta(-99.),
258 m_tauConfigPath(""),
260 m_tauInputFile(""),
262 m_tauDoTTM(false),
266 //
267 m_jetPt(-99.),
268 m_jetEta(-99.),
269 m_jetJvt(-99.),
270 m_JvtWP(""),
271 m_JvtPtMax(-99.),
272 m_JvtConfigRun2(""),
273 m_JvtConfigRun3(""),
274 m_trkJetPt(-99.),
275 m_trkJetEta(-99.),
276 m_doFwdJVT(false),
277 m_fJvtWP(""),
278 m_fJvtPtMax(-99.),
279 m_fJvtEtaMin(-99.),
282 m_JMScalib(false),
283 //
284 m_orDoTau(false),
285 m_orDoPhoton(false),
286 m_orDoEleJet(true),
287 m_orDoElEl(false),
288 m_orDoElMu(false),
289 m_orDoMuonJet(true),
290 m_orDoBjet(false),
291 m_orDoElBjet(true),
292 m_orDoMuBjet(true),
293 m_orDoTauBjet(true),
295 m_orBoostedElectronC1(-999.), // set to positive value to activate
296 m_orBoostedElectronC2(-999.), // set to positive value to activate
297 m_orBoostedElectronMaxConeSize(-999.), // set to positive value to activate
298 m_orDoBoostedMuon(true),
299 m_orBoostedMuonC1(-999.), // set to positive value to activate
300 m_orBoostedMuonC2(-999.), // set to positive value to activate
301 m_orBoostedMuonMaxConeSize(-999.), // set to positive value to activate
302 m_orApplyRelPt(false),
303 m_orMuJetPtRatio(-999.),
304 m_orMuJetTrkPtRatio(-999.),
305 m_orMuJetInnerDR(-999),
308 m_orBtagWP(""),
309 m_orInputLabel(""),
310 m_orPhotonFavoured(false),
313 m_orDoFatjets(false),
314 m_EleFatJetDR(-999.),
315 m_JetFatJetDR(-999.),
316 m_doIsoSignal(true),
317 m_doElIsoSignal(true),
318 m_doPhIsoSignal(true),
319 m_doMuIsoSignal(true),
320
323
324 m_slices(std::map<std::string,bool>()),
325 m_isRun3(false),
326 m_isPHYSLITE(false),
327
329 m_fatJets(""),
330 //
333 m_EG_corrModel(""),
334 m_EG_corrFNList(""),
335 m_applyJVTCut(true),
336 //
337 // set toolhandles empty by default
338 m_jetCalibTool(""),
353 //
354 m_WTaggerTool(""),
355 m_ZTaggerTool(""),
356 m_TopTaggerTool(""),
361 //
365 m_muonCalibTool(""),
372 //
379 //
383 m_photonSelIsEM(""),
391 //
392 m_tauSelTool(""),
395 m_tauTruthMatch(""),
396 m_tauEffTool(""),
397 //
398 m_btagEffTool(""),
399 m_btagSelTool(""),
403 //
404 m_metMaker(""),
405 m_metSystTool(""),
406 m_metSignif(""),
407 //
436 m_trigConfTool(""),
437 m_trigDecTool(""),
441 //
442 m_isoCorrTool(""),
443 m_isoTool(""),
444 //disable m_isoToolLowPtPLV(""),
446 m_isoHighPtTool(""),
447 //
448 m_prwTool(""),
449 //
450 m_LRTuncTool(""),
451 //
452 m_orToolbox("ORToolbox",this),
453 //
456 //
457 m_acc_eleIdBaseline("DFCommonElectronsLHLooseBL"),
458 m_acc_eleId("DFCommonElectronsLHTight"),
459 m_acc_photonIdBaseline("DFCommonPhotonsIsEMTight"),
460 m_acc_photonId("DFCommonPhotonsIsEMTight"),
461 //
462 m_acc_jetClean("DFCommonJets_jetClean_LooseBad")
463{
464 //General settings
465 declareProperty( "DataSource", m_dataSource = Undefined );
466 declareProperty( "DebugMode", m_debug );
467 declareProperty( "ConfigFile", m_configFile = "SUSYTools/SUSYTools_Default.conf" );
468 //Overlap Removal
469 declareProperty( "DoTauOR", m_orDoTau );
470 declareProperty( "DoPhotonOR", m_orDoPhoton );
471 declareProperty( "DoEleJetOR", m_orDoEleJet );
472 declareProperty( "DoElElOR", m_orDoElEl );
473 declareProperty( "DoElMuOR", m_orDoElMu );
474 declareProperty( "DoMuonJetOR", m_orDoMuonJet );
475 declareProperty( "DoBjetOR", m_orDoBjet );
476 declareProperty( "DoElBjetOR", m_orDoElBjet );
477 declareProperty( "DoMuBjetOR", m_orDoMuBjet );
478 declareProperty( "DoTauBjetOR", m_orDoTauBjet );
479 declareProperty( "UseBtagging", m_useBtagging );
480 declareProperty( "UseBtaggingTrkJet", m_useBtagging_trkJet );
481 declareProperty( "DoBoostedElectronOR", m_orDoBoostedElectron );
482 declareProperty( "BoostedElectronORC1", m_orBoostedElectronC1 );
483 declareProperty( "BoostedElectronORC2", m_orBoostedElectronC2 );
484 declareProperty( "BoostedElectronORMaxConeSize", m_orBoostedElectronMaxConeSize );
485 declareProperty( "DoBoostedMuonOR", m_orDoBoostedMuon );
486 declareProperty( "BoostedMuonORC1", m_orBoostedMuonC1 );
487 declareProperty( "BoostedMuonORC2", m_orBoostedMuonC2 );
488 declareProperty( "BoostedMuonORMaxConeSize", m_orBoostedMuonMaxConeSize );
489 declareProperty( "ORDoMuonJetGhostAssociation", m_orDoMuonJetGhostAssociation );
490 declareProperty( "ORRemoveCaloMuons", m_orRemoveCaloMuons );
491 declareProperty( "ORMuJetApplyRelPt", m_orApplyRelPt);
492 declareProperty( "ORMuJetPtRatio", m_orMuJetPtRatio);
493 declareProperty( "ORMuJetInnerDR", m_orMuJetInnerDR );
494 declareProperty( "ORJetTrkPtRatio", m_orMuJetTrkPtRatio);
495 declareProperty( "ORInputLabel", m_orInputLabel);
496 declareProperty( "ORPhotonFavoured", m_orPhotonFavoured);
497 declareProperty( "ORBJetPtUpperThres", m_orBJetPtUpperThres);
498 declareProperty( "ORLinkOverlapObjects", m_orLinkOverlapObjects);
499
500 declareProperty( "DoFatJetOR", m_orDoFatjets);
501 declareProperty( "OREleFatJetDR", m_EleFatJetDR);
502 declareProperty( "ORJetFatJetDR", m_JetFatJetDR);
503 declareProperty( "TriggerUpstreamMatching", m_upstreamTriggerMatching, "Use alternative trigger matching tool based on upstream (in-derivation) matching");
504 declareProperty( "TriggerMatchingPrefix", m_trigMatchingPrefix, "Prefix for trigger matching containers (Analysis for PHSYLITE derivations");
505
506 //--- Object definitions
507 //MET
508 declareProperty( "METEleTerm", m_eleTerm );
509 declareProperty( "METGammaTerm", m_gammaTerm );
510 declareProperty( "METTauTerm", m_tauTerm );
511 declareProperty( "METJetTerm", m_jetTerm );
512 declareProperty( "METMuonTerm", m_muonTerm );
513 declareProperty( "METInputSuffix", m_inputMETSuffix );
514 declareProperty( "METOutputTerm", m_outMETTerm );
515 declareProperty( "METDoTrkSyst", m_trkMETsyst );
516 declareProperty( "METDoCaloSyst", m_caloMETsyst );
517 declareProperty( "METDoTrkJetSyst", m_trkJetsyst );
518 declareProperty( "METJetSelection", m_metJetSelection );
519 declareProperty( "METSysConfigPrefix", m_metsysConfigPrefix );
520
521 declareProperty( "METRemoveORCaloTaggedMuons", m_metRemoveOverlappingCaloTaggedMuons);
522 declareProperty( "METDoSetMuonJetEMScale", m_metDoSetMuonJetEMScale);
523 declareProperty( "METDoRemoveMuonJets", m_metDoRemoveMuonJets );
524 declareProperty( "METUseGhostMuons", m_metUseGhostMuons );
525 declareProperty( "METDoMuonEloss", m_metDoMuonEloss );
526 declareProperty( "METDoGreedyPhotons", m_metGreedyPhotons );
527 declareProperty( "METDoVeryGreedyPhotons", m_metVeryGreedyPhotons );
528
529
530 declareProperty( "SoftTermParam", m_softTermParam);
531 declareProperty( "TreatPUJets", m_treatPUJets);
532 declareProperty( "DoPhiReso", m_doPhiReso);
533
534 //JETS
535 declareProperty( "JetInputType", m_jetInputType );
536
537 declareProperty( "FwdJetDoJVT", m_doFwdJVT );
538
539 declareProperty( "JetJMSCalib", m_JMScalib );
540 declareProperty( "JetLargeRcollection", m_fatJets );
541
542 //BTAGGING
543 declareProperty( "BtagTagger", m_BtagTagger);
544 declareProperty( "BtagWPOR", m_orBtagWP); //the one used in the Overlap Removal
545 declareProperty( "BtagWP", m_BtagWP); //the one used in FillJet() afterwards
546 declareProperty( "BtagMinPt", m_BtagMinPt); // minimum jetPt cut (MR31061) >=20 GeV EM jets & >=10 GeV TrackJets (not calibrated below)
548 declareProperty( "BtagReadFromObject", m_BtagReadFromObject);
549 declareProperty( "BtagTaggerTrkJet", m_BtagTagger_trkJet);
550 declareProperty( "BtagMinPtTrkJet", m_BtagMinPt_trkJet); // minimum jetPt cut (MR31061) >=20 GeV EM jets & >=10 GeV TrackJets (not calibrated below)
551 declareProperty( "BtagWPTrkJet", m_BtagWP_trkJet); //the one used in FillTrackJet() afterwards
552 declareProperty( "BtagReadFromObjectTrkJet", m_BtagReadFromObject_trkJet);
553 //ELECTRONS
554 declareProperty( "EleBaselinePt", m_eleBaselinePt);
555 declareProperty( "ElePt", m_elePt);
556 declareProperty( "EleBaselineEta", m_eleBaselineEta);
557 declareProperty( "EleEta", m_eleEta);
558 declareProperty( "EleBaselineId", m_eleIdBaseline);
559 declareProperty( "EleBaselineConfig", m_eleConfigBaseline);
560 declareProperty( "EleBaselineCrackVeto", m_eleBaselineCrackVeto);
561 declareProperty( "EleId", m_eleId);
562 declareProperty( "EleConfig", m_eleConfig);
563 declareProperty( "EleIso", m_eleIso_WP);
564 declareProperty( "EleIsoHighPt", m_eleIsoHighPt_WP);
565 declareProperty( "EleIsoHighPtThresh", m_eleIsoHighPtThresh);
566 declareProperty( "EleCFT", m_eleChID_WP);
567 declareProperty( "EleCFTIso", m_eleChIso);
568 declareProperty( "EleCFTSignal", m_eleChID_signal);
569 declareProperty( "EleD0sig", m_eled0sig);
570 declareProperty( "EleZ0", m_elez0);
571 declareProperty( "EleBaselineD0sig", m_elebaselined0sig);
572 declareProperty( "EleBaselineZ0", m_elebaselinez0);
573 declareProperty( "EleCrackVeto", m_eleCrackVeto);
574 declareProperty( "EleForceNoId", m_force_noElId );
575 declareProperty( "EleEffMapFilePath", m_eleEffMapFilePath);
576 declareProperty( "EleAllowRun3TrigSFFallback", m_eleAllowRun3TrigSFFallback);
577 declareProperty( "EleForceFullSimCalib", m_eleForceFullSimCalib);
578
579 //MUONS
580 declareProperty( "MuonBaselinePt", m_muBaselinePt);
581 declareProperty( "MuonPt", m_muPt);
582 declareProperty( "MuonBaselineEta", m_muBaselineEta);
583 declareProperty( "MuonEta", m_muEta);
584 declareProperty( "MuonBaselineId", m_muIdBaseline);
585 declareProperty( "MuonId", m_muId);
586 declareProperty( "MuonIso", m_muIso_WP);
587 declareProperty( "MuonIsoHighPt", m_muIsoHighPt_WP);
588 declareProperty( "MuonIsoHighPtThresh", m_muIsoHighPtThresh);
589 declareProperty( "MuonHighPtExtraSmear", m_muHighPtExtraSmear);
590 declareProperty( "MuonEffCorrForce1D", m_muEffCorrForce1D);
591 declareProperty( "MuonD0sig", m_mud0sig);
592 declareProperty( "MuonZ0", m_muz0);
593 declareProperty( "MuonBaselineD0sig", m_mubaselined0sig);
594 declareProperty( "MuonBaselineZ0", m_mubaselinez0);
595 declareProperty( "MuonRequireHighPtCuts", m_murequirepassedHighPtCuts);
596 declareProperty( "MuonForceNoId", m_force_noMuId );
597 declareProperty( "MuonTTVASF", m_doTTVAsf );
598 declareProperty( "MuonCalibrationMode", m_muCalibrationMode);
599 //MUONS TRIGGER SCALE FACTOR
600 declareProperty( "MuonTriggerSFCalibRelease", m_muTriggerSFCalibRelease );
601 declareProperty( "MuonTriggerSFCalibFilename", m_muTriggerSFCalibFilename );
602 //PHOTONS
603 declareProperty( "PhotonBaselinePt", m_photonBaselinePt);
604 declareProperty( "PhotonPt", m_photonPt);
605 declareProperty( "PhotonBaselineEta", m_photonBaselineEta);
606 declareProperty( "PhotonEta", m_photonEta);
607 declareProperty( "PhotonBaselineId", m_photonIdBaseline);
608 declareProperty( "PhotonId", m_photonId);
609 declareProperty( "PhotonIso", m_photonIso_WP);
610 declareProperty( "PhotonTriggerName", m_photonTriggerName);
611 declareProperty( "PhotonBaselineCrackVeto", m_photonBaselineCrackVeto);
612 declareProperty( "PhotonCrackVeto", m_photonCrackVeto);
613 declareProperty( "PhotonAllowLate", m_photonAllowLate);
614
615 //TAUS
616 declareProperty( "TauTagger", m_tauTagger);
617 declareProperty( "TauBaselineId", m_tauIdBaseline);
618 declareProperty( "TauId", m_tauId);
619 declareProperty( "TauBaselineEleId", m_tauEleIdBaseline);
620 declareProperty( "TauEleId", m_tauEleId);
621 declareProperty( "TauBaselineMuOLR", m_tauMuOLRBaseline);
622 declareProperty( "TauMuOLR", m_tauMuOLR);
623 declareProperty( "TauIdConfigPathBaseline", m_tauConfigPathBaseline);
624 declareProperty( "TauIdConfigPath", m_tauConfigPath);
625 declareProperty( "TauIdInputFileBaseline", m_tauInputFileBaseline);
626 declareProperty( "TauIdInputFile", m_tauInputFile);
627 declareProperty( "TauDoTruthMatching", m_tauDoTTM);
628 declareProperty( "TauSmearingToolRecommendationTag", m_tauSmearingToolRecommendationTag);
629 declareProperty( "TauEffToolRecommendationTag", m_tauEffToolRecommendationTag);
630 declareProperty( "TauMVATESQualityCheck", m_ApplyMVATESQualityCheck);
631
632 //Leptons
633 declareProperty( "SigLepRequireIso", m_doIsoSignal ); //leave here for back-compatibility
634 declareProperty( "SigElRequireIso", m_doElIsoSignal );
635 declareProperty( "SigMuRequireIso", m_doMuIsoSignal );
636 declareProperty( "SigPhRequireIso", m_doPhIsoSignal );
637
638 //Isolation correction for leptons and photons
639 declareProperty( "UseSigLepForIsoCloseByOR", m_useSigLepForIsoCloseByOR );
640 declareProperty( "IsoCloseByORpassLabel", m_IsoCloseByORpassLabel );
641
642 //--- Tools configuration
643 //PRW
644 declareProperty( "AutoconfigurePRWTool", m_autoconfigPRW );
645 declareProperty( "AutoconfigurePRWToolPath", m_autoconfigPRWPath ); // e.g. dev/PileupReweighting/share/
646 declareProperty( "AutoconfigurePRWToolFile", m_autoconfigPRWFile ); // e.g. DSID407xxx/pileup_mc16a_dsid407352_FS.root
647 declareProperty( "AutoconfigurePRWToolCombinedmode", m_autoconfigPRWCombinedmode );
648 declareProperty( "AutoconfigurePRWToolRPVmode", m_autoconfigPRWRPVmode );
649 declareProperty( "AutoconfigurePRWToolRtags", m_autoconfigPRWRtags );
650 declareProperty( "mcCampaign", m_mcCampaign );
651 declareProperty( "mcChannel", m_mcChannel );
652 declareProperty( "PRWConfigFiles", m_prwConfFiles );
653 declareProperty( "PRWLumiCalcFiles", m_prwLcalcFiles );
654 declareProperty( "PRWActualMu2017File", m_prwActualMu2017File );
655 declareProperty( "PRWActualMu2018File", m_prwActualMu2018File );
656 declareProperty( "PRWActualMu2022File", m_prwActualMu2022File );
657 declareProperty( "PRWActualMu2023File", m_prwActualMu2023File );
658 declareProperty( "PRWActualMu2024File", m_prwActualMu2024File );
659 declareProperty( "PRWActualMu2025File", m_prwActualMu2025File );
660 declareProperty( "PRWDataScaleFactor", m_prwDataSF);
661 declareProperty( "PRWDataScaleFactorUP", m_prwDataSF_UP);
662 declareProperty( "PRWDataScaleFactorDOWN", m_prwDataSF_DW);
663 declareProperty( "PRWUseRunDependentPrescaleWeight", m_runDepPrescaleWeightPRW);
664 declareProperty( "PRWUseCommonMCFiles", m_useCommonPRWFiles);
665 declareProperty( "PRWCommonFileMC20a", m_commonPRWFileMC20a);
666 declareProperty( "PRWCommonFileMC20d", m_commonPRWFileMC20d);
667 declareProperty( "PRWCommonFileMC20e", m_commonPRWFileMC20e);
668 declareProperty( "PRWCommonFileMC23a", m_commonPRWFileMC23a);
669 declareProperty( "PRWCommonFileMC23d", m_commonPRWFileMC23d);
670 declareProperty( "PRWCommonFileMC23e", m_commonPRWFileMC23e);
671 declareProperty( "PRWCommonFileMC23g", m_commonPRWFileMC23g);
672 //LargeR uncertainties config, as from https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/JetUncertainties2016PrerecLargeR#Understanding_which_configuratio
673 declareProperty( "JetLargeRuncConfig", m_fatJetUncConfig );
674 declareProperty( "JetLargeRuncVars", m_fatJetUncVars );
675 declareProperty( "JetWtaggerConfig", m_WtagConfig );
676 declareProperty( "JetZtaggerConfig", m_ZtagConfig );
677 declareProperty( "JetWZTaggerCalibArea", m_WZTaggerCalibArea );
678 declareProperty( "JetToptaggerConfig", m_ToptagConfig );
679 declareProperty( "JetTruthLabelName", m_JetTruthLabelName );
680 declareProperty( "JetTopTaggerCalibArea", m_TopTaggerCalibArea );
681 declareProperty( "JetWTaguncConfig", m_WTagUncConfig );
682 declareProperty( "JetZTaguncConfig", m_ZTagUncConfig );
683 declareProperty( "JetTopTaguncConfig", m_TopTagUncConfig );
684 //Btagging MCtoMC SFs
685 declareProperty( "ShowerType", m_showerType = 0 );
686 //Egamma NP correlation model
687 declareProperty( "EleEffNPcorrModel", m_EG_corrModel );
688 //Egamma correction file list override
689 declareProperty( "EleEffCorrFNList", m_EG_corrFNList );
690 declareProperty( "IsRun3", m_isRun3 );
691 declareProperty( "IsPHYSLITE", m_isPHYSLITE );
692
693 //For electron trigger SF tools
694 declareProperty( "ElectronTriggerSFStringSingle", m_electronTriggerSFStringSingle);
695
696 //--- Tool pointers /MT : we may want to improve the descriptions :)
697 m_jetCalibTool.declarePropertyFor( this, "JetCalibTool", "The JetCalibTool" );
698 m_jetFatCalibTool.declarePropertyFor( this, "FatJetCalibTool", "The JetCalibTool for large-R jets" );
699 m_jetUncertaintiesTool.declarePropertyFor( this, "JetUncertaintiesTool", "The JetUncertaintiesTool" );
700 m_jetUncertaintiesPDSmearTool.declarePropertyFor( this, "JetPDSmearUncertaintiesTool", "The JetPDSmearUncertaintiesTool" );
701 m_fatjetUncertaintiesTool.declarePropertyFor( this, "FatJetUncertaintiesTool", "The JetUncertaintiesTool for large-R jets" );
702 m_fatjetUncertaintiesPDSmearTool.declarePropertyFor( this, "FatJetPDSmearUncertaintiesTool", "The FatJetPDSmearUncertaintiesTool" );
703 m_fatjetFFSmearingTool.declarePropertyFor( this, "FatJetFFSmearingTool", "The FFSmearingTool for large-R jets" );
704 m_WTagjetUncertaintiesTool.declarePropertyFor( this, "WJetUncertaintiesTool", "The JetUncertaintiesTool for large-R W-tagged jets" );
705 m_ZTagjetUncertaintiesTool.declarePropertyFor( this, "ZJetUncertaintiesTool", "The JetUncertaintiesTool for large-R Z-tagged jets" );
706 m_TopTagjetUncertaintiesTool.declarePropertyFor( this, "TopJetUncertaintiesTool", "The JetUncertaintiesTool for large-R Top-tagged jets" );
707 m_jetCleaningTool.declarePropertyFor( this, "JetCleaningTool", "The JetCleaningTool" );
708 m_jetPileupLabelingTool.declarePropertyFor( this, "JetPileupLabelingTool", "The JetPileupLabelingTool" );
709 m_jetJvtMomentTool.declarePropertyFor( this, "JetJvtMomentTool", "The JetJvtMomentTool" );
710 m_jetNNJvtMomentTool.declarePropertyFor( this, "JetNNJvtMomentTool", "The JetNNJvtMomentTool" );
711 m_jetNNJvtSelectionTool.declarePropertyFor( this, "JetNNJvtSelectionTool", "The JetNNJvtSelectionTool" );
712 m_jetNNJvtEfficiencyTool.declarePropertyFor( this, "JetNNJvtEfficiencyTool", "The JetNNJvtEfficiencyTool" );
713 m_jetfJvtSelectionTool.declarePropertyFor( this, "JetfJvtSelectionTool", "The JetfJvtSelectionTool" );
714 m_jetfJvtEfficiencyTool.declarePropertyFor( this, "JetfJvtEfficiencyTool", "The JetfJvtEfficiencyTool" );
715 //
716 m_WTaggerTool.declarePropertyFor( this, "WTaggerTool", "The SmoothedWZTaggerTool" );
717 m_ZTaggerTool.declarePropertyFor( this, "ZTaggerTool", "The SmoothedWZTaggerTool" );
718 m_TopTaggerTool.declarePropertyFor( this, "TopTaggerTool", "The DNNTopTaggerTool" );
719 m_jetTruthLabelingTool.declarePropertyFor( this, "JetTruthLabelingTool", "The JetTruthLabelingTool" );
720 //
721 m_muonSelectionTool.declarePropertyFor( this, "MuonSelectionTool", "The MuonSelectionTool for signal muons" );
722 m_muonSelectionHighPtTool.declarePropertyFor( this, "MuonSelectionHighPtTool", "The MuonSelectionTool for signal muons (HighPt WP)" );
723 m_muonSelectionToolBaseline.declarePropertyFor( this, "MuonSelectionToolBaseline", "The MuonSelectionTool for baseline muons" );
724 m_muonCalibTool.declarePropertyFor( this, "MuonCalibTool", "The MuonCalibTool" );
725 m_muonEfficiencySFTool.declarePropertyFor( this, "MuonEfficiencyScaleFactorsTool", "The MuonEfficiencySFTool" );
726 m_muonEfficiencyBMHighPtSFTool.declarePropertyFor( this, "MuonBadMuonHighPtScaleFactorsTool", "The MuonBadMuonHighPtSFTool" );
727 m_muonTTVAEfficiencySFTool.declarePropertyFor( this, "MuonTTVAEfficiencyScaleFactorsTool", "The MuonTTVAEfficiencySFTool" );
728 m_muonIsolationSFTool.declarePropertyFor( this, "MuonIsolationScaleFactorsTool", "The MuonIsolationSFTool" );
729 m_muonHighPtIsolationSFTool.declarePropertyFor( this, "MuonHighPtIsolationScaleFactorsTool", "The MuonIsolationSFTool" );
730 m_muonTriggerSFTool.declarePropertyFor( this, "MuonTriggerScaleFactorsTool", "The MuonTriggerSFTool" );
731 m_muonLRTORTool.declarePropertyFor( this, "MuonLRTOverlapRemovalTool", "Prompt/LRT muon OR Tool" );
732 //
733 m_elecEfficiencySFTool_reco.declarePropertyFor( this, "ElectronEfficiencyCorrectionTool_reco", "The ElectronEfficiencyCorrectionTool for reconstruction SFs" );
734 m_elecEfficiencySFTool_trig_singleLep.declarePropertyFor( this, "ElectronEfficiencyCorrectionTool_trig_singleLep", "The ElectronEfficiencyCorrectionTool for single-e triggers" );
735 m_elecEfficiencySFTool_id.declarePropertyFor( this, "ElectronEfficiencyCorrectionTool_id", "The ElectronEfficiencyCorrectionTool for ID SFs" );
736 m_elecEfficiencySFTool_iso.declarePropertyFor( this, "ElectronEfficiencyCorrectionTool_iso" , "The ElectronEfficiencyCorrectionTool for iso SFs" );
737 m_elecEfficiencySFTool_isoHighPt.declarePropertyFor( this, "ElectronEfficiencyCorrectionTool_isoHigPt" , "The ElectronEfficiencyCorrectionTool for iso high-pt SFs" );
738 m_elecSelLikelihood.declarePropertyFor( this, "ElectronLikelihoodTool" , "The ElectronSelLikelihoodTool for signal electrons" );
739 m_elecSelLikelihoodBaseline.declarePropertyFor( this, "ElectronLikelihoodToolBaseline" , "The ElectronSelLikelihoodTool for baseline electrons" );
740 m_egammaAmbiguityTool.declarePropertyFor( this, "EgammaAmbiguityTool", "The EgammaAmbiguityTool" );
741 m_elecChargeIDSelectorTool.declarePropertyFor( this, "ElectronChargeIDSelectorTool", "The ElectronChargeIDSelectorTool" );
742 m_elecChargeEffCorrTool.declarePropertyFor( this, "ElectronChargeEffCorrectionTool", "The ElectronChargeEffCorrectionTool" );
743 m_elecLRTORTool.declarePropertyFor( this, "ElectronLRTOverlapRemovalTool", "Prompt/LRT electron OR Tool" );
744 //
745 m_photonSelIsEM.declarePropertyFor( this, "PhotonIsEMSelector" , "The PhotonIsEMSelectorTool for signal photons" );
746 m_photonSelIsEMBaseline.declarePropertyFor( this, "PhotonIsEMSelectorBaseline" , "The PhotonIsEMSelectorTool for baseline photons" );
747 m_photonEfficiencySFTool.declarePropertyFor( this, "PhotonEfficiencyCorrectionTool", "The PhotonEfficiencyCorrectionTool for reco SFs" );
748 m_photonIsolationSFTool.declarePropertyFor( this, "PhotonIsolationCorrectionTool", "The PhotonEfficiencyCorrectionTool for iso SFs" );
749 m_photonTriggerSFTool.declarePropertyFor( this, "PhotonTriggerEfficiencyCorrectionTool", "The PhotonEfficiencyCorrectionTool for trigger SFs" );
750 //
751 m_egammaCalibTool.declarePropertyFor( this, "EgammaCalibrationAndSmearingTool", "The EgammaCalibrationAndSmearingTool");
752 //
753 m_tauSelTool.declarePropertyFor( this, "TauSelectionTool", "The TauSelectionTool for signal taus" );
754 m_tauSelToolBaseline.declarePropertyFor( this, "TauSelectionToolBaseline", "The TauSelectionTool for baseline taus" );
755 m_tauSmearingTool.declarePropertyFor( this, "TauSmearingTool", "The TauSmearingTool" );
756 m_tauTruthMatch.declarePropertyFor( this, "TauTruthMatch", "The TTMT" );
757 m_tauEffTool.declarePropertyFor( this, "TauEfficiencyCorrectionsTool", "The TauEfficiencyCorrectionsTool" );
758 //
759 m_btagEffTool.declarePropertyFor( this, "BTaggingEfficiencyTool", "The BTaggingEfficiencyTool" );
760 m_btagSelTool.declarePropertyFor( this, "BTaggingSelectionTool", "The main BTaggingSelectionTool" );
761 m_btagSelTool_OR.declarePropertyFor( this, "BTaggingSelectionTool_OR", "The BTaggingSelectionTool used to select b-jets for overlap removal" );
762 m_btagEffTool_trkJet.declarePropertyFor( this, "BTaggingEfficiencyTool_trkJet", "The BTaggingEfficiencyTool for track jets" );
763 m_btagSelTool_trkJet.declarePropertyFor( this, "BTaggingSelectionTool_trkJet", "The main BTaggingSelectionTool for track jets" );
764 //
765 m_metMaker.declarePropertyFor( this, "METMaker", "The METMaker instance");
766 m_metSystTool.declarePropertyFor( this, "METSystTool", "The METSystematicsTool");
767 m_metSignif.declarePropertyFor( this, "METSignificance", "The METSignifiance instance");
768 //
769 m_trigGlobalEffCorrTool_diLep.declarePropertyFor( this, "TrigGlobalEfficiencyCorrection_diLep", "The TrigGlobalEfficiencyCorrection tool for dilepton" );
770 m_trigGlobalEffCorrTool_multiLep.declarePropertyFor( this, "TrigGlobalEfficiencyCorrection_multiLep", "The TrigGlobalEfficiencyCorrection tool for trilepton" );
771 m_trigGlobalEffCorrTool_diPhoton.declarePropertyFor( this, "TrigGlobalEfficiencyCorrection_diPhoton", "The TrigGlobalEfficiencyCorrection tool for asymmetric diphoton" );
772 m_trigConfTool.declarePropertyFor( this, "TrigConfigTool", "The TrigConfigTool" );
773 m_trigDecTool.declarePropertyFor( this, "TrigDecisionTool", "The TrigDecisionTool" );
774 m_trigMatchingTool.declarePropertyFor( this, "TrigMatchTool", "The TrigMatchingTool" );
775 m_trigMatchScoringTool.declarePropertyFor( this, "TrigMatchScoringTool", "The TrigMatchScoringTool" );
776 m_trigDRScoringTool.declarePropertyFor( this, "TrigDRScoringTool", "The TrigDRScoringTool" );
777 //
778 m_isoCorrTool.declarePropertyFor( this, "IsolationCorrectionTool", "The IsolationCorrectionTool" );
779 m_isoTool.declarePropertyFor( this, "IsolationSelectionTool", "The IsolationSelectionTool");
780 //disable m_isoToolLowPtPLV.declarePropertyFor( this, "IsolationLowPtPLVTool", "The IsolationLowPtPLVTool");
781 m_isoBaselineTool.declarePropertyFor( this, "IsolationSelectionTool_Baseline", "The IsolationSelectionTool for baseline objects");
782 m_isoHighPtTool.declarePropertyFor( this, "IsolationSelectionTool_HighPt", "The IsolationSelectionTool for High Pt");
783 m_isoCloseByTool.declarePropertyFor( this, "IsolationCloseByCorrectionTool", "The IsolationCloseByCorrectionTool");
784 //
785 m_prwTool.declarePropertyFor( this, "PileupReweightingTool", "The PRW tool" );
786 //
787 m_LRTuncTool.declarePropertyFor( this, "InclusiveTrackFilterTool", "The LRT uncertainty tool");
788 //
789 m_pmgSHnjetWeighter.declarePropertyFor( this, "PMGSHVjetReweightTool", "The PMGSHVjetReweightTool (AntiKt4TruthJets)" );
790 m_pmgSHnjetWeighterWZ.declarePropertyFor( this, "PMGSHVjetReweightWZTool", "The PMGSHVjetReweightTool (AntiKt4TruthWZJets)" );
791 //
792 m_tauJetORtool.declarePropertyFor( this, "TauJetOverlapTool", "The TauJetOverlapTool");
793 //disable m_orToolbox.declarePropertyFor( this, "OverlapRemovalTool", "The overlap removal tool");
794
795 //load supported WPs (by tightness order)
796 m_el_id_support.push_back("VeryLooseNoPix"); // WPs for LRT Electron
797 m_el_id_support.push_back("VeryLooseLLH");
798 m_el_id_support.push_back("LooseNoPix"); // WPs for LRT Electron
799 m_el_id_support.push_back("LooseLLH");
800 m_el_id_support.push_back("LooseAndBLayerLLH");
801 m_el_id_support.push_back("LooseDNNnoCF");
802 m_el_id_support.push_back("LooseDNN");
803 m_el_id_support.push_back("MediumNoPix"); // WPs for LRT Electron
804 m_el_id_support.push_back("MediumLLH");
805 m_el_id_support.push_back("MediumDNNnoCF");
806 m_el_id_support.push_back("MediumDNN");
807 m_el_id_support.push_back("TightNoPix"); // WPs for LRT Electron
808 m_el_id_support.push_back("TightLLH");
809 m_el_id_support.push_back("TightDNNnoCF");
810 m_el_id_support.push_back("TightDNN");
811
812 m_ph_id_support.push_back("Loose");
813 m_ph_id_support.push_back("Medium");
814 m_ph_id_support.push_back("Tight");
815 m_ph_id_support.push_back("TightPtIncl"); // Should not be mixed with Tight
816
817 m_mu_id_support = 4; //maximum value supported
818
819 // Tau ID WPs
820 m_tau_id_support.push_back("001");
821 m_tau_id_support.push_back("VeryLoose");
822 m_tau_id_support.push_back("Loose");
823 m_tau_id_support.push_back("Medium");
824 m_tau_id_support.push_back("Tight");
825
826 // Iso WPs
827 // -- see https://twiki.cern.ch/twiki/bin/view/AtlasProtected/RecommendedIsolationWPs#Current_official_working_points
828 // -- the el iso points are those which have (or will have) SFs available
830 "FCLoose", "FCTight", // current WPs
831 "FCHighPtCaloOnly", // current HighPtCaloOnly WPs
832 "Gradient", //
833 "HighPtCaloOnly", //
834 "TightTrackOnly_VarRad","TightTrackOnly_FixedRad",//
835 "Tight_VarRad","Loose_VarRad", //
836 "PLVLoose", "PLVTight", // PLV recommended WPs, fallback support below b/o SFs and & egamma map file
837 "PLImprovedTight", "PLImprovedVeryTight" // New PLIV WPs, fallback support below b/o SFs & egamma map file
838 };
839 // -- the muon iso points are those which have SFs available
840 // -- more details https://indico.cern.ch/event/878781/contributions/3721998/attachments/1976194/3289315/20200127_IFFshort_2.pdf
842 "PflowLoose_FixedRad", "PflowLoose_VarRad", "PflowTight_FixedRad", "PflowTight_VarRad", // PFlow (new naming) recommended WPs
843 "TightTrackOnly_FixedRad", "TightTrackOnly_VarRad", "HighPtTrackOnly", // TrackOnly (new naming) recommended WPs
844 "PLVLoose", "PLVTight", // PLV recommended WPs
845 "Loose_VarRad", "Loose_FixedRad", "Tight_VarRad", "Tight_FixedRad", // Other WPs (new naming)
846 "PLImprovedTight", "PLImprovedVeryTight" // New PLIV WPs, fallback support below b/o SFs
847 };
848
849 // Construct electron fallback WPs for SFs
850 for (const auto& x : m_el_iso_support) { m_el_iso_fallback[x] = x; } // all current WPs
851 m_el_iso_fallback["PLVTight"] = "FCTight"; // plus actual fallback
852 m_el_iso_fallback["PLVLoose"] = "FCLoose";
853 m_el_iso_fallback["PLImprovedTight"] = "FCTight";
854 m_el_iso_fallback["PLImprovedVeryTight"] = "FCTight";
855 m_el_iso_fallback["HighPtCaloOnly"] = "FCHighPtCaloOnly";
856 m_el_iso_fallback["TightTrackOnly_VarRad"] = "FCTight";
857 m_el_iso_fallback["TightTrackOnly_FixedRad"] = "FCTight";
858 m_el_iso_fallback["Tight_VarRad"] = "FCTight";
859 m_el_iso_fallback["Loose_VarRad"] = "FCLoose";
860
861 // Construct muon fallback WPs for SFs
863 m_mu_iso_fallback["PLImprovedTight"] = "PLVTight";
864 m_mu_iso_fallback["PLImprovedVeryTight"] = "PLVTight";
865
866 // Construct tau fallback WPs for GNTau --> RNN ID SFs
868 m_tau_id_fallback[10] = 6; // VeryLoose
869 m_tau_id_fallback[11] = 7; // Loose
870 m_tau_id_fallback[12] = 8; // Medium
871 m_tau_id_fallback[13] = 9; // Tight
872}
873
874#define CHECK_TOOL_RETRIEVE( TOOLHANDLE ) \
875 ATH_MSG_VERBOSE("Try to retrieve " << #TOOLHANDLE); \
876 if( TOOLHANDLE.retrieve().isFailure()) { \
877 ATH_MSG_ERROR("Failed to retrieve tool " << #TOOLHANDLE); \
878 return StatusCode::FAILURE; \
879 }
880
881#define CHECK_TOOL_RETRIEVE_NONEMPTY( TOOLHANDLE ) \
882 CHECK_TOOL_RETRIEVE_CONDITIONAL( TOOLHANDLE, !TOOLHANDLE.empty())
883
884#define CHECK_TOOL_RETRIEVE_CONDITIONAL( TOOLHANDLE, CONDITION ) \
885 if( CONDITION) { \
886 ATH_MSG_VERBOSE("Try to retrieve " << #TOOLHANDLE); \
887 if(TOOLHANDLE.retrieve().isFailure()) { \
888 ATH_MSG_ERROR("Failed to retrieve tool " << #TOOLHANDLE); \
889 return StatusCode::FAILURE; \
890 } \
891 }
892
893//--- override AsgTools behaviour for HyperBool properties
894StatusCode SUSYObjDef_xAOD::setBoolProperty(const std::string& name, const bool& property){
895 m_bool_prop_set.insert(name);
896 return this->setProperty(name, property);
897}
898//---
899
901
902 if (m_tool_init) {
903 ATH_MSG_ERROR("Initialising for a second time -- something is wrong!");
904 return StatusCode::FAILURE;
905 }
906
907 // Greet the user:
908 ATH_MSG_INFO( "Initialising... " );
909
910 bool autoconf(false);
911#ifndef XAOD_STANDALONE // For now metadata is Athena-only
912 if ( m_dataSource < 0 ) {
913 autoconf = true;
914 ATH_MSG_INFO("Autoconfiguring: dataSource, mcCampaign, isPHYSLITE");
915 std::string projectName = "";
916 ATH_CHECK( AthAnalysisHelper::retrieveMetadata("/TagInfo", "project_name", projectName, inputMetaStore() ) );
917 if ( projectName == "IS_SIMULATION" ) {
918 std::string simFlavour = "";
919 ATH_CHECK( AthAnalysisHelper::retrieveMetadata("/Simulation/Parameters", "SimulationFlavour", simFlavour, inputMetaStore() ) );
920 TString s(simFlavour); s.ToUpper();
921 m_dataSource = s.Contains("ATLFAST") ? AtlfastII : FullSim;
922 } else if (projectName.compare(0, 4, "data") == 0 ) {
924 } else {
925 ATH_MSG_ERROR("Failed to autoconfigure -- project_name matches neither IS_SIMULATION nor data!");
926 return StatusCode::FAILURE;
927 }
928
929 }
930#endif
931
933
934 //Read configuration from file (stored as Property)
936
937 if (m_dataSource < 0) {
938 ATH_MSG_FATAL( "Data source incorrectly configured!!" );
939 ATH_MSG_FATAL("You must set the DataSource property to Data, FullSim or AtlfastII !!");
940 if (autoconf) ATH_MSG_FATAL("Autoconfiguration seems to have failed!");
941 // if(m_useLeptonTrigger<0) ATH_MSG_ERROR( "UseLeptonTrigger not set");
942 ATH_MSG_FATAL( "Exiting... " );
943 return StatusCode::FAILURE;
944 }
945 ATH_MSG_DEBUG( "Configured: IsData: " << isData() );
946 ATH_MSG_DEBUG( "Configured: IsAtlfast: " << isAtlfast() );
947
948 switch (m_jetInputType) {
952 break;
953 default:
955 return StatusCode::FAILURE;
956 }
957
958 if (m_inputMETSuffix.empty()){
960 }
962 ATH_MSG_INFO( "Configured for jet collection: " << m_defaultJets );
963
964 m_defaultTruthJets = "AntiKt4TruthJets";
965 const xAOD::FileMetaData* fmd = nullptr;
966 std::string dataType;
967 if ( inputMetaStore()->contains<xAOD::FileMetaData>("FileMetaData") && inputMetaStore()->retrieve(fmd,"FileMetaData").isSuccess() )
968 fmd->value(xAOD::FileMetaData::dataType, dataType);
969 if ( dataType.compare("StreamDAOD_PHYS")==0 || dataType.compare("StreamDAOD_PHYSLITE")==0 ) m_defaultTruthJets = "AntiKt4TruthDressedWZJets";
970 if ( dataType.compare("StreamDAOD_PHYSLITE")==0) m_isPHYSLITE = true;
971
972 ATH_MSG_INFO( "Configured for truth jet collection: " << m_defaultTruthJets );
973
974 m_inputMETCore = m_isPHYSLITE? "MET_Core_AnalysisMET":"MET_Core_" + m_inputMETSuffix;
975 m_inputMETMap = m_isPHYSLITE? "METAssoc_AnalysisMET":"METAssoc_" + m_inputMETSuffix;
976
977 ATH_MSG_DEBUG ( "Build MET Core: " << m_inputMETCore);
978 ATH_MSG_DEBUG ( "Build MET with map: " << m_inputMETMap);
979
980 m_jetCleanDFName = TString::Format("DFCommonJets_jetClean_%s", m_badJetCut.c_str());
982
983 // the decorations are named like DFCommonElectronsLHTight, DFCommonElectronsDNNTight or DFCommonElectronsDNNTightNoCF
984 m_eleIdBaselineDFName = m_eleIdBaseline.find("DNN") == std::string::npos ? "DFCommonElectronsLH" : "DFCommonElectronsDNN";
985 m_eleIdBaselineDFName += TString(m_eleIdBaseline).ReplaceAll("LooseAndBLayer","LooseBL").ReplaceAll("LLH","").ReplaceAll("DNNnoCF","").ReplaceAll("DNN","").Data();
986 if (m_eleIdBaseline.find("noCF") != std::string::npos)
987 m_eleIdBaselineDFName += "NoCF";
989
990 m_eleIdDFName = m_eleId.find("DNN") == std::string::npos ? "DFCommonElectronsLH" : "DFCommonElectronsDNN";
991 m_eleIdDFName += TString(m_eleId).ReplaceAll("LooseAndBLayer","LooseBL").ReplaceAll("LLH","").ReplaceAll("DNNnoCF","").ReplaceAll("DNN","").Data();
992 if (m_eleId.find("noCF") != std::string::npos)
993 m_eleIdDFName += "NoCF";
995
996 m_photonIdBaselineDFName = "DFCommonPhotonsIsEM";
999
1000 m_photonIdDFName = "DFCommonPhotonsIsEM";
1001 m_photonIdDFName += TString(m_photonId).Data();
1003
1004 // autoconfigure PRW tool if m_autoconfigPRW==true
1005 if (m_autoconfigPRWPath == "dev/PileupReweighting/share/")
1007 else
1008 // need to set a full path if you don't use the one in CVMFS
1010
1011 // Read Handles
1012 ATH_CHECK( m_LRTCollectionName.initialize() );
1013 ATH_CHECK( m_GSFLRTCollectionName.initialize() );
1014
1015 // Write Handles
1016 ATH_CHECK( m_outElectronLocation.initialize() );
1017 ATH_CHECK( m_outMuonLocation.initialize() );
1018
1019 ATH_CHECK( this->SUSYToolsInit() );
1020
1021 ATH_MSG_VERBOSE("Done with tool retrieval");
1022
1023 m_tool_init = true;
1024
1025 // Return gracefully:
1026 return StatusCode::SUCCESS;
1027}
1028
1029StatusCode SUSYObjDef_xAOD::autoconfigurePileupRWTool(const std::string& PRWfilesDir, const std::string& PRWfileName, bool usePathResolver, bool RPVLLmode, bool Combinedmode, const std::string& /* HFFilter */ ) {
1030
1031 // this will contain the path of the PRW file on /cvmfs which needs to be reverse engineered from the DSID and MC campaign
1032 // the path(s) will be added to m_prwConfFiles which is later used in the configuration of the CP PRW tool
1033 std::string prwConfigFile("");
1034
1035 if ( !isData() && m_autoconfigPRW ) {
1036
1037 prwConfigFile = PRWfilesDir;
1038
1039 float dsid = -999;
1040 std::string amiTag("");
1041 std::string mcCampaignMD("");
1042 std::string simFlavour("");
1043 std::string simType("");
1044 const xAOD::FileMetaData* fmd = nullptr;
1045
1046 // configure PRW rtag options from m_autoconfigPRWRtags string
1047 // e.g. "mc20a:r13167_r14859,mc20d:r13144_r14860,mc20e:r13145_r14861,mc23a:r14622_r14932_r15540,mc23d:r15224_r15530,mc23e:r16083,mc23g:r17610"
1048 std::map<std::string,std::vector<std::string>> PRWRtags = {};
1049 std::string allcampaigns = "mc20a.mc20d.mc20e.mc23a.mc23d.mc23e.mc23g";
1050 bool standard_like = true;
1051 for ( const auto& campaign_rtags : split( m_autoconfigPRWRtags, "," ) ) { // split string by ","
1052 std::string icampaign = campaign_rtags.substr(0, campaign_rtags.find(":")); // first field = campaign, split by ":"
1053 std::vector<std::string> irtags = split( campaign_rtags.substr(campaign_rtags.find(":")+1), "_" ); // remaining fields = rtags, split by "_"
1054 PRWRtags[icampaign] = irtags;
1055 ATH_MSG_DEBUG( "PRW autoconfigure considering rtags " << campaign_rtags.substr(campaign_rtags.find("_")+1) << " for campaign " << icampaign );
1056 }
1057 for ( const auto& x : PRWRtags ) {
1058 if ( allcampaigns.find(x.first)==string::npos ) {
1059 ATH_MSG_ERROR("m_autoconfigPRWRtags contains invalid campaign: " << x.first << " (" << m_autoconfigPRWRtags << ")");
1060 ATH_MSG_ERROR("use any of " << allcampaigns);
1061 return StatusCode::FAILURE;
1062 }
1063 }
1064
1065 // let's use MetaData to extract sample information
1066 if ( inputMetaStore()->contains<xAOD::FileMetaData>("FileMetaData") && inputMetaStore()->retrieve(fmd,"FileMetaData").isSuccess() ) {
1068 fmd->value(xAOD::FileMetaData::amiTag, amiTag);
1069 fmd->value(xAOD::FileMetaData::simFlavour, simFlavour);
1070
1071 if(simFlavour.starts_with("ATLFASTII")) simType = "AFII";
1072 else if(simFlavour.starts_with("ATLFAST3")) simType = "AF3";
1073 else simType = "FS";
1074
1075 bool found = false;
1076 while ( mcCampaignMD.empty() ) {
1077 for ( const auto& campaign_rtags : PRWRtags ) { // consider all campaigns
1078 for ( const auto& rtag: campaign_rtags.second ) { // consider all rtags
1079 if (found) continue;
1080 if (amiTag.find(rtag)!=string::npos) { // find matching tag
1081 mcCampaignMD = campaign_rtags.first.substr(0,5); // save campaign
1082 standard_like = (campaign_rtags.first.find("ns")?true:false); // track non-standard r-tags
1083 found = true; // break if found
1084 }
1085 }
1086 }
1087 // in case not found
1088 if (!found) {
1089 ATH_MSG_ERROR( "autoconfigurePileupRWTool(): unrecognized xAOD::FileMetaData::amiTag, \'" << amiTag << "'. Please check your input sample.");
1090 return StatusCode::FAILURE;
1091 }
1092 //
1093 ATH_MSG_INFO( "Setting up autoconfigurePileupRWTool for mc campaign " << mcCampaignMD << " (from amiTag " << amiTag << ") (standard-like = " << (standard_like?"true":"false") << ")." );
1094 if ( (!standard_like) && (!RPVLLmode) )
1095 ATH_MSG_WARNING("Non-standard r-tag found (" << amiTag.data() << "), but RPVLLmode not set. Perhaps you want to set \"PRW.autoconfigPRWRPVmode: 1\" in the config?");
1096 }
1097 } else {
1098#ifndef XAOD_STANDALONE
1099 ATH_MSG_ERROR( "autoconfigurePileupRWTool(): access to FileMetaData failed, can't get mc channel number.");
1100 return StatusCode::FAILURE;
1101#else
1102
1103 if ( m_mcCampaign == "mc20a" || m_mcCampaign == "mc20d" || m_mcCampaign == "mc20e" || m_mcCampaign == "mc23a" || m_mcCampaign == "mc23d" || m_mcCampaign == "mc23e" || m_mcCampaign == "mc23g") {
1104 // First see if the user set the mcCampaign/run number by property (hopefully temporary workaround)
1105 if ( m_mcChannel > 0) {
1106 ATH_MSG_WARNING( "autoconfigurePileupRWTool(): access to FileMetaData failed -> getting the mc channel number (DSID) and campaign from configuration." );
1107 std::string NoMetadataButPropertyOK("");
1108 NoMetadataButPropertyOK += "autoconfigurePileupRWTool(): 'mcCampaign' is used and passed to SUSYTools as '";
1109 NoMetadataButPropertyOK += m_mcCampaign;
1110 NoMetadataButPropertyOK += "'. 'mcChannel' is used and passed to SUSYTools as '";
1111 NoMetadataButPropertyOK += std::to_string(m_mcChannel);
1112 NoMetadataButPropertyOK += "'. Autocongiguring PRW accordingly.";
1113 ATH_MSG_WARNING( NoMetadataButPropertyOK );
1114 mcCampaignMD = m_mcCampaign;
1115 dsid = m_mcChannel;
1116 } else {
1117 // OK, this is a fall-back option without using MetaData but one has to manually set 'mcCampaign' property
1118 ATH_MSG_WARNING( "autoconfigurePileupRWTool(): access to FileMetaData failed -> getting the mc channel number (DSID) from the event store." );
1119 const xAOD::EventInfo* evtInfo = GetEventInfo();
1120 dsid = evtInfo->mcChannelNumber();
1121
1122 std::string NoMetadataButPropertyOK("");
1123 NoMetadataButPropertyOK += "autoconfigurePileupRWTool(): 'mcCampaign' is used and passed to SUSYTools as '";
1124 NoMetadataButPropertyOK += m_mcCampaign;
1125 NoMetadataButPropertyOK += "'. Autoconfiguring PRW accordingly.";
1126 ATH_MSG_WARNING( NoMetadataButPropertyOK );
1127 mcCampaignMD = m_mcCampaign;
1128 }
1129 } else {
1130 ATH_MSG_ERROR( "autoconfigurePileupRWTool(): `mcCampaign' is not set properly.");
1131 return StatusCode::FAILURE;
1132 }
1133#endif
1134 }
1135
1136 // If requested set the PRW file to common PRW file of the processed MC campaign
1137 if (m_useCommonPRWFiles) {
1138 ATH_MSG_INFO( "autoconfigurePileupRWTool(): retrieving the common PRW file for MC campaign: " << mcCampaignMD );
1139 if (mcCampaignMD == "mc20a") {prwConfigFile = PathResolverFindCalibFile(m_commonPRWFileMC20a);}
1140 else if (mcCampaignMD == "mc20d") {prwConfigFile = PathResolverFindCalibFile(m_commonPRWFileMC20d);}
1141 else if (mcCampaignMD == "mc20e") {prwConfigFile = PathResolverFindCalibFile(m_commonPRWFileMC20e);}
1142 else if (mcCampaignMD == "mc23a") {prwConfigFile = PathResolverFindCalibFile(m_commonPRWFileMC23a);}
1143 else if (mcCampaignMD == "mc23d") {prwConfigFile = PathResolverFindCalibFile(m_commonPRWFileMC23d);}
1144 else if (mcCampaignMD == "mc23e") {prwConfigFile = PathResolverFindCalibFile(m_commonPRWFileMC23e);}
1145 else if (mcCampaignMD == "mc23g") {prwConfigFile = PathResolverFindCalibFile(m_commonPRWFileMC23g);}
1146 else {
1147 ATH_MSG_ERROR( "autoconfigurePileupRWTool(): no common PRW file known for MC campaign: " << mcCampaignMD);
1148 return StatusCode::FAILURE;
1149 }
1150 }
1151 // Otherwise try finding the dedicated PRW file on /cvmfs
1152 else {
1153 // Retrieve the input file
1154 int DSID_INT = static_cast<int>(dsid);
1155 prwConfigFile += "DSID" + std::to_string(DSID_INT/1000) + "xxx/pileup_" + mcCampaignMD + "_dsid" + std::to_string(DSID_INT) + "_" + simType + ".root";
1156
1157 if (RPVLLmode) prwConfigFile = TString(prwConfigFile).ReplaceAll(".root","_rpvll.root").Data();
1158
1159 // PRW file specified by user
1160 // e.g. DSID700xxx/pileup_mc20a_dsid700015_FS.root
1161 if (!PRWfileName.empty()) {
1162 prwConfigFile = PRWfilesDir + PRWfileName;
1163 ATH_MSG_INFO( "autoconfigurePileupRWTool(): PRW file was specifed by user: " << prwConfigFile.data() );
1164 }
1165 }
1166
1167 m_prwConfFiles.clear();
1168
1169 // Combined mode can be only used when running with full data with the same MC samples
1170 if (Combinedmode) {
1171 if (mcCampaignMD.find("mc20") == std::string::npos) {
1172 ATH_MSG_ERROR( "autoconfigurePileupRWTool(): combined mode currently onlys supported for mc20! Impossible to autoconfigure PRW. Aborting." );
1173 return StatusCode::FAILURE;
1174 }
1175 // When using the common PRW files we can directly add them
1176 if (m_useCommonPRWFiles) {
1180 }
1181 // Otherwise we have to replace the mc campaign in the name accordingly
1182 else {
1183 m_prwConfFiles.emplace_back( TString(prwConfigFile).ReplaceAll(mcCampaignMD, "mc20a").Data() );
1184 m_prwConfFiles.emplace_back( TString(prwConfigFile).ReplaceAll(mcCampaignMD, "mc20d").Data() );
1185 m_prwConfFiles.emplace_back( TString(prwConfigFile).ReplaceAll(mcCampaignMD, "mc20e").Data() );
1186 }
1189 } else {
1190 m_prwConfFiles.push_back( prwConfigFile );
1191 if ( mcCampaignMD == "mc20d") {
1193 } else if (mcCampaignMD == "mc20e") {
1195 } else if (mcCampaignMD == "mc23a") {
1197 } else if (mcCampaignMD == "mc23d") {
1199 } else if (mcCampaignMD == "mc23e") {
1201 } else if (mcCampaignMD == "mc23g") {
1203 }
1204 }
1205 prwConfigFile = usePathResolver ? PathResolverFindCalibFile(prwConfigFile) : prwConfigFile;
1206
1207 // Test if file exists (i.e. was requested already to /cvmfs if the DSID-specific PRW files are used) and is usable
1208 TFile testF(prwConfigFile.data(),"read");
1209 if (testF.IsZombie()) {
1210 ATH_MSG_ERROR( "autoconfigurePileupRWTool(): file not found -> " << prwConfigFile.data() << " ! Impossible to autoconfigure PRW. Aborting." );
1211 if ( (!standard_like) && (!RPVLLmode) )
1212 ATH_MSG_WARNING("Running with non-standard r-tag (" << amiTag.data() << "), but RPVLLmode not set. Perhaps you want to set \"PRW.autoconfigPRWRPVmode: 1\" in the config?");
1213 return StatusCode::FAILURE;
1214 }
1215
1216 ATH_MSG_INFO( "autoconfigurePileupRWTool(): configuring PRW tool using " << prwConfigFile.data() );
1217 }
1218 // Return gracefully
1219 return StatusCode::SUCCESS;
1220}
1221
1223 if (source == 0) m_dataSource = Data;
1224 else if (source == 1) m_dataSource = FullSim;
1225 else if (source == 2) m_dataSource = AtlfastII;
1226 else ATH_MSG_ERROR("Trying to set data source to unknown type (" << source << ")");
1227}
1228
1229
1230bool SUSYObjDef_xAOD::check_isOption(const std::string& wp, const std::vector<std::string>& list) const {
1231 //check if the selected WP is supported
1232 return (std::find(list.begin(), list.end(),wp) != list.end());
1233}
1234
1235bool SUSYObjDef_xAOD::check_isTighter(const std::string& wp1, const std::string& wp2, const std::vector<std::string>& list) const {
1236 //check if WP1 is tighter than WP2
1237 //it is assumed that both WPs are supported
1238 return (std::find(list.begin(),list.end(),wp1) > std::find(list.begin(), list.end(),wp2));
1239}
1240
1241
1242std::string SUSYObjDef_xAOD::EG_WP(const std::string& wp) const {
1243 //translate our electron wps to EGamma internal jargon
1244 //@ElectronPhotonSelectorTools/EGSelectorConfigurationMapping.h
1245 TString copy = TString(wp).Copy().ReplaceAll("AndBLayer","BL").ReplaceAll("LLH","LHElectron");
1246 // the DNN WPs are labeled in the map as e.g. TightDNNnoCFElectron or TightDNNElectron
1247 if (wp.find("DNNnoCF") != std::string::npos)
1248 copy.ReplaceAll("DNNnoCF", "DNNnoCFElectron");
1249 else if (wp.find("DNN") != std::string::npos)
1250 copy.ReplaceAll("DNN", "DNNElectron");
1251 return copy.Data();
1252}
1253
1254std::vector<std::string> SUSYObjDef_xAOD::getElSFkeys(const std::string& mapFile) const {
1255
1256 if( mapFile.empty() )
1257 return {};
1258
1259 std::vector<std::string> theKeys;
1260
1261 std::string filename = PathResolverFindCalibFile(mapFile);
1262 std::ifstream input( filename );
1263 for( std::string line; getline( input, line ); ){
1264 std::vector<std::string> tokens = split((const std::string)line,"=");
1265 if(tokens.size()){
1266 theKeys.push_back(tokens.at(0));
1267 }
1268 }
1269
1270 return theKeys;
1271}
1272
1273void SUSYObjDef_xAOD::configFromFile(bool& property, const std::string& propname, TEnv& rEnv,
1274 bool defaultValue)
1275{
1276 if(m_bool_prop_set.find(m_conf_to_prop[propname])!=m_bool_prop_set.end()){
1277 ATH_MSG_INFO( "configFromFile(): property \"" << propname << "\" already set with value " << property << ". Ignoring change request." );
1278 rEnv.GetTable()->Remove( rEnv.GetTable()->FindObject(propname.c_str() ) );
1279 return;
1280 }
1281 property = rEnv.GetValue(propname.c_str(), static_cast<int>(defaultValue));
1282 ATH_MSG_INFO( "configFromFile(): Loaded property \"" << propname << "\" with value " << property );
1283 // Remove the item from the table
1284 rEnv.GetTable()->Remove( rEnv.GetTable()->FindObject(propname.c_str() ) );
1285}
1286
1287
1288void SUSYObjDef_xAOD::configFromFile(double& property, const std::string& propname, TEnv& rEnv,
1289 double defaultValue)
1290{
1291 // ignore if already configured
1292 if (property > -90.) {
1293 ATH_MSG_INFO( "configFromFile(): property \"" << propname << "\" already set with value " << property << ". Ignoring change request." );
1294 rEnv.GetTable()->Remove( rEnv.GetTable()->FindObject(propname.c_str() ) );
1295 return;
1296 }
1297 property = rEnv.GetValue(propname.c_str(), defaultValue);
1298 ATH_MSG_INFO( "configFromFile(): Loaded property \"" << propname << "\" with value " << property );
1299 // Remove the item from the table
1300 rEnv.GetTable()->Remove( rEnv.GetTable()->FindObject(propname.c_str() ) );
1301}
1302
1303
1304void SUSYObjDef_xAOD::configFromFile(int& property, const std::string& propname, TEnv& rEnv,
1305 int defaultValue)
1306{
1307 // ignore if already configured
1308 if (property > -90){
1309 ATH_MSG_INFO( "configFromFile(): property \"" << propname << "\" already set with value " << property << ". Ignoring change request." );
1310 rEnv.GetTable()->Remove( rEnv.GetTable()->FindObject(propname.c_str() ) );
1311 return;
1312 }
1313 property = rEnv.GetValue(propname.c_str(), defaultValue);
1314 ATH_MSG_INFO( "configFromFile(): Loaded property \"" << propname << "\" with value " << property );
1315 // Remove the item from the table
1316 rEnv.GetTable()->Remove( rEnv.GetTable()->FindObject(propname.c_str() ) );
1317}
1318
1319
1320void SUSYObjDef_xAOD::configFromFile(std::string& property, const std::string& propname, TEnv& rEnv,
1321 const std::string& defaultValue, bool allowEmpty)
1322{
1323 // ignore if already configured
1324 if (!property.empty()){
1325 ATH_MSG_INFO( "configFromFile(): property \"" << propname << "\" already set with value " << property << ". Ignoring change request." );
1326 rEnv.GetTable()->Remove( rEnv.GetTable()->FindObject(propname.c_str() ) );
1327 return;
1328 }
1329 property = rEnv.GetValue(propname.c_str(), defaultValue.c_str());
1330 if (property.empty() && !allowEmpty) {
1331 ATH_MSG_FATAL("Read empty string property from text file (property name: " << propname << ")");
1332 }
1333
1334 // post-processing to get rid of leading/trailing spaces and comments
1335 std::string tmp_prop = property.substr(0, property.find('#', 0));
1336 property = TString(tmp_prop).ReplaceAll(" ","").Data();
1337
1338 // Interpret None as an empty string
1339 if (property=="None" || property=="NONE" || property=="none") {
1340 ATH_MSG_VERBOSE( "Property \"" << propname << "\" being set to empty string due to specification of \"" << property << "\"" );
1341 property = "";
1342 }
1343
1344 ATH_MSG_INFO( "configFromFile(): Loaded property \"" << propname << "\" with value " << property );
1345 // Remove the item from the table
1346 rEnv.GetTable()->Remove( rEnv.GetTable()->FindObject(propname.c_str() ) );
1347}
1348
1349
1351{
1352 ATH_MSG_INFO( "***** ***** ***** *****" );
1353 ATH_MSG_INFO( "Configuring from file " << m_configFile );
1354
1355 TEnv rEnv;
1356 int success = -1;
1357 success = rEnv.ReadFile(m_configFile.c_str(), kEnvAll);
1358 if (success != 0) return StatusCode::FAILURE;
1359
1360 ATH_MSG_INFO( "Config file opened" );
1361
1363 m_jetInputType = xAOD::JetInput::Type(rEnv.GetValue("Jet.InputType", 9));
1364 ATH_MSG_INFO( "readConfig(): Loaded property Jet.InputType with value " << static_cast<int>(m_jetInputType));
1365 }
1366 // Remove the item from the table
1367 rEnv.GetTable()->Remove( rEnv.GetTable()->FindObject("Jet.InputType") );
1368
1369 if (m_muId == static_cast<int>(xAOD::Muon::Quality(xAOD::Muon::VeryLoose))) {
1370 int muIdTmp = rEnv.GetValue("Muon.Id", 1);
1371 m_muId = (muIdTmp<4 ? static_cast<int>(xAOD::Muon::Quality(muIdTmp)) : muIdTmp);
1372 ATH_MSG_INFO( "readConfig(): Loaded property Muon.Id with value " << m_muId);
1373 // Remove the item from the table
1374 rEnv.GetTable()->Remove( rEnv.GetTable()->FindObject("Muon.Id") );
1375 }
1376 if (m_muIdBaseline == static_cast<int>(xAOD::Muon::Quality(xAOD::Muon::VeryLoose))) {
1377 int muIdTmp = rEnv.GetValue("MuonBaseline.Id", 1);
1378 m_muIdBaseline = (muIdTmp<4 ? static_cast<int>(xAOD::Muon::Quality(muIdTmp)) : muIdTmp);
1379 ATH_MSG_INFO( "readConfig(): Loaded property MuonBaseline.Id with value " << m_muIdBaseline);
1380 // Remove the item from the table
1381 rEnv.GetTable()->Remove( rEnv.GetTable()->FindObject("MuonBaseline.Id") );
1382 }
1383
1384 // Deprecation warning
1385 std::string prop = rEnv.GetValue("Jet.JVT_WP", "");
1386 if ( !prop.empty() ) {
1387 ATH_MSG_WARNING("readConfig(): Found deprecated property name Jet.JVT_WP. Please move to using Jet.JvtWP. Propagating for now.");
1388 rEnv.SetValue("Jet.JvtWP", prop.c_str());
1389 rEnv.GetTable()->Remove( rEnv.GetTable()->FindObject("Jet.JVT_WP") );
1390 }
1391
1392 //load config file to Properties map (only booleans for now)
1393 m_conf_to_prop["IsRun3"] = "IsRun3";
1394 m_conf_to_prop["StrictConfigCheck"] = "StrictConfigCheck";
1395 m_conf_to_prop["Btag.enable"] = "UseBtagging";
1396 m_conf_to_prop["BtagTrkJet.enable"] = "UseBtaggingTrkJet";
1397 m_conf_to_prop["Ele.CrackVeto"] = "EleCrackVeto";
1398 m_conf_to_prop["EleBaseline.CrackVeto"] = "EleBaselineCrackVeto";
1399 m_conf_to_prop["Ele.ForceNoId"] = "EleForceNoId";
1400 m_conf_to_prop["Ele.AllowRun3TrigSFFallback"] = "EleAllowRun3TrigSFFallback";
1401 m_conf_to_prop["Muon.ForceNoId"] = "MuonForceNoId";
1402 m_conf_to_prop["Muon.TTVASF"] = "MuonTTVASF";
1403 m_conf_to_prop["Muon.passedHighPt"] = "MuonRequireHighPtCuts";
1404 m_conf_to_prop["PhotonBaseline.CrackVeto"] = "PhotonBaselineCrackVeto";
1405 m_conf_to_prop["Photon.CrackVeto"] = "PhotonCrackVeto";
1406 m_conf_to_prop["Photon.AllowLate"] = "PhotonAllowLate";
1407
1408 m_conf_to_prop["FwdJet.doJVT"] = "FwdJetDoJVT";
1409
1410 m_conf_to_prop["OR.DoBoostedElectron"] = "DoBoostedElectronOR";
1411 m_conf_to_prop["OR.DoBoostedMuon"] = "DoBoostedMuonOR";
1412 m_conf_to_prop["OR.DoMuonJetGhostAssociation"] = "ORDoMuonJetGhostAssociation";
1413 m_conf_to_prop["OR.DoTau"] = "DoTauOR";
1414 m_conf_to_prop["OR.DoPhoton"] = "DoPhotonOR";
1415 m_conf_to_prop["OR.DoEleJet"] = "DoEleJetOR";
1416 m_conf_to_prop["OR.DoElEl"] = "DoElElOR";
1417 m_conf_to_prop["OR.DoElMu"] = "DoElMuOR";
1418 m_conf_to_prop["OR.DoMuonJet"] = "DoMuonJetOR";
1419 m_conf_to_prop["OR.Bjet"] = "DoBjetOR";
1420 m_conf_to_prop["OR.ElBjet"] = "DoElBjetOR";
1421 m_conf_to_prop["OR.MuBjet"] = "DoMuBjetOR";
1422 m_conf_to_prop["OR.TauBjet"] = "DoTauBjetOR";
1423 m_conf_to_prop["OR.DoFatJets"] = "DoFatJetOR";
1424 m_conf_to_prop["OR.RemoveCaloMuons"] = "ORRemoveCaloMuons";
1425 m_conf_to_prop["OR.MuJetApplyRelPt"] = "ORMuJetApplyRelPt";
1426 m_conf_to_prop["OR.InputLabel"] = "ORInputLabel";
1427 m_conf_to_prop["Trigger.UpstreamMatching"] = "TriggerUpstreamMatching";
1428
1429 m_conf_to_prop["SigLep.RequireIso"] = "SigLepRequireIso";
1430 m_conf_to_prop["SigEl.RequireIso"] = "SigElRequireIso";
1431 m_conf_to_prop["SigMu.RequireIso"] = "SigMuRequireIso";
1432 m_conf_to_prop["SigPh.RequireIso"] = "SigPhRequireIso";
1433 m_conf_to_prop["SigLepPh.IsoCloseByOR"] = "SigLepPhIsoCloseByOR";
1434 m_conf_to_prop["MET.RemoveOverlappingCaloTaggedMuons"] = "METRemoveORCaloTaggedMuons";
1435 m_conf_to_prop["MET.DoSetMuonJetEMScale"] = "METDoSetMuonJetEMScale";
1436 m_conf_to_prop["MET.DoRemoveMuonJets"] = "METDoRemoveMuonJets";
1437 m_conf_to_prop["MET.DoUseGhostMuons"] = "METUseGhostMuons";
1438 m_conf_to_prop["MET.DoMuonEloss"] = "METDoMuonEloss";
1439
1440 m_conf_to_prop["MET.DoTrkSyst"] = "METDoTrkSyst";
1441 m_conf_to_prop["MET.DoCaloSyst"] = "METDoCaloSyst";
1442
1443 m_conf_to_prop["Tau.DoTruthMatching"] = "TauDoTruthMatching";
1444 //
1445
1446 configFromFile(m_slices["ele"], "Slices.Ele", rEnv, true);
1447 configFromFile(m_slices["pho"], "Slices.Pho", rEnv, true);
1448 configFromFile(m_slices["mu"], "Slices.Mu", rEnv, true);
1449 configFromFile(m_slices["tau"], "Slices.Tau", rEnv, true);
1450 configFromFile(m_slices["jet"], "Slices.Jet", rEnv, true);
1451 configFromFile(m_slices["bjet"], "Slices.BJet", rEnv, true);
1452 configFromFile(m_slices["fjet"], "Slices.FJet", rEnv, true);
1453 configFromFile(m_slices["tjet"], "Slices.TJet", rEnv, true);
1454 configFromFile(m_slices["met"], "Slices.MET", rEnv, true);
1455 //
1456 configFromFile(m_isRun3, "IsRun3", rEnv, false);
1457 //
1458 configFromFile(m_eleBaselinePt, "EleBaseline.Pt", rEnv, 10000.);
1459 configFromFile(m_eleBaselineEta, "EleBaseline.Eta", rEnv, 2.47);
1460 configFromFile(m_eleIdBaseline, "EleBaseline.Id", rEnv, "LooseAndBLayerLLH");
1461 configFromFile(m_eleBaselineIso_WP, "EleBaseline.Iso", rEnv, "None");
1462 configFromFile(m_eleConfigBaseline, "EleBaseline.Config", rEnv, "None");
1463 configFromFile(m_eleBaselineCrackVeto, "EleBaseline.CrackVeto", rEnv, false);
1464 configFromFile(m_force_noElId, "Ele.ForceNoId", rEnv, false);
1465
1466 //
1467 configFromFile(m_elePt, "Ele.Et", rEnv, 25000.);
1468 configFromFile(m_eleEta, "Ele.Eta", rEnv, 2.47);
1469 configFromFile(m_eleCrackVeto, "Ele.CrackVeto", rEnv, false);
1470 configFromFile(m_eleIso_WP, "Ele.Iso", rEnv, "Loose_VarRad");
1471 configFromFile(m_eleIsoHighPt_WP, "Ele.IsoHighPt", rEnv, "HighPtCaloOnly");
1472 configFromFile(m_eleIsoHighPtThresh, "Ele.IsoHighPtThresh", rEnv, 200e3);
1473 configFromFile(m_eleChID_WP, "Ele.CFT", rEnv, "None"); // Loose is the only one supported for the moment, and not many clients yet.
1474 configFromFile(m_eleChIso, "Ele.CFTIso", rEnv, true); // use charge ID SFs without iso applied
1475 configFromFile(m_eleChID_signal, "Ele.CFTSignal", rEnv, !m_eleChID_WP.empty()); // Require ECID as part of the signal lepton definition
1476 configFromFile(m_eleId, "Ele.Id", rEnv, "TightLLH");
1477 configFromFile(m_eleLRT, "Ele.LRTOR", rEnv, false);
1478 configFromFile(m_eleLRT_strat, "Ele.LRTORStrat", rEnv, 0);
1479 configFromFile(m_eleConfig, "Ele.Config", rEnv, "None");
1480 configFromFile(m_eled0sig, "Ele.d0sig", rEnv, 5.);
1481 configFromFile(m_elez0, "Ele.z0", rEnv, 0.5);
1482 configFromFile(m_elebaselined0sig, "EleBaseline.d0sig", rEnv, -99.);
1483 configFromFile(m_elebaselinez0, "EleBaseline.z0", rEnv, 0.5);
1484 configFromFile(m_eleIdExpert, "Ele.IdExpert", rEnv, false);
1485 configFromFile(m_EG_corrModel, "Ele.EffNPcorrModel", rEnv, "TOTAL");
1486 configFromFile(m_EG_corrFNList, "Ele.EffCorrFNList", rEnv, "None");
1487 configFromFile(m_electronTriggerSFStringSingle, "Ele.TriggerSFStringSingle", rEnv, "SINGLE_E_2015_e24_lhmedium_L1EM20VH_OR_e60_lhmedium_OR_e120_lhloose_2016_2018_e26_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0");
1488 configFromFile(m_eleEffMapFilePath, "Ele.EffMapFilePath", rEnv, "ElectronEfficiencyCorrection/2015_2025/rel22.2/2025_Run3_Consolidated_Recommendation_v4/map2.txt");
1489 configFromFile(m_eleAllowRun3TrigSFFallback, "Ele.AllowRun3TrigSFFallback", rEnv, false);
1490 configFromFile(m_eleForceFullSimCalib, "Ele.ForceFullSimCalib", rEnv, false);
1491
1492 configFromFile(m_trig2015combination_singleLep, "Trig.Singlelep2015", rEnv, "e24_lhmedium_L1EM20VH_OR_e60_lhmedium_OR_e120_lhloose || mu20_iloose_L1MU15_OR_mu40");
1493 configFromFile(m_trig2016combination_singleLep, "Trig.Singlelep2016", rEnv, "e26_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0 || mu26_ivarmedium_OR_mu50");
1494 configFromFile(m_trig2017combination_singleLep, "Trig.Singlelep2017", rEnv, "e26_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0 || mu26_ivarmedium_OR_mu50");
1495 configFromFile(m_trig2018combination_singleLep, "Trig.Singlelep2018", rEnv, "e26_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0 || mu26_ivarmedium_OR_mu50");
1496 configFromFile(m_trig2022combination_singleLep, "Trig.Singlelep2022", rEnv, "e26_lhtight_ivarloose_L1EM22VHI_OR_e60_lhmedium_L1EM22VHI_OR_e140_lhloose_L1EM22VHI || HLT_mu24_ivarmedium_L1MU14FCH_OR_HLT_mu50_L1MU14FCH");
1497 configFromFile(m_trig2023combination_singleLep, "Trig.Singlelep2023", rEnv, "e26_lhtight_ivarloose_L1eEM26M_OR_e60_lhmedium_L1eEM26M_OR_e140_lhloose_L1eEM26M || HLT_mu24_ivarmedium_L1MU14FCH_OR_HLT_mu50_L1MU14FCH");
1498 configFromFile(m_trig2024combination_singleLep, "Trig.Singlelep2024", rEnv, "e26_lhtight_ivarloose_L1eEM26M_OR_e60_lhmedium_L1eEM26M_OR_e140_lhloose_L1eEM26M || HLT_mu24_ivarmedium_L1MU14FCH_OR_HLT_mu50_L1MU14FCH");
1499 configFromFile(m_trigNToys_diLep, "Trig.DilepNToys", rEnv, 250); // 0 means calculate from formula instead - needs to be supported for the trigger combination
1500 configFromFile(m_trig2015combination_diLep, "Trig.Dilep2015", rEnv, "e24_lhmedium_L1EM20VH_OR_e60_lhmedium_OR_e120_lhloose || mu20_iloose_L1MU15_OR_mu40 || 2e12_lhloose_L12EM10VH || e17_lhloose_mu14 || e7_lhmedium_mu24 || mu18_mu8noL1 || 2mu10");
1501 configFromFile(m_trig2016combination_diLep, "Trig.Dilep2016", rEnv, "e26_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0 || mu26_ivarmedium_OR_mu50 || 2e17_lhvloose_nod0 || e17_lhloose_nod0_mu14 || e7_lhmedium_nod0_mu24 || e26_lhmedium_nod0_L1EM22VHI_mu8noL1 || mu22_mu8noL1 || 2mu14");
1502 configFromFile(m_trig2017combination_diLep, "Trig.Dilep2017", rEnv, "e26_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0 || mu26_ivarmedium_OR_mu50 || 2e24_lhvloose_nod0 || e17_lhloose_nod0_mu14 || e7_lhmedium_nod0_mu24 || e26_lhmedium_nod0_mu8noL1 || mu22_mu8noL1 || 2mu14");
1503 configFromFile(m_trig2018combination_diLep, "Trig.Dilep2018", rEnv, "e26_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0 || mu26_ivarmedium_OR_mu50 || 2e24_lhvloose_nod0 || e17_lhloose_nod0_mu14 || e7_lhmedium_nod0_mu24 || e26_lhmedium_nod0_mu8noL1 || mu22_mu8noL1 || 2mu14");
1504 // configFromFile(m_trig2022combination_diLep, "Trig.Dilep2022", rEnv, "");
1505 configFromFile(m_trigNToys_multiLep, "Trig.MultiNToys", rEnv, 250); // 0 means calculate from formula instead - needs to be supported for the trigger combination
1506 configFromFile(m_trig2015combination_multiLep, "Trig.Multi2015", rEnv, "e24_lhmedium_L1EM20VH_OR_e60_lhmedium_OR_e120_lhloose || mu20_iloose_L1MU15_OR_mu40 || 2e12_lhloose_L12EM10VH || e17_lhloose_2e9_lhloose || 2e12_lhloose_mu10 || e12_lhloose_2mu10 || e17_lhloose_mu14 || e7_lhmedium_mu24 || mu18_mu8noL1 || 2mu10 || 3mu6");
1507 configFromFile(m_trig2016combination_multiLep, "Trig.Multi2016", rEnv, "e26_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0 || mu26_ivarmedium_OR_mu50 || 2e17_lhvloose_nod0 || e17_lhloose_nod0_mu14 || e7_lhmedium_nod0_mu24 || e26_lhmedium_nod0_L1EM22VHI_mu8noL1 || e17_lhloose_nod0_2e9_lhloose_nod0 || e12_lhloose_nod0_2mu10 || 2e12_lhloose_nod0_mu10 || mu22_mu8noL1 || 2mu14 || 3mu6");
1508 configFromFile(m_trig2017combination_multiLep, "Trig.Multi2017", rEnv, "e26_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0 || mu26_ivarmedium_OR_mu50 || 2e24_lhvloose_nod0 || e17_lhloose_nod0_mu14 || e7_lhmedium_nod0_mu24 || e26_lhmedium_nod0_mu8noL1 || e24_lhvloose_nod0_2e12_lhvloose_nod0_L1EM20VH_3EM10VH || e12_lhloose_nod0_2mu10 || 2e12_lhloose_nod0_mu10 || mu22_mu8noL1 || 2mu14 || 3mu6");
1509 configFromFile(m_trig2018combination_multiLep, "Trig.Multi2018", rEnv, "e26_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0 || mu26_ivarmedium_OR_mu50 || 2e24_lhvloose_nod0 || e17_lhloose_nod0_mu14 || e7_lhmedium_nod0_mu24 || e26_lhmedium_nod0_mu8noL1 || e24_lhvloose_nod0_2e12_lhvloose_nod0_L1EM20VH_3EM10VH || e12_lhloose_nod0_2mu10 || 2e12_lhloose_nod0_mu10 || mu22_mu8noL1 || 2mu14 || 3mu6");
1510 // configFromFile(m_trig2022combination_multiLep, "Trig.Multi2022", rEnv, "");
1511 configFromFile(m_trigNToys_diPhoton, "Trig.DiphotonNToys", rEnv, 250); // 0 means calculate from formula instead - needs to be supported for the trigger combination
1512 configFromFile(m_trig2015combination_diPhoton, "Trig.Diphoton2015", rEnv, "g35_loose_g25_loose");
1513 configFromFile(m_trig2016combination_diPhoton, "Trig.Diphotonp2016", rEnv, "g35_loose_g25_loose");
1514 configFromFile(m_trig2017combination_diPhoton, "Trig.Diphotonp2017", rEnv, "g35_medium_g25_medium_L12EM20VH");
1515 configFromFile(m_trig2018combination_diPhoton, "Trig.Diphotonp2018", rEnv, "g35_medium_g25_medium_L12EM20VH");
1516 // configFromFile(m_trig2018combination_diPhoton, "Trig.Diphotonp2022", rEnv, "");
1517 //
1518 configFromFile(m_muBaselinePt, "MuonBaseline.Pt", rEnv, 10000.);
1519 configFromFile(m_muBaselineEta, "MuonBaseline.Eta", rEnv, 2.7);
1520 configFromFile(m_force_noMuId, "Muon.ForceNoId", rEnv, false);
1521 configFromFile(m_muBaselineIso_WP, "MuonBaseline.Iso", rEnv, "None");
1522 configFromFile(m_doTTVAsf, "Muon.TTVASF", rEnv, true);
1523 //
1524 configFromFile(m_muPt, "Muon.Pt", rEnv, 25000.);
1525 configFromFile(m_muEta, "Muon.Eta", rEnv, 2.7);
1526 configFromFile(m_muIso_WP, "Muon.Iso", rEnv, "Loose_VarRad");
1527 configFromFile(m_muIsoHighPt_WP, "Muon.IsoHighPt", rEnv, "Loose_VarRad");
1528 configFromFile(m_muIsoHighPtThresh, "Muon.IsoHighPtThresh", rEnv, 200e3);
1529 configFromFile(m_mud0sig, "Muon.d0sig", rEnv, 3.);
1530 configFromFile(m_muz0, "Muon.z0", rEnv, 0.5);
1531 configFromFile(m_mubaselined0sig, "MuonBaseline.d0sig", rEnv, -99.);
1532 configFromFile(m_mubaselinez0, "MuonBaseline.z0", rEnv, 0.5);
1533 configFromFile(m_murequirepassedHighPtCuts, "Muon.passedHighPt", rEnv, false);
1534 configFromFile(m_muHighPtExtraSmear, "Muon.HighPtExtraSmear", rEnv, false);
1535 configFromFile(m_muEffCorrForce1D, "Muon.EffCorrForce1D", rEnv, false);
1536 //
1537 configFromFile(m_muTriggerSFCalibRelease, "Muon.TriggerSFCalibRelease" ,rEnv, "None");
1538 configFromFile(m_muTriggerSFCalibFilename, "Muon.TriggerSFCalibFilename",rEnv, "None");
1539 //
1540 configFromFile(m_muCosmicz0, "MuonCosmic.z0", rEnv, 1.);
1541 configFromFile(m_muCosmicd0, "MuonCosmic.d0", rEnv, 0.2);
1542 //
1543 // LRT muons
1544 configFromFile(m_muLRT, "Muon.LRTOR", rEnv, false);
1545 //
1546 configFromFile(m_badmuQoverP, "BadMuon.qoverp", rEnv, 0.4);
1547 //
1548 configFromFile(m_muCalibrationMode, "Muon.CalibrationMode", rEnv, 0); // 0: correctData_CB
1549 //
1550 configFromFile(m_photonBaselinePt, "PhotonBaseline.Pt", rEnv, 25000.);
1551 configFromFile(m_photonBaselineEta, "PhotonBaseline.Eta", rEnv, 2.37);
1552 configFromFile(m_photonIdBaseline, "PhotonBaseline.Id", rEnv, "Tight");
1553 configFromFile(m_photonBaselineCrackVeto, "PhotonBaseline.CrackVeto", rEnv, true);
1554 configFromFile(m_photonBaselineIso_WP, "PhotonBaseline.Iso", rEnv, "None");
1555 //
1556 configFromFile(m_photonPt, "Photon.Pt", rEnv, 130000.);
1557 configFromFile(m_photonEta, "Photon.Eta", rEnv, 2.37);
1558 configFromFile(m_photonId, "Photon.Id", rEnv, "Tight");
1559 configFromFile(m_photonIso_WP, "Photon.Iso", rEnv, "FixedCutTight");
1560 configFromFile(m_photonTriggerName, "Photon.TriggerName", rEnv, "DI_PH_2015_2016_g20_tight_2016_g22_tight_2017_2018_g20_tight_icalovloose_L1EM15VHI"); // for symmetric diphoton triggers
1561 configFromFile(m_photonCrackVeto, "Photon.CrackVeto", rEnv, true);
1562 configFromFile(m_photonAllowLate, "Photon.AllowLate", rEnv, false);
1563 //
1564 configFromFile(m_tauPrePtCut, "Tau.PrePtCut", rEnv, 0.);
1565 configFromFile(m_tauPt, "Tau.Pt", rEnv, 20000.);
1566 configFromFile(m_tauEta, "Tau.Eta", rEnv, 2.5);
1567 configFromFile(m_tauTagger, "Tau.Tagger", rEnv, "RNN");
1568 configFromFile(m_tauId, "Tau.Id", rEnv, "Medium");
1569 configFromFile(m_tauEleId, "Tau.EleId", rEnv, true);
1570 configFromFile(m_tauMuOLR, "Tau.MuOLR", rEnv, false);
1571 configFromFile(m_tauConfigPath, "Tau.ConfigPath", rEnv, "default");
1572 configFromFile(m_tauIdBaseline, "TauBaseline.Id", rEnv, "Medium");
1573 configFromFile(m_tauEleIdBaseline, "TauBaseline.EleId", rEnv, true);
1574 configFromFile(m_tauMuOLRBaseline, "TauBaseline.MuOLR", rEnv, false);
1575 configFromFile(m_tauConfigPathBaseline, "TauBaseline.ConfigPath", rEnv, "default");
1576 configFromFile(m_tauDoTTM, "Tau.DoTruthMatching", rEnv, false);
1577 //
1578 configFromFile(m_tauSmearingToolRecommendationTag,"Tau.SmearingToolRecommendationTag", rEnv, "2025-prerec");
1579 configFromFile(m_tauEffToolRecommendationTag,"Tau.EffToolRecommendationTag", rEnv, "2025-prerec");
1580 configFromFile(m_ApplyMVATESQualityCheck, "Tau.MVATESQualityCheck", rEnv, true);
1581 //
1582 configFromFile(m_jetPt, "Jet.Pt", rEnv, 20000.);
1583 configFromFile(m_jetEta, "Jet.Eta", rEnv, 2.8);
1584 configFromFile(m_JvtWP, "Jet.JvtWP", rEnv, "FixedEffPt"); // https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/PileupJetRecommendations
1585 configFromFile(m_JvtPtMax, "Jet.JvtPtMax", rEnv, 60.0e3);
1586 configFromFile(m_JvtConfigRun2, "Jet.JvtConfigRun2", rEnv, "JetJvtEfficiency/May2024/NNJvtSFFile_Run2_EMPFlow.root", true); // empty string means dummy SF
1587 configFromFile(m_JvtConfigRun3, "Jet.JvtConfigRun3", rEnv, "JetJvtEfficiency/May2024/NNJvtSFFile_Run3_EMPFlow.root", true); // empty string means dummy SF
1588 configFromFile(m_jetUncertaintiesConfig, "Jet.UncertConfig", rEnv, getDefaultJetUncConfig() ); // https://twiki.cern.ch/twiki/bin/view/AtlasProtected/JetUncertaintiesRel22/
1589 configFromFile(m_jetUncertaintiesAnalysisFile, "Jet.AnalysisFile", rEnv, "default"); // https://twiki.cern.ch/twiki/bin/view/AtlasProtected/JetUncertaintiesRel21Summer2018SmallR
1590 configFromFile(m_jetUncertaintiesCalibArea, "Jet.UncertCalibArea", rEnv, "default"); // Defaults to default area set by tool
1591 configFromFile(m_jetUncertaintiesMCType, "Jet.UncertMCType", rEnv, "", true); // empty string means the MCType is guessed
1592 configFromFile(m_jetUncertaintiesPDsmearing, "Jet.UncertPDsmearing", rEnv, true); // for non "SimpleJER" config, run the PDSmear systematics. This are labelled with an __2 if they are being used, but otherwise will have the same tree name as the JET_JER systematic trees.
1593 configFromFile(m_fatJets, "Jet.LargeRcollection", rEnv, "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets"); // set to "None" to turn off large jets
1594 configFromFile(m_fatJetUncConfig, "Jet.LargeRuncConfig", rEnv, "rel22/Spring2025_PreRec/R10_CategoryJES_FullJER_FullJMS.config");
1595 configFromFile(m_fatJetUncertaintiesPDsmearing, "Jet.LargeRUncertPDsmearing", rEnv, true); // for non "SimpleJER" config, run the PDSmear systematics. This are labelled with an __2 if they are being used, but otherwise will have the same tree name as the JET_JER systematic trees.
1596 configFromFile(m_fatJetUncVars, "Jet.LargeRuncVars", rEnv, "default"); // do all if not specified
1597 configFromFile(m_WtagConfig, "Jet.WtaggerConfig", rEnv, "SmoothedContainedWTagger_AntiKt10UFOCSSKSoftDrop_FixedSignalEfficiency80_20220221.dat");
1598 configFromFile(m_ZtagConfig, "Jet.ZtaggerConfig", rEnv, "SmoothedContainedZTagger_AntiKt10UFOCSSKSoftDrop_FixedSignalEfficiency80_20220221.dat");
1599 configFromFile(m_WZTaggerCalibArea, "Jet.WZTaggerCalibArea", rEnv, "Winter2024_R22_PreRecs/SmoothedWZTaggers/");
1600 configFromFile(m_ToptagConfig, "Jet.ToptaggerConfig", rEnv, "DNNTagger_AntiKt10UFOSD_TopInclusive80_Oct30.dat");
1601 configFromFile(m_JetTruthLabelName, "Jet.JetTruthLabelName", rEnv, "R10TruthLabel_R22v1");
1602 configFromFile(m_TopTaggerCalibArea, "Jet.TopTaggerCalibArea", rEnv, "Winter2024_R22_PreRecs/JSSWTopTaggerDNN/");
1603 configFromFile(m_jesConfig, "Jet.JESConfig", rEnv, m_isRun3 ? "AntiKt4EMPFlow_MC23a_PreRecR22_Phase2_CalibConfig_ResPU_EtaJES_GSC_241208_InSitu.config" : "PreRec_R22_PFlow_ResPU_EtaJES_GSC_February23_230215.config"); //https://twiki.cern.ch/twiki/bin/view/AtlasProtected/ApplyJetCalibrationR22
1604 configFromFile(m_jesConfigAFII, "Jet.JESConfigAFII", rEnv, m_isRun3 ? "AntiKt4EMPFlow_MC23a_PreRecR22_Phase2_CalibConfig_ResPU_EtaJES_GSC_241208_InSitu.config" : "PreRec_R22_PFlow_ResPU_EtaJES_GSC_February23_230215.config");
1605 configFromFile(m_jesConfigJMS, "Jet.JESConfigJMS", rEnv, "JES_JMS_MC16Recommendation_Consolidated_MC_only_EMTopo_July2019_Rel21.config");
1606 configFromFile(m_jesConfigJMSData, "Jet.JESConfigJMSData", rEnv, "JES_JMS_MC16Recommendation_Consolidated_data_only_EMTopo_Sep2019_Rel21.config");
1607 configFromFile(m_jesConfigFat, "Jet.JESConfigFat", rEnv, "JES_MC20PreRecommendation_R10_UFO_CSSK_SoftDrop_JMS_R21Insitu_26Nov2024.config");
1608 configFromFile(m_jesConfigFatData, "Jet.JESConfigFatData", rEnv, "JES_MC20PreRecommendation_R10_UFO_CSSK_SoftDrop_JMS_R21Insitu_26Nov2024.config");
1609 configFromFile(m_jesCalibSeq, "Jet.CalibSeq", rEnv, "JetArea_Residual_EtaJES_GSC_Insitu");
1610 configFromFile(m_jesCalibSeqJMS, "Jet.CalibSeqJMS", rEnv, "JetArea_Residual_EtaJES_GSC");
1611 configFromFile(m_jesCalibSeqFat, "Jet.CalibSeqFat", rEnv, "EtaJES_JMS");
1612 configFromFile(m_jesCalibArea, "Jet.CalibArea", rEnv, m_isRun3 ? "00-04-83" : "00-04-82");
1613 //
1614 configFromFile(m_defaultTrackJets, "TrackJet.Coll", rEnv, "AntiKtVR30Rmax4Rmin02TrackJets");
1615 configFromFile(m_trkJetPt, "TrackJet.Pt", rEnv, 20000.);
1616 configFromFile(m_trkJetEta, "TrackJet.Eta", rEnv, 2.8);
1617 //
1618 configFromFile(m_badJetCut, "BadJet.Cut", rEnv, "LooseBad");
1619 //
1620 configFromFile(m_doFwdJVT, "FwdJet.doJVT", rEnv, false); // https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/PileupJetRecommendations
1621 configFromFile(m_fJvtWP, "FwdJet.JvtWP", rEnv, "Loose");
1622 configFromFile(m_fJvtPtMax, "FwdJet.JvtPtMax", rEnv, 60e3);
1623 configFromFile(m_fJvtEtaMin, "FwdJet.JvtEtaMin", rEnv, 2.5);
1624 configFromFile(m_fJvtConfigRun2, "FwdJet.JvtConfigRun2", rEnv, "JetJvtEfficiency/May2024/fJvtSFFile_Run2_EMPFlow.root", true); // empty string means dummy SF
1625 configFromFile(m_fJvtConfigRun3, "FwdJet.JvtConfigRun3", rEnv, "JetJvtEfficiency/May2024/fJvtSFFile_Run2_EMPFlow.root", true); // empty string means dummy SF
1626 configFromFile(m_JMScalib, "Jet.JMSCalib", rEnv, false);
1627 //
1628 configFromFile(m_useBtagging, "Btag.enable", rEnv, true);
1629 configFromFile(m_BtagTagger, "Btag.Tagger", rEnv, "GN2v01");
1630 configFromFile(m_BtagWP, "Btag.WP", rEnv, "Continuous");
1631 configFromFile(m_BtagMinPt, "Btag.MinPt", rEnv, -1.); // Not calibrated below 20
1632
1633 configFromFile(m_bTaggingCalibrationFilePath, "Btag.CalibPath", rEnv, m_isRun3 ? "xAODBTaggingEfficiency/13p6TeV/MC23_2026_05_13_GN2v01_v0.root": "xAODBTaggingEfficiency/13TeV/MC20_2025-06-17_GN2v01_v4.root");
1634 configFromFile(m_BtagSystStrategy, "Btag.SystStrategy", rEnv, "SFEigen");
1635 configFromFile(m_EigenvectorReductionB, "Btag.EigenvectorReductionB", rEnv, "Loose");
1636 configFromFile(m_EigenvectorReductionC, "Btag.EigenvectorReductionC", rEnv, "Loose");
1637 configFromFile(m_EigenvectorReductionLight, "Btag.EigenvectorReductionLight", rEnv, "Loose");
1638 configFromFile(m_BtagReadFromObject, "Btag.ReadFromObject", rEnv, false);
1639
1640 configFromFile(m_useBtagging_trkJet, "BtagTrkJet.enable", rEnv, true);
1641 configFromFile(m_BtagTagger_trkJet, "BtagTrkJet.Tagger", rEnv, "DL1r");
1642 configFromFile(m_BtagWP_trkJet, "BtagTrkJet.WP", rEnv, "FixedCutBEff_77");
1643 configFromFile(m_BtagMinPt_trkJet, "BtagTrkJet.MinPt", rEnv, -1.); // Not calibrated below 10
1644 configFromFile(m_BtagReadFromObject_trkJet, "BtagTrkJet.ReadFromObject", rEnv, false);
1645 //
1646 configFromFile(m_orDoBoostedElectron, "OR.DoBoostedElectron", rEnv, true);
1647 configFromFile(m_orBoostedElectronC1, "OR.BoostedElectronC1", rEnv, -999.); // set to positive number to override default
1648 configFromFile(m_orBoostedElectronC2, "OR.BoostedElectronC2", rEnv, -999.); // set to positive number to override default - specify in MeV (i.e. "10*GeV" will nor work in the config file)
1649 configFromFile(m_orBoostedElectronMaxConeSize, "OR.BoostedElectronMaxConeSize", rEnv, -999.); // set to positive number to override default
1650 configFromFile(m_orDoBoostedMuon, "OR.DoBoostedMuon", rEnv, true);
1651 configFromFile(m_orBoostedMuonC1, "OR.BoostedMuonC1", rEnv, -999.); // set to positive number to override default
1652 configFromFile(m_orBoostedMuonC2, "OR.BoostedMuonC2", rEnv, -999.); // set to positive number to override default - specify in MeV (i.e. "10*GeV" will nor work in the config file)
1653 configFromFile(m_orBoostedMuonMaxConeSize, "OR.BoostedMuonMaxConeSize", rEnv, -999.); // set to positive number to override default
1654 configFromFile(m_orDoMuonJetGhostAssociation, "OR.DoMuonJetGhostAssociation", rEnv, true);
1655 configFromFile(m_orDoTau, "OR.DoTau", rEnv, false);
1656 configFromFile(m_orDoPhoton, "OR.DoPhoton", rEnv, false);
1657 configFromFile(m_orDoEleJet, "OR.EleJet", rEnv, true);
1658 configFromFile(m_orDoElEl, "OR.ElEl", rEnv, false);
1659 configFromFile(m_orDoElMu, "OR.ElMu", rEnv, false);
1660 configFromFile(m_orDoMuonJet, "OR.MuonJet", rEnv, true);
1661 configFromFile(m_orDoBjet, "OR.Bjet", rEnv, false);
1662 configFromFile(m_orDoElBjet, "OR.ElBjet", rEnv, false);
1663 configFromFile(m_orDoMuBjet, "OR.MuBjet", rEnv, false);
1664 configFromFile(m_orDoTauBjet, "OR.TauBjet", rEnv, false);
1665 configFromFile(m_orApplyRelPt, "OR.MuJetApplyRelPt", rEnv, false);
1666 configFromFile(m_orMuJetPtRatio, "OR.MuJetPtRatio", rEnv, -999.);
1667 configFromFile(m_orMuJetTrkPtRatio, "OR.MuJetTrkPtRatio", rEnv, -999.);
1668 configFromFile(m_orRemoveCaloMuons, "OR.RemoveCaloMuons", rEnv, true);
1669 configFromFile(m_orMuJetInnerDR, "OR.MuJetInnerDR", rEnv, -999.);
1670 configFromFile(m_orBtagWP, "OR.BtagWP", rEnv, "FixedCutBEff_85");
1671 configFromFile(m_orInputLabel, "OR.InputLabel", rEnv, "selected"); //"baseline"
1672 configFromFile(m_orPhotonFavoured, "OR.PhotonFavoured", rEnv, false);
1673 configFromFile(m_orBJetPtUpperThres, "OR.BJetPtUpperThres", rEnv, -1.); // upper pt threshold of b-jet in OR in unit of MeV, -1 means no pt threshold
1674 configFromFile(m_orLinkOverlapObjects, "OR.LinkOverlapObjects", rEnv, false);
1675 //
1676 configFromFile(m_orDoFatjets, "OR.DoFatJets", rEnv, false);
1677 configFromFile(m_EleFatJetDR, "OR.EleFatJetDR", rEnv, -999.);
1678 configFromFile(m_JetFatJetDR, "OR.JetFatJetDR", rEnv, -999.);
1679 //
1680 configFromFile(m_upstreamTriggerMatching, "Trigger.UpstreamMatching", rEnv, false);
1681 configFromFile(m_trigMatchingPrefix, "Trigger.MatchingPrefix", rEnv, "", true);
1682 //
1683 configFromFile(m_doIsoSignal, "SigLep.RequireIso", rEnv, true);
1684 configFromFile(m_doElIsoSignal, "SigEl.RequireIso", rEnv, m_doIsoSignal);
1685 configFromFile(m_doMuIsoSignal, "SigMu.RequireIso", rEnv, m_doIsoSignal);
1686 configFromFile(m_doPhIsoSignal, "SigPh.RequireIso", rEnv, m_doIsoSignal);
1687 configFromFile(m_useSigLepForIsoCloseByOR, "SigLepPh.UseSigLepForIsoCloseByOR", rEnv, false);
1688 configFromFile(m_IsoCloseByORpassLabel, "SigLepPh.IsoCloseByORpassLabel", rEnv, "None");
1689
1690 //
1691 configFromFile(m_eleTerm, "MET.EleTerm", rEnv, "RefEle");
1692 configFromFile(m_gammaTerm, "MET.GammaTerm", rEnv, "RefGamma");
1693 configFromFile(m_tauTerm, "MET.TauTerm", rEnv, "RefTau");
1694 configFromFile(m_jetTerm, "MET.JetTerm", rEnv, "RefJet");
1695 configFromFile(m_muonTerm, "MET.MuonTerm", rEnv, "Muons");
1696 configFromFile(m_inputMETSuffix, "MET.InputSuffix", rEnv, "", true); // May be empty
1697 configFromFile(m_outMETTerm, "MET.OutputTerm", rEnv, "Final");
1698 configFromFile(m_metRemoveOverlappingCaloTaggedMuons, "MET.RemoveOverlappingCaloTaggedMuons", rEnv, true);
1699 configFromFile(m_metDoSetMuonJetEMScale, "Met.DoSetMuonJetEMScale", rEnv, true);
1700 configFromFile(m_metDoRemoveMuonJets, "MET.DoRemoveMuonJets", rEnv, true);
1701 configFromFile(m_metUseGhostMuons, "MET.UseGhostMuons", rEnv, false);
1702 configFromFile(m_metDoMuonEloss, "MET.DoMuonEloss", rEnv, false);
1703 configFromFile(m_metGreedyPhotons, "MET.DoGreedyPhotons", rEnv, false);
1704 configFromFile(m_metVeryGreedyPhotons, "MET.DoVeryGreedyPhotons", rEnv, false);
1705
1706 configFromFile(m_trkMETsyst, "MET.DoTrkSyst", rEnv, true);
1707 configFromFile(m_caloMETsyst, "MET.DoCaloSyst", rEnv, false);
1708 configFromFile(m_trkJetsyst, "MET.DoTrkJetSyst", rEnv, false);
1709 configFromFile(m_metsysConfigPrefix, "METSys.ConfigPrefix", rEnv, "METUtilities/R22_PreRecs");
1710 configFromFile(m_metJetSelection, "MET.JetSelection", rEnv, "Tight"); // Loose, Tight (default), Tighter, Tenacious
1711 configFromFile(m_softTermParam, "METSig.SoftTermParam", rEnv, met::Random);
1712 configFromFile(m_treatPUJets, "METSig.TreatPUJets", rEnv, true);
1713 configFromFile(m_doPhiReso, "METSig.DoPhiReso", rEnv, false);
1714 //
1715 configFromFile(m_prwActualMu2017File, "PRW.ActualMu2017File", rEnv, "GoodRunsLists/data17_13TeV/20180619/physics_25ns_Triggerno17e33prim.actualMu.OflLumi-13TeV-010.root");
1716 configFromFile(m_prwActualMu2018File, "PRW.ActualMu2018File", rEnv, "GoodRunsLists/data18_13TeV/20190318/physics_25ns_Triggerno17e33prim.actualMu.OflLumi-13TeV-010.root");
1717 configFromFile(m_prwActualMu2022File, "PRW.ActualMu2022File", rEnv, "GoodRunsLists/data22_13p6TeV/20250321/purw.actualMu.root");
1718 configFromFile(m_prwActualMu2023File, "PRW.ActualMu2023File", rEnv, "GoodRunsLists/data23_13p6TeV/20250321/purw.actualMu.root");
1719 configFromFile(m_prwActualMu2024File, "PRW.ActualMu2024File", rEnv, "GoodRunsLists/data24_13p6TeV/20260127/purw.actualMu.root");
1720 configFromFile(m_prwActualMu2025File, "PRW.ActualMu2025File", rEnv, "GoodRunsLists/data25_13p6TeV/20260129/purw.actualMu.root");
1721 configFromFile(m_prwDataSF, "PRW.DataSF", rEnv, 1./1.03); // default for mc16, see: https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/ExtendedPileupReweighting#Tool_Properties
1722 configFromFile(m_prwDataSF_UP, "PRW.DataSF_UP", rEnv, 1./0.99); // mc16 uncertainty? defaulting to the value in PRWtool
1723 configFromFile(m_prwDataSF_DW, "PRW.DataSF_DW", rEnv, 1./1.07); // mc16 uncertainty? defaulting to the value in PRWtool
1724 configFromFile(m_runDepPrescaleWeightPRW, "PRW.UseRunDependentPrescaleWeight", rEnv, false); // If set to true, the prescale weight is the luminosity-average prescale over the lumiblocks in the unprescaled lumicalc file in the PRW tool.
1725 configFromFile(m_autoconfigPRWPath, "PRW.autoconfigPRWPath", rEnv, "dev/PileupReweighting/share/");
1726 configFromFile(m_autoconfigPRWFile, "PRW.autoconfigPRWFile", rEnv, "None");
1727 configFromFile(m_autoconfigPRWCombinedmode, "PRW.autoconfigPRWCombinedmode", rEnv, false);
1728 configFromFile(m_autoconfigPRWRPVmode, "PRW.autoconfigPRWRPVmode", rEnv, false);
1729 configFromFile(m_autoconfigPRWRtags, "PRW.autoconfigPRWRtags", rEnv, "mc20a:r13167_r14859,mc20d:r13144_r14860,mc20e:r13145_r14861,mc23a:r14622_r14932_r15540,mc23d:r15224_r15530,mc23e:r16083,mc23g:r17610"); // Tag details here: https://twiki.cern.ch/twiki/bin/view/AtlasProtected/AtlasProductionGroup
1730 configFromFile(m_commonPRWFileMC20a, "PRW.commonPRWFileMC20a", rEnv, "PileupReweighting/mc20_common/mc20a.284500.physlite.prw.v1.root");
1731 configFromFile(m_commonPRWFileMC20d, "PRW.commonPRWFileMC20d", rEnv, "PileupReweighting/mc20_common/mc20d.300000.physlite.prw.v1.root");
1732 configFromFile(m_commonPRWFileMC20e, "PRW.commonPRWFileMC20e", rEnv, "PileupReweighting/mc20_common/mc20e.310000.physlite.prw.v1.root");
1733 configFromFile(m_commonPRWFileMC23a, "PRW.commonPRWFileMC23a", rEnv, "PileupReweighting/mc23_common/mc23a.410000.physlite.prw.v2.root");
1734 configFromFile(m_commonPRWFileMC23d, "PRW.commonPRWFileMC23d", rEnv, "PileupReweighting/mc23_common/mc23d.450000.physlite.prw.v1.root");
1735 configFromFile(m_commonPRWFileMC23e, "PRW.commonPRWFileMC23e", rEnv, "PileupReweighting/mc23_common/mc23e.470000.physlite.prw.v1.root");
1736 configFromFile(m_commonPRWFileMC23g, "PRW.commonPRWFileMC23g", rEnv, "PileupReweighting/mc23_common/mc23g.495000.physlite.prw.v1.root");
1737 //
1738 configFromFile(m_strictConfigCheck, "StrictConfigCheck", rEnv, false);
1739
1740 // Translate tau config names
1741 if(!m_tauConfigPathBaseline.empty()) { //baseline taus
1743 if( m_tauConfigPathBaseline=="default" ) {
1744 if (m_tauTagger == "RNN") m_tauInputFileBaseline = "SUSYTools/tau_selection";
1745 else if (m_tauTagger == "GNTau") m_tauInputFileBaseline = "SUSYTools/tau_selection_gntau";
1746 else if (m_tauTagger == "LowPt") m_tauInputFileBaseline = "SUSYTools/tau_selection_lowpt";
1747 else {
1748 ATH_MSG_ERROR("Invalid tau ID selected: " << m_tauTagger << " - " << m_tauIdBaseline);
1749 return StatusCode::FAILURE;
1750 }
1751 std::string tauWPLC = m_tauIdBaseline;
1752 std::transform(tauWPLC.begin(), tauWPLC.end(), tauWPLC.begin(), [](unsigned char c) { return std::tolower(c); });
1753 // wp
1754 m_tauInputFileBaseline += "_"+tauWPLC;
1755 // eleid & muOLR
1756 m_tauInputFileBaseline += (m_tauEleIdBaseline ? "_eleid" : "_noeleid");
1757 m_tauInputFileBaseline += (m_tauMuOLRBaseline ? "_muonolr" : "");
1758 m_tauInputFileBaseline += ".conf";
1759 }
1760 ANA_MSG_INFO("configFromFile(): Parsed Tau Baseline Config input: " << m_tauInputFileBaseline);
1761 }
1762 if(!m_tauConfigPathBaseline.empty()) { //signal taus
1764 if( m_tauConfigPath=="default" ) {
1765 if (m_tauTagger == "RNN") m_tauInputFile = "SUSYTools/tau_selection";
1766 else if (m_tauTagger == "GNTau") m_tauInputFile = "SUSYTools/tau_selection_gntau";
1767 else if (m_tauTagger == "LowPt") m_tauInputFile = "SUSYTools/tau_selection_lowpt";
1768 else {
1769 ATH_MSG_ERROR("Invalid tau ID selected: " << m_tauTagger << " - " << m_tauId);
1770 return StatusCode::FAILURE;
1771 }
1772 std::string tauWPLC = m_tauId;
1773 std::transform(tauWPLC.begin(), tauWPLC.end(), tauWPLC.begin(), [](unsigned char c) { return std::tolower(c); });
1774 // wp
1775 m_tauInputFile += "_"+tauWPLC;
1776 // eleid & muOLR
1777 m_tauInputFile += (m_tauEleId ? "_eleid" : "_noeleid");
1778 m_tauInputFile += (m_tauMuOLR ? "_muonolr" : "");
1779 m_tauInputFile += ".conf";
1780 }
1781 ANA_MSG_INFO("configFromFile(): Parsed Tau Signal Config input: " << m_tauInputFile);
1782 }
1783
1784 // By now rEnv should be empty!
1785 if (rEnv.GetTable() && rEnv.GetTable()->GetSize()>0){
1786 ATH_MSG_ERROR("Found " << rEnv.GetTable()->GetSize() << " unparsed environment options:");
1787 rEnv.Print();
1788 ATH_MSG_ERROR("Please fix your configuration!");
1789 return StatusCode::FAILURE;
1790 }
1791
1792 // Set up the correct configuration files for the large-R jet tagging corresponding to the input tagger config
1793 if (!m_WtagConfig.empty()) {
1794 if (m_WtagConfig.find("Efficiency50") != std::string::npos){
1795 m_WTagUncConfig = "R10_SF_LCTopo_WTag_SigEff50.config";
1796 }
1797 else if (m_WtagConfig.find("Efficiency80") != std::string::npos){
1798 m_WTagUncConfig = "R10_SF_LCTopo_WTag_SigEff80.config";
1799 }
1800 else {
1801 ATH_MSG_ERROR("You have specified a large-R W-tag config without a matching uncertainties file. Please fix this. Currently the 50% and 80% WPs are supported");
1802 }
1803 }
1804 if (!m_ZtagConfig.empty()) {
1805 if (m_ZtagConfig.find("Efficiency50") != std::string::npos){
1806 m_ZTagUncConfig = "R10_SF_LCTopo_ZTag_SigEff50.config";
1807 }
1808 else if (m_ZtagConfig.find("Efficiency80") != std::string::npos){
1809 m_ZTagUncConfig = "R10_SF_LCTopo_ZTag_SigEff80.config";
1810 }
1811 else {
1812 ATH_MSG_ERROR("You have specified a large-R Z-tag config without a matching uncertainties file. Please fix this. Currently the 50% and 80% WPs are supported");
1813 }
1814 }
1815 std::string TopTagEff = "";
1816 std::string TopTagType = "";
1817 if (!m_ToptagConfig.empty()) {
1818 if (m_ToptagConfig.find("50") != std::string::npos){
1819 TopTagEff = "50";
1820 }
1821 else if (m_ToptagConfig.find("80") != std::string::npos){
1822 TopTagEff = "80";
1823 }
1824 else {
1825 ATH_MSG_ERROR("You have specified a large-R Top-tag config without a matching uncertainties file. Please fix this. Currently the 50% and 80% WPs are supported");
1826 }
1827 //
1828 if (m_ToptagConfig.find("Inclusive") != std::string::npos){
1829 TopTagType = "Inclusive";
1830 }
1831 else if (m_ToptagConfig.find("Contained") != std::string::npos){
1832 TopTagType = "Contained";
1833 }
1834 else {
1835 ATH_MSG_ERROR("You have specified a large-R Top-tag config without a matching uncertainties file. Please fix this. Currently the contained and inclusive WPs are supported");
1836 }
1837 m_TopTagUncConfig = "R10_SF_LCTopo_TopTag"+TopTagType+"_SigEff"+TopTagEff+".config";
1838 }
1839
1840 //** validate configuration
1842
1843 //** cache trigger chains for electron matching
1845
1846 //** cache trigger chains for matching (both electrons and muons)
1848
1856
1862
1868
1869 return StatusCode::SUCCESS;
1870}
1871
1872
1873const std::vector<std::string> SUSYObjDef_xAOD::split(const std::string& s, const std::string& delim) const {
1874 assert(delim.length() == 1);
1875 std::vector<std::string> retval;
1876 retval.reserve(std::count(s.begin(), s.end(), delim[0]) + 1);
1877 // if only 1
1878 if (s.find(delim)==std::string::npos) {
1879 retval.emplace_back(s);
1880 return retval;
1881 }
1882 // if need to split
1883 size_t last = 0;
1884 size_t next = 0;
1885 bool gothere=false;
1886 while ((next = s.find(delim, last)) != std::string::npos) {
1887 retval.emplace_back(s.substr(last, next - last));
1888 last = next + delim.length();
1889 gothere=true;
1890 }
1891 if(gothere)
1892 retval.emplace_back(s.substr(last));
1893
1894 return retval;
1895}
1896
1898 if (m_isRun3)
1899 return isAtlfast() ? "rel22/Spring2025_PreRec/R4_CategoryReduction_FullJER_MC23.config" : "rel22/Spring2025_PreRec/R4_CategoryReduction_FullJER_MC23.config";
1900 else
1901 return isAtlfast() ? "rel22/Spring2025_PreRec/R4_CategoryReduction_FullJER_MC20_MC21.config" : "rel22/Spring2025_PreRec/R4_CategoryReduction_FullJER_MC20_MC21.config";
1902}
1903
1904StatusCode SUSYObjDef_xAOD::getTauConfig(const std::string& tauConfigPath, std::vector<float>& pT_window, std::vector<float>& eta_window, bool &eleOLR, bool &muVeto, bool &muOLR) const {
1905
1906 if(tauConfigPath.empty()) return StatusCode::FAILURE;
1907
1908 TEnv rEnv;
1909 auto filename = PathResolverFindCalibFile(tauConfigPath);
1910 if ( rEnv.ReadFile(filename.c_str(), kEnvAll) ) {
1911 ATH_MSG_ERROR( "Error while reading tau config file : " << filename );
1912 ATH_MSG_ERROR( "Find examples at: https://gitlab.cern.ch/atlas/athena/-/tree/main/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/data");
1913 return StatusCode::FAILURE;
1914 } else {
1915 ATH_MSG_DEBUG( "Successfully read tau config file : " << filename );
1916 }
1917
1918 std::vector<std::string> cuts;
1919 if (rEnv.Defined("SelectionCuts")) {
1920 cuts = split(rEnv.GetValue("SelectionCuts", " "), " ");
1921 } else {
1922 auto *l = rEnv.GetTable();
1923 for( Int_t i = 0; i < l->GetEntries(); ++i ) {
1924 cuts.push_back( l->At(i)->GetName() );
1925 }
1926 }
1927
1928 //default OR settings
1929 eleOLR=false;
1930 muOLR=false;
1931 muVeto=false;
1932
1933 static const std::string trueBool = "TRUE";
1934
1935 // Now find the pT and eta window
1936 std::vector<std::string> v_pT_window;
1937 std::vector<std::string> v_eta_window;
1938 pT_window.clear();
1939 eta_window.clear();
1940 float pT_min = -99.0;
1941 float pT_max = -99.0;
1942 float eta_min = -99.0;
1943 float eta_max = -99.0;
1944 for (const auto& cut : cuts) {
1945 if(cut == "PtRegion") {
1946 v_pT_window = split(rEnv.GetValue("PtRegion", ""), ";");
1947 std::transform(std::begin(v_pT_window),
1948 std::end(v_pT_window),
1949 std::back_inserter(pT_window),
1950 [](const std::string& s) { return std::stof(s); }
1951 );
1952 } else if (cut == "PtMin") {
1953 pT_min = rEnv.GetValue("PtMin", NAN);
1954 } else if (cut == "PtMax") {
1955 pT_max = rEnv.GetValue("PtMax", NAN);
1956 } else if (cut == "AbsEtaRegion") {
1957 v_eta_window = split(rEnv.GetValue("AbsEtaRegion", ""), ";");
1958 std::transform(std::begin(v_eta_window),
1959 std::end(v_eta_window),
1960 std::back_inserter(eta_window),
1961 [](const std::string& s) { return std::stof(s); }
1962 );
1963 } else if (cut == "AbsEtaMin") {
1964 eta_min = rEnv.GetValue("AbsEtaMin", NAN);
1965 } else if (cut == "AbsEtaMax") {
1966 eta_max = rEnv.GetValue("AbsEtaMax", NAN);
1967 }
1968
1969 //OR settings
1970 else if (cut == "EleOLR"){
1971 eleOLR = (rEnv.GetValue("EleOLR", "FALSE") == trueBool);
1972 }
1973 else if (cut == "MuonVeto"){
1974 muVeto = (rEnv.GetValue("MuonVeto", "FALSE") == trueBool);
1975 }
1976 else if (cut == "MuonOLR"){
1977 muOLR = (rEnv.GetValue("MuonOLR", "FALSE") == trueBool);
1978 }
1979 }
1980
1981 if(pT_window.empty()) {
1982 if(pT_min == pT_min) {
1983 // fails on NaN
1984 pT_window.push_back(pT_min);
1985 } else {
1986 pT_window.push_back(-std::numeric_limits<float>::infinity());
1987 }
1988
1989 if(pT_max == pT_max) {
1990 // fails on NaN
1991 pT_window.push_back(pT_max);
1992 } else {
1993 pT_window.push_back(std::numeric_limits<float>::infinity());
1994 }
1995 }
1996
1997 if(eta_window.empty()) {
1998 if(eta_min == eta_min) {
1999 // fails on NaN
2000 eta_window.push_back(eta_min);
2001 } else {
2002 eta_window.push_back(-std::numeric_limits<float>::infinity());
2003 }
2004
2005 if(eta_max == eta_max) {
2006 // fails on NaN
2007 eta_window.push_back(eta_max);
2008 } else {
2009 eta_window.push_back(std::numeric_limits<float>::infinity());
2010 }
2011 }
2012
2013 return StatusCode::SUCCESS;
2014}
2015
2016StatusCode SUSYObjDef_xAOD::validConfig(bool strict) const {
2017 // Validate configuration (i.e. that signal settings are tighter than baseline, etc)
2018 // :: Throw SC::FAILURE if strict mode is enabled, just a WARNING if not
2019
2020 // Electrons
2021 if( m_elePt < m_eleBaselinePt ){
2022 ATH_MSG_WARNING("Your electron pt configuration is inconsistent! Signal : " << m_elePt << " < Baseline : " << m_eleBaselinePt);
2023 if(strict) return StatusCode::FAILURE;
2024 }
2025 if( m_eleEta > m_eleBaselineEta ){
2026 ATH_MSG_WARNING("Your electron eta configuration is inconsistent! Signal : " << m_eleEta << " < Baseline : " << m_eleBaselineEta);
2027 if(strict) return StatusCode::FAILURE;
2028 }
2029
2031 ATH_MSG_WARNING("Your electron ID configuration is inconsistent! Signal : " << m_eleId << " looser than Baseline : " << m_eleIdBaseline);
2032 if(strict) return StatusCode::FAILURE;
2033 }
2035 ATH_MSG_WARNING("Your electron crack removal is inconsistent! Signal : " << m_eleCrackVeto << " while Baseline : " << m_eleBaselineCrackVeto);
2036 if(strict) return StatusCode::FAILURE;
2037 }
2038
2039 // Muons
2040 if( m_muPt < m_muBaselinePt ){
2041 ATH_MSG_WARNING("Your muon pt configuration is inconsistent! Signal : " << m_muPt << " < Baseline : " << m_muBaselinePt);
2042 if(strict) return StatusCode::FAILURE;
2043 }
2044 if( m_muEta > m_muBaselineEta ){
2045 ATH_MSG_WARNING("Your muon eta configuration is inconsistent! Signal : " << m_muEta << " < Baseline : " << m_muBaselineEta);
2046 if(strict) return StatusCode::FAILURE;
2047 }
2048 if( m_muId > m_muIdBaseline ){
2049 ATH_MSG_WARNING("Your muon ID configuration is inconsistent! Signal : " << m_muId << " < Baseline : " << m_muIdBaseline);
2050 if(strict) return StatusCode::FAILURE;
2051 }
2052
2053 // Photons
2055 ATH_MSG_WARNING("Your photon pt configuration is inconsistent! Signal : " << m_photonPt << " < Baseline : " << m_photonBaselinePt);
2056 if(strict) return StatusCode::FAILURE;
2057 }
2059 ATH_MSG_WARNING("Your photon eta configuration is inconsistent! Signal : " << m_photonEta << " < Baseline : " << m_photonBaselineEta);
2060 if(strict) return StatusCode::FAILURE;
2061 }
2062 if( m_photonId=="Loose" && m_photonIdBaseline=="Tight" ){
2063 ATH_MSG_WARNING("Your photon ID configuration is inconsistent! Signal : " << m_photonId << " < Baseline : " << m_photonIdBaseline);
2064 if(strict) return StatusCode::FAILURE;
2065 }
2067 ATH_MSG_WARNING("Your photon crack removal is inconsistent! Signal : " << m_photonCrackVeto << " while Baseline : " << m_photonBaselineCrackVeto);
2068 if(strict) return StatusCode::FAILURE;
2069 }
2070
2071 // Jets
2072 if ( m_jetPt < 20e3 ){
2073 ATH_MSG_WARNING("Your minimum signal jet pt is less than 20 GeV! Jet.Pt : " << m_jetPt << ". This is NOT supported by the jet group!");
2074 }
2075
2076 //Btagging //OR-wp looser than signal-wp?
2077 if( m_BtagWP.compare(0, m_BtagWP.size()-3, m_orBtagWP, 0, m_BtagWP.size()-3) == 0 ){ //same tagger WP (FixedCutBEff_XX or HybBEff_XX)
2078 if( atoi(m_BtagWP.substr(m_BtagWP.size()-2, m_BtagWP.size()).c_str()) > atoi(m_orBtagWP.substr(m_orBtagWP.size()-2, m_orBtagWP.size()).c_str()) ){
2079 ATH_MSG_WARNING("Your btagging configuration is inconsistent! Signal : " << m_BtagWP << " is looser than OR-Baseline : " << m_orBtagWP);
2080 }
2081 }
2082 if (m_BtagMinPt < 20e3 || m_BtagMinPt_trkJet < 10e3) {
2083 ATH_MSG_WARNING("You btagging MinPt settings are inconsistent! EM(Topo|PFlow)Jets: not calibrated below 20 GeV (Btag.MinPt: " << m_BtagMinPt/1000. << " GeV set), VRTrackJets: not calibrated below 10 GeV (BtagTrkJet.MinPt: " << m_BtagMinPt_trkJet/1000. << " GeV set).");
2084 }
2085
2086 //Taus
2088 if(m_tauPrePtCut > 0 and m_tauPrePtCut > m_tauPt) {
2089 ATH_MSG_WARNING("Your tau pt configuration is inconsistent! Signal pt cut : " << m_tauPt << " < Baseline (pre) pt cut : " << m_tauPrePtCut);
2090 if(strict) return StatusCode::FAILURE;
2091 }
2094 ATH_MSG_WARNING("Your tau ID configuration is inconsistent! Signal : " << m_tauId << " looser than Baseline : " << m_tauIdBaseline);
2095 if(strict) return StatusCode::FAILURE;
2096 }
2097
2099 std::vector<float> pT_window;
2100 std::vector<float> eta_window;
2101 bool elOLR=false;
2102 bool muVeto=false;
2103 bool muOLR=false;
2104
2105 if(!m_tauConfigPathBaseline.empty()) { //baseline taus
2106
2107 //read config
2108 ANA_CHECK(getTauConfig(m_tauInputFileBaseline, pT_window, eta_window, elOLR, muVeto, muOLR));
2109
2110 //pt-eta checks
2111 if( m_tauPrePtCut > 0 and (m_tauPrePtCut != 1000*pT_window[0] or (pT_window[1] > 0 and m_tauPrePtCut > 1000*pT_window[1]))) {
2112 ATH_MSG_WARNING("Your baseline tau pt configuration is inconsistent! pre pT cut : " << m_tauPrePtCut << " / TauSelectionTool window (in MeV) : [" << 1000*pT_window[0] << ", " << 1000*pT_window[1] << "]");
2113 if(strict) return StatusCode::FAILURE;
2114 }
2115
2116 if( m_tauPt > 0 and (m_tauPt != 1000*pT_window[0] or (pT_window[1] > 0 and m_tauPt > 1000*pT_window[1]))) {
2117 ATH_MSG_WARNING("Your baseline tau pt configuration is inconsistent! pT cut : " << m_tauPt << " / TauSelectionTool window (in Mev) : [" << 1000*pT_window[0] << ", " << 1000*pT_window[1] << "]");
2118 if(strict) return StatusCode::FAILURE;
2119 }
2120
2121 if( m_tauEta > 0 and m_tauEta != eta_window[eta_window.size()-1]) { // eta window can have 4 entries
2122 ATH_MSG_WARNING("Your baseline tau eta configuration is inconsistent! eta cut : " << m_tauEta << " != TauSelectionTool max eta : " << eta_window[eta_window.size()-1]);
2123 if(strict) return StatusCode::FAILURE;
2124 }
2125 }
2126
2127 if(!m_tauConfigPath.empty()) { //signal taus
2128
2129 ANA_CHECK(getTauConfig(m_tauInputFile, pT_window, eta_window, elOLR, muVeto, muOLR));
2130
2131 if( m_tauPrePtCut > 0 and (m_tauPrePtCut != 1000*pT_window[0] or (pT_window[1] > 0 and m_tauPrePtCut > 1000*pT_window[1]))) {
2132 ATH_MSG_WARNING("Your tau pt configuration is inconsistent! pre pT cut : " << m_tauPrePtCut << " / TauSelectionTool window (in MeV) : [" << 1000*pT_window[0] << ", " << 1000*pT_window[1] << "]");
2133 if(strict) return StatusCode::FAILURE;
2134 }
2135
2136 if( m_tauPt > 0 and (m_tauPt != 1000*pT_window[0] or (pT_window[1] > 0 and m_tauPt > 1000*pT_window[1]))) {
2137 ATH_MSG_WARNING("Your tau pt configuration is inconsistent! pT cut : " << m_tauPt << " / TauSelectionTool window (in Mev) : [" << 1000*pT_window[0] << ", " << 1000*pT_window[1] << "]");
2138 if(strict) return StatusCode::FAILURE;
2139 }
2140
2141 if( m_tauEta > 0 and m_tauEta != eta_window[eta_window.size()-1]) { // eta window can have 4 entries
2142 ATH_MSG_WARNING("Your tau eta configuration is inconsistent! eta cut : " << m_tauEta << " != TauSelectionTool max eta : " << eta_window[eta_window.size()-1]);
2143 if(strict) return StatusCode::FAILURE;
2144 }
2145 }
2146
2147
2148 return StatusCode::SUCCESS;
2149}
2150
2151
2152
2154
2158
2162
2164 return syst.name().empty();
2165}
2166
2168 // returns true if all systematics do _not_ affect kinematics and _any_ of them affects the weight
2169 bool affectsWeights = false;
2170 for (const auto& sys : systSet) {
2171 auto info = getSystInfo(sys);
2172 if(info.affectsKinematics) { return false; }
2173 affectsWeights = affectsWeights or info.affectsWeights;
2174 }
2175 return affectsWeights;
2176}
2177
2179 // returns true if _any_ of the systematics affect kinematics. ignores effect on weights.
2180 for (const auto& sys : systSet) {
2181 auto info = getSystInfo(sys);
2182 if(info.affectsKinematics) { return true; }
2183 }
2184 return false;
2185}
2186
2190
2194
2198
2199
2200
2202{
2203 if (!m_tool_init) {
2204 ATH_MSG_ERROR("SUSYTools was not initialized!!");
2205 return StatusCode::FAILURE;
2206 }
2207
2208 ATH_MSG_DEBUG(" in SUSYObjDef_xAOD::applySystematicVariation \"" << systConfig.name() << "\" size " << systConfig.size());
2209
2210 m_currentSyst = systConfig;
2211
2212 // NB: SystematicSet typically has only one component (see SUSYToolsTester macro)
2213 if (!m_jetUncertaintiesTool.empty() && systConfig.name().find("PseudoData") == std::string::npos) {
2214 StatusCode ret = m_jetUncertaintiesTool->applySystematicVariation(systConfig);
2215 if ( ret != StatusCode::SUCCESS) {
2216 ATH_MSG_VERBOSE("Cannot configure JetUncertaintiesTool for systematic var. " << systConfig.name() );
2217 } else {
2218 ATH_MSG_VERBOSE("Configured JetUncertaintiesTool for systematic var. " << systConfig.name() );
2219 }
2220 }
2221 if (!m_jetUncertaintiesPDSmearTool.empty() && systConfig.name().find("PseudoData") != std::string::npos) {
2222 StatusCode ret = m_jetUncertaintiesPDSmearTool->applySystematicVariation(systConfig);
2223 if ( ret != StatusCode::SUCCESS) {
2224 ATH_MSG_VERBOSE("Cannot configure JetUncertaintiesPDSmearTool for systematic var. " << systConfig.name() );
2225 } else {
2226 ATH_MSG_VERBOSE("Configured JetUncertaintiesPDSmearTool for systematic var. " << systConfig.name() );
2227 }
2228 }
2229 if (!m_WTagjetUncertaintiesTool.empty() && !m_WTagUncConfig.empty()) {
2230 StatusCode ret = m_WTagjetUncertaintiesTool->applySystematicVariation(systConfig);
2231 if ( ret != StatusCode::SUCCESS) {
2232 ATH_MSG_VERBOSE("Cannot configure (Fat)JetUncertaintiesTool (WTag) for systematic var. " << systConfig.name() );
2233 } else {
2234 ATH_MSG_VERBOSE("Configured (Fat)JetUncertaintiesTool (WTag) for systematic var. " << systConfig.name() );
2235 }
2236 }
2237 if (!m_ZTagjetUncertaintiesTool.empty() && !m_ZTagUncConfig.empty()) {
2238 StatusCode ret = m_ZTagjetUncertaintiesTool->applySystematicVariation(systConfig);
2239 if ( ret != StatusCode::SUCCESS) {
2240 ATH_MSG_VERBOSE("Cannot configure (Fat)JetUncertaintiesTool (ZTag) for systematic var. " << systConfig.name() );
2241 } else {
2242 ATH_MSG_VERBOSE("Configured (Fat)JetUncertaintiesTool (ZTag) for systematic var. " << systConfig.name() );
2243 }
2244 }
2245
2246 if (!m_TopTagjetUncertaintiesTool.empty() && !m_TopTagUncConfig.empty()) {
2247 StatusCode ret = m_TopTagjetUncertaintiesTool->applySystematicVariation(systConfig);
2248 if ( ret != StatusCode::SUCCESS) {
2249 ATH_MSG_VERBOSE("Cannot configure (Fat)JetUncertaintiesTool (TopTag) for systematic var. " << systConfig.name() );
2250 } else {
2251 ATH_MSG_VERBOSE("Configured (Fat)JetUncertaintiesTool (TopTag) for systematic var. " << systConfig.name() );
2252 }
2253 }
2254 if (!m_fatjetUncertaintiesTool.empty() && systConfig.name().find("PseudoData") == std::string::npos) {
2255 StatusCode ret = m_fatjetUncertaintiesTool->applySystematicVariation(systConfig);
2256 if ( ret != StatusCode::SUCCESS) {
2257 ATH_MSG_VERBOSE("Cannot configure (Fat)JetUncertaintiesTool (main) for systematic var. " << systConfig.name() );
2258 } else {
2259 ATH_MSG_VERBOSE("Configured (Fat)JetUncertaintiesTool (main) for systematic var. " << systConfig.name() );
2260 }
2261 }
2262 if (!m_fatjetUncertaintiesPDSmearTool.empty() && systConfig.name().find("PseudoData") != std::string::npos) {
2263 StatusCode ret = m_fatjetUncertaintiesPDSmearTool->applySystematicVariation(systConfig);
2264 if ( ret != StatusCode::SUCCESS) {
2265 ATH_MSG_VERBOSE("Cannot configure FatJetUncertaintiesPDSmearTool for systematic var. " << systConfig.name() );
2266 } else {
2267 ATH_MSG_VERBOSE("Configured FatJetUncertaintiesPDSmearTool for systematic var. " << systConfig.name() );
2268 }
2269 }
2270 if (!m_fatjetFFSmearingTool.empty() && std::find(m_fatjetFFSmearingSyst.begin(), m_fatjetFFSmearingSyst.end(), systConfig) != m_fatjetFFSmearingSyst.end()) {
2271 StatusCode ret = m_fatjetFFSmearingTool->applySystematicVariation(systConfig);
2272 if ( ret != StatusCode::SUCCESS) {
2273 ATH_MSG_VERBOSE("Cannot configure (Fat)JetFFSmearingTool (main) for systematic var. " << systConfig.name() );
2274 } else {
2275 ATH_MSG_VERBOSE("Configured (Fat)JetFFSmearingTool (main) for systematic var. " << systConfig.name() );
2276 }
2277 }
2278 if (!m_jetNNJvtEfficiencyTool.empty()) {
2279 StatusCode ret = m_jetNNJvtEfficiencyTool->applySystematicVariation(systConfig);
2280 if ( ret != StatusCode::SUCCESS) {
2281 ATH_MSG_VERBOSE("Cannot configure NNJvtEfficiency for systematic var. " << systConfig.name() );
2282 } else {
2283 ATH_MSG_VERBOSE("Configured NNJvtEfficiency for systematic var. " << systConfig.name() );
2284 }
2285 }
2286 if (!m_jetfJvtEfficiencyTool.empty()) {
2287 StatusCode ret = m_jetfJvtEfficiencyTool->applySystematicVariation(systConfig);
2288 if ( ret != StatusCode::SUCCESS) {
2289 ATH_MSG_VERBOSE("Cannot configure fJvtEfficiency for systematic var. " << systConfig.name() );
2290 } else {
2291 ATH_MSG_VERBOSE("Configured fJvtEfficiency for systematic var. " << systConfig.name() );
2292 }
2293 }
2294 if (!m_muonCalibTool.empty()) {
2295 StatusCode ret = m_muonCalibTool->applySystematicVariation(systConfig);
2296 if (ret != StatusCode::SUCCESS) {
2297 ATH_MSG_ERROR("Cannot configure MuonCalibTool for systematic var. " << systConfig.name() );
2298 return ret;
2299 } else {
2300 ATH_MSG_VERBOSE("MuonCalibTool configured for systematic var. " << systConfig.name() );
2301 }
2302 }
2303 if (!m_muonEfficiencySFTool.empty()) {
2304 StatusCode ret = m_muonEfficiencySFTool->applySystematicVariation(systConfig);
2305 if ( ret != StatusCode::SUCCESS) {
2306 ATH_MSG_ERROR("Cannot configure MuonEfficiencyScaleFactors for systematic var. " << systConfig.name() );
2307 return ret;
2308 } else {
2309 ATH_MSG_VERBOSE("MuonEfficiencyScaleFactors configured for systematic var. " << systConfig.name() );
2310 }
2311 }
2312 if (!m_muonEfficiencyBMHighPtSFTool.empty()) {
2313 StatusCode ret = m_muonEfficiencyBMHighPtSFTool->applySystematicVariation(systConfig);
2314 if ( ret != StatusCode::SUCCESS) {
2315 ATH_MSG_ERROR("Cannot configure MuonBadMuonHighPtScaleFactors for systematic var. " << systConfig.name() );
2316 return ret;
2317 } else {
2318 ATH_MSG_VERBOSE("MuonBadMuonHighPtScaleFactors configured for systematic var. " << systConfig.name() );
2319 }
2320 }
2321 if (!m_muonTTVAEfficiencySFTool.empty()) {
2322 StatusCode ret = m_muonTTVAEfficiencySFTool->applySystematicVariation(systConfig);
2323 if ( ret != StatusCode::SUCCESS) {
2324 ATH_MSG_ERROR("Cannot configure MuonTTVAEfficiencyScaleFactors for systematic var. " << systConfig.name() );
2325 return ret;
2326 } else {
2327 ATH_MSG_VERBOSE("MuonTTVAEfficiencyScaleFactors configured for systematic var. " << systConfig.name() );
2328 }
2329 }
2330 if (!m_muonIsolationSFTool.empty()) {
2331 StatusCode ret = m_muonIsolationSFTool->applySystematicVariation(systConfig);
2332 if ( ret != StatusCode::SUCCESS) {
2333 ATH_MSG_ERROR("Cannot configure MuonIsolationScaleFactors for systematic var. " << systConfig.name() );
2334 return ret;
2335 } else {
2336 ATH_MSG_VERBOSE("MuonIsolationScaleFactors configured for systematic var. " << systConfig.name() );
2337 }
2338 }
2339 if (!m_muonTriggerSFTool.empty()) {
2340 StatusCode ret = m_muonTriggerSFTool->applySystematicVariation(systConfig);
2341 if ( ret != StatusCode::SUCCESS) {
2342 ATH_MSG_ERROR("Cannot configure MuonTriggerScaleFactors for systematic var. " << systConfig.name() );
2343 return ret;
2344 } else {
2345 ATH_MSG_VERBOSE("MuonTriggerScaleFactors configured for systematic var. " << systConfig.name() );
2346 }
2347 }
2348 if (!m_elecEfficiencySFTool_reco.empty()) {
2349 StatusCode ret = m_elecEfficiencySFTool_reco->applySystematicVariation(systConfig);
2350 if (ret != StatusCode::SUCCESS) {
2351 ATH_MSG_ERROR("Cannot configure AsgElectronEfficiencyCorrectionTool (reco) for systematic var. " << systConfig.name() );
2352 return ret;
2353 } else {
2354 ATH_MSG_VERBOSE("AsgElectronEfficiencyCorrectionTool (reco) configured for systematic var. " << systConfig.name() );
2355 }
2356 }
2357 if (!m_elecEfficiencySFTool_id.empty()) {
2358 StatusCode ret = m_elecEfficiencySFTool_id->applySystematicVariation(systConfig);
2359 if (ret != StatusCode::SUCCESS) {
2360 ATH_MSG_ERROR("Cannot configure AsgElectronEfficiencyCorrectionTool (id) for systematic var. " << systConfig.name() );
2361 return ret;
2362 } else {
2363 ATH_MSG_VERBOSE("AsgElectronEfficiencyCorrectionTool (id) configured for systematic var. " << systConfig.name() );
2364 }
2365 }
2367 StatusCode ret = m_elecEfficiencySFTool_trig_singleLep->applySystematicVariation(systConfig);
2368 if (ret != StatusCode::SUCCESS) {
2369 ATH_MSG_ERROR("Cannot configure AsgElectronEfficiencyCorrectionTool (trigger) for systematic var. " << systConfig.name() );
2370 return ret;
2371 } else {
2372 ATH_MSG_VERBOSE("AsgElectronEfficiencyCorrectionTool (trigger) configured for systematic var. " << systConfig.name() );
2373 }
2374 }
2376 StatusCode ret = m_elecEfficiencySFTool_trigEff_singleLep->applySystematicVariation(systConfig);
2377 if (ret != StatusCode::SUCCESS) {
2378 ATH_MSG_ERROR("Cannot configure AsgElectronEfficiencyCorrectionTool (trigger SFTool) for systematic var. " << systConfig.name() );
2379 return ret;
2380 } else {
2381 ATH_MSG_VERBOSE("AsgElectronEfficiencyCorrectionTool (trigger SFTool) configured for systematic var. " << systConfig.name() );
2382 }
2383 }
2384 if (!m_trigGlobalEffCorrTool_diLep.empty()) {
2385 StatusCode ret = m_trigGlobalEffCorrTool_diLep->applySystematicVariation(systConfig);
2386 for(auto &sfop : m_elecTrigEffTools){
2387 StatusCode ret1 = sfop->applySystematicVariation(systConfig);
2388 if (ret1 != StatusCode::SUCCESS) { ATH_MSG_ERROR("Cannot configure m_elecTrigEffTools (dilepton trigger) for systematic var. " << systConfig.name() ); return ret1; }
2389 }
2390 for(auto &sfop : m_elecTrigSFTools){
2391 StatusCode ret1 = sfop->applySystematicVariation(systConfig);
2392 if (ret1 != StatusCode::SUCCESS) { ATH_MSG_ERROR("Cannot configure m_elecTrigSFTools (dilepton trigger) for systematic var. " << systConfig.name() ); return ret1; }
2393 }
2394 for(auto &sfop : m_muonTrigSFTools){
2395 StatusCode ret1 = sfop->applySystematicVariation(systConfig);
2396 if (ret1 != StatusCode::SUCCESS) { ATH_MSG_ERROR("Cannot configure m_muonTrigSFTools (dilepton trigger) for systematic var. " << systConfig.name() ); return ret1; }
2397 }
2398 if (ret != StatusCode::SUCCESS) {
2399 ATH_MSG_ERROR("Cannot configure TrigGlobalEfficiencyCorrectionTool (dilepton trigger) for systematic var. " << systConfig.name() );
2400 return ret;
2401 } else {
2402 ATH_MSG_VERBOSE("TrigGlobalEfficiencyCorrectionTool (dilepton trigger) configured for systematic var. " << systConfig.name() );
2403 }
2404 }
2405 if (!m_trigGlobalEffCorrTool_multiLep.empty()) {
2406 StatusCode ret = m_trigGlobalEffCorrTool_multiLep->applySystematicVariation(systConfig);
2407 for(auto &sfop : m_elecTrigEffTools){
2408 StatusCode ret1 = sfop->applySystematicVariation(systConfig);
2409 if (ret1 != StatusCode::SUCCESS) { ATH_MSG_ERROR("Cannot configure m_elecTrigEffTools (multilep trigger) for systematic var. " << systConfig.name() ); return ret1; }
2410 }
2411 for(auto &sfop : m_elecTrigSFTools){
2412 StatusCode ret1 = sfop->applySystematicVariation(systConfig);
2413 if (ret1 != StatusCode::SUCCESS) { ATH_MSG_ERROR("Cannot configure m_elecTrigSFTools (multilep trigger) for systematic var. " << systConfig.name() ); return ret1; }
2414 }
2415 for(auto &sfop : m_muonTrigSFTools){
2416 StatusCode ret1 = sfop->applySystematicVariation(systConfig);
2417 if (ret1 != StatusCode::SUCCESS) { ATH_MSG_ERROR("Cannot configure m_muonTrigSFTools (multilep trigger) for systematic var. " << systConfig.name() ); return ret1; }
2418 }
2419 if (ret != StatusCode::SUCCESS) {
2420 ATH_MSG_ERROR("Cannot configure TrigGlobalEfficiencyCorrectionTool (multi-lepton trigger) for systematic var. " << systConfig.name() );
2421 return ret;
2422 } else {
2423 ATH_MSG_VERBOSE("TrigGlobalEfficiencyCorrectionTool (multi-lepton trigger) configured for systematic var. " << systConfig.name() );
2424 }
2425 }
2426 if (!m_elecEfficiencySFTool_iso.empty()) {
2427 StatusCode ret = m_elecEfficiencySFTool_iso->applySystematicVariation(systConfig);
2428 if (ret != StatusCode::SUCCESS) {
2429 ATH_MSG_ERROR("Cannot configure AsgElectronEfficiencyCorrectionTool (iso) for systematic var. " << systConfig.name() );
2430 return ret;
2431 } else {
2432 ATH_MSG_VERBOSE("AsgElectronEfficiencyCorrectionTool (iso) configured for systematic var. " << systConfig.name() );
2433 }
2434 }
2435 if (!m_elecEfficiencySFTool_isoHighPt.empty()) {
2436 StatusCode ret = m_elecEfficiencySFTool_isoHighPt->applySystematicVariation(systConfig);
2437 if (ret != StatusCode::SUCCESS) {
2438 ATH_MSG_ERROR("Cannot configure AsgElectronEfficiencyCorrectionTool (iso high-pt) for systematic var. " << systConfig.name() );
2439 return ret;
2440 } else {
2441 ATH_MSG_VERBOSE("AsgElectronEfficiencyCorrectionTool (iso high-pt) configured for systematic var. " << systConfig.name() );
2442 }
2443 }
2444 if (!m_elecChargeEffCorrTool.empty()) {
2445 StatusCode ret = m_elecChargeEffCorrTool->applySystematicVariation(systConfig);
2446 if (ret != StatusCode::SUCCESS) {
2447 ATH_MSG_ERROR("Cannot configure ElectronChargeEffCorrectionTool for systematic var. " << systConfig.name() );
2448 return ret;
2449 } else {
2450 ATH_MSG_VERBOSE("ElectronChargeEffCorrectionTool configured for systematic var. " << systConfig.name() );
2451 }
2452 }
2453 if (!isData() && !m_photonEfficiencySFTool.empty()) {
2454 StatusCode ret = m_photonEfficiencySFTool->applySystematicVariation(systConfig);
2455 if (ret != StatusCode::SUCCESS) {
2456 ATH_MSG_ERROR("Cannot configure AsgPhotonEfficiencyCorrectionTool (reco) for systematic var. " << systConfig.name() );
2457 return ret;
2458 } else {
2459 ATH_MSG_VERBOSE("AsgPhotonEfficiencyCorrectionTool (reco) configured for systematic var. " << systConfig.name() );
2460 }
2461 }
2462 if (!isData() && !m_photonIsolationSFTool.empty()) {
2463 StatusCode ret = m_photonIsolationSFTool->applySystematicVariation(systConfig);
2464 if (ret != StatusCode::SUCCESS) {
2465 ATH_MSG_ERROR("Cannot configure AsgPhotonEfficiencyCorrectionTool (iso) for systematic var. " << systConfig.name() );
2466 return ret;
2467 } else {
2468 ATH_MSG_VERBOSE("AsgPhotonEfficiencyCorrectionTool configured (iso) for systematic var. " << systConfig.name() );
2469 }
2470 }
2471 if (!isData() && !m_photonTriggerSFTool.empty()) {
2472 StatusCode ret = m_photonTriggerSFTool->applySystematicVariation(systConfig);
2473 if (ret != StatusCode::SUCCESS) {
2474 ATH_MSG_ERROR("Cannot configure AsgPhotonEfficiencyCorrectionTool (trigger) for systematic var. " << systConfig.name() );
2475 return ret;
2476 } else {
2477 ATH_MSG_VERBOSE("AsgPhotonEfficiencyCorrectionTool configured (trigger) for systematic var. " << systConfig.name() );
2478 }
2479 }
2480 if (!m_trigGlobalEffCorrTool_diPhoton.empty()) {
2481 StatusCode ret = m_trigGlobalEffCorrTool_diPhoton->applySystematicVariation(systConfig);
2482 for(auto &sfop : m_photonTrigEffTools){
2483 StatusCode ret1 = sfop->applySystematicVariation(systConfig);
2484 if (ret1 != StatusCode::SUCCESS) { ATH_MSG_ERROR("Cannot configure m_photonTrigEffTools (diphoton trigger) for systematic var. " << systConfig.name() ); return ret1; }
2485 }
2486 for(auto &sfop : m_photonTrigSFTools){
2487 StatusCode ret1 = sfop->applySystematicVariation(systConfig);
2488 if (ret1 != StatusCode::SUCCESS) { ATH_MSG_ERROR("Cannot configure m_photonTrigSFTools (diphoton trigger) for systematic var. " << systConfig.name() ); return ret1; }
2489 }
2490 if (ret != StatusCode::SUCCESS) {
2491 ATH_MSG_ERROR("Cannot configure TrigGlobalEfficiencyCorrectionTool (diphoton trigger) for systematic var. " << systConfig.name() );
2492 return ret;
2493 } else {
2494 ATH_MSG_VERBOSE("TrigGlobalEfficiencyCorrectionTool (diphoton trigger) configured for systematic var. " << systConfig.name() );
2495 }
2496 }
2497 if (!m_egammaCalibTool.empty()) {
2498 StatusCode ret = m_egammaCalibTool->applySystematicVariation(systConfig);
2499 if (ret != StatusCode::SUCCESS) {
2500 ATH_MSG_ERROR("Cannot configure EgammaCalibrationAndSmearingTool for systematic var. " << systConfig.name() );
2501 return ret;
2502 } else {
2503 ATH_MSG_VERBOSE("EgammaCalibrationAndSmearingTool configured for systematic var. " << systConfig.name() );
2504 }
2505 }
2506 if (!m_isoCorrTool.empty()) {
2507 StatusCode ret = m_isoCorrTool->applySystematicVariation(systConfig);
2508 if (ret != StatusCode::SUCCESS) {
2509 ATH_MSG_ERROR("Cannot configure IsolationCorrectionTool for systematic var. " << systConfig.name() );
2510 return ret;
2511 } else {
2512 ATH_MSG_VERBOSE("IsolationCorrectionTool configured for systematic var. " << systConfig.name() );
2513 }
2514 }
2515 if (!m_btagEffTool.empty()) {
2516 //if ( systConfig.size() > 0 && m_btagEffTool->isAffectedBySystematic(*systConfig.begin()) ) {
2517 StatusCode ret = m_btagEffTool->applySystematicVariation(systConfig);
2518 if ( ret != StatusCode::SUCCESS) {
2519 ATH_MSG_ERROR("Cannot configure xAODBTaggingEfficiency for systematic var. " << systConfig.name() );
2520 return ret;
2521 } else {
2522 ATH_MSG_VERBOSE("Configured xAODBTaggingEfficiency for systematic var. " << systConfig.name() );
2523 }
2524 //}
2525 }
2526 if (!m_btagEffTool_trkJet.empty()) {
2527 StatusCode ret = m_btagEffTool_trkJet->applySystematicVariation(systConfig);
2528 if ( ret != StatusCode::SUCCESS) {
2529 ATH_MSG_ERROR("Cannot configure xAODBTaggingEfficiency (track jets) for systematic var. " << systConfig.name() );
2530 return ret;
2531 } else {
2532 ATH_MSG_VERBOSE("Configured xAODBTaggingEfficiency (track jets) for systematic var. " << systConfig.name() );
2533 }
2534 }
2535 if (!m_tauSmearingTool.empty()) {
2536 StatusCode ret = m_tauSmearingTool->applySystematicVariation(systConfig);
2537 if ( ret != StatusCode::SUCCESS) {
2538 ATH_MSG_ERROR("Cannot configure TauSmearingTool for systematic var. " << systConfig.name() );
2539 return ret;
2540 } else {
2541 ATH_MSG_VERBOSE("Configured TauSmearingTool for systematic var. " << systConfig.name() );
2542 }
2543 }
2544 if (!m_tauEffTool.empty()) {
2545 StatusCode ret = m_tauEffTool->applySystematicVariation(systConfig);
2546 if ( ret != StatusCode::SUCCESS) {
2547 ATH_MSG_ERROR("Cannot configure TauEfficiencyCorrectionsTool for systematic var. " << systConfig.name() );
2548 return ret;
2549 } else {
2550 ATH_MSG_VERBOSE("Configured TauEfficiencyCorrectionsTool for systematic var. " << systConfig.name() );
2551 }
2552 }
2553 for(auto &tool : m_tauTrigEffTool) {
2554 StatusCode ret = tool->applySystematicVariation(systConfig);
2555 if (ret != StatusCode::SUCCESS) {
2556 ATH_MSG_ERROR("Cannot configure " << tool->name() << " for systematic var. " << systConfig.name() );
2557 return ret;
2558 } else {
2559 ATH_MSG_VERBOSE("Configured " << tool->name() << " for systematic var. " << systConfig.name() );
2560 }
2561 }
2562 if (!m_metSystTool.empty()) {
2563 StatusCode ret = m_metSystTool->applySystematicVariation(systConfig);
2564 if ( ret != StatusCode::SUCCESS) {
2565 ATH_MSG_ERROR("Cannot configure METSystematicsTool for systematic var. " << systConfig.name() );
2566 return ret;
2567 } else {
2568 ATH_MSG_VERBOSE("Configured METSystematicsTool for systematic var. " << systConfig.name() );
2569 }
2570 }
2571 if (!m_prwTool.empty()) {
2572 StatusCode ret = m_prwTool->applySystematicVariation(systConfig);
2573 if ( ret != StatusCode::SUCCESS) {
2574 ATH_MSG_ERROR("Cannot configure PileupReweightingTool for systematic var. " << systConfig.name() );
2575 return ret;
2576 } else {
2577 ATH_MSG_VERBOSE("Configured PileupReweightingTool for systematic var. " << systConfig.name() );
2578 }
2579 }
2580
2581 if (!m_LRTuncTool.empty()) {
2582 StatusCode ret = m_LRTuncTool->applySystematicVariation(systConfig);
2583 if ( ret != StatusCode::SUCCESS) {
2584 ATH_MSG_ERROR("Cannot configure InDetTrackFilterTool for systematic var. " << systConfig.name() );
2585 return ret;
2586 } else {
2587 ATH_MSG_VERBOSE("Configured InDetTrackFilterTool for systematic var. " << systConfig.name() );
2588 }
2589 }
2590
2591 return StatusCode::SUCCESS;
2592}
2593
2594std::vector<ST::SystInfo> SUSYObjDef_xAOD::getSystInfoList() const {
2595 if (!m_tool_init) {
2596 ATH_MSG_ERROR("SUSYTools was not initialized!!");
2597 return vector<ST::SystInfo>();
2598 }
2599
2600 ATH_MSG_INFO("Extracting systematics info list");
2601
2602 // Now we can look at systematics:
2604 const CP::SystematicSet& recommendedSystematics = registry.recommendedSystematics();
2605
2606 vector<SystInfo> sysInfoList;
2607 sysInfoList.reserve(recommendedSystematics.size() * 2); // allow for continuous systematics
2608
2609 // this is the nominal set
2610 SystInfo infodef;
2611 infodef.affectsKinematics = false;
2612 infodef.affectsWeights = false;
2613 infodef.affectsType = Unknown;
2614 infodef.affectedWeights.clear();
2615 sysInfoList.push_back(infodef);
2616
2617
2618 // add all recommended systematics
2619 for (const auto& systSet : CP::make_systematics_vector(recommendedSystematics)) {
2620 for (const auto& sys : systSet) {
2621 sysInfoList.push_back(getSystInfo(sys));
2622 }
2623 }
2624
2625 ATH_MSG_INFO("Returning list of " << sysInfoList.size() << " systematic variations");
2626 return sysInfoList;
2627}
2628
2630
2631 SystInfo sysInfo;
2632 sysInfo.affectsKinematics = false;
2633 sysInfo.affectsWeights = false;
2634 sysInfo.affectedWeights.clear();
2635 sysInfo.systset.insert(sys);
2636
2637 if (!m_jetNNJvtEfficiencyTool.empty()) {
2638 if ( m_jetNNJvtEfficiencyTool->isAffectedBySystematic( sys ) ) {
2639 sysInfo.affectsWeights = true;
2640 sysInfo.affectsType = SystObjType::Jet;
2641 sysInfo.affectedWeights.insert(ST::Weights::Jet::JVT);
2642 }
2643 }
2644
2645 if (!m_jetfJvtEfficiencyTool.empty()) {
2646 if ( m_jetfJvtEfficiencyTool->isAffectedBySystematic( sys ) ) {
2647 sysInfo.affectsWeights = true;
2648 sysInfo.affectsType = SystObjType::Jet;
2649 sysInfo.affectedWeights.insert(ST::Weights::Jet::FJVT);
2650 }
2651 }
2652
2653 if (!m_jetUncertaintiesTool.empty()) {
2654 if ( m_jetUncertaintiesTool->isAffectedBySystematic( sys ) ) {
2655 sysInfo.affectsKinematics = true;
2656 sysInfo.affectsType = SystObjType::Jet;
2657 }
2658 }
2659 if (!m_jetUncertaintiesPDSmearTool.empty()) {
2660 if ( m_jetUncertaintiesPDSmearTool->isAffectedBySystematic( sys ) ) {
2661 sysInfo.affectsKinematics = true;
2662 sysInfo.affectsType = SystObjType::Jet;
2663 }
2664 }
2665
2666 if (!m_fatjetUncertaintiesTool.empty()) {
2667 if ( m_fatjetUncertaintiesTool->isAffectedBySystematic( sys ) ) {
2668 sysInfo.affectsKinematics = true;
2669 sysInfo.affectsType = SystObjType::Jet;
2670 }
2671 }
2672 if (!m_fatjetUncertaintiesPDSmearTool.empty()) {
2673 if ( m_fatjetUncertaintiesPDSmearTool->isAffectedBySystematic( sys ) ) {
2674 sysInfo.affectsKinematics = true;
2675 sysInfo.affectsType = SystObjType::Jet;
2676 }
2677 }
2678
2679 if (!m_fatjetFFSmearingTool.empty()) {
2680 CP::SystematicSet dummy;
2681 dummy.insert(sys);
2682 if ( std::find(m_fatjetFFSmearingSyst.begin(), m_fatjetFFSmearingSyst.end(), dummy) != m_fatjetFFSmearingSyst.end() ) {
2683 sysInfo.affectsKinematics = true;
2684 sysInfo.affectsType = SystObjType::Jet;
2685 }
2686 }
2687
2688 if (!m_WTagjetUncertaintiesTool.empty()) {
2689 if ( m_WTagjetUncertaintiesTool->isAffectedBySystematic( CP::SystematicVariation(sys.basename(), CP::SystematicVariation::CONTINUOUS) ) ) {
2690 sysInfo.affectsKinematics = true;
2691 sysInfo.affectsType = SystObjType::Jet;
2692 }
2693 }
2694 if (!m_ZTagjetUncertaintiesTool.empty()) {
2695 if ( m_ZTagjetUncertaintiesTool->isAffectedBySystematic( CP::SystematicVariation(sys.basename(), CP::SystematicVariation::CONTINUOUS) ) ) {
2696 sysInfo.affectsKinematics = true;
2697 sysInfo.affectsType = SystObjType::Jet;
2698 }
2699 }
2700 if (!m_TopTagjetUncertaintiesTool.empty()) {
2701 if ( m_TopTagjetUncertaintiesTool->isAffectedBySystematic( CP::SystematicVariation(sys.basename(), CP::SystematicVariation::CONTINUOUS) ) ) {
2702 sysInfo.affectsKinematics = true;
2703 sysInfo.affectsType = SystObjType::Jet;
2704 }
2705 }
2706
2707 if (!m_muonCalibTool.empty()) {
2708 if ( m_muonCalibTool->isAffectedBySystematic(sys) ) {
2709 sysInfo.affectsKinematics = true;
2711 }
2712 }
2714 if ( m_elecEfficiencySFTool_trig_singleLep->isAffectedBySystematic(sys) ) {
2715 sysInfo.affectsWeights = true;
2717 sysInfo.affectedWeights.insert(ST::Weights::Electron::Trigger);
2718 }
2719 }
2721 if ( m_elecEfficiencySFTool_trigEff_singleLep->isAffectedBySystematic(sys) ) {
2722 sysInfo.affectsWeights = true;
2724 sysInfo.affectedWeights.insert(ST::Weights::Electron::Trigger);
2725 }
2726 }
2727 if (!m_muonEfficiencySFTool.empty()) {
2728 if ( m_muonEfficiencySFTool->isAffectedBySystematic(sys) ) {
2729 sysInfo.affectsWeights = true;
2731 sysInfo.affectedWeights.insert(ST::Weights::Muon::Reconstruction);
2732 }
2733 }
2734 if (!m_muonEfficiencyBMHighPtSFTool.empty()) {
2735 if ( m_muonEfficiencyBMHighPtSFTool->isAffectedBySystematic(sys) ) {
2736 sysInfo.affectsWeights = true;
2738 sysInfo.affectedWeights.insert(ST::Weights::Muon::Reconstruction);
2739 }
2740 }
2741 if (!m_muonTTVAEfficiencySFTool.empty()) {
2742 if ( m_muonTTVAEfficiencySFTool->isAffectedBySystematic(sys) ) {
2743 sysInfo.affectsWeights = true;
2745 sysInfo.affectedWeights.insert(ST::Weights::Muon::Reconstruction);
2746 }
2747 }
2748 if (!m_muonIsolationSFTool.empty()) {
2749 if ( m_muonIsolationSFTool->isAffectedBySystematic(sys) ) {
2750 sysInfo.affectsWeights = true;
2752 sysInfo.affectedWeights.insert(ST::Weights::Muon::Isolation);
2753 }
2754 }
2755 if (!m_muonTriggerSFTool.empty()) {
2756 if ( m_muonTriggerSFTool->isAffectedBySystematic(sys) ) {
2757 sysInfo.affectsWeights = true;
2759 sysInfo.affectedWeights.insert(ST::Weights::Muon::Trigger);
2760 }
2761 }
2762 if (!m_elecEfficiencySFTool_reco.empty()) {
2763 if ( m_elecEfficiencySFTool_reco->isAffectedBySystematic(sys) ) {
2764 sysInfo.affectsWeights = true;
2766 sysInfo.affectedWeights.insert(ST::Weights::Electron::Reconstruction);
2767 }
2768 }
2769 if (!m_elecEfficiencySFTool_id.empty()) {
2770 if ( m_elecEfficiencySFTool_id->isAffectedBySystematic(sys) ) {
2771 sysInfo.affectsWeights = true;
2773 sysInfo.affectedWeights.insert(ST::Weights::Electron::ID);
2774 }
2775 }
2776 if (!m_trigGlobalEffCorrTool_diLep.empty()) {
2777 if ( m_trigGlobalEffCorrTool_diLep->isAffectedBySystematic(sys) ) {
2778 sysInfo.affectsWeights = true;
2780 sysInfo.affectedWeights.insert(ST::Weights::Electron::Trigger);
2781 }
2782 }
2783 if (!m_trigGlobalEffCorrTool_multiLep.empty()) {
2784 if ( m_trigGlobalEffCorrTool_multiLep->isAffectedBySystematic(sys) ) {
2785 sysInfo.affectsWeights = true;
2787 sysInfo.affectedWeights.insert(ST::Weights::Electron::Trigger);
2788 }
2789 }
2790 if (!m_elecEfficiencySFTool_iso.empty() ) {
2791 if ( m_elecEfficiencySFTool_iso->isAffectedBySystematic(sys) ) {
2792 sysInfo.affectsWeights = true;
2794 sysInfo.affectedWeights.insert(ST::Weights::Electron::Isolation);
2795 }
2796 }
2797 if (!m_elecEfficiencySFTool_isoHighPt.empty() ) {
2798 if ( m_elecEfficiencySFTool_isoHighPt->isAffectedBySystematic(sys) ) {
2799 sysInfo.affectsWeights = true;
2801 sysInfo.affectedWeights.insert(ST::Weights::Electron::Isolation);
2802 }
2803 }
2804 if (!m_egammaCalibTool.empty()) {
2805 if ( m_egammaCalibTool->isAffectedBySystematic(sys) ) {
2806 sysInfo.affectsKinematics = true;
2807 if (sys.basename().compare(0, 3, "EG_") == 0) {
2809 } else if (sys.basename().compare(0, 3, "PH_") == 0) {
2811 } else if (sys.basename().compare(0, 3, "EL_") == 0) {
2813 }
2814 }
2815 }
2816 if (!isData() && !m_isoCorrTool.empty()) {
2817 if (m_isoCorrTool->isAffectedBySystematic(sys)){
2818 sysInfo.affectsWeights = false;
2819 sysInfo.affectsKinematics = true;
2821 }
2822 }
2823 if (!isData() && !m_photonEfficiencySFTool.empty()) {
2824 if (m_photonEfficiencySFTool->isAffectedBySystematic(CP::SystematicVariation(sys.basename(), CP::SystematicVariation::CONTINUOUS)) ) {
2825 sysInfo.affectsWeights = true;
2827 sysInfo.affectedWeights.insert(ST::Weights::Photon::Reconstruction);
2828 }
2829 }
2830 if (!isData() && !m_photonIsolationSFTool.empty()) {
2831 if (m_photonIsolationSFTool->isAffectedBySystematic(sys)) {
2832 sysInfo.affectsWeights = true;
2834 sysInfo.affectedWeights.insert(ST::Weights::Photon::Isolation);
2835 }
2836 }
2837 if (!isData() && !m_photonTriggerSFTool.empty()) {
2838 if (m_photonTriggerSFTool->isAffectedBySystematic(sys)) {
2839 sysInfo.affectsWeights = true;
2841 sysInfo.affectedWeights.insert(ST::Weights::Photon::Trigger);
2842 }
2843 }
2844 if (!m_trigGlobalEffCorrTool_diPhoton.empty()) {
2845 if ( m_trigGlobalEffCorrTool_diPhoton->isAffectedBySystematic(sys) ) {
2846 sysInfo.affectsWeights = true;
2848 sysInfo.affectedWeights.insert(ST::Weights::Photon::Trigger);
2849 }
2850 }
2851 if ( !m_btagEffTool.empty() ) {
2852 if ( m_btagEffTool->isAffectedBySystematic(sys) ) {
2853 sysInfo.affectsWeights = true;
2855 sysInfo.affectedWeights.insert(ST::Weights::Jet::Btag);
2856 }
2857 }
2858 if ( !m_btagEffTool_trkJet.empty() ) {
2859 if ( m_btagEffTool_trkJet->isAffectedBySystematic(sys) ) {
2860 sysInfo.affectsWeights = true;
2862 sysInfo.affectedWeights.insert(ST::Weights::Jet::Btag_Track);
2863 }
2864 }
2865 if (!m_tauSmearingTool.empty()) {
2866 if ( m_tauSmearingTool->isAffectedBySystematic(sys) ) {
2867 sysInfo.affectsKinematics = true;
2868 sysInfo.affectsType = SystObjType::Tau;
2869 }
2870 }
2871 if (!m_tauEffTool.empty()) {
2872 if ( m_tauEffTool->isAffectedBySystematic(sys) ) {
2873 sysInfo.affectsWeights = true;
2874 sysInfo.affectsType = SystObjType::Tau;
2876 }
2877 }
2878 for(const auto &tool : m_tauTrigEffTool) {
2879 if(tool->isAffectedBySystematic(sys)) {
2880 sysInfo.affectsWeights = true;
2881 sysInfo.affectsType = SystObjType::Tau;
2883 break;
2884 }
2885 }
2886 if (!m_metSystTool.empty()) {
2887 if ( m_metSystTool->isAffectedBySystematic(sys) ) {
2888 sysInfo.affectsKinematics = true;
2889 switch (met::getSystType(sys)) {
2890 case met::SOFTCALO:
2892 break;
2893 case met::SOFTTRK:
2895 break;
2896 case met::JETTRK:
2898 break;
2899 default:
2900 ATH_MSG_ERROR("Unsupported systematic!");
2901 }
2902 }
2903 }
2904 if (!m_prwTool.empty()) {
2905 if ( m_prwTool->isAffectedBySystematic(sys) ) {
2906 sysInfo.affectsWeights = true;
2908 }
2909 }
2910
2911 if (!m_LRTuncTool.empty()){
2912 if ( m_LRTuncTool->isAffectedBySystematic(sys) ) {
2913 sysInfo.affectsKinematics = true;
2915 }
2916 }
2917
2918 std::string affectedType;
2919 switch (sysInfo.affectsType) {
2920 case Unknown : affectedType = "UNKNOWN"; break;
2921 case Jet : affectedType = "JET"; break;
2922 case Egamma : affectedType = "EGAMMA"; break;
2923 case Electron : affectedType = "ELECTRON"; break;
2924 case Photon : affectedType = "PHOTON"; break;
2925 case Muon : affectedType = "MUON"; break;
2926 case Tau : affectedType = "TAU"; break;
2927 case BTag : affectedType = "BTAG"; break;
2928 case MET_TST : affectedType = "MET_TST"; break;
2929 case MET_CST : affectedType = "MET_CST"; break;
2930 case MET_Track : affectedType = "MET_Track"; break;
2931 case EventWeight : affectedType = "EVENT WEIGHT"; break;
2932 case LRT_Object : affectedType = "LRT_OBJECT"; break;
2933 }
2934
2935 ATH_MSG_VERBOSE("Variation " << sys.name() << " affects "
2936 << ( sysInfo.affectsWeights ? "weights " : "" )
2937 << ( sysInfo.affectsKinematics ? "kinematics " : "" )
2938 << "for " << affectedType );
2939
2940 return sysInfo;
2941
2942}
2943
2944
2945// Temporary function for Sherpa 2.2 V+jets n-jets reweighting
2946// (see https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/CentralMC15ProductionList#NEW_Sherpa_v2_2_V_jets_NJet_rewe)
2948
2949 //Retrieve the truth jets
2950 if( evtStore()->contains<xAOD::JetContainer>("AntiKt4TruthWZJets") ){
2951 return getSherpaVjetsNjetsWeight("AntiKt4TruthWZJets");
2952 }
2953 else if( evtStore()->contains<xAOD::JetContainer>("AntiKt4TruthJets")){
2954 return getSherpaVjetsNjetsWeight("AntiKt4TruthJets" );
2955 }
2956 else{
2957 ATH_MSG_WARNING("No TruthJetContainer found! Dummy null weight retrieved.");
2958 }
2959 return 0.;
2960}
2961
2962float SUSYObjDef_xAOD::getSherpaVjetsNjetsWeight(const std::string& jetContainer) const {
2963
2964 if(jetContainer=="AntiKt4TruthWZJets"){
2965 return m_pmgSHnjetWeighterWZ->getWeight();
2966 }
2967 else if (jetContainer=="AntiKt4TruthJets"){
2968 return m_pmgSHnjetWeighter->getWeight();
2969 }
2970 else{
2971 ATH_MSG_WARNING(jetContainer << " is no supported by PMGSherpa22VJetsWeightTool! Please check...");
2972 }
2973 return 1.;
2974
2975}
2976
2977
2979 const xAOD::VertexContainer* vertices = nullptr;
2980 if ( evtStore()->retrieve( vertices, "PrimaryVertices" ).isSuccess() ) {
2981 for ( const auto vx : *vertices ) {
2982 if (vx->vertexType() == xAOD::VxType::PriVtx) {
2983 ATH_MSG_DEBUG("PrimaryVertex found with z=" << vx->z());
2984 return vx;
2985 }
2986 }
2987 } else {
2988 ATH_MSG_WARNING("Failed to retrieve VertexContainer \"PrimaryVertices\", returning nullptr");
2989 }
2990 return nullptr;
2991}
2992
2993
2995 const xAOD::JetContainer *jets, const xAOD::PhotonContainer* gamma,
2996 const xAOD::TauJetContainer* taujet, const xAOD::JetContainer* fatjets)
2997{
2998
2999 if (this->GetPrimVtx() == nullptr) {
3000 ATH_MSG_WARNING( "Will now call the OR tool on an event without a primary vertex, and it will likely crash. Please require a PV earlier in your analysis code!");
3001 }
3002
3003 ATH_CHECK( m_orToolbox.masterTool->removeOverlaps(electrons, muons, jets, taujet, gamma, fatjets) );
3004
3005 /*
3006 // Count number of objects after overlap removal
3007 int Nel = 0;
3008 for (const auto& el : *electrons) {
3009 if (dec_passOR( *el )) Nel++;
3010 }
3011
3012 int Nmu = 0;
3013 for (const auto& mu : *muons) {
3014 if (dec_passOR( *mu )) Nmu++;
3015 }
3016
3017 int Njet = 0;
3018 for (const auto& jet : *jets) {
3019 if (dec_passOR( *jet )) Njet++;
3020 }
3021
3022 ATH_MSG_VERBOSE( "After overlap removal: Nel=" << Nel << ", Nmu=" << Nmu << ", Njet=" << Njet );
3023 */
3024
3025 return StatusCode::SUCCESS;
3026}
3027
3028
3030 // This getCloseByIsoCorrection is computationally less expensive and actually corrects the isoaltion
3031 // variables from the contribution of the close by leptons
3032 if (m_isoCloseByTool->getCloseByIsoCorrection(Gaudi::Hive::currentContext(), electrons,muons) != CP::CorrectionCode::Ok) {
3033 return StatusCode::FAILURE;
3034 }
3035 // All done, all good :-)
3036 return StatusCode::SUCCESS;
3037}
3038
3040 const xAOD::EventInfo* evtInfo = nullptr;
3041 if ( evtStore()->retrieve( evtInfo, "EventInfo" ).isFailure() ) {
3042 throw std::runtime_error("Unable to fetch EventInfo.");
3043 }
3044 return evtInfo;
3045}
3046
3048
3049 const xAOD::EventInfo* evtInfo = GetEventInfo();
3050 float pu_weight = m_prwTool->getCombinedWeight(*evtInfo);
3051
3052 if(!isfinite(pu_weight)) pu_weight = 1.;
3053
3054 return pu_weight;
3055}
3056
3057float SUSYObjDef_xAOD::GetPileupWeightPrescaledTrigger(const std::string & trigger_expr) {
3058 /* This requires the setup of the PRW tool using your own prescaled lumicalc
3059 files with syntax "HLT_PrescaledTriggerA.lumicalc.root:HLT_PrescaledTriggerA".
3060 For further informations, please refer to:
3061 https://twiki.cern.ch/twiki/bin/view/AtlasProtected/ExtendedPileupReweighting#Prescaling%20MC
3062 */
3063
3064 const xAOD::EventInfo* evtInfo = GetEventInfo();
3065 float pu_weight = m_prwTool->getCombinedWeight(*evtInfo,trigger_expr);
3066
3067 if(!isfinite(pu_weight)) pu_weight = 1.;
3068
3069 return pu_weight;
3070}
3071
3073 const xAOD::EventInfo* evtInfo = GetEventInfo();
3074 return m_prwTool->getPRWHash( *evtInfo );
3075}
3076
3077float SUSYObjDef_xAOD::GetDataWeight(const std::string& trig) {
3078 const xAOD::EventInfo* evtInfo = GetEventInfo();
3079 return m_prwTool->getDataWeight( *evtInfo, trig );
3080}
3081
3083 const xAOD::EventInfo* evtInfo = GetEventInfo();
3084 return m_prwTool->getCorrectedAverageInteractionsPerCrossing( *evtInfo, includeDataSF );
3085}
3086
3088 const xAOD::EventInfo* evtInfo = GetEventInfo();
3089 return m_prwTool->getCorrectedActualInteractionsPerCrossing( *evtInfo, includeDataSF );
3090}
3091
3093 return m_prwTool->GetSumOfEventWeights(channel);
3094}
3095
3096unsigned int SUSYObjDef_xAOD::GetRandomRunNumber(bool muDependentRRN) {
3097
3098 const xAOD::EventInfo* evtInfo = GetEventInfo();
3099 if (randomrunnumber.isAvailable(*(evtInfo)) && muDependentRRN) {
3100 return randomrunnumber(*(evtInfo));
3101 }
3102 else if (!muDependentRRN) {
3103 return m_prwTool->getRandomRunNumber( *evtInfo, muDependentRRN );
3104 }
3105 ATH_MSG_ERROR ( "Failed to find RandomRunNumber decoration! You need to call ApplyPRWTool() beforehand!" );
3106 return 0;
3107}
3108
3109
3110StatusCode SUSYObjDef_xAOD::ApplyPRWTool(bool muDependentRRN) {
3111
3112 const xAOD::EventInfo* evtInfo = GetEventInfo();
3113 if(!randomrunnumber.isAvailable(*evtInfo))
3114 ATH_CHECK( m_prwTool->apply( *evtInfo, muDependentRRN ) );
3115 return StatusCode::SUCCESS;
3116}
3117
3118unsigned int SUSYObjDef_xAOD::GetRunNumber() const {
3119
3120 const xAOD::EventInfo* evtInfo = GetEventInfo();
3121
3122 // For data, we can just directly use the run number
3123 if (isData()) { return evtInfo->runNumber(); }
3124
3125 // else it's MC as we need the RRN assigned by the PRW tool
3126 if (!randomrunnumber.isAvailable(*(evtInfo))) {
3127 ATH_MSG_ERROR ( "Failed to find RandomRunNumber decoration! You need to call ApplyPRWTool() beforehand!" );
3128 }
3129 return randomrunnumber(*(evtInfo));
3130
3131}
3132
3133
3136
3137 if ( !tracks.isValid() ) {
3138 throw std::runtime_error("Unable to fetch LargeD0 tracks.");
3139 }
3140
3141 //const xAOD::TrackParticleContainer out = *tracks;
3142
3143 return *tracks;
3144}
3145
3148
3149 if ( !tracks.isValid() ) {
3150 throw std::runtime_error("Unable to fetch LargeD0 GSF tracks.");
3151 }
3152 return *tracks;
3153}
3154
3156
3157 // Don't apply variations for data
3158 if (isData()) return StatusCode::SUCCESS;
3159
3160 const EventContext& ctx = Gaudi::Hive::currentContext();
3161
3162 // Loop over tracks and call LRT uncertainty tool
3163 ATH_MSG_DEBUG ( "Applying LRT filter tool decorations for uncertainty");
3165 for(const auto* trk: inTracks) dec_lrtFilter(*trk) = m_LRTuncTool->accept(trk);
3166
3167 // Loop over GSF LRT tracks and call uncertainty tool
3169 for(const auto* trk: inGSFTracks) dec_lrtFilter(*trk) = m_LRTuncTool->accept(trk);
3170
3171 return StatusCode::SUCCESS;
3172}
3173
3174
3175int SUSYObjDef_xAOD::treatAsYear(const int runNumber) const {
3176 // Use the run number we are passed if we are passed one, otherwise
3177 // use the run number from the GetRunNumber function
3178 int theRunNumber = runNumber>0?runNumber:GetRunNumber();
3179 if (theRunNumber<290000) return 2015;
3180 else if (theRunNumber<320000) return 2016;
3181 else if (theRunNumber<342000) return 2017;
3182 else if (theRunNumber<400000) return 2018;
3183 else if (theRunNumber<445000) return 2022;
3184 else if (theRunNumber<465000) return 2023;
3185 else if (theRunNumber<490000) return 2024;
3186 else if (theRunNumber<510000) return 2025;
3187 return 2026;
3188}
3189
3191
3192#ifdef XAOD_STANDALONE
3193 // remove all tools from the asg::ToolStore (and delete them)
3194 // so that they don't get re-used if we set up another SUSYTools
3195 // instance, e.g. when processing two datasets in one EventLoop
3196 // job
3197 if (!m_trigDecTool.empty()){
3198 if (asg::ToolStore::contains<Trig::TrigDecisionTool>("ToolSvc.TrigDecisionTool") ){
3199 // Ignore both of these so that we are safe if others have cleaned up
3200 m_trigDecTool->finalize().ignore();
3201 asg::ToolStore::remove("ToolSvc.TrigDecisionTool").ignore();
3202 }
3203 }
3204#endif
3205}
3206
3207
3208}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
void setProperty(columnar::PythonToolHandle &self, const std::string &key, nb::object value)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
#define x
static std::string retrieveMetadata(const std::string &folder, const std::string &key, const ServiceHandle< StoreGateSvc > &inputMetaStore)
method that always returns as a string you can use from, e.g, pyROOT with evt = ROOT....
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
@ 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.
std::string name() const
returns: the systematics joined into a single string.
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
size_t size() const
returns: size of the set
virtual bool isValid() override final
Can the handle be successfully dereferenced?
asg::AnaToolHandle< TauAnalysisTools::ITauSelectionTool > m_tauSelToolBaseline
std::vector< std::string > m_v_trigs24_cache_singleEle
std::string m_defaultTrackJets
std::vector< std::string > m_v_trigs23_cache_singleLep
std::vector< std::string > m_ph_id_support
bool m_metRemoveOverlappingCaloTaggedMuons
std::string m_BtagWP_trkJet
bool isAtlfast() const override final
std::string m_tauConfigPath
asg::AnaToolHandle< IWeightTool > m_pmgSHnjetWeighter
std::string m_JetTruthLabelName
std::map< std::string, std::string > m_conf_to_prop
asg::AnaToolHandle< ICPJetUncertaintiesTool > m_WTagjetUncertaintiesTool
asg::AnaToolHandle< CP::IElectronLRTOverlapRemovalTool > m_elecLRTORTool
std::vector< std::string > m_mu_iso_support
std::vector< std::string > m_el_id_support
asg::AnaToolHandle< Trig::TrigDecisionTool > m_trigDecTool
asg::AnaToolHandle< CP::IMuonSelectionTool > m_muonSelectionTool
std::string m_trig2017combination_singleLep
asg::AnaToolHandle< IWeightTool > m_pmgSHnjetWeighterWZ
std::string m_prwActualMu2018File
asg::AnaToolHandle< ICPJetUncertaintiesTool > m_ZTagjetUncertaintiesTool
std::string m_autoconfigPRWPath
std::string m_trig2017combination_diPhoton
std::string m_trig2018combination_singleLep
StatusCode ApplyLRTUncertainty() override final
std::string m_trig2016combination_multiLep
std::string m_photonIdBaseline
std::string m_prwActualMu2025File
asg::AnaToolHandle< IJetCalibrationTool > m_jetFatCalibTool
std::string m_trig2016combination_diPhoton
asg::AnaToolHandle< ITrigGlobalEfficiencyCorrectionTool > m_trigGlobalEffCorrTool_multiLep
asg::AnaToolHandle< CP::IIsolationSelectionTool > m_isoBaselineTool
std::vector< std::string > m_v_trigs18_cache_multiLep
asg::AnaToolHandle< IAsgElectronEfficiencyCorrectionTool > m_elecEfficiencySFTool_isoHighPt
asg::AnaToolHandle< CP::IMuonEfficiencyScaleFactors > m_muonEfficiencySFTool
std::string m_prwActualMu2022File
asg::AnaToolHandle< CP::IPileupReweightingTool > m_prwTool
std::string m_EG_corrFNList
asg::AnaToolHandle< TauAnalysisTools::ITauSelectionTool > m_tauSelTool
asg::AnaToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesPDSmearTool
std::string m_autoconfigPRWRtags
std::string m_trig2024combination_singleLep
asg::AnaToolHandle< IAsgElectronLikelihoodTool > m_elecSelLikelihood
double m_orBoostedElectronMaxConeSize
ST::SystInfo getSystInfo(const CP::SystematicVariation &sys) const override final
std::vector< std::string > m_v_trigs15_cache_singleEle
ToolHandleArray< CP::IMuonTriggerScaleFactors > m_muonTrigSFTools
std::vector< std::string > m_prwLcalcFiles
std::string m_metsysConfigPrefix
StatusCode OverlapRemoval(const xAOD::ElectronContainer *electrons, const xAOD::MuonContainer *muons, const xAOD::JetContainer *jets, const xAOD::PhotonContainer *gamma=nullptr, const xAOD::TauJetContainer *taujet=nullptr, const xAOD::JetContainer *fatjets=nullptr) override final
bool check_isTighter(const std::string &wp1, const std::string &wp, const std::vector< std::string > &list) const
asg::AnaToolHandle< TauAnalysisTools::ITauEfficiencyCorrectionsTool > m_tauEffTool
void setDataSource(int source)
std::string m_trig2016combination_singleLep
std::string m_trigMatchingPrefix
Use composite trigger matching tool if matching was done upstream.
asg::AnaToolHandle< CP::IIsolationSelectionTool > m_isoHighPtTool
std::string m_commonPRWFileMC20d
std::map< std::string, bool > m_slices
std::string m_commonPRWFileMC23g
asg::AnaToolHandle< ITrigGlobalEfficiencyCorrectionTool > m_trigGlobalEffCorrTool_diPhoton
asg::AnaToolHandle< IAsgElectronLikelihoodTool > m_elecSelLikelihoodBaseline
bool isWeight(const CP::SystematicSet &systSet) const
bool isVariation(const CP::SystematicSet &syst) const
asg::AnaToolHandle< IAsgPhotonIsEMSelector > m_photonSelIsEM
bool isData() const override final
SG::ConstAccessor< char > m_acc_photonId
asg::AnaToolHandle< IAsgElectronEfficiencyCorrectionTool > m_elecEfficiencySFTool_id
asg::AnaToolHandle< CP::IMuonEfficiencyScaleFactors > m_muonTTVAEfficiencySFTool
std::string m_ZTagUncConfig
StatusCode NearbyLeptonCorrections(xAOD::ElectronContainer *electrons=nullptr, xAOD::MuonContainer *muons=nullptr) const override final
asg::AnaToolHandle< ICPJetCorrectionTool > m_fatjetFFSmearingTool
std::string m_eleEffMapFilePath
std::string m_WZTaggerCalibArea
unsigned int GetRunNumber() const override final
std::string m_trig2015combination_singleLep
std::string m_EigenvectorReductionB
asg::AnaToolHandle< IMETSignificance > m_metSignif
asg::AnaToolHandle< CP::IIsolationSelectionTool > m_isoTool
asg::AnaToolHandle< CP::IJvtEfficiencyTool > m_jetfJvtEfficiencyTool
void GetTriggerTokens(std::string, std::vector< std::string > &, std::vector< std::string > &, std::vector< std::string > &, std::vector< std::string > &, std::vector< std::string > &, std::vector< std::string > &, std::vector< std::string > &) const
Definition Trigger.cxx:332
SG::ConstAccessor< char > m_acc_eleId
std::string m_prwActualMu2024File
std::vector< std::string > m_v_trigs22_cache_diLep
std::string m_metJetSelection
float GetPileupWeightPrescaledTrigger(const std::string &trigger_expr) override final
SG::WriteHandleKey< xAOD::MuonContainer > m_outMuonLocation
std::vector< std::string > m_el_iso_support
std::string m_trig2017combination_multiLep
std::string m_jetUncertaintiesConfig
Prefix for trigger matchiing container name.
asg::AnaToolHandle< Trig::IMatchingTool > m_trigMatchingTool
std::string m_photonBaselineIso_WP
asg::AnaToolHandle< IAsgElectronLikelihoodTool > m_elecChargeIDSelectorTool
SG::WriteHandleKey< xAOD::ElectronContainer > m_outElectronLocation
StatusCode ApplyPRWTool(bool muDependentRRN=true) override final
double GetSumOfWeights(int channel) override final
std::string m_BtagSystStrategy
ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > m_elecTrigEffTools
ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > m_elecTrigSFTools
std::string EG_WP(const std::string &wp) const
StatusCode applySystematicVariation(const CP::SystematicSet &systConfig) override final
std::string m_defaultTruthJets
std::string m_commonPRWFileMC20e
asg::AnaToolHandle< JetPileupLabelingTool > m_jetPileupLabelingTool
std::string m_trig2023combination_singleLep
asg::AnaToolHandle< CP::IMuonLRTOverlapRemovalTool > m_muonLRTORTool
std::vector< std::string > m_v_trigs23_cache_singleEle
SUSYObjDef_xAOD(const std::string &name)
SG::ConstAccessor< char > m_acc_photonIdBaseline
asg::AnaToolHandle< JSSWTopTaggerDNN > m_TopTaggerTool
const CP::SystematicSet & currentSystematic() const
asg::AnaToolHandle< CP::IMuonTriggerScaleFactors > m_muonTriggerSFTool
std::string m_jetUncertaintiesCalibArea
float GetCorrectedActualInteractionsPerCrossing(bool includeDataSF=false) override final
std::vector< std::string > m_tau_id_support
std::string m_tauEffToolRecommendationTag
std::string m_muBaselineIso_WP
std::vector< std::string > m_v_trigs18_cache_singleEle
int treatAsYear(const int runNumber=-1) const override final
std::vector< std::string > m_v_trigs17_cache_multiLep
unsigned int GetRandomRunNumber(bool muDependentRRN=true) override final
std::vector< std::string > m_v_trigs22_cache_singleLep
std::string m_TopTaggerCalibArea
std::vector< std::string > GetTriggerOR(const std::string &trigExpr) const
Definition Trigger.cxx:314
std::string m_trig2015combination_diLep
asg::AnaToolHandle< IAsgElectronEfficiencyCorrectionTool > m_elecEfficiencySFTool_trigEff_singleLep
std::string m_photonTriggerName
asg::AnaToolHandle< IAsgSelectionTool > m_jetNNJvtSelectionTool
float GetPileupWeight() override final
asg::AnaToolHandle< SmoothedWZTagger > m_ZTaggerTool
asg::AnaToolHandle< JetPileupTag::JetVertexNNTagger > m_jetNNJvtMomentTool
std::string m_fJvtConfigRun3
std::vector< std::string > m_v_trigs15_cache_multiLep
std::string m_eleIdBaseline
std::map< std::string, std::string > m_el_iso_fallback
CP::SystematicSet m_currentSyst
StatusCode initialize() override final
Dummy implementation of the initialisation function.
asg::AnaToolHandle< CP::IMuonEfficiencyScaleFactors > m_muonEfficiencyBMHighPtSFTool
asg::AnaToolHandle< ORUtils::IOverlapTool > m_tauJetORtool
std::vector< std::string > m_v_trigs17_cache_diLep
float GetCorrectedAverageInteractionsPerCrossing(bool includeDataSF=false) override final
std::string m_commonPRWFileMC23d
std::string m_muIsoHighPt_WP
std::vector< std::string > m_v_trigs18_cache_singleLep
CP::SystematicSet m_defaultSyst
std::string m_jesConfigJMSData
std::string m_commonPRWFileMC23e
asg::AnaToolHandle< CP::IMuonCalibrationAndSmearingTool > m_muonCalibTool
std::string m_fJvtConfigRun2
std::vector< std::string > m_v_trigs15_cache_diLep
std::string m_photonIdBaselineDFName
asg::AnaToolHandle< JetVertexTaggerTool > m_jetJvtMomentTool
ULong64_t GetPileupWeightHash() override final
asg::AnaToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesTool
std::string m_tauSmearingToolRecommendationTag
asg::AnaToolHandle< IEGammaAmbiguityTool > m_egammaAmbiguityTool
std::vector< std::string > m_v_trigs22_cache_multiLep
asg::AnaToolHandle< IAsgElectronEfficiencyCorrectionTool > m_elecChargeEffCorrTool
StatusCode validConfig(bool strict=false) const
asg::AnaToolHandle< TrigConf::ITrigConfigTool > m_trigConfTool
std::string m_WTagUncConfig
asg::AnaToolHandle< CP::IIsolationCloseByCorrectionTool > m_isoCloseByTool
std::string m_jesCalibSeqJMS
std::map< int, int > m_tau_id_fallback
std::string m_tauIdBaseline
std::string m_eleIsoHighPt_WP
bool check_isOption(const std::string &wp, const std::vector< std::string > &list) const
asg::AnaToolHandle< IMETMaker > m_metMaker
asg::AnaToolHandle< Trig::IMatchScoringTool > m_trigDRScoringTool
StatusCode resetSystematics() override final
asg::AnaToolHandle< IAsgPhotonEfficiencyCorrectionTool > m_photonIsolationSFTool
bool m_orDoTau
Overlap removal options.
StatusCode readConfig() override final
std::string m_trig2016combination_diLep
std::vector< std::string > m_v_trigs24_cache_singleLep
std::string m_JvtConfigRun2
asg::AnaToolHandle< ICPJetUncertaintiesTool > m_fatjetUncertaintiesTool
bool isNominal(const CP::SystematicSet &syst) const
std::vector< std::string > m_v_trigs18_cache_diLep
asg::AnaToolHandle< CP::IIsolationCorrectionTool > m_isoCorrTool
ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > m_photonTrigSFTools
std::vector< ST::SystInfo > getSystInfoList() const override final
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_GSFLRTCollectionName
std::string m_eleConfigBaseline
std::string m_trig2022combination_singleLep
asg::AnaToolHandle< IMETSystematicsTool > m_metSystTool
std::set< std::string > m_bool_prop_set
asg::AnaToolHandle< CP::IMuonSelectionTool > m_muonSelectionHighPtTool
std::string m_EigenvectorReductionLight
asg::AnaToolHandle< IAsgSelectionTool > m_jetfJvtSelectionTool
bool currentSystematicIsVariation() const
std::string m_trig2018combination_diPhoton
asg::AnaToolHandle< IJetSelector > m_jetCleaningTool
const xAOD::TrackParticleContainer & GetInDetLargeD0GSFTracks(const EventContext &ctx) const override final
asg::AnaToolHandle< IBTaggingSelectionTool > m_btagSelTool_trkJet
asg::AnaToolHandle< InDet::IInclusiveTrackFilterTool > m_LRTuncTool
std::vector< std::string > getElSFkeys(const std::string &mapFile) const
std::vector< std::string > m_v_trigs16_cache_multiLep
asg::AnaToolHandle< CP::IJvtEfficiencyTool > m_jetNNJvtEfficiencyTool
float GetDataWeight(const std::string &) override final
std::string m_commonPRWFileMC20a
std::string m_trig2022combination_diLep
asg::AnaToolHandle< CP::IMuonEfficiencyScaleFactors > m_muonHighPtIsolationSFTool
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_LRTCollectionName
asg::AnaToolHandle< TauAnalysisTools::ITauSmearingTool > m_tauSmearingTool
SG::ConstAccessor< char > m_acc_eleIdBaseline
std::string m_trig2018combination_diLep
std::string m_trig2017combination_diLep
asg::AnaToolHandle< ITrigGlobalEfficiencyCorrectionTool > m_trigGlobalEffCorrTool_diLep
const std::vector< std::string > split(const std::string &s, const std::string &delim) const
asg::AnaToolHandle< IBTaggingEfficiencyTool > m_btagEffTool_trkJet
std::string m_prwActualMu2017File
std::vector< std::string > m_v_trigs22_cache_singleEle
std::vector< std::string > m_prwConfFiles
asg::AnaToolHandle< IAsgElectronEfficiencyCorrectionTool > m_elecEfficiencySFTool_reco
Combined muon collection.
std::string m_jesConfigAFII
const xAOD::Vertex * GetPrimVtx() const override final
asg::AnaToolHandle< ICPJetUncertaintiesTool > m_TopTagjetUncertaintiesTool
std::vector< CP::SystematicSet > m_fatjetFFSmearingSyst
std::vector< std::string > m_v_trigs17_cache_singleEle
asg::AnaToolHandle< IBTaggingEfficiencyTool > m_btagEffTool
StatusCode SUSYToolsInit()
float getSherpaVjetsNjetsWeight() const override final
std::vector< std::string > m_v_trigs16_cache_singleLep
asg::AnaToolHandle< TauAnalysisTools::ITauTruthMatchingTool > m_tauTruthMatch
std::vector< std::string > m_v_trigs16_cache_singleEle
asg::AnaToolHandle< IBTaggingSelectionTool > m_btagSelTool_OR
std::string m_muTriggerSFCalibRelease
std::string m_tauConfigPathBaseline
std::vector< std::string > m_v_trigs16_cache_diLep
std::map< std::string, std::string > m_mu_iso_fallback
std::string m_jetUncertaintiesAnalysisFile
asg::AnaToolHandle< IAsgPhotonIsEMSelector > m_photonSelIsEMBaseline
bool currentSystematicIsNominal() const
std::string m_eleIdBaselineDFName
std::string m_jetUncertaintiesMCType
std::string m_inputMETSuffix
std::vector< asg::AnaToolHandle< TauAnalysisTools::ITauEfficiencyCorrectionsTool > > m_tauTrigEffTool
asg::AnaToolHandle< IBTaggingSelectionTool > m_btagSelTool
SG::ConstAccessor< char > m_acc_jetClean
StatusCode getTauConfig(const std::string &tauConfigPath, std::vector< float > &pT_window, std::vector< float > &eta_window, bool &eleOLR, bool &muVeto, bool &muOLR) const
ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > m_photonTrigEffTools
asg::AnaToolHandle< IAsgPhotonEfficiencyCorrectionTool > m_photonTriggerSFTool
std::string m_EigenvectorReductionC
std::string m_fatJetUncConfig
ORUtils::ToolBox m_orToolbox
std::string m_TopTagUncConfig
std::string m_tauInputFileBaseline
asg::AnaToolHandle< Trig::IMatchScoringTool > m_trigMatchScoringTool
asg::AnaToolHandle< CP::IMuonSelectionTool > m_muonSelectionToolBaseline
std::string m_trig2022combination_multiLep
std::string m_muTriggerSFCalibFilename
asg::AnaToolHandle< CP::IEgammaCalibrationAndSmearingTool > m_egammaCalibTool
Combined electron collection.
std::string m_IsoCloseByORpassLabel
const xAOD::TrackParticleContainer & GetInDetLargeD0Tracks(const EventContext &ctx) const override final
StatusCode autoconfigurePileupRWTool(const std::string &PRWfilesDir="dev/PileupReweighting/share/", const std::string &PRWfileName="", bool usePathResolver=true, bool RPVLLmode=false, bool Combinedmode=false, const std::string &HFFilter="")
std::string m_trig2015combination_multiLep
std::string m_trig2022combination_diPhoton
void configFromFile(bool &property, const std::string &propname, TEnv &rEnv, bool defaultValue)
std::string m_prwActualMu2023File
asg::AnaToolHandle< IAsgElectronEfficiencyCorrectionTool > m_elecEfficiencySFTool_trig_singleLep
asg::AnaToolHandle< JetTruthLabelingTool > m_jetTruthLabelingTool
asg::AnaToolHandle< ICPJetUncertaintiesTool > m_fatjetUncertaintiesPDSmearTool
std::string m_autoconfigPRWFile
StatusCode setBoolProperty(const std::string &name, const bool &property) override final
std::string m_bTaggingCalibrationFilePath
asg::AnaToolHandle< IAsgElectronEfficiencyCorrectionTool > m_elecEfficiencySFTool_iso
asg::AnaToolHandle< SmoothedWZTagger > m_WTaggerTool
std::string m_commonPRWFileMC23a
asg::AnaToolHandle< IJetCalibrationTool > m_jetCalibTool
bool currentSystematicIsWeight() const
std::string m_eleBaselineIso_WP
std::vector< std::string > m_v_trigs15_cache_singleLep
std::string m_fatJetUncVars
std::string m_electronTriggerSFStringSingle
std::string getDefaultJetUncConfig()
std::string m_trig2015combination_diPhoton
asg::AnaToolHandle< CP::IMuonEfficiencyScaleFactors > m_muonIsolationSFTool
const xAOD::EventInfo * GetEventInfo() const override final
std::vector< std::string > m_v_trigs17_cache_singleLep
std::string m_jesConfigFatData
std::string TrigSingleLep() const override final
std::string m_BtagTagger_trkJet
std::string m_trig2018combination_multiLep
asg::AnaToolHandle< IAsgPhotonEfficiencyCorrectionTool > m_photonEfficiencySFTool
std::string m_JvtConfigRun3
std::string m_jesCalibSeqFat
AsgMetadataTool(const std::string &name)
Normal ASG tool constructor with a name.
MetaStorePtr_t inputMetaStore() const
Accessor for the input metadata store.
static bool contains(const std::string &name)
Check whether a tool with a given type and name is known in the store.
Definition ToolStore.h:51
static StatusCode remove(const IAsgTool *tool)
Remove the specified tool from the store.
Definition ToolStore.cxx:77
uint32_t runNumber() const
The current event's run number.
uint32_t mcChannelNumber() const
The MC generator's channel number.
@ mcProcID
Same as mc_channel_number [float].
@ dataType
Data type that's in the file [string].
@ amiTag
AMI tag used to process the file the last time [string].
@ 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
std::vector< CP::SystematicSet > make_systematics_vector(const SystematicSet &systematics)
utility functions for working with systematics
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
static const unsigned int Reconstruction
static const unsigned int Trigger
static const SG::Decorator< char > dec_lrtFilter("passLRTFilter")
static const SG::ConstAccessor< unsigned int > randomrunnumber("RandomRunNumber")
SystType getSystType(const CP::SystematicVariation &systematic)
STL namespace.
const std::string & typeName(Type id)
@ PriVtx
Primary vertex.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Jet_v1 Jet
Definition of the current "jet version".
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
EventInfo_v1 EventInfo
Definition of the latest event info version.
@ Unknown
Track fitter not defined.
setRawEt setRawPhi int
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Photon_v1 Photon
Definition of the current "egamma version".
setBGCode setTAP setLVL2ErrorBits bool
FileMetaData_v1 FileMetaData
Declare the latest version of the class.
JetContainer_v1 JetContainer
Definition of the current "jet container version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
Electron_v1 Electron
Definition of the current "egamma version".
std::set< unsigned int > affectedWeights
unsigned int affectsType
CP::SystematicSet systset