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