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