ATLAS Offline Software
CommonSmearingTool.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 // Framework include(s):
7 
8 // local include(s)
11 
14 
15 // ROOT include(s)
16 #include "TROOT.h"
17 #include "TF1.h"
18 #include "TClass.h"
19 #include "TKey.h"
20 
21 // tauRecTools include(s)
23 
24 using namespace TauAnalysisTools;
25 /*
26  This tool acts as a common tool to apply tau energy smearing and
27  uncertainties. By default, only nominal smearings without systematic
28  variations are applied. Unavailable systematic variations are ignored, meaning
29  that the tool only returns the nominal value. In case the one available
30  systematic is requested, the smeared scale factor is computed as:
31  - pTsmearing = pTsmearing_nominal +/- n * uncertainty
32 
33  where n is in general 1 (representing a 1 sigma smearing), but can be any
34  arbitrary value. In case multiple systematic variations are passed they are
35  added in quadrature. Note that it's currently only supported if all are up or
36  down systematics.
37 
38  The tool reads in root files including TH2 histograms which need to fulfill a
39  predefined structure:
40 
41  nominal smearing:
42  - sf_<workingpoint>_<prongness>p
43  uncertainties:
44  - <NP>_<up/down>_<workingpoint>_<prongness>p (for asymmetric uncertainties)
45  - <NP>_<workingpoint>_<prongness>p (for symmetric uncertainties)
46 
47  where the <workingpoint> (e.g. loose/medium/tight) fields may be
48  optional. <prongness> represents either 1 or 3, whereas 3 is currently used
49  for multiprong in general. The <NP> fields are names for the type of nuisance
50  parameter (e.g. STAT or SYST), note the tool decides whether the NP is a
51  recommended or only an available systematic based on the first character:
52  - uppercase -> recommended
53  - lowercase -> available
54  This magic happens here:
55  - CommonSmearingTool::generateSystematicSets()
56 
57  In addition the root input file can also contain objects of type TF1 that can
58  be used to provide kind of unbinned smearings or systematics. Currently there
59  is no usecase for tau energy smearing
60 
61  The files may also include TNamed objects which is used to define how x and
62  y-axes should be treated. By default the x-axis is given in units of tau-pT in
63  GeV and the y-axis is given as tau-eta. If there is for example a TNamed
64  object with name "Yaxis" and title "|eta|" the y-axis is treated in units of
65  absolute tau eta. All this is done in:
66  - void CommonSmearingTool::ReadInputs(TFile* fFile)
67 
68  Other tools for scale factors may build up on this tool and overwrite or add
69  particular functionality.
70 */
71 
72 //______________________________________________________________________________
73 CommonSmearingTool::CommonSmearingTool(const std::string& sName)
74  : asg::AsgMetadataTool( sName )
75  , m_sSystematicSet(nullptr)
76  , m_fX(&finalTauPt)
77  , m_fY(&finalTauEta)
78  , m_bIsData(false)
79  , m_bIsConfigured(false)
80  , m_tTauCombinedTES("TauCombinedTES", this)
81  , m_eCheckTruth(TauAnalysisTools::Unknown)
82 {
83 }
84 
85 /*
86  need to clear the map of histograms cause we have the ownership, not ROOT
87 */
89 {
90  for (auto& mEntry : m_mSF)
91  delete mEntry.second;
92 }
93 
94 /*
95  - Find the root files with smearing inputs on cvmfs using PathResolver
96  (more info here:
97  https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/PathResolver)
98  - Call further functions to process and define NP strings and so on
99  - Configure to provide nominal smearings by default
100 */
102 {
103  ATH_MSG_INFO( "Initializing CommonSmearingTool" );
104 
105  // FIXME: do we expect initialize() to be called several times?
106  // only read in histograms once
107  if (m_mSF.empty())
108  {
109  std::string sInputFilePath = PathResolverFindCalibFile(m_sInputFilePath);
110  std::unique_ptr<TFile> fSF( TFile::Open(sInputFilePath.c_str()) );
111  if(fSF == nullptr) {
112  ATH_MSG_FATAL("Could not open file " << sInputFilePath.c_str());
113  return StatusCode::FAILURE;
114  }
115  ReadInputs(fSF.get(), m_mSF);
116  fSF->Close();
117  }
118 
120 
121  // load empty systematic variation by default
122  if (applySystematicVariation(CP::SystematicSet()) != StatusCode::SUCCESS )
123  return StatusCode::FAILURE;
124 
125  // TauCombinedTES tool must be set up when checking compatibility between calo TES and MVA TES
127  {
129  ATH_CHECK(m_tTauCombinedTES.setProperty("WeightFileName", "CombinedTES_R22_Round2.5_v2.root"));
131  }
132 
133  return StatusCode::SUCCESS;
134 }
135 
136 /*
137  Retrieve the smearing value and if requested the values for the NP's and add
138  this stuff in quadrature. Finally apply the correction to the tau pt of the
139  non-const tau.
140 */
141 //______________________________________________________________________________
143 {
144  // optional consistency check between calo-only pt ("ptTauEnergyScale") and MVA pt ("ptFinalCalib" i.e. "pt", MVA TES is the default calibration)
145  // not recommended until validated in R22: MVA TES always has better resolution than calo-only TES for true taus
146  // in practice this check mostly discards muons faking taus with large track momentum but little energy deposit in the calorimeter:
147  // when enforcing calo-only pt, the muon will likely fail the tau pt cut applied by TauSelectionTool
148 
149  if (m_bMVATESQualityCheck) {
150  bool compatibility = true;
151  static const SG::ConstAccessor<float> accPtTauEnergyScale ("ptTauEnergyScale");
152  if(accPtTauEnergyScale.isAvailable(xTau)) {
153  const auto combinedTEStool = dynamic_cast<const TauCombinedTES*>(m_tTauCombinedTES.get());
154  compatibility = combinedTEStool->getTESCompatibility(xTau);
155  }
156  static const SG::Accessor<char> accTESCompatibility("TESCompatibility");
157  accTESCompatibility(xTau) = char(compatibility);
158  }
159 
160  // step out here if we run on data
161  if (m_bIsData)
162  return CP::CorrectionCode::Ok;
163 
164  // check which true state is requested
166  return CP::CorrectionCode::Ok;
167  }
168 
169  // skip taus which are not 1 or 3 prong
170  if( xTau.nTracks() != 1 && xTau.nTracks() != 3) {
171  return CP::CorrectionCode::Ok;
172  }
173 
174  // get prong extension for histogram name
175  std::string sProng = ConvertProngToString(xTau.nTracks());
176 
177  double dCorrection = 1.;
178  CP::CorrectionCode tmpCorrectionCode;
180  {
181  // get standard scale factor
182  tmpCorrectionCode = getValue("sf"+sProng,
183  xTau,
184  dCorrection);
185  // return correction code if histogram is not available
186  if (tmpCorrectionCode != CP::CorrectionCode::Ok)
187  return tmpCorrectionCode;
188  }
189 
190  // skip further process if systematic set is empty
191  if (!m_sSystematicSet->empty())
192  {
193  // get uncertainties summed in quadrature
194  double dTotalSystematic2 = 0.;
195  double dDirection = 0.;
196  for (auto& syst : *m_sSystematicSet)
197  {
198  // check if systematic is available
199  auto it = m_mSystematicsHistNames.find(syst.basename());
200 
201  // get uncertainty value
202  double dUncertaintySyst = 0.;
203  tmpCorrectionCode = getValue(it->second+sProng,
204  xTau,
205  dUncertaintySyst);
206  // return correction code if histogram is not available
207  if (tmpCorrectionCode != CP::CorrectionCode::Ok)
208  return tmpCorrectionCode;
209 
210  // needed for up/down decision
211  dDirection = syst.parameter();
212 
213  // scale uncertainty with direction, i.e. +/- n*sigma
214  dUncertaintySyst *= dDirection;
215 
216  // square uncertainty and add to total uncertainty
217  dTotalSystematic2 += dUncertaintySyst * dUncertaintySyst;
218  }
219 
220  // now use dDirection to use up/down uncertainty
221  dDirection = (dDirection > 0.) ? 1. : -1.;
222 
223  // finally apply uncertainty (eff * ( 1 +/- \sum )
224  dCorrection *= 1 + dDirection * std::sqrt(dTotalSystematic2);
225  }
226 
227  // finally apply correction
228  // in-situ TES is applied w.r.t. ptFinalCalib, use explicit calibration for pt to avoid irreproducibility upon re-calibration (PHYSLITE)
229  // not required for eta/phi/m that we don't correct (only ptFinalCalib and etaFinalCalib are stored in DAODs)
230  xTau.setP4( xTau.ptFinalCalib() * dCorrection,
231  xTau.eta(), xTau.phi(), xTau.m());
232  return CP::CorrectionCode::Ok;
233 }
234 
235 /*
236  Create a non-const copy of the passed const xTau object and apply the
237  correction to the non-const copy.
238  */
239 //______________________________________________________________________________
241  xAOD::TauJet*& xTauCopy ) const
242 {
243 
244  // A sanity check:
245  if( xTauCopy )
246  {
247  ATH_MSG_WARNING( "Non-null pointer received. "
248  "There's a possible memory leak!" );
249  }
250 
251  // Create a new object:
252  xTauCopy = new xAOD::TauJet();
253  xTauCopy->makePrivateStore( xTau );
254 
255  // Use the other function to modify this object:
256  return applyCorrection( *xTauCopy );
257 }
258 
259 /*
260  standard check if a systematic is available
261 */
262 //______________________________________________________________________________
264 {
266  return sys.find(systematic) != sys.end();
267 }
268 
269 /*
270  standard way to return systematics that are available (including recommended
271  systematics)
272 */
273 //______________________________________________________________________________
275 {
277 }
278 
279 /*
280  standard way to return systematics that are recommended
281 */
282 //______________________________________________________________________________
284 {
286 }
287 
288 /*
289  Configure the tool to use a systematic variation for further usage, until the
290  tool is reconfigured with this function. The passed systematic set is checked
291  for sanity:
292  - unsupported systematics are skipped
293  - only combinations of up or down supported systematics is allowed
294  - don't mix recommended systematics with other available systematics, cause
295  sometimes recommended are a quadratic sum of the other variations,
296  e.g. TOTAL=(SYST^2 + STAT^2)^0.5
297 */
298 //______________________________________________________________________________
300 {
301  // first check if we already know this systematic configuration
302  auto itSystematicSet = m_mSystematicSets.find(sSystematicSet);
303  if (itSystematicSet != m_mSystematicSets.end())
304  {
305  m_sSystematicSet = &itSystematicSet->first;
306  return StatusCode::SUCCESS;
307  }
308 
309  // sanity checks if systematic set is supported
310  double dDirection = 0.;
311  CP::SystematicSet sSystematicSetAvailable;
312  for (auto& sSyst : sSystematicSet)
313  {
314  // check if systematic is available
315  auto it = m_mSystematicsHistNames.find(sSyst.basename());
316  if (it == m_mSystematicsHistNames.end())
317  {
318  ATH_MSG_VERBOSE("unsupported systematic variation: "<< sSyst.basename()<<"; skipping this one");
319  continue;
320  }
321 
322  if (sSyst.parameter() * dDirection < 0)
323  {
324  ATH_MSG_ERROR("unsupported set of systematic variations, you should either use only \"UP\" or only \"DOWN\" systematics in one set!");
325  ATH_MSG_ERROR("systematic set will not be applied");
326  return StatusCode::FAILURE;
327  }
328  dDirection = sSyst.parameter();
329 
330  if ((m_sRecommendedSystematics.find(sSyst.basename()) != m_sRecommendedSystematics.end()) and sSystematicSet.size() > 1)
331  {
332  ATH_MSG_ERROR("unsupported set of systematic variations, you should not combine \"TAUS_{TRUE|FAKE}_SME_TOTAL\" with other systematic variations!");
333  ATH_MSG_ERROR("systematic set will not be applied");
334  return StatusCode::FAILURE;
335  }
336 
337  // finally add the systematic to the set of systematics to process
338  sSystematicSetAvailable.insert(sSyst);
339  }
340 
341  // store this calibration for future use, and make it current
342  m_sSystematicSet = &m_mSystematicSets.insert(std::pair<CP::SystematicSet,std::string>(sSystematicSetAvailable, sSystematicSet.name())).first->first;
343 
344  return StatusCode::SUCCESS;
345 }
346 
347 //=================================PRIVATE-PART=================================
348 /*
349  Executed at the beginning of each event, checks if the tool is used on data or MC.
350  This tool is mostly for MC (in-situ TES correction).
351  But the TES compatibility requirement is applied to both data and MC (when MVATESQualityCheck=true).
352 */
353 //______________________________________________________________________________
355 {
356  if (m_bIsConfigured)
357  return StatusCode::SUCCESS;
358 
359  const xAOD::EventInfo* xEventInfo = nullptr;
360  ATH_CHECK(evtStore()->retrieve(xEventInfo,"EventInfo"));
362  m_bIsConfigured = true;
363 
364  return StatusCode::SUCCESS;
365 }
366 
367 //______________________________________________________________________________
368 std::string CommonSmearingTool::ConvertProngToString(const int fProngness) const
369 {
370  return fProngness == 1 ? "_1p" : "_3p";
371 }
372 
373 //______________________________________________________________________________
374 template<class T>
375 void CommonSmearingTool::ReadInputs(TFile* fFile, std::map<std::string, T>& mMap)
376 {
377  // initialize function pointer
378  m_fX = &finalTauPt;
379  m_fY = &finalTauEta;
380 
381  TKey *kKey;
382  TIter itNext(fFile->GetListOfKeys());
383  while ((kKey = (TKey*)itNext()))
384  {
385  TClass *cClass = gROOT->GetClass(kKey->GetClassName());
386 
387  // parse file content for objects of type TNamed, check their title for
388  // known strings and reset funtion pointer
389  std::string sKeyName = kKey->GetName();
390  if (sKeyName == "Xaxis")
391  {
392  TNamed* tObj = (TNamed*)kKey->ReadObj();
393  std::string sTitle = tObj->GetTitle();
394  delete tObj;
395  if (sTitle == "P" || sTitle == "PFinalCalib")
396  {
397  m_fX = &finalTauP;
398  ATH_MSG_DEBUG("using full momentum for x-axis");
399  }
400  }
401  if (sKeyName == "Yaxis")
402  {
403  TNamed* tObj = (TNamed*)kKey->ReadObj();
404  std::string sTitle = tObj->GetTitle();
405  delete tObj;
406  if (sTitle == "track-eta")
407  {
409  ATH_MSG_DEBUG("using leading track eta for y-axis");
410  }
411  else if (sTitle == "|eta|")
412  {
413  m_fY = &finalTauAbsEta;
414  ATH_MSG_DEBUG("using absolute tau eta for y-axis");
415  }
416  }
417  if (!cClass->InheritsFrom("TH1"))
418  continue;
419  T tObj = (T)kKey->ReadObj();
420  tObj->SetDirectory(0);
421  mMap[sKeyName] = tObj;
422  }
423  ATH_MSG_INFO("data loaded from " << fFile->GetName());
424 }
425 
426 //______________________________________________________________________________
428 {
429  std::vector<std::string> vInputFilePath;
430  split(m_sInputFilePath,'/',vInputFilePath);
431  std::string sInputFileName = vInputFilePath.back();
432 
433  // creation of basic string for all NPs, e.g. "TAUS_TRUEHADTAU_SME_TES_"
434  std::vector<std::string> vSplitInputFilePath = {};
435  split(sInputFileName,'_',vSplitInputFilePath);
436  std::string sEfficiencyType = vSplitInputFilePath.at(0);
437  std::string sTruthType = vSplitInputFilePath.at(1);
438  std::transform(sEfficiencyType.begin(), sEfficiencyType.end(), sEfficiencyType.begin(), toupper);
439  std::transform(sTruthType.begin(), sTruthType.end(), sTruthType.begin(), toupper);
440  std::string sSystematicBaseString = "TAUS_" + sTruthType + "_SME_" + sEfficiencyType + "_";
441 
442  // set truth type to check for in truth matching - only true hadronic tau is supported at the moment
443  if (sTruthType=="TRUEHADTAU") m_eCheckTruth = TauAnalysisTools::TruthHadronicTau;
444 
445 
446  for (auto& mSF : m_mSF)
447  {
448  // parse for nuisance parameter in histogram name
449  std::vector<std::string> vSplitNP = {};
450  split(mSF.first,'_',vSplitNP);
451  std::string sNP;
452  std::string sNPUppercase;
453  if (vSplitNP.size() > 2)
454  {
455  sNP = vSplitNP.at(0)+'_'+vSplitNP.at(1);
456  sNPUppercase = vSplitNP.at(0) + '_' + vSplitNP.at(1);
457  } else {
458  sNP = vSplitNP.at(0);
459  sNPUppercase = vSplitNP.at(0);
460  }
461 
462  // skip nominal scale factors
463  if (sNP == "sf") continue;
464  // skip if non 1p histogram to avoid duplications (TODO: come up with a better solution)
465  if (mSF.first.find("_1p") == std::string::npos) continue;
466 
467  // test if NP starts with a capital letter indicating that this should be recommended
468  bool bIsRecommended = false;
469  if (isupper(sNP.at(0)))
470  bIsRecommended = true;
471 
472  // make sNP uppercase and build final NP entry name
473  std::transform(sNPUppercase.begin(), sNPUppercase.end(), sNPUppercase.begin(), toupper);
474  std::string sSystematicString = sSystematicBaseString + sNPUppercase;
475 
476  // add all found systematics to the AffectingSystematics
478  m_sAffectingSystematics.insert(CP::SystematicVariation (sSystematicString, -1));
479  // only add found uppercase systematics to the RecommendedSystematics
480  if (bIsRecommended)
481  {
484  }
485 
486  ATH_MSG_DEBUG("connected histogram base name " << sNP << " with systematic " << sSystematicString);
487  m_mSystematicsHistNames.insert({sSystematicString,sNP});
488  }
489 }
490 
491 //______________________________________________________________________________
493  const xAOD::TauJet& xTau,
494  double& dEfficiencyScaleFactor) const
495 {
496  TH1* hHist = m_mSF.at(sHistName);
497  if (hHist == nullptr)
498  {
499  ATH_MSG_ERROR("Histogram with name " << sHistName << " was not found in input file.");
501  }
502 
503  double dPt = m_fX(xTau);
504  double dEta = m_fY(xTau);
505 
506  // protect values from underflow bins
507  dPt = std::max(dPt,hHist->GetXaxis()->GetXmin());
508  dEta = std::max(dEta,hHist->GetYaxis()->GetXmin());
509  // protect values from overflow bins (times .999 to keep it inside last bin)
510  dPt = std::min(dPt,hHist->GetXaxis()->GetXmax() * .999);
511  dEta = std::min(dEta,hHist->GetYaxis()->GetXmax() * .999);
512 
513  int iBin = hHist->FindFixBin(dPt,dEta);
514  dEfficiencyScaleFactor = hHist->GetBinContent(iBin);
515 
516  if (m_bApplyFading)
517  {
518  std::string sTitle = hHist->GetTitle();
519  if (!sTitle.empty())
520  {
521  TF1 f("",sTitle.c_str(), 0, 1000);
522  if (sHistName.find("sf_") != std::string::npos)
523  dEfficiencyScaleFactor = (dEfficiencyScaleFactor -1.) *f.Eval(m_fX(xTau)) + 1.;
524  else
525  dEfficiencyScaleFactor *= f.Eval(m_fX(xTau));
526  }
527  }
528  return CP::CorrectionCode::Ok;
529 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
asg::AnaToolHandle::initialize
StatusCode initialize()
initialize the tool
TauAnalysisTools::CommonSmearingTool::m_bApplyFading
Gaudi::Property< bool > m_bApplyFading
Definition: CommonSmearingTool.h:104
TauAnalysisTools::CommonSmearingTool::ReadInputs
void ReadInputs(TFile *fFile, std::map< std::string, T > &mMap)
Definition: CommonSmearingTool.cxx:375
TauAnalysisTools
Definition: TruthCollectionMakerTau.h:16
TauAnalysisTools::CommonSmearingTool::recommendedSystematics
virtual CP::SystematicSet recommendedSystematics() const
returns: the list of all systematics this tool recommends to use
Definition: CommonSmearingTool.cxx:283
TauCombinedTES::getTESCompatibility
bool getTESCompatibility(const xAOD::TauJet &tau) const
Check if MVA TES and CaloTES are compatible, invoked by TauSmearing tool.
Definition: TauCombinedTES.cxx:181
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TauAnalysisTools::CommonSmearingTool::m_bSkipTruthMatchCheck
Gaudi::Property< bool > m_bSkipTruthMatchCheck
Definition: CommonSmearingTool.h:103
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::TauJet_v3::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
SG::Accessor< char >
TauAnalysisTools::TruthHadronicTau
@ TruthHadronicTau
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:99
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
CP::SystematicSet::empty
bool empty() const
returns: whether the set is empty
Definition: SystematicSet.h:67
TruthParticleContainer.h
xAOD::TauJet_v3::m
virtual double m() const
The invariant mass of the particle.
TauCombinedTES
Definition: TauCombinedTES.h:21
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
TauAnalysisTools::CommonSmearingTool::m_sSystematicSet
const CP::SystematicSet * m_sSystematicSet
Definition: CommonSmearingTool.h:85
xAOD::TauJet_v3::nTracks
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
Definition: TauJet_v3.cxx:488
skel.it
it
Definition: skel.GENtoEVGEN.py:407
asg
Definition: DataHandleTestTool.h:28
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
TauAnalysisTools::CommonSmearingTool::m_sRecommendedSystematics
CP::SystematicSet m_sRecommendedSystematics
Definition: CommonSmearingTool.h:115
CP::SystematicSet::name
std::string name() const
returns: the systematics joined into a single string.
Definition: SystematicSet.cxx:277
TauAnalysisTools::CommonSmearingTool::m_bApplyInsituCorrection
Gaudi::Property< bool > m_bApplyInsituCorrection
Definition: CommonSmearingTool.h:106
SG::ConstAccessor< float >
TauAnalysisTools::finalTauPt
double finalTauPt(const xAOD::TauJet &xTau)
return MVA based tau pt in GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:113
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
CP::SystematicVariation
Definition: SystematicVariation.h:47
TauAnalysisTools::Unknown
@ Unknown
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:98
ASG_MAKE_ANA_TOOL
#define ASG_MAKE_ANA_TOOL(handle, type)
create the tool in the given tool handle
Definition: AnaToolHandle.h:690
asg::AnaToolHandle::setProperty
StatusCode setProperty(const std::string &property, const T2 &value)
set the given property of the tool.
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
xAOD::TauJet_v3::setP4
void setP4(double pt, double eta, double phi, double m)
Set methods for IParticle values.
Definition: TauJet_v3.cxx:171
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
TauClusterVars::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:114
TauAnalysisTools::CommonSmearingTool::applyCorrection
virtual CP::CorrectionCode applyCorrection(xAOD::TauJet &xTau) const
Apply the correction on a modifyable object.
Definition: CommonSmearingTool.cxx:142
TauAnalysisTools::CommonSmearingTool::m_sInputFilePath
Gaudi::Property< std::string > m_sInputFilePath
Definition: CommonSmearingTool.h:102
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
TauAnalysisTools::finalTauP
double finalTauP(const xAOD::TauJet &xTau)
return MVA based tau P in GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:134
xAOD::TauJet_v3::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
TauAnalysisTools::CommonSmearingTool::~CommonSmearingTool
~CommonSmearingTool()
Definition: CommonSmearingTool.cxx:88
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
TauAnalysisTools::CommonSmearingTool::m_eCheckTruth
TruthMatchedParticleType m_eCheckTruth
Definition: CommonSmearingTool.h:113
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TauSmearingTool.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TauAnalysisTools::CommonSmearingTool::applySystematicVariation
virtual StatusCode applySystematicVariation(const CP::SystematicSet &sSystematicSet)
configure this tool for the given list of systematic variations.
Definition: CommonSmearingTool.cxx:299
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
TauAnalysisTools::CommonSmearingTool::m_sAffectingSystematics
CP::SystematicSet m_sAffectingSystematics
Definition: CommonSmearingTool.h:114
CP::SystematicSet::end
const_iterator end() const
description: const iterator to the end of the set
Definition: SystematicSet.h:59
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
hist_file_dump.f
f
Definition: hist_file_dump.py:140
xAOD::TauJet
TauJet_v3 TauJet
Definition of the current "tau version".
Definition: Event/xAOD/xAODTau/xAODTau/TauJet.h:17
TauAnalysisTools::CommonSmearingTool::m_tTauCombinedTES
asg::AnaToolHandle< ITauToolBase > m_tTauCombinedTES
Definition: CommonSmearingTool.h:111
TauAnalysisTools::CommonSmearingTool::getValue
virtual CP::CorrectionCode getValue(const std::string &sHistName, const xAOD::TauJet &xTau, double &dEfficiencyScaleFactor) const
Definition: CommonSmearingTool.cxx:492
TauCombinedTES.h
TauAnalysisTools::CommonSmearingTool::isAffectedBySystematic
virtual bool isAffectedBySystematic(const CP::SystematicVariation &systematic) const
returns: whether this tool is affected by the given systematics
Definition: CommonSmearingTool.cxx:263
TauAnalysisTools::CommonSmearingTool::correctedCopy
virtual CP::CorrectionCode correctedCopy(const xAOD::TauJet &xTau, xAOD::TauJet *&xTauCopy) const
Create a corrected copy from a constant tau.
Definition: CommonSmearingTool.cxx:240
TauAnalysisTools::CommonSmearingTool::m_bIsData
bool m_bIsData
Definition: CommonSmearingTool.h:108
PathResolver.h
CP::SystematicSet::insert
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
Definition: SystematicSet.cxx:87
TauAnalysisTools::CommonSmearingTool::m_bIsConfigured
bool m_bIsConfigured
Definition: CommonSmearingTool.h:109
TauAnalysisTools::CommonSmearingTool::m_fX
double(* m_fX)(const xAOD::TauJet &xTau)
Definition: CommonSmearingTool.h:90
SG::AuxElement::makePrivateStore
void makePrivateStore()
Create a new (empty) private store for this object.
Definition: AuxElement.cxx:192
TauAnalysisTools::CommonSmearingTool::m_fY
double(* m_fY)(const xAOD::TauJet &xTau)
Definition: CommonSmearingTool.h:91
CommonSmearingTool.h
TauAnalysisTools::CommonSmearingTool::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: CommonSmearingTool.cxx:101
EventInfo.h
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:321
TauAnalysisTools::CommonSmearingTool::m_mSF
std::map< std::string, TH1 * > m_mSF
Definition: CommonSmearingTool.h:83
CP::SystematicSet::find
iterator find(const SystematicVariation &sys) const
description: find an element in the set
Definition: SystematicSet.h:63
TauAnalysisTools::CommonSmearingTool::m_mSystematicSets
std::unordered_map< CP::SystematicSet, std::string > m_mSystematicSets
Definition: CommonSmearingTool.h:84
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
TauAnalysisTools::CommonSmearingTool::beginEvent
virtual StatusCode beginEvent()
Function called when a new events is loaded.
Definition: CommonSmearingTool.cxx:354
TauAnalysisTools::finalTauAbsEta
double finalTauAbsEta(const xAOD::TauJet &xTau)
return MVA based absolute tau eta
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:127
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TauAnalysisTools::tauLeadTrackEta
double tauLeadTrackEta(const xAOD::TauJet &xTau)
return leading charge tau track eta
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:141
TauAnalysisTools::getTruthParticleType
TruthMatchedParticleType getTruthParticleType(const xAOD::TauJet &xTau)
return TauJet match type
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:493
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
TauAnalysisTools::CommonSmearingTool::CommonSmearingTool
CommonSmearingTool(const std::string &sName)
Create a proper constructor for Athena.
Definition: CommonSmearingTool.cxx:73
TauAnalysisTools::CommonSmearingTool::generateSystematicSets
void generateSystematicSets()
Definition: CommonSmearingTool.cxx:427
TauAnalysisTools::CommonSmearingTool::m_mSystematicsHistNames
std::map< std::string, std::string > m_mSystematicsHistNames
Definition: CommonSmearingTool.h:87
TauAnalysisTools::CommonSmearingTool::ConvertProngToString
std::string ConvertProngToString(const int iProngness) const
Definition: CommonSmearingTool.cxx:368
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
TauAnalysisTools::CommonSmearingTool::affectingSystematics
virtual CP::SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by
Definition: CommonSmearingTool.cxx:274
TauAnalysisTools::CommonSmearingTool::m_bMVATESQualityCheck
Gaudi::Property< bool > m_bMVATESQualityCheck
Definition: CommonSmearingTool.h:105
xAOD::TauJet_v3::ptFinalCalib
double ptFinalCalib() const
asg::AnaToolHandle::get
T * get()
access the tool
TauAnalysisTools::finalTauEta
double finalTauEta(const xAOD::TauJet &xTau)
return MVA based tau eta
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:120
xAOD::EventInfo_v1::eventType
bool eventType(EventType type) const
Check for one particular bitmask value.
TauAnalysisTools::split
void split(const std::string &sInput, const char cDelim, std::vector< std::string > &vOut)
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:23