 |
ATLAS Offline Software
|
Go to the documentation of this file.
19 :
asg::AsgMetadataTool( sName )
20 , m_vCommonEfficiencyTools()
22 , m_bIsConfigured(false)
36 ATH_MSG_INFO(
"Initializing TauEfficiencyCorrectionsTool" );
41 ATH_MSG_WARNING(
"Truth match check will be skipped. This is ONLY FOR TESTING PURPOSE!");
46 ATH_MSG_ERROR(
"Could not retrieve any EfficiencyCorrectionType");
47 return StatusCode::FAILURE;
53 ATH_MSG_WARNING(
"2022-prerec tag are pre-recommendations superseeded by 2025-prerec");
58 return StatusCode::FAILURE;
64 ATH_CHECK((**it).setProperty(
"OutputLevel", this->msg().level()));
70 if (!
registry.registerSystematics(*
this))
73 return StatusCode::FAILURE;
78 return StatusCode::SUCCESS;
89 ANA_MSG_WARNING(
"Could not determine MC campaign from run number! The mu dependent systematic of the trigger scale factors should not be trusted. Current (" << xEventInfo->
runNumber() <<
"). Will only print this warning once." );
93 ANA_MSG_WARNING(
"TauEfficiency callibrations from 2022-prerec are not recommended for Run2 MC. Will only print this warning once." );
96 return StatusCode::SUCCESS;
115 return StatusCode::SUCCESS;
126 return StatusCode::SUCCESS;
132 ATH_MSG_DEBUG(
"TauEfficiencyCorrectionsTool with name " <<
name() <<
" is configured as follows:" );
134 ATH_MSG_DEBUG(
" EfficiencyCorrectionTypes " << iEfficiencyCorrectionType );
153 double&
eff,
unsigned int )
167 double dToolEff = 1.;
170 return tmpCorrectionCode;
189 return tmpCorrectionCode;
199 if ((**it)->isAffectedBySystematic(systematic))
210 sAffectingSystematics.
insert((**it)->affectingSystematics());
211 return sAffectingSystematics;
220 sRecommendedSystematics.
insert((**it)->recommendedSystematics());
221 return sRecommendedSystematics;
228 if ((**it)->applySystematicVariation(sSystematicSet) == StatusCode::FAILURE)
229 return StatusCode::FAILURE;
230 return StatusCode::SUCCESS;
236 std::string sDirectory =
"TauAnalysisTools/" + std::string(sSharedFilesVersion) +
"/EfficiencyCorrections/";
243 ATH_MSG_WARNING(
"No fast-sim recommendation for Tau RNN, using full sim");
255 if (sJetIDWP.empty()) {
256 ATH_MSG_WARNING(
"Could not find valid ID working point. Skip ID efficiency corrections.");
270 m_sVarName =
"TauScaleFactorReconstructionHadTau";
295 ATH_MSG_WARNING(
"No fast-sim recommendation for tau electron veto, using full sim");
306 return StatusCode::FAILURE;
316 return StatusCode::FAILURE;
333 ATH_MSG_ERROR(
"Property \"Trigger\" was not set, please provide a trigger name.");
334 return StatusCode::FAILURE;
339 if (
m_sTriggerName.value().find(
"mediumRNN_tracktwoMVA") != std::string::npos) {
343 ATH_MSG_ERROR(
"Trigger " <<
m_sTriggerName <<
" is not supported for " <<
m_sCampaign <<
" campaign. Please fix \"TriggerName\" property. In case of doubt please consult with TauTrigger coordinators");
344 return StatusCode::FAILURE;
347 if (
m_sTriggerName.value().find(
"mediumRNN_tracktwoMVA") != std::string::npos) {
351 ATH_MSG_ERROR(
"Trigger " <<
m_sTriggerName <<
" is not supported for " <<
m_sCampaign <<
" campaign. Please fix \"TriggerName\" property. In case of doubt please consult with TauTrigger coordinators");
352 return StatusCode::FAILURE;
355 if (
m_sTriggerName.value().find(
"tracktwoEF") != std::string::npos) {
362 }
else if (
m_sTriggerName.value().find(
"tracktwo") != std::string::npos) {
366 }
else if (
m_sTriggerName.value().find(
"tau125") != std::string::npos) {
369 }
else if (
m_sTriggerName.value().find(
"tau60") != std::string::npos) {
376 ATH_MSG_ERROR(
"Trigger " <<
m_sTriggerName <<
" is not supported. Please fix \"TriggerName\" property. If this is correct, then please contact the tau trigger coordinators");
377 return StatusCode::FAILURE;
380 ATH_MSG_ERROR(
"SFs are not available for " <<
m_sCampaign <<
" campaign. If the config is correct, then please contact the tau trigger coordinators");
381 return StatusCode::FAILURE;
395 ATH_MSG_WARNING(
"unsupported EfficiencyCorrectionsType with enum " << iEfficiencyCorrectionType);
399 return StatusCode::SUCCESS;
407 std::string sDirectory =
"TauAnalysisTools/" + std::string(sSharedFilesVersion) +
"/EfficiencyCorrections/";
416 ATH_MSG_WARNING(
"No fast-sim recommendation for Tau RNN, using full sim");
424 if (sJetIDWP.empty()) {
425 ATH_MSG_WARNING(
"Could not find valid ID working point. Skip ID efficiency corrections.");
454 ATH_MSG_WARNING(
"No fast-sim recommendation for tau electron veto, using full sim");
472 m_sVarName =
"TauScaleFactorReconstructionHadTau";
486 if (sJetIDWP.empty()) {
487 ATH_MSG_WARNING(
"Could not find valid ID working point. Skip ID efficiency corrections.");
503 ATH_MSG_ERROR(
"Property \"Trigger\" was not set, please provide a trigger name.");
504 return StatusCode::FAILURE;
513 if (
m_sTriggerName.value().find(
"mediumRNN_tracktwoMVA") != std::string::npos) {
516 else if (
m_sTriggerName.value().find(
"tracktwoEF") != std::string::npos) {
519 else if (
m_sTriggerName.value().find(
"tau160_medium1") != std::string::npos) {
530 return StatusCode::FAILURE;
544 ATH_MSG_WARNING(
"unsupported EfficiencyCorrectionsType with enum " << iEfficiencyCorrectionType);
548 return StatusCode::SUCCESS;
555 if (
inputMetaStore()->contains<xAOD::FileMetaData>(
"FileMetaData")) {
558 std::string simType(
"");
563 if( simType.find(
"ATLFAST3") != std::string::npos && !
m_useFastSim){
564 ATH_MSG_WARNING(
"Input file is AF3 sample but you are _not_ using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"true\"");
565 }
else if (simType.find(
"FULLG4")!=std::string::npos &&
m_useFastSim){
566 ATH_MSG_WARNING(
"Input file is full simulation but you are using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"false\"");
570 return StatusCode::SUCCESS;
581 ATH_MSG_WARNING(
"Efficiency corrections for JETIDRNNVERYLOOSE working point are not supported.");
584 return "jetrnnsigloose";
586 return "jetrnnsigmedium";
588 return "jetrnnsigtight";
600 return "eleRNNTight";
602 return "eleRNNMedium";
604 return "eleRNNLoose";
631 std::string sMeasurement =
"_comb_";
634 sMeasurement =
"_Ztt_";
636 sMeasurement =
"_ttbar_";
650 if (!
evtStore()->contains<xAOD::EventInfo>(
"EventInfo") || !
evtStore()->
retrieve(eventInfo,
"EventInfo").isSuccess())
653 return StatusCode::FAILURE;
658 ANA_MSG_ERROR(
"Failed to find the RandomRunNumber decoration. Call the apply() method from the PileupReweightingTool beforehand to get period dependent SFs.");
659 return StatusCode::FAILURE;
667 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
Class to wrap a set of SystematicVariations.
@ IS_SIMULATION
true: simulation, false: data
uint32_t runNumber() const
The current event's run number.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a tau jet.
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
Class describing the basic event information.
@ Ok
The correction was done successfully.
#define ATH_MSG_WARNING(x)
This module implements the central registry for handling systematic uncertainties with CP tools.
Return value from object correction CP tools.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
bool eventType(EventType type) const
Check for one particular bitmask value.
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.