80 #ifndef XAOD_STANDALONE
88 #define CONFIG_EG_EFF_TOOL( TOOLHANDLE, TOOLNAME, CORRFILE ) \
89 if( !TOOLHANDLE.isUserConfigured() ) { \
90 TOOLHANDLE.setTypeAndName("AsgElectronEfficiencyCorrectionTool/"+TOOLNAME); \
91 std::vector< std::string > corrFileNameList = {CORRFILE}; \
92 ATH_CHECK( TOOLHANDLE.setProperty("CorrectionFileNameList", corrFileNameList) ); \
94 ATH_CHECK (TOOLHANDLE.setProperty("ForceDataType", static_cast<int>(data_type))); \
95 ATH_CHECK( TOOLHANDLE.setProperty("CorrelationModel", m_EG_corrModel) ); \
96 ATH_CHECK( TOOLHANDLE.setProperty("OutputLevel", this->msg().level()) ); \
97 ATH_CHECK( TOOLHANDLE.initialize() ); \
98 } else ATH_CHECK(TOOLHANDLE.retrieve());
100 #define CONFIG_EG_EFF_TOOL_KEY( TOOLHANDLE, TOOLNAME, KEYNAME, KEY, MAP ) \
101 if( !TOOLHANDLE.isUserConfigured() ) { \
102 TOOLHANDLE.setTypeAndName("AsgElectronEfficiencyCorrectionTool/"+TOOLNAME); \
103 ATH_MSG_INFO( "Will now set key \"" << KEYNAME << "\" to value \"" << KEY << "\" when configuring an AsgElectronEfficiencyCorrectionTool" ); \
104 ATH_CHECK( TOOLHANDLE.setProperty(KEYNAME, KEY) ); \
106 ATH_CHECK (TOOLHANDLE.setProperty("ForceDataType", static_cast<int>(data_type))); \
107 ATH_CHECK( TOOLHANDLE.setProperty("CorrelationModel", m_EG_corrModel) ); \
108 ATH_CHECK( TOOLHANDLE.setProperty("OutputLevel", this->msg().level()) ); \
109 ATH_CHECK( TOOLHANDLE.setProperty("MapFilePath", MAP) ); \
110 ATH_CHECK( TOOLHANDLE.initialize() ); \
111 } else if (!isData()) ATH_CHECK(TOOLHANDLE.retrieve());
117 ATH_MSG_FATAL(
"You must set the DataSource property to Data, FullSim or AtlfastII !!");
118 ATH_MSG_FATAL(
"Expect segfaults if you're not checking status codes, which you should be !!");
119 return StatusCode::FAILURE;
123 ATH_MSG_INFO(
"SUSYTools subtools already created. Ignoring this call.");
124 ATH_MSG_INFO(
"Note: No longer necessary to explicitly call SUSYToolsInit. Will avoid creating tools again.");
125 return StatusCode::SUCCESS;
133 std::vector<std::string> file_conf;
139 std::vector<std::string> file_ilumi;
169 ATH_MSG_WARNING(
"Please note that current ID recommendations only cover mc23a and not (yet) mc23d/e!");
173 ATH_CHECK(
m_LRTuncTool.
setProperty(
"calibFileLRTEff",
"InDetTrackSystematicsTools/CalibData_24.0_2023-v00/LargeD0TrackingRecommendations_20230824.root") );
176 ATH_MSG_INFO(
"Using user-configured LRT uncertainty tool");
180 std::string toolName;
182 std::string jetname,
jetcoll,fatjetcoll;
192 toolName =
"JetCalibTool_" + jetname;
194 std::string JES_config_file, calibseq;
198 return StatusCode::FAILURE;
203 ATH_MSG_WARNING(
"Jet JES/JER recommendations currently not available for fast sim in Run 3, falling back to full sim version");
208 JES_config_file = JESconfig;
212 std::string insitu(
"_Insitu");
213 auto found = calibseq.find(insitu);
214 if(
found != std::string::npos){
215 calibseq.erase(
found, insitu.length());
221 ATH_MSG_ERROR(
"JMS calibration is not supported yet for R22. Please modify your settings.");
222 return StatusCode::FAILURE;
240 if(fatjetcoll ==
"AnalysisLargeRJets") {
241 ATH_MSG_DEBUG(
"Fall back to calibration for AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets, original name for AnalysisLargeRJets");
242 fatjetcoll =
"AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets";
244 if (fatjetcoll.size()>3)fatjetcoll.erase(fatjetcoll.size()-4,4);
246 toolName =
"JetFatCalibTool_" +
m_fatJets;
252 if(
isData()) jesCalibSeqFat +=
"_Insitu";
276 #ifndef XAOD_STANDALONE
285 ATH_MSG_ERROR(
"Error while reading large-R config file : " << WConfigPath );
286 return StatusCode::FAILURE;
288 else ATH_MSG_DEBUG(
"Successfully read large-R config file : " << WConfigPath );
303 #ifndef XAOD_STANDALONE
312 ATH_MSG_ERROR(
"Error while reading large-R config file : " << ZConfigPath );
313 return StatusCode::FAILURE;
315 else ATH_MSG_DEBUG(
"Successfully read large-R config file : " << ZConfigPath );
330 #ifndef XAOD_STANDALONE
339 ATH_MSG_ERROR(
"Error while reading large-R config file : " << TopConfigPath );
340 return StatusCode::FAILURE;
342 else ATH_MSG_DEBUG(
"Successfully read large-R config file : " << TopConfigPath );
389 if(jetdef !=
"AntiKt4EMPFlow"){
390 ATH_MSG_WARNING(
"Jet Uncertaintes recommendations only exist for PFlow jets, falling back to AntiKt4EMPFlow");
391 jetdef =
"AntiKt4EMPFlow";
393 toolName =
"JetUncertaintiesTool_" + jetdef;
407 ATH_MSG_INFO(
"Set up Jet PD Smear Uncertainty tool...");
412 if(jetdef !=
"AntiKt4EMPFlow"){
413 ATH_MSG_WARNING(
"Jet Uncertaintes recommendations only exist for PFlow jets, falling back to AntiKt4EMPFlow");
414 jetdef =
"AntiKt4EMPFlow";
416 toolName =
"JetUncertaintiesPDSmearTool_" + jetdef;
423 ATH_MSG_ERROR(
"You are trying to use the SimpleJER set, with PDsmearing. There is no functionality for this. Please fix your config file. Either run with PDSmear set to false, or run with the AllJER or FullJER sets.");
424 return StatusCode::FAILURE;
435 ATH_MSG_DEBUG(
"Do not retrieve the jet PD Smearing tool if it is not configured");
449 ATH_MSG_WARNING(
"Uncertainties for large-R jets in mc23 and fast simulation not yet available; be aware uncertainties might be not complete!");
451 toolName =
"JetUncertaintiesTool_" +
m_fatJets;
462 std::vector<std::string> shift_vars = {};
467 shift_vars.push_back(
temp.substr(0,
pos));
468 if (
pos == std::string::npos)
474 while (!
temp.empty() );
486 ATH_MSG_INFO(
"Set up Jet PD Smear Uncertainty tool...");
488 toolName =
"JetUncertaintiesPDSmearTool_" +
m_fatJets;
493 if (
m_fatJetUncConfig.find(
"SimpleJER") != std::string::npos && JERUncPDsmearing){
494 ATH_MSG_ERROR(
"You are trying to use the SimpleJER set, with PDsmearing. There is no functionality for this. Please fix your config file. Either run with PDSmear set to false, or run with the AllJER or FullJER sets.");
495 return StatusCode::FAILURE;
506 ATH_MSG_DEBUG(
"Do not retrieve the jet PD Smearing tool if it is not configured");
515 toolName =
"FFJetSmearingTool_" +
m_fatJets;
528 ATH_MSG_INFO(
"The following uncertainties have been defined for the m_fatjetFFSmearingTool");
535 ATH_MSG_INFO(
" Won't initialise Wtagger uncertainty tool for fat jets until we get rec for UFO");
550 ATH_MSG_INFO(
" Won't initialise Ztagger uncertainty tool for fat jets until we get rec for UFO");
565 ATH_MSG_INFO(
" Won't initialise top-tagger uncertainty tool for fat jets until we get rec for UFO");
593 toolName =
"JetCleaningTool";
605 toolName =
"PileupLabelingTool";
609 #ifndef XAOD_STANDALONE
621 toolName =
"JvtMomentTool";
624 #ifndef XAOD_STANDALONE
637 toolName =
"NNJvtMomentTool";
640 #ifndef XAOD_STANDALONE
652 toolName =
"NNJvtSelectionTool";
666 toolName =
"NNJvtEfficiencyTool";
680 toolName =
"fJvtSelectionTool";
694 toolName =
"fJvtEfficiencyTool";
710 std::string muQualBaseline =
"";
713 ATH_MSG_WARNING(
"No muon scale factors are available for VeryLoose working point.");
718 case 4: muQualBaseline =
"HighPt";
break;
719 case 5: muQualBaseline =
"LowPt";
break;
720 case 6: muQualBaseline =
"LowPtMVA";
break;
721 case 7: muQualBaseline =
"HighPt3Layers";
break;
724 return StatusCode::FAILURE;
741 if (IdBaselineInt == 4) {
752 toolName =
"MuonSelectionTool_Baseline_" + muQualBaseline;
758 ") that is tighter than the signal cut (" <<
m_muEta <<
"). Please check your config." );
759 return StatusCode::FAILURE;
763 if (IdBaselineInt == 6){
766 }
else if (IdBaselineInt == 7){
775 std::string muQual =
"";
778 ATH_MSG_WARNING(
"No muon scale factors are available for VeryLoose working point.");
783 case 4: muQual =
"HighPt";
break;
784 case 5: muQual =
"LowPt";
break;
785 case 6: muQual =
"LowPtMVA";
break;
786 case 7: muQual =
"HighPt3Layers";
break;
788 ATH_MSG_ERROR(
"Invalid muon working point provided: " <<
m_muId <<
". Cannot initialise!");
789 return StatusCode::FAILURE;
794 toolName =
"MuonSelectionTool_" + muQual;
802 }
else if (IdInt == 7){
812 toolName =
"MuonSelectionHighPtTool_" + muQual;
825 toolName =
"MuonLRTOverlapRemovalTool";
836 toolName =
"MuonEfficiencyScaleFactors_" + muQual;
846 toolName =
"MuonEfficiencyScaleFactorsBMHighPt_" + muQual;
856 ATH_MSG_WARNING(
"Requested TTVA SFs without d0sig and z0 cuts. Disabling scale factors as they will not make sense.");
861 toolName =
"MuonTTVAEfficiencyScaleFactors";
874 toolName =
"MuonIsolationScaleFactors_" +
m_muIso_WP;
880 <<
") does not have SFs defined. Will try to find an appropriate fall-back.");
885 <<
" is not supported, and does not have SFs available. Falling back to "
887 <<
" for SF determination.");
889 ATH_MSG_ERROR(
"*** The muon isolation WP you selected (" <<
m_muIso_WP <<
") is not currentely supported, and no known fall-back option for SFs exists. Sorry! ***");
890 return StatusCode::FAILURE;
910 <<
") does not have SFs defined. Will try to find an appropriate fall-back.");
915 <<
" is not supported, and does not have SFs available. Falling back to "
916 << tmp_muIsoHighPt_WP
917 <<
" for SF determination.");
919 ATH_MSG_ERROR(
"*** The muon isolation WP you selected (" <<
m_muIsoHighPt_WP <<
") is not currentely supported, and no known fall-back option for SFs exists. Sorry! ***");
920 return StatusCode::FAILURE;
938 toolName =
"MuonTriggerScaleFactors_" + muQual;
940 if ( muQual==
"LowPt" ) {
941 ATH_MSG_WARNING(
"You're using the LowPt muon selection, which is not supported yet in terms of muon trigger scale facorts. TEMPORAIRLY configuring the muonTriggerSFTool for Medium muons. Beware!");
964 toolName =
"EleSelLikelihood_" +
m_eleId;
966 if (
m_eleId.find(
"DNN") != std::string::npos) {
974 ATH_MSG_INFO(
"Overriding specified Ele.Id working point in favour of configuration file");
978 return StatusCode::FAILURE;
981 ATH_MSG_WARNING(
" ****************************************************************************");
983 ATH_MSG_WARNING(
" These may be used for loose electron CRs but no scale factors are provided.");
984 ATH_MSG_WARNING(
" ****************************************************************************");
1006 ATH_MSG_INFO(
"Overriding specified EleBaseline.Id working point in favour of configuration file");
1010 return StatusCode::FAILURE;
1023 toolName =
"ElectronLRTOverlapRemovalTool";
1040 return StatusCode::FAILURE;
1054 return StatusCode::FAILURE;
1087 ATH_MSG_INFO(
"Running on Run2 samples; Using egamma SF tools from R21 map ");
1091 toolName =
"AsgElectronEfficiencyCorrectionTool_reco";
1102 std::string eleId = TString(
m_eleId).ReplaceAll(
"AndBLayer",
"BLayer").ReplaceAll(
"LLH",
"").Data();
1104 if (
m_eleId.find(
"DNN") != std::string::npos) {
1105 eleId = TString(eleId).ReplaceAll(
"DNNnoCF",
"").ReplaceAll(
"DNN",
"").ReplaceAll(
"Loose",
"LooseBLayer").Data();
1106 ATH_MSG_WARNING(
"Electron DNN ID working point " <<
m_eleId <<
" doesn't have SFs yet, fall back to " << eleId);
1110 toolName =
"AsgElectronEfficiencyCorrectionTool_id_" +
m_eleId;
1114 std::map<std::string,std::string> corrFNList;
1117 std::string
WP = WP_fname.substr(0,WP_fname.find(
":"));
1118 std::string
fname = WP_fname.substr(WP_fname.find(
":")+1);
1121 ATH_MSG_WARNING(
"Will use correction file rather than central map file." );
1126 std::string EleIso(
"");
1132 ATH_MSG_WARNING(
"(AsgElectronEfficiencyCorrectionTool_iso_*) Your selected electron Iso WP ("
1134 <<
") does not have iso SFs defined. Falling back to "
1136 <<
" for SF calculations");
1140 return StatusCode::FAILURE;
1143 toolName =
"AsgElectronEfficiencyCorrectionTool_iso_" +
m_eleId + EleIso;
1146 if ( (!
m_EG_corrFNList.empty()) && corrFNList.find(EleIso)!=corrFNList.end() ) {
1153 ATH_MSG_WARNING(
"(" << toolName <<
") Your electron Iso WP: " << EleIso<<
" is no longer supported. This will almost certainly cause a crash now.");
1165 if (!
isData() && ((EleIso.find(
"TightTrackOnly_VarRad")!=std::string::npos)||
1166 (EleIso.find(
"TightTrackOnly_FixedRad")!=std::string::npos)||
1167 (EleIso.find(
"Tight_VarRad")!=std::string::npos)||
1168 (EleIso.find(
"Loose_VarRad")!=std::string::npos))) {
1169 if (
isAtlfast())
ATH_MSG_WARNING(
"(AsgElectronEfficiencyCorrectionTool/"+toolName+
"). Your selected electron Iso WP (" + EleIso +
") don't have AFII SF. Falling back to FullSim");
1182 std::string EleIsohighPt(
"");
1188 ATH_MSG_WARNING(
"(AsgElectronEfficiencyCorrectionTool_iso_*) Your selected high-pT electron Iso WP ("
1190 <<
") does not have iso SFs defined. Falling back to "
1192 <<
" for SF calculations");
1196 return StatusCode::FAILURE;
1199 toolName =
"AsgElectronEfficiencyCorrectionTool_isoHigPt_" +
m_eleId + EleIsohighPt;
1202 if ( (!
m_EG_corrFNList.empty()) && corrFNList.find(EleIsohighPt)!=corrFNList.end() ) {
1210 ATH_MSG_WARNING(
"(" << toolName <<
") Your electron high-pt Iso WP: " << EleIsohighPt <<
" is no longer supported. This will almost certainly cause a crash now.");
1231 if(
m_isRun3 && eleId.find(
"LooseBLayer") != std::string::npos)
ATH_MSG_WARNING(
"Replacing 'LooseBLayer' with 'Loose' for Electron ID while configuring single-ele trigger SF using: " <<
m_eleEffMapFilePath);
1232 std::string triggerEleID =
m_isRun3? TString(eleId).ReplaceAll(
"LooseBLayer",
"Loose").Data() : eleId;
1238 bool pass_isRun3TrigSFFallback =
true;
1239 if (triggerEleID.find(
"Medium") != std::string::npos && triggerEleIso.find(
"Loose") != std::string::npos) {triggerEleID =
"Loose";}
1240 else if (triggerEleID.find(
"Medium") != std::string::npos && triggerEleIso.find(
"Tight") != std::string::npos) {triggerEleID =
"Tight"; triggerEleIso =
"Tight_VarRad";}
1241 else if (triggerEleID.find(
"Medium") != std::string::npos && triggerEleIso.find(
"HighPtCaloOnly") != std::string::npos) {triggerEleID =
"Tight"; triggerEleIso =
"Tight_VarRad";}
1242 else if (triggerEleID.find(
"Tight") != std::string::npos && triggerEleIso.find(
"Loose") != std::string::npos) {triggerEleID =
"Loose";}
1243 else if (triggerEleID.find(
"Tight") != std::string::npos && triggerEleIso.find(
"Tight") != std::string::npos) {triggerEleIso=
"Tight_VarRad";}
1244 else if (triggerEleID.find(
"Tight") != std::string::npos && triggerEleIso.find(
"HighPtCaloOnly") != std::string::npos) {triggerEleID =
"Tight"; triggerEleIso =
"Tight_VarRad";}
1245 else if (triggerEleID.find(
"Loose") != std::string::npos && triggerEleIso.find(
"Tight") != std::string::npos) {triggerEleID =
"Loose"; triggerEleIso =
"Loose_VarRad";}
1246 else if (triggerEleID.find(
"Loose") != std::string::npos && triggerEleIso.find(
"HighPtCaloOnly") != std::string::npos) {triggerEleID =
"Loose"; triggerEleIso =
"Loose_VarRad";}
1247 else {pass_isRun3TrigSFFallback=
false;}
1248 if(pass_isRun3TrigSFFallback){
1249 ATH_MSG_INFO(
" ************** This is only for testing/studying purpose! ************** ");
1250 ATH_MSG_INFO(
" ************** For official recommendation, please get in contact with the SUSY Bkg Forum ************** ");
1251 ATH_MSG_INFO(
"In the current map ("<<
m_eleEffMapFilePath<<
"), the only supported Electron ID working-points supported for Electron Trigger Scale Factor are 'Loose_Loose_VarRad' and 'Tight_Tight_VarRad' ");
1252 ATH_MSG_INFO(
"Only for single-lepton trigger scale factor, fall back to Electron ID: -> "<< triggerEleID <<
" with Isolation: " << triggerEleIso);
1264 auto next_pos = [&](
size_t self) {
1265 size_t next = std::string::npos;
1268 if (p23 >
self && p23 <
next)
next = p23;
1269 if (p24 >
self && p24 <
next)
next = p24;
1271 else if (
self == p23) {
1272 if (p22 >
self && p22 <
next)
next = p22;
1273 if (p24 >
self && p24 <
next)
next = p24;
1275 else if (
self == p24) {
1276 if (p22 >
self && p22 <
next)
next = p22;
1277 if (p23 >
self && p23 <
next)
next = p23;
1282 std::string SFStringSingle22=
"";
1283 std::string SFStringSingle23=
"";
1284 std::string SFStringSingle24=
"";
1292 std::string* toks[] = { &SFStringSingle22, &SFStringSingle23, &SFStringSingle24 };
1293 for (
auto t : toks) {
1294 while (!
t->empty() &&
t->back() ==
'_')
t->pop_back();
1301 ATH_MSG_WARNING(
"Unknown or unsupported mcCampaign for Run 3: " <<
m_mcCampaign <<
". Please contact the SUSY Bkg Forum for assistance.");
1302 ATH_MSG_WARNING(
"Falling back to 2024 trigger SFs for single-electron triggers.");
1315 ATH_MSG_WARNING(
"(AsgElectronEfficiencyCorrectionTool_trig_singleLep_*) Your selected electron Iso WP ("
1317 <<
") does not have trigger SFs defined. Falling back to "
1319 <<
" for SF calculations");
1323 return StatusCode::FAILURE;
1326 toolName =
"AsgElectronEfficiencyCorrectionTool_trig_singleLep_" + triggerEleID;
1342 toolName =
"AsgElectronEfficiencyCorrectionTool_trigEff_singleLep_" + triggerEleID;
1359 std::map<std::string,std::string> electronTriggerSFMapMixedLepton {
1361 {
"e24_lhmedium_L1EM20VH_OR_e60_lhmedium_OR_e120_lhloose,e26_lhtight_nod0_ivarloose_OR_e60_lhmedium_nod0_OR_e140_lhloose_nod0",
m_electronTriggerSFStringSingle},
1362 {
"e24_lhvloose_nod0_L1EM20VH,e17_lhvloose_nod0,e12_lhloose_L1EM10VH",
"DI_E_2015_e12_lhloose_L1EM10VH_2016_e17_lhvloose_nod0_2017_2018_e24_lhvloose_nod0_L1EM20VH"},
1363 {
"e26_lhmedium_nod0_L1EM22VHI,e26_lhmedium_nod0",
"MULTI_L_2015_e24_lhmedium_L1EM20VH_OR_e60_lhmedium_OR_e120_lhloose_2016_e26_lhmedium_nod0_L1EM22VHI_2017_2018_e26_lhmedium_nod0"},
1364 {
"e17_lhloose,e17_lhloose_nod0",
"MULTI_L_2015_e17_lhloose_2016_2018_e17_lhloose_nod0"},
1365 {
"e12_lhloose,e12_lhloose_nod0",
"MULTI_L_2015_e12_lhloose_2016_2018_e12_lhloose_nod0"},
1366 {
"e7_lhmedium,e7_lhmedium_nod0",
"MULTI_L_2015_e7_lhmedium_2016_2018_e7_lhmedium_nod0"},
1367 {
"e9_lhloose,e9_lhloose_nod0,e12_lhvloose_nod0_L1EM10VH",
"TRI_E_2015_e9_lhloose_2016_e9_lhloose_nod0_2017_2018_e12_lhvloose_nod0_L1EM10VH"}
1373 if (triglist_2017to2018.find(
"2e17_lhvloose_nod0_L12EM15VHI") != std::string::npos) {
1374 electronTriggerSFMapMixedLepton[
"e17_lhvloose_nod0_L1EM15VHI"] =
"DI_E_2015_e12_lhloose_L1EM10VH_2016_e17_lhvloose_nod0_2017_2018_e17_lhvloose_nod0_L1EM15VHI";
1377 std::string triggerMixedEleIso(
"");
1379 for(
auto const&
item : electronTriggerSFMapMixedLepton){
1386 ATH_MSG_WARNING(
"(AsgElectronEfficiencyCorrectionTool_trig_mixLep_*) Your selected electron Iso WP ("
1388 <<
") does not have trigger SFs defined. Falling back to "
1389 << triggerMixedEleIso
1390 <<
" for SF calculations");
1392 ATH_MSG_ERROR(
"*** THE MIXED ELECTRON TRIGGER SF YOU SELECTED (" <<
item.second <<
") GOT NO SUPPORT FOR YOUR ID+ISO WPs (" <<
m_eleId <<
"+" <<
m_eleIso_WP <<
"). The fallback options failed as well sorry! ***");
1393 return StatusCode::FAILURE;
1396 ATH_MSG_VERBOSE (
"Selected WP: " <<
item.second <<
"_" << eleId <<
"_" << triggerMixedEleIso);
1398 toolName =
"AsgElectronEfficiencyCorrectionTool_trig_mixLep_" + (
item.first).substr(0,8) +
m_eleId;
1402 ATH_CHECK( t_sf->setProperty(
"IdKey", eleId) );
1403 ATH_CHECK( t_sf->setProperty(
"IsoKey", triggerMixedEleIso) );
1408 ATH_CHECK( t_sf->setProperty(
"OutputLevel", this->msg().level()) );
1411 #ifndef XAOD_STANDALONE
1417 toolName =
"AsgElectronEfficiencyCorrectionTool_trigEff_mixLep_" + (
item.first).substr(0,8) +
m_eleId;
1420 ATH_CHECK( t_eff->setProperty(
"TriggerKey",
"Eff_"+
item.second) );
1421 ATH_CHECK( t_eff->setProperty(
"IdKey", eleId) );
1422 ATH_CHECK( t_eff->setProperty(
"IsoKey", triggerMixedEleIso) );
1427 ATH_CHECK( t_eff->setProperty(
"OutputLevel", this->msg().level()) );
1430 #ifndef XAOD_STANDALONE
1438 else ATH_MSG_WARNING(
"*** THE ELECTRON TRIGGER SF MIXED AND SF DILEP ARE CURRENTY NOT SUPPORTED IN RUN3 ***");
1440 ATH_MSG_WARNING(
"*** THE ELECTRON CHARGE FLIP SF ARE CURRENTY NOT SUPPORTED ***");
1484 photonIso_forTrigSF =
"TightCaloOnly";
1486 photonIso_forTrigSF = TString(
m_photonIso_WP).ReplaceAll(
"FixedCut",
"").Data();
1498 std::map<std::string,std::string> diphotonTriggerSFMapAsymmetric {
1500 {
"g25_loose,g25_medium_L1EM20VH",
"DI_PH_2015_g25_loose_2016_g25_loose_2017_g25_medium_L1EM20VH_2018_g25_medium_L1EM20VH"},
1501 {
"g35_loose,g35_medium_L1EM20VH",
"DI_PH_2015_g35_loose_2016_g35_loose_2017_g35_medium_L1EM20VH_2018_g35_medium_L1EM20VH"},
1504 for(
auto const&
item : diphotonTriggerSFMapAsymmetric){
1506 toolName =
"AsgPhotonEfficiencyCorrectionTool_trigSF_asymm_diphoton_" + (
item.first).substr(0,9) + photonIso_forTrigSF;
1508 ATH_CHECK( ph_trigSF->setProperty(
"MapFilePath",
"PhotonEfficiencyCorrection/2015_2018/rel21.2/Summer2020_Rec_v1/map3.txt") );
1509 ATH_CHECK( ph_trigSF->setProperty(
"IsoKey", photonIso_forTrigSF) );
1510 ATH_CHECK( ph_trigSF->setProperty(
"TriggerKey",
item.second) );
1511 ATH_CHECK( ph_trigSF->setProperty(
"ForceDataType", 1) );
1512 ATH_CHECK( ph_trigSF->setProperty(
"OutputLevel", this->msg().level()) );
1515 #ifndef XAOD_STANDALONE
1521 toolName =
"AsgPhotonEfficiencyCorrectionTool_trigEff_asymm_diphoton_" + (
item.first).substr(0,9) + photonIso_forTrigSF;
1523 ATH_CHECK( ph_trigEff->setProperty(
"MapFilePath",
"PhotonEfficiencyCorrection/2015_2018/rel21.2/Summer2020_Rec_v1/map3.txt") );
1524 ATH_CHECK( ph_trigEff->setProperty(
"IsoKey", photonIso_forTrigSF) );
1525 ATH_CHECK( ph_trigEff->setProperty(
"TriggerKey",
"Eff_"+
item.second) );
1526 ATH_CHECK( ph_trigEff->setProperty(
"ForceDataType", 1) );
1527 ATH_CHECK( ph_trigEff->setProperty(
"OutputLevel", this->msg().level()) );
1530 #ifndef XAOD_STANDALONE
1586 ATH_MSG_WARNING(
"Forcing EgcalibTool to use calibrations for full simulation" );
1607 else if (
m_tauId ==
"rnn001")
inputfile =
"SUSYTools/tau_selection_rnn001.conf";
1608 else if (
m_tauId ==
"VeryLoose")
inputfile =
"SUSYTools/tau_selection_veryloose.conf";
1609 else if (
m_tauId ==
"Loose")
inputfile =
"SUSYTools/tau_selection_loose.conf";
1610 else if (
m_tauId ==
"Medium")
inputfile =
"SUSYTools/tau_selection_medium.conf";
1611 else if (
m_tauId ==
"Tight")
inputfile =
"SUSYTools/tau_selection_tight.conf";
1614 return StatusCode::FAILURE;
1620 return StatusCode::FAILURE;
1629 toolName =
"TauSelectionTool_" +
m_tauId;
1647 return StatusCode::FAILURE;
1662 toolName =
"TauEffTool_" +
m_tauId;
1665 std::vector<int> correction_types;
1668 ANA_MSG_DEBUG(
"Found JetIDWP in tau config file : " << jetIDWP );
1676 ATH_MSG_ERROR(
"Invalid Tau ID in tau config file " << jetIDWP);
1677 return StatusCode::FAILURE;
1680 correction_types.insert(correction_types.end(), {TauAnalysisTools::EfficiencyCorrectionType::SFRecoHadTau,
1681 TauAnalysisTools::EfficiencyCorrectionType::SFJetIDHadTau});
1685 ANA_MSG_DEBUG(
"Found EleIDWP in tau config file : " << eleIDWP );
1686 int ele_id_lvl = -1;
1691 ATH_MSG_INFO(
"No or invalid Ele OR in tau config file " << eleIDWP <<
" will not apply SFs for electro veto" );
1694 if (ele_id_lvl != -1 )
1695 correction_types.insert(correction_types.end(), {TauAnalysisTools::EfficiencyCorrectionType::SFEleIDHadTau,
1696 TauAnalysisTools::EfficiencyCorrectionType::SFEleIDElectron});
1722 return StatusCode::FAILURE;
1727 {
"HLT_tau25_medium1_tracktwo",
"HLT_tau25_medium1_tracktwo"},
1728 {
"HLT_tau35_medium1_tracktwo",
"HLT_tau35_medium1_tracktwo"},
1729 {
"HLT_tau50L1TAU12_medium1_tracktwo",
"HLT_tau50_medium1_tracktwo_L1TAU12"},
1730 {
"HLT_tau60_medium1_tracktwo",
"HLT_tau60_medium1_tracktwo"},
1731 {
"HLT_tau80L1TAU60_medium1_tracktwo",
"HLT_tau80_medium1_tracktwo_L1TAU60"},
1732 {
"HLT_tau125_medium1_tracktwo",
"HLT_tau125_medium1_tracktwo"},
1733 {
"HLT_tau160_medium1_tracktwo",
"HLT_tau160_medium1_tracktwo"},
1734 {
"HLT_tau160L1TAU100_medium1_tracktwo",
"HLT_tau160_medium1_tracktwo_L1TAU100"},
1736 {
"HLT_tau25_medium1_tracktwoEF",
"HLT_tau25_medium1_tracktwoEF"},
1737 {
"HLT_tau35_medium1_tracktwoEF",
"HLT_tau35_medium1_tracktwoEF"},
1738 {
"HLT_tau60_medium1_tracktwoEF",
"HLT_tau60_medium1_tracktwoEF"},
1739 {
"HLT_tau80L1TAU60_medium1_tracktwoEF",
"HLT_tau80_medium1_tracktwoEF_L1TAU60"},
1740 {
"HLT_tau160L1TAU100_medium1_tracktwoEF",
"HLT_tau160_medium1_tracktwoEF_L1TAU100"},
1746 {
"HLT_tau25_mediumRNN_tracktwoMVA",
"HLT_tau25_mediumRNN_tracktwoMVA"},
1747 {
"HLT_tau35_mediumRNN_tracktwoMVA",
"HLT_tau35_mediumRNN_tracktwoMVA"},
1749 {
"HLT_tau160_mediumRNN_tracktwoMVA",
"HLT_tau160_mediumRNN_tracktwoMVA_L1TAU100"},
1751 {
"HLT_tau160_mediumRNN_tracktwoMVA",
"HLT_tau160_mediumRNN_tracktwoMVA_L1eTAU140"}
1756 toolName =
"TauTrigEffTool_" +
m_tauId +
"_" + trigger.first;
1758 ATH_CHECK( tau_trigSF->setProperty(
"EfficiencyCorrectionTypes", std::vector<int>({TauAnalysisTools::SFTriggerHadTau})) );
1759 ATH_CHECK( tau_trigSF->setProperty(
"TriggerName", trigger.first) );
1760 ATH_CHECK( tau_trigSF->setProperty(
"JetIDLevel", iTauID) );
1761 ATH_CHECK( tau_trigSF->setProperty(
"OutputLevel", this->msg().level()) );
1765 else {
ATH_CHECK( tau_trigSF->setProperty(
"Campaign",
"mc20") );}
1806 std::string jetcollBTag =
jetcoll;
1807 if (
jetcoll ==
"AntiKt4LCTopoJets") {
1808 ATH_MSG_WARNING(
" *** HACK *** Treating LCTopoJets jets as EMTopo -- use at your own risk!");
1809 jetcollBTag =
"AntiKt4EMTopoJets";
1815 ATH_MSG_WARNING(
"You are using a "<<(!
m_isRun3 ?
"Run3":
"Run2")<<
" CDI file while running on "<<(!
m_isRun3 ?
"Run2":
"Run3")<<
" sample; Please updates your CDI file to the correct version for "<<(!
m_isRun3 ?
"Run2":
"Run3"));
1819 if (jetcollBTag.find(
"AntiKt4EMTopoJets") == std::string::npos && jetcollBTag.find(
"AntiKt4EMPFlowJets")==std::string::npos) {
1820 ATH_MSG_WARNING(
"** Only AntiKt4EMTopoJets and AntiKt4EMPFlowJets are supported with FTAG scale factors!");
1821 return StatusCode::FAILURE;
1841 if (
jetcoll !=
"AntiKt4EMTopoJets" &&
jetcoll !=
"AntiKt4EMPFlowJets") {
1842 ATH_MSG_WARNING(
"** Only AntiKt4EMTopoJets and AntiKt4EMPFlowJets are supported with FTAG scale factors!");
1843 return StatusCode::FAILURE;
1846 toolName =
"BTagSelOR_" + jetcollBTag +
m_orBtagWP;
1862 const std::string& BTagColl_TrkJet = trkjetcoll;
1866 ATH_MSG_INFO(
"TrackJet collection set to None: disabling btagging for TrackJets.");
1870 if (trkjetcoll.find(
"AntiKt2PV0TrackJets")==std::string::npos && trkjetcoll.find(
"AntiKtVR30Rmax4Rmin02TrackJets")==std::string::npos) {
1871 ATH_MSG_WARNING(
"** Only AntiKt2PV0TrackJets and AntiKtVR30Rmax4Rmin02TrackJets are supported with FTAG scale factors!");
1872 return StatusCode::FAILURE;
1894 std::string MCshowerID;
1896 ATH_MSG_ERROR(
"Error! m_showerType=-1, which is an error case for FTAG MC/MC SFs." );
1897 return StatusCode::FAILURE;
1901 MCshowerID=
"default";
1911 ATH_MSG_WARNING(
"Unknown ShowerID detected! Using default FTAG MC-MC SFs (Powheg+Pythia8). Please check if these are applicable for this sample!");
1915 MCshowerID=
"default";
1919 ATH_MSG_WARNING(
"Unknown ShowerID detected! Using default FTAG MC-MC SFs (Powheg+Pythia8). Please check if these are applicable for this sample!");
1924 MCshowerID=
"default";
1932 ATH_MSG_WARNING(
"Unknown Sherpa version detected! Using FTAG MC-MC SFs for Sherpa 2.2.11-2.2.16. Please check if these are applicable for this sample!");
1933 MCshowerID =
"700660";
1936 ATH_MSG_WARNING(
"Unknown ShowerID detected! Using default FTAG MC-MC SFs (Powheg+Pythia8). Please check if these are applicable for this sample!");
1940 MCshowerID=
"default";
1946 ATH_MSG_WARNING(
"Unknown Sherpa version detected! Using FTAG MC-MC SFs for Sherpa 2.2.11-2.2.16. Please check if these are applicable for this sample!");
1947 MCshowerID =
"700660";
1950 ATH_MSG_WARNING(
"Unknown ShowerID detected! Using default FTAG MC-MC SFs (Powheg+Pythia8). Please check if these are applicable for this sample!");
1954 ATH_MSG_WARNING(
"Unknown b-tagger detected! Only DL1dv01 and GN2v01 are supported. Falling back to default FTAG MC-MC SFs (Powheg+Pythia8). Please check if these are applicable for this sample!");
1955 MCshowerID=
"default";
1960 if (
jetcoll !=
"AntiKt4EMTopoJets" &&
jetcoll !=
"AntiKt4EMPFlowJets") {
1961 ATH_MSG_WARNING(
"** Only AntiKt4EMTopoJets and AntiKt4EMPFlowJets are supported with FTAG scale factors!");
1962 return StatusCode::FAILURE;
1990 if (trkjetcoll.find(
"AntiKt2PV0TrackJets")==std::string::npos && trkjetcoll.find(
"AntiKtVR30Rmax4Rmin02TrackJets")==std::string::npos) {
1991 ATH_MSG_WARNING(
"** Only AntiKt2PV0TrackJets and AntiKtVR30Rmax4Rmin02TrackJets are supported with FTAG scale factors!");
1992 return StatusCode::FAILURE;
1995 toolName =
"BTagSF_" + trkjetcoll;
2051 ATH_MSG_ERROR(
"Can only have CST *or* TST configured for MET maker. Please unset either METDoCaloSyst or METDoTrkSyst in your config file" );
2052 return StatusCode::FAILURE;
2077 #ifndef XAOD_STANDALONE // Athena and AthAnalysis; need to take into account that MuonCalibTool is private tool
2081 if(jetname !=
"AntiKt4EMPFlow")
2082 ATH_MSG_WARNING(
"METSignificance recommendations only exist for AntiKt4EMPFlow jets, falling back to this.");
2099 if (IdBaselineInt == 4)
2103 #else // AnalysisBase; can just pass the jet/egamma/muon calib tools configured above
2107 if(jetname !=
"AntiKt4EMPFlow")
2108 ATH_MSG_WARNING(
"METSignificance recommendations only exist for AntiKt4EMPFlow jets, falling back to this.");
2138 #ifndef XAOD_STANDALONE // Athena and AthAnalysis
2141 #else // AnalysisBase
2185 std::string no2e17(
"");
2195 ATH_MSG_DEBUG(
"TrigGlobalEfficiencyCorrectionTool/TrigGlobal_diLep: no2e17 trigger string: " << no2e17 );
2197 std::map<std::string,std::string> triggers_diLep;
2201 triggers_diLep[
"326834-328393"] = no2e17;
2220 std::string no2e17(
"");
2230 ATH_MSG_DEBUG(
"TrigGlobalEfficiencyCorrectionTool/TrigGlobal_multiLep: no2e17 trigger string: " << no2e17 );
2232 std::map<std::string,std::string> triggers_multiLep;
2236 triggers_multiLep[
"326834-328393"] = no2e17;
2337 #ifndef XAOD_ANALYSIS
2354 std::string toolName =
"ORTool" +
suffix;
2355 ATH_MSG_INFO(
"SUSYTools: Autoconfiguring " << toolName);
2498 return StatusCode::SUCCESS;