|
ATLAS Offline Software
|
Go to the documentation of this file.
19 :
asg::AsgMetadataTool( sName )
20 , m_vCommonEfficiencyTools()
21 , m_vTriggerEfficiencyTools()
23 , m_bIsConfigured(false)
66 ATH_MSG_INFO(
"Initializing TauEfficiencyCorrectionsTool" );
69 ATH_MSG_WARNING(
"Truth match check will be skipped. This is ONLY FOR TESTING PURPOSE!");
77 ATH_MSG_ERROR(
"Could not retrieve any EfficiencyCorrectionType");
78 return StatusCode::FAILURE;
82 ATH_MSG_WARNING(
"2022-prerec tag are pre-recommendations and still under development.");
87 return StatusCode::FAILURE;
93 ATH_CHECK((**it).setProperty(
"OutputLevel", this->msg().level()));
98 ATH_CHECK((**it).setProperty(
"OutputLevel", this->msg().level()));
104 if (!
registry.registerSystematics(*
this))
107 return StatusCode::FAILURE;
112 return StatusCode::SUCCESS;
122 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." );
126 ANA_MSG_WARNING(
"TauEfficiency callibrations from 2022-prerec are not recommended for Run2 MC. Will only print this warning once." );
128 return StatusCode::SUCCESS;
147 return StatusCode::SUCCESS;
157 return StatusCode::SUCCESS;
161 return StatusCode::SUCCESS;
164 return StatusCode::SUCCESS;
170 ATH_MSG_DEBUG(
"TauEfficiencyCorrectionsTool with name " <<
name() <<
" is configured as follows:" );
172 ATH_MSG_DEBUG(
" EfficiencyCorrectionTypes " << iEfficiencyCorrectionType );
197 double&
eff,
unsigned int ,
unsigned int )
211 double dToolEff = 1.;
214 return tmpCorrectionCode;
221 double dToolEff = 1.;
222 CP::CorrectionCode tmpCorrectionCode = (**it)->getEfficiencyScaleFactor(xTau, dToolEff);
224 return tmpCorrectionCode;
243 return tmpCorrectionCode;
251 return tmpCorrectionCode;
261 if ((**it)->isAffectedBySystematic(systematic))
264 if ((**it)->isAffectedBySystematic(systematic))
275 sAffectingSystematics.
insert((**it)->affectingSystematics());
277 sAffectingSystematics.
insert((**it)->affectingSystematics());
278 return sAffectingSystematics;
287 sRecommendedSystematics.
insert((**it)->recommendedSystematics());
289 sRecommendedSystematics.
insert((**it)->recommendedSystematics());
290 return sRecommendedSystematics;
297 if ((**it)->applySystematicVariation(sSystematicSet) == StatusCode::FAILURE)
298 return StatusCode::FAILURE;
300 if ((**it)->applySystematicVariation(sSystematicSet) == StatusCode::FAILURE)
301 return StatusCode::FAILURE;
302 return StatusCode::SUCCESS;
312 std::string sDirectory =
"TauAnalysisTools/" + std::string(sSharedFilesVersion) +
"/EfficiencyCorrections/";
321 ATH_MSG_WARNING(
"No fast-sim recommendation for Tau RNN, using full sim");
329 if (sJetIDWP.empty()) {
330 ATH_MSG_WARNING(
"Could not find valid ID working point. Skip ID efficiency corrections.");
359 ATH_MSG_WARNING(
"No fast-sim recommendation for tau electron veto, using full sim");
391 if (sJetIDWP.empty()) {
392 ATH_MSG_WARNING(
"Could not find valid ID working point. Skip ID efficiency corrections.");
408 ATH_MSG_ERROR(
"Property \"Trigger\" was not set, please provide a trigger name.");
409 return StatusCode::FAILURE;
418 if (
m_sTriggerName.find(
"mediumRNN_tracktwoMVA") != std::string::npos) {
421 else if (
m_sTriggerName.find(
"tracktwoEF") != std::string::npos) {
424 else if (
m_sTriggerName.find(
"tau160_medium1") != std::string::npos) {
435 return StatusCode::FAILURE;
448 ATH_MSG_WARNING(
"unsupported EfficiencyCorrectionsType with enum " << iEfficiencyCorrectionType);
452 return StatusCode::SUCCESS;
459 if (
inputMetaStore()->contains<xAOD::FileMetaData>(
"FileMetaData")) {
462 std::string simType(
"");
467 if( simType.find(
"ATLFAST3") != std::string::npos && !
m_useFastSim){
468 ATH_MSG_WARNING(
"Input file is AF3 sample but you are _not_ using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"true\"");
469 }
else if (simType.find(
"FULLG4")!=std::string::npos &&
m_useFastSim){
470 ATH_MSG_WARNING(
"Input file is full simulation but you are using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"false\"");
474 return StatusCode::SUCCESS;
485 ATH_MSG_WARNING(
"Efficiency corrections for JETIDRNNVERYLOOSE working point are not supported.");
488 return "jetrnnsigloose";
490 return "jetrnnsigmedium";
492 return "jetrnnsigtight";
504 return "eleRNNTight";
506 return "eleRNNMedium";
508 return "eleRNNLoose";
535 std::string sMeasurement =
"_comb_";
538 sMeasurement =
"_Ztt_";
540 sMeasurement =
"_ttbar_";
553 if (!
evtStore()->contains<xAOD::EventInfo>(
"EventInfo") || !
evtStore()->
retrieve(eventInfo,
"EventInfo").isSuccess())
556 return StatusCode::FAILURE;
561 ANA_MSG_ERROR(
"Failed to find the RandomRunNumber decoration. Call the apply() method from the PileupReweightingTool beforehand to get period dependent SFs.");
562 return StatusCode::FAILURE;
570 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
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.
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
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.