ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
TauAnalysisTools::CommonSmearingTool Class Referenceabstract

#include <CommonSmearingTool.h>

Inheritance diagram for TauAnalysisTools::CommonSmearingTool:
Collaboration diagram for TauAnalysisTools::CommonSmearingTool:

Public Member Functions

 CommonSmearingTool (const std::string &sName)
 Create a proper constructor for Athena. More...
 
 ~CommonSmearingTool ()
 
virtual StatusCode initialize ()
 Dummy implementation of the initialisation function. More...
 
virtual CP::CorrectionCode applyCorrection (xAOD::TauJet &xTau) const
 Apply the correction on a modifyable object. More...
 
virtual CP::CorrectionCode correctedCopy (const xAOD::TauJet &xTau, xAOD::TauJet *&xTauCopy) const
 Create a corrected copy from a constant tau. More...
 
virtual bool isAffectedBySystematic (const CP::SystematicVariation &systematic) const
 returns: whether this tool is affected by the given systematics More...
 
virtual CP::SystematicSet affectingSystematics () const
 returns: the list of all systematics this tool can be affected by More...
 
virtual CP::SystematicSet recommendedSystematics () const
 returns: the list of all systematics this tool recommends to use More...
 
virtual StatusCode applySystematicVariation (const CP::SystematicSet &sSystematicSet)
 configure this tool for the given list of systematic variations. More...
 
virtual void print () const =0
 Print the state of the tool. More...
 
virtual StatusCode sysInitialize ()
 Function initialising the tool in the correct way in Athena. More...
 
virtual void print () const
 Print the state of the tool. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

std::string ConvertProngToString (const int iProngness) const
 
template<class T >
void ReadInputs (TFile *fFile, std::map< std::string, T > &mMap)
 
virtual CP::CorrectionCode getValue (const std::string &sHistName, const xAOD::TauJet &xTau, double &dEfficiencyScaleFactor) const
 
void generateSystematicSets ()
 
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Protected Attributes

std::map< std::string, TH1 * > m_mSF
 
std::unordered_map< CP::SystematicSet, std::string > m_mSystematicSets
 
const CP::SystematicSetm_sSystematicSet
 
std::map< std::string, int > m_mSystematics
 
std::map< std::string, std::string > m_mSystematicsHistNames
 
double(* m_fX )(const xAOD::TauJet &xTau)
 
double(* m_fY )(const xAOD::TauJet &xTau)
 
std::string m_sInputFilePath
 
bool m_bIsData
 
bool m_bIsConfigured
 
bool m_bSkipTruthMatchCheck
 
bool m_bApplyFading
 
bool m_bApplyMVATESQualityCheck
 
bool m_bApplyInsituCorrection
 
asg::AnaToolHandle< ITauToolBasem_tTauCombinedTES
 
TruthMatchedParticleType m_eCheckTruth
 
CP::SystematicSet m_sAffectingSystematics
 
CP::SystematicSet m_sRecommendedSystematics
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

virtual StatusCode beginEvent ()
 Function called when a new events is loaded. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

MetaStore_t m_inputMetaStore
 Object accessing the input metadata store. More...
 
MetaStore_t m_outputMetaStore
 Object accessing the output metadata store. More...
 
bool m_beginInputFileCalled
 Flag helping to discover when the tool misses the opening of the first input file. More...
 
bool m_useIncidents
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Callback functions helping in metadata reading/writing

void setUseIncidents (const bool flag)
 
virtual void handle (const Incident &inc)
 Function receiving incidents from IncidentSvc/TEvent. More...
 
virtual StatusCode beginInputFile ()
 Function called when a new input file is opened. More...
 
virtual StatusCode endInputFile ()
 Function called when the currently open input file got completely processed. More...
 
virtual StatusCode metaDataStop ()
 Function called when the tool should write out its metadata. More...
 

Detailed Description

Definition at line 40 of file CommonSmearingTool.h.

Member Typedef Documentation

◆ MetaStore_t

Type of the metadata store object in Athena.

Definition at line 66 of file AsgMetadataTool.h.

◆ MetaStorePtr_t

Type of the metadata store pointer in standalone mode.

Definition at line 68 of file AsgMetadataTool.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ CommonSmearingTool()

CommonSmearingTool::CommonSmearingTool ( const std::string &  sName)

Create a proper constructor for Athena.

Definition at line 74 of file CommonSmearingTool.cxx.

75  : asg::AsgMetadataTool( sName )
76  , m_sSystematicSet(nullptr)
77  , m_fX(&finalTauPt)
78  , m_fY(&finalTauEta)
79  , m_bIsData(false)
80  , m_bIsConfigured(false)
81  , m_tTauCombinedTES("TauCombinedTES", this)
83 {
84  declareProperty("InputFilePath", m_sInputFilePath = "" );
85  declareProperty("SkipTruthMatchCheck", m_bSkipTruthMatchCheck = false );
86  declareProperty("ApplyFading", m_bApplyFading = true );
87  declareProperty("ApplyMVATESQualityCheck", m_bApplyMVATESQualityCheck = false );
88  declareProperty("ApplyInsituCorrection", m_bApplyInsituCorrection = true );
89 }

◆ ~CommonSmearingTool()

CommonSmearingTool::~CommonSmearingTool ( )

Definition at line 94 of file CommonSmearingTool.cxx.

95 {
96  for (auto& mEntry : m_mSF)
97  delete mEntry.second;
98 }

Member Function Documentation

◆ affectingSystematics()

CP::SystematicSet CommonSmearingTool::affectingSystematics ( ) const
virtual

returns: the list of all systematics this tool can be affected by

Implements CP::IReentrantSystematicsTool.

Definition at line 287 of file CommonSmearingTool.cxx.

288 {
290 }

◆ applyCorrection()

CP::CorrectionCode CommonSmearingTool::applyCorrection ( xAOD::TauJet xTau) const
virtual

Apply the correction on a modifyable object.

Implements TauAnalysisTools::ITauSmearingTool.

Definition at line 148 of file CommonSmearingTool.cxx.

149 {
150  // optional consistency check between calo-only pt ("ptTauEnergyScale") and MVA pt ("ptFinalCalib" i.e. "pt", MVA TES is the default calibration)
151  // not recommended until validated in R22: MVA TES always has better resolution than calo-only TES for true taus
152  // in practice this check mostly discards muons faking taus with large track momentum but little energy deposit in the calorimeter:
153  // when enforcing calo-only pt, the muon will likely fail the tau pt cut applied by TauSelectionTool
154 
155  // WARNING: overwriting ptFinalCalib would lead to irreproducibilities upon re-calibration (re-apply in-situ TES on already-calibrated PHYSLITE)
157  bool useCaloPt = false;
158  static const SG::ConstAccessor<float> accPtTauEnergyScale ("ptTauEnergyScale");
159  if(accPtTauEnergyScale.isAvailable(xTau)) {
160  const auto combinedTEStool = dynamic_cast<const TauCombinedTES*>(m_tTauCombinedTES.get());
161  useCaloPt = combinedTEStool->getUseCaloPtFlag(xTau);
162  if (useCaloPt) {
163  // only override pt, keep eta and phi from substructure as it has likely better angular resolution than calo-only
164  ATH_MSG_DEBUG("overriding MVA pt with calo pt");
165  xTau.setP4(xAOD::TauJetParameters::FinalCalib, xTau.ptTauEnergyScale(), xTau.eta(), xTau.phi(), xTau.m());
166  xTau.setP4(xTau.ptTauEnergyScale(), xTau.eta(), xTau.phi(), xTau.m());
167  }
168  }
169  static const SG::Accessor<char> accUseCaloPt("useCaloPt");
170  accUseCaloPt(xTau) = char(useCaloPt);
171  }
172 
173  // step out here if we run on data
174  if (m_bIsData)
175  return CP::CorrectionCode::Ok;
176 
177  // check which true state is requested
179  return CP::CorrectionCode::Ok;
180  }
181 
182  // skip taus which are not 1 or 3 prong
183  if( xTau.nTracks() != 1 && xTau.nTracks() != 3) {
184  return CP::CorrectionCode::Ok;
185  }
186 
187  // get prong extension for histogram name
188  std::string sProng = ConvertProngToString(xTau.nTracks());
189 
190  double dCorrection = 1.;
191  CP::CorrectionCode tmpCorrectionCode;
193  {
194  // get standard scale factor
195  tmpCorrectionCode = getValue("sf"+sProng,
196  xTau,
197  dCorrection);
198  // return correction code if histogram is not available
199  if (tmpCorrectionCode != CP::CorrectionCode::Ok)
200  return tmpCorrectionCode;
201  }
202 
203  // skip further process if systematic set is empty
204  if (!m_sSystematicSet->empty())
205  {
206  // get uncertainties summed in quadrature
207  double dTotalSystematic2 = 0.;
208  double dDirection = 0.;
209  for (auto& syst : *m_sSystematicSet)
210  {
211  // check if systematic is available
212  auto it = m_mSystematicsHistNames.find(syst.basename());
213 
214  // get uncertainty value
215  double dUncertaintySyst = 0.;
216  tmpCorrectionCode = getValue(it->second+sProng,
217  xTau,
218  dUncertaintySyst);
219  // return correction code if histogram is not available
220  if (tmpCorrectionCode != CP::CorrectionCode::Ok)
221  return tmpCorrectionCode;
222 
223  // needed for up/down decision
224  dDirection = syst.parameter();
225 
226  // scale uncertainty with direction, i.e. +/- n*sigma
227  dUncertaintySyst *= dDirection;
228 
229  // square uncertainty and add to total uncertainty
230  dTotalSystematic2 += dUncertaintySyst * dUncertaintySyst;
231  }
232 
233  // now use dDirection to use up/down uncertainty
234  dDirection = (dDirection > 0.) ? 1. : -1.;
235 
236  // finally apply uncertainty (eff * ( 1 +/- \sum )
237  dCorrection *= 1 + dDirection * std::sqrt(dTotalSystematic2);
238  }
239 
240  // finally apply correction
241  // in-situ TES is applied w.r.t. ptFinalCalib, use explicit calibration for pt to avoid irreproducibility upon re-calibration (PHYSLITE)
242  // not required for eta/phi/m that we don't correct (only ptFinalCalib and etaFinalCalib are stored in DAODs)
243  xTau.setP4( xTau.ptFinalCalib() * dCorrection,
244  xTau.eta(), xTau.phi(), xTau.m());
245  return CP::CorrectionCode::Ok;
246 }

◆ applySystematicVariation()

StatusCode CommonSmearingTool::applySystematicVariation ( const CP::SystematicSet sSystematicSet)
virtual

configure this tool for the given list of systematic variations.

any requested systematics that are not affecting this tool will be silently ignored

Implements CP::ISystematicsTool.

Definition at line 312 of file CommonSmearingTool.cxx.

313 {
314  // first check if we already know this systematic configuration
315  auto itSystematicSet = m_mSystematicSets.find(sSystematicSet);
316  if (itSystematicSet != m_mSystematicSets.end())
317  {
318  m_sSystematicSet = &itSystematicSet->first;
319  return StatusCode::SUCCESS;
320  }
321 
322  // sanity checks if systematic set is supported
323  double dDirection = 0.;
324  CP::SystematicSet sSystematicSetAvailable;
325  for (auto& sSyst : sSystematicSet)
326  {
327  // check if systematic is available
328  auto it = m_mSystematicsHistNames.find(sSyst.basename());
329  if (it == m_mSystematicsHistNames.end())
330  {
331  ATH_MSG_VERBOSE("unsupported systematic variation: "<< sSyst.basename()<<"; skipping this one");
332  continue;
333  }
334 
335  if (sSyst.parameter() * dDirection < 0)
336  {
337  ATH_MSG_ERROR("unsupported set of systematic variations, you should either use only \"UP\" or only \"DOWN\" systematics in one set!");
338  ATH_MSG_ERROR("systematic set will not be applied");
339  return StatusCode::FAILURE;
340  }
341  dDirection = sSyst.parameter();
342 
343  if ((m_sRecommendedSystematics.find(sSyst.basename()) != m_sRecommendedSystematics.end()) and sSystematicSet.size() > 1)
344  {
345  ATH_MSG_ERROR("unsupported set of systematic variations, you should not combine \"TAUS_{TRUE|FAKE}_SME_TOTAL\" with other systematic variations!");
346  ATH_MSG_ERROR("systematic set will not be applied");
347  return StatusCode::FAILURE;
348  }
349 
350  // finally add the systematic to the set of systematics to process
351  sSystematicSetAvailable.insert(sSyst);
352  }
353 
354  // store this calibration for future use, and make it current
355  m_sSystematicSet = &m_mSystematicSets.insert(std::pair<CP::SystematicSet,std::string>(sSystematicSetAvailable, sSystematicSet.name())).first->first;
356 
357  return StatusCode::SUCCESS;
358 }

◆ beginEvent()

StatusCode CommonSmearingTool::beginEvent ( )
privatevirtual

Function called when a new events is loaded.

Dummy implementation that can be overridden by the derived tool.

Reimplemented from asg::AsgMetadataTool.

Definition at line 367 of file CommonSmearingTool.cxx.

368 {
369  if (m_bIsConfigured)
370  return StatusCode::SUCCESS;
371 
372  const xAOD::EventInfo* xEventInfo = nullptr;
373  ATH_CHECK(evtStore()->retrieve(xEventInfo,"EventInfo"));
375  m_bIsConfigured = true;
376 
377  return StatusCode::SUCCESS;
378 }

◆ beginInputFile()

StatusCode asg::AsgMetadataTool::beginInputFile ( )
protectedvirtualinherited

Function called when a new input file is opened.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in AsgElectronEfficiencyCorrectionTool, TrigConf::xAODConfigTool, PMGTools::PMGTruthWeightTool, BookkeeperTool, HFORSelectionTool, xAODMaker::FileMetaDataTool, BookkeeperDumperTool, Trig::TrigDecisionTool, xAODMaker::TriggerMenuMetaDataTool, xAODMaker::TruthMetaDataTool, Trig::xAODBunchCrossingTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, and TauAnalysisTools::TauSmearingTool.

Definition at line 180 of file AsgMetadataTool.cxx.

180  {
181 
182  // Return gracefully:
183  return StatusCode::SUCCESS;
184  }

◆ ConvertProngToString()

std::string CommonSmearingTool::ConvertProngToString ( const int  iProngness) const
protected

Definition at line 381 of file CommonSmearingTool.cxx.

382 {
383  return fProngness == 1 ? "_1p" : "_3p";
384 }

◆ correctedCopy()

CP::CorrectionCode CommonSmearingTool::correctedCopy ( const xAOD::TauJet xTau,
xAOD::TauJet *&  xTauCopy 
) const
virtual

Create a corrected copy from a constant tau.

Implements TauAnalysisTools::ITauSmearingTool.

Definition at line 253 of file CommonSmearingTool.cxx.

255 {
256 
257  // A sanity check:
258  if( xTauCopy )
259  {
260  ATH_MSG_WARNING( "Non-null pointer received. "
261  "There's a possible memory leak!" );
262  }
263 
264  // Create a new object:
265  xTauCopy = new xAOD::TauJet();
266  xTauCopy->makePrivateStore( xTau );
267 
268  // Use the other function to modify this object:
269  return applyCorrection( *xTauCopy );
270 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ endInputFile()

StatusCode asg::AsgMetadataTool::endInputFile ( )
protectedvirtualinherited

Function called when the currently open input file got completely processed.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in BookkeeperTool, HFORSelectionTool, xAODMaker::FileMetaDataTool, BookkeeperDumperTool, xAODMaker::TriggerMenuMetaDataTool, and xAODMaker::TruthMetaDataTool.

Definition at line 188 of file AsgMetadataTool.cxx.

188  {
189 
190  // Return gracefully:
191  return StatusCode::SUCCESS;
192  }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ generateSystematicSets()

void CommonSmearingTool::generateSystematicSets ( )
protected

Definition at line 440 of file CommonSmearingTool.cxx.

441 {
442  std::vector<std::string> vInputFilePath;
443  split(m_sInputFilePath,'/',vInputFilePath);
444  std::string sInputFileName = vInputFilePath.back();
445 
446  // creation of basic string for all NPs, e.g. "TAUS_TRUEHADTAU_SME_TES_"
447  std::vector<std::string> vSplitInputFilePath = {};
448  split(sInputFileName,'_',vSplitInputFilePath);
449  std::string sEfficiencyType = vSplitInputFilePath.at(0);
450  std::string sTruthType = vSplitInputFilePath.at(1);
451  std::transform(sEfficiencyType.begin(), sEfficiencyType.end(), sEfficiencyType.begin(), toupper);
452  std::transform(sTruthType.begin(), sTruthType.end(), sTruthType.begin(), toupper);
453  std::string sSystematicBaseString = "TAUS_" + sTruthType + "_SME_" + sEfficiencyType + "_";
454 
455  // set truth type to check for in truth matching
456  if (sTruthType=="TRUEHADTAU") m_eCheckTruth = TauAnalysisTools::TruthHadronicTau;
457  if (sTruthType=="TRUEELECTRON") m_eCheckTruth = TauAnalysisTools::TruthElectron;
458  if (sTruthType=="TRUEMUON") m_eCheckTruth = TauAnalysisTools::TruthMuon;
459  if (sTruthType=="TRUEJET") m_eCheckTruth = TauAnalysisTools::TruthJet;
460 
461  for (auto& mSF : m_mSF)
462  {
463  // parse for nuisance parameter in histogram name
464  std::vector<std::string> vSplitNP = {};
465  split(mSF.first,'_',vSplitNP);
466  std::string sNP;
467  std::string sNPUppercase;
468  if (vSplitNP.size() > 2)
469  {
470  sNP = vSplitNP.at(0)+'_'+vSplitNP.at(1);
471  sNPUppercase = vSplitNP.at(0) + '_' + vSplitNP.at(1);
472  } else {
473  sNP = vSplitNP.at(0);
474  sNPUppercase = vSplitNP.at(0);
475  }
476 
477  // skip nominal scale factors
478  if (sNP == "sf") continue;
479  // skip if non 1p histogram to avoid duplications (TODO: come up with a better solution)
480  if (mSF.first.find("_1p") == std::string::npos) continue;
481 
482  // test if NP starts with a capital letter indicating that this should be recommended
483  bool bIsRecommended = false;
484  if (isupper(sNP.at(0)))
485  bIsRecommended = true;
486 
487  // make sNP uppercase and build final NP entry name
488  std::transform(sNPUppercase.begin(), sNPUppercase.end(), sNPUppercase.begin(), toupper);
489  std::string sSystematicString = sSystematicBaseString + sNPUppercase;
490 
491  // add all found systematics to the AffectingSystematics
493  m_sAffectingSystematics.insert(CP::SystematicVariation (sSystematicString, -1));
494  // only add found uppercase systematics to the RecommendedSystematics
495  if (bIsRecommended)
496  {
499  }
500 
501  ATH_MSG_DEBUG("connected histogram base name " << sNP << " with systematic " << sSystematicString);
502  m_mSystematicsHistNames.insert({sSystematicString,sNP});
503  }
504 }

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void *  ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119  {
120 
121 #ifdef XAOD_STANDALONE
122  // In case we use @c xAOD::TEvent, we have a direct function call
123  // for this.
124  return evtStore()->event()->getKey( ptr );
125 #else
126  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127  return ( proxy == nullptr ? 0 : proxy->sgkey() );
128 #endif // XAOD_STANDALONE
129  }

◆ getName()

const std::string & asg::AsgTool::getName ( const void *  ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106  {
107 
108 #ifdef XAOD_STANDALONE
109  // In case we use @c xAOD::TEvent, we have a direct function call
110  // for this.
111  return evtStore()->event()->getName( ptr );
112 #else
113  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114  static const std::string dummy = "";
115  return ( proxy == nullptr ? dummy : proxy->name() );
116 #endif // XAOD_STANDALONE
117  }

◆ getProperty()

template<class T >
const T* asg::AsgTool::getProperty ( const std::string &  name) const
inherited

Get one of the tool's properties.

◆ getValue()

CP::CorrectionCode CommonSmearingTool::getValue ( const std::string &  sHistName,
const xAOD::TauJet xTau,
double &  dEfficiencyScaleFactor 
) const
protectedvirtual

Definition at line 507 of file CommonSmearingTool.cxx.

510 {
511  TH1* hHist = m_mSF.at(sHistName);
512  if (hHist == nullptr)
513  {
514  ATH_MSG_ERROR("Histogram with name " << sHistName << " was not found in input file.");
516  }
517 
518  double dPt = m_fX(xTau);
519  double dEta = m_fY(xTau);
520 
521  // protect values from underflow bins
522  dPt = std::max(dPt,hHist->GetXaxis()->GetXmin());
523  dEta = std::max(dEta,hHist->GetYaxis()->GetXmin());
524  // protect values from overflow bins (times .999 to keep it inside last bin)
525  dPt = std::min(dPt,hHist->GetXaxis()->GetXmax() * .999);
526  dEta = std::min(dEta,hHist->GetYaxis()->GetXmax() * .999);
527 
528  int iBin = hHist->FindFixBin(dPt,dEta);
529  dEfficiencyScaleFactor = hHist->GetBinContent(iBin);
530 
531  if (m_bApplyFading)
532  {
533  std::string sTitle = hHist->GetTitle();
534  if (!sTitle.empty())
535  {
536  TF1 f("",sTitle.c_str(), 0, 1000);
537  if (sHistName.find("sf_") != std::string::npos)
538  dEfficiencyScaleFactor = (dEfficiencyScaleFactor -1.) *f.Eval(m_fX(xTau)) + 1.;
539  else
540  dEfficiencyScaleFactor *= f.Eval(m_fX(xTau));
541  }
542  }
543  return CP::CorrectionCode::Ok;
544 }

◆ handle()

void asg::AsgMetadataTool::handle ( const Incident &  inc)
protectedvirtualinherited

Function receiving incidents from IncidentSvc/TEvent.

Reimplemented in Trig::TrigDecisionTool.

Definition at line 130 of file AsgMetadataTool.cxx.

130  {
131 
132  // Tell the user what's happening:
133  ATH_MSG_VERBOSE( "Callback received with incident: " << inc.type() );
134 
135  // Call the appropriate member function:
136  if( inc.type() == IncidentType::BeginInputFile ) {
137  m_beginInputFileCalled = true;
138  if( beginInputFile().isFailure() ) {
139  ATH_MSG_FATAL( "Failed to call beginInputFile()" );
140  throw std::runtime_error( "Couldn't call beginInputFile()" );
141  }
142  } else if( inc.type() == IncidentType::EndInputFile ) {
143  if( endInputFile().isFailure() ) {
144  ATH_MSG_FATAL( "Failed to call endInputFile()" );
145  throw std::runtime_error( "Couldn't call endInputFile()" );
146  }
147  } else if( inc.type() == IncidentType::BeginEvent ) {
148  // If the tool didn't catch the begin input file incident for the
149  // first input file of the job, then call the appropriate function
150  // now.
151  if( ! m_beginInputFileCalled ) {
152  m_beginInputFileCalled = true;
153  if( beginInputFile().isFailure() ) {
154  ATH_MSG_FATAL( "Failed to call beginInputFile()" );
155  throw std::runtime_error( "Couldn't call beginInputFile()" );
156  }
157  }
158  if( beginEvent().isFailure() ) {
159  ATH_MSG_FATAL( "Failed to call beginEvent()" );
160  throw std::runtime_error( "Couldn't call beginEvent()" );
161  }
162 
163  #ifdef XAOD_STANDALONE
164  } else if( inc.type() == IncidentType::MetaDataStop ) {
165  if( metaDataStop().isFailure() ) {
166  ATH_MSG_FATAL( "Failed to call metaDataStop()" );
167  throw std::runtime_error( "Couldn't call metaDataStop()" );
168  }
169 
170  #endif // XAOD_STANDALONE
171  } else {
172  ATH_MSG_WARNING( "Unknown incident type received in AsgMetaDataTool: " << inc.type() );
173  }
174 
175  return;
176  }

◆ initialize()

StatusCode CommonSmearingTool::initialize ( )
virtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Reimplemented in TauAnalysisTools::CommonDiTauSmearingTool.

Definition at line 107 of file CommonSmearingTool.cxx.

108 {
109  ATH_MSG_INFO( "Initializing CommonSmearingTool" );
110 
111  // FIXME: do we expect initialize() to be called several times?
112  // only read in histograms once
113  if (m_mSF.empty())
114  {
115  std::string sInputFilePath = PathResolverFindCalibFile(m_sInputFilePath);
116  std::unique_ptr<TFile> fSF( TFile::Open(sInputFilePath.c_str()) );
117  if(fSF == nullptr) {
118  ATH_MSG_FATAL("Could not open file " << sInputFilePath.c_str());
119  return StatusCode::FAILURE;
120  }
121  ReadInputs(fSF.get(), m_mSF);
122  fSF->Close();
123  }
124 
126 
127  // load empty systematic variation by default
128  if (applySystematicVariation(CP::SystematicSet()) != StatusCode::SUCCESS )
129  return StatusCode::FAILURE;
130 
131  // TauCombinedTES tool must be set up when checking compatibility between calo TES and MVA TES
133  {
135  ATH_CHECK(m_tTauCombinedTES.setProperty("WeightFileName", "CombinedTES_R22_Round2.5_v2.root"));
137  }
138 
139  return StatusCode::SUCCESS;
140 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ inputMetaStore()

AsgMetadataTool::MetaStorePtr_t asg::AsgMetadataTool::inputMetaStore ( ) const
inherited

Accessor for the input metadata store.

Definition at line 88 of file AsgMetadataTool.cxx.

88  {
89 
90 #ifdef XAOD_STANDALONE
91  return &m_inputMetaStore;
92 #else // XAOD_STANDALONE
93  return m_inputMetaStore;
94 #endif // XAOD_STANDALONE
95  }

◆ isAffectedBySystematic()

bool CommonSmearingTool::isAffectedBySystematic ( const CP::SystematicVariation systematic) const
virtual

returns: whether this tool is affected by the given systematics

Implements CP::ISystematicsTool.

Definition at line 276 of file CommonSmearingTool.cxx.

277 {
279  return sys.find(systematic) != sys.end();
280 }

◆ metaDataStop()

StatusCode asg::AsgMetadataTool::metaDataStop ( )
protectedvirtualinherited

Function called when the tool should write out its metadata.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in xAODMaker::FileMetaDataTool, BookkeeperTool, BookkeeperDumperTool, xAODMaker::TriggerMenuMetaDataTool, and xAODMaker::TruthMetaDataTool.

Definition at line 204 of file AsgMetadataTool.cxx.

204  {
205 
206  // Return gracefully:
207  return StatusCode::SUCCESS;
208  }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101  {
102 
103  return MSG::name( msg().level() );
104  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ outputMetaStore()

AsgMetadataTool::MetaStorePtr_t asg::AsgMetadataTool::outputMetaStore ( ) const
inherited

Accessor for the output metadata store.

Definition at line 97 of file AsgMetadataTool.cxx.

97  {
98 
99 #ifdef XAOD_STANDALONE
100  return &m_outputMetaStore;
101 #else // XAOD_STANDALONE
102  return m_outputMetaStore;
103 #endif // XAOD_STANDALONE
104  }

◆ print() [1/2]

void asg::AsgTool::print ( ) const
virtualinherited

◆ print() [2/2]

virtual void asg::IAsgTool::print ( ) const
pure virtualinherited

◆ ReadInputs()

template<class T >
void CommonSmearingTool::ReadInputs ( TFile *  fFile,
std::map< std::string, T > &  mMap 
)
protected

Definition at line 388 of file CommonSmearingTool.cxx.

389 {
390  // initialize function pointer
391  m_fX = &finalTauPt;
392  m_fY = &finalTauEta;
393 
394  TKey *kKey;
395  TIter itNext(fFile->GetListOfKeys());
396  while ((kKey = (TKey*)itNext()))
397  {
398  TClass *cClass = gROOT->GetClass(kKey->GetClassName());
399 
400  // parse file content for objects of type TNamed, check their title for
401  // known strings and reset funtion pointer
402  std::string sKeyName = kKey->GetName();
403  if (sKeyName == "Xaxis")
404  {
405  TNamed* tObj = (TNamed*)kKey->ReadObj();
406  std::string sTitle = tObj->GetTitle();
407  delete tObj;
408  if (sTitle == "P" || sTitle == "PFinalCalib")
409  {
410  m_fX = &finalTauP;
411  ATH_MSG_DEBUG("using full momentum for x-axis");
412  }
413  }
414  if (sKeyName == "Yaxis")
415  {
416  TNamed* tObj = (TNamed*)kKey->ReadObj();
417  std::string sTitle = tObj->GetTitle();
418  delete tObj;
419  if (sTitle == "track-eta")
420  {
422  ATH_MSG_DEBUG("using leading track eta for y-axis");
423  }
424  else if (sTitle == "|eta|")
425  {
426  m_fY = &finalTauAbsEta;
427  ATH_MSG_DEBUG("using absolute tau eta for y-axis");
428  }
429  }
430  if (!cClass->InheritsFrom("TH1"))
431  continue;
432  T tObj = (T)kKey->ReadObj();
433  tObj->SetDirectory(0);
434  mMap[sKeyName] = tObj;
435  }
436  ATH_MSG_INFO("data loaded from " << fFile->GetName());
437 }

◆ recommendedSystematics()

CP::SystematicSet CommonSmearingTool::recommendedSystematics ( ) const
virtual

returns: the list of all systematics this tool recommends to use

Implements CP::IReentrantSystematicsTool.

Definition at line 296 of file CommonSmearingTool.cxx.

297 {
299 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setUseIncidents()

void asg::AsgMetadataTool::setUseIncidents ( const bool  flag)
inlineprotectedinherited

Definition at line 132 of file AsgMetadataTool.h.

133  {
135  }

◆ sysInitialize()

StatusCode asg::AsgMetadataTool::sysInitialize ( )
virtualinherited

Function initialising the tool in the correct way in Athena.

This function is used to set up the callbacks from IncidentSvc in Athena at the right time during initialisation, without the user having to do anything special in his/her code.

Reimplemented from AthCommonDataStore< AthCommonMsg< AlgTool > >.

Definition at line 110 of file AsgMetadataTool.cxx.

110  {
111 
112 #ifndef XAOD_STANDALONE
113  if (m_useIncidents) {
114  // Connect to the IncidentSvc:
115  ServiceHandle< IIncidentSvc > incSvc( "IncidentSvc", name() );
116  ATH_CHECK( incSvc.retrieve() );
117 
118  // Set up the right callbacks: don't rethrow exceptions, any failure and we should end
119  incSvc->addListener( this, IncidentType::BeginEvent, 0, false );
120  }
121  // Let the base class do its thing:
122  ATH_CHECK( AlgTool::sysInitialize() );
123 
124 #endif // not XAOD_STANDALONE
125 
126  // Return gracefully:
127  return StatusCode::SUCCESS;
128  }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_bApplyFading

bool TauAnalysisTools::CommonSmearingTool::m_bApplyFading
protected

Definition at line 105 of file CommonSmearingTool.h.

◆ m_bApplyInsituCorrection

bool TauAnalysisTools::CommonSmearingTool::m_bApplyInsituCorrection
protected

Definition at line 107 of file CommonSmearingTool.h.

◆ m_bApplyMVATESQualityCheck

bool TauAnalysisTools::CommonSmearingTool::m_bApplyMVATESQualityCheck
protected

Definition at line 106 of file CommonSmearingTool.h.

◆ m_beginInputFileCalled

bool asg::AsgMetadataTool::m_beginInputFileCalled
privateinherited

Flag helping to discover when the tool misses the opening of the first input file.

Definition at line 126 of file AsgMetadataTool.h.

◆ m_bIsConfigured

bool TauAnalysisTools::CommonSmearingTool::m_bIsConfigured
protected

Definition at line 103 of file CommonSmearingTool.h.

◆ m_bIsData

bool TauAnalysisTools::CommonSmearingTool::m_bIsData
protected

Definition at line 102 of file CommonSmearingTool.h.

◆ m_bSkipTruthMatchCheck

bool TauAnalysisTools::CommonSmearingTool::m_bSkipTruthMatchCheck
protected

Definition at line 104 of file CommonSmearingTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_eCheckTruth

TruthMatchedParticleType TauAnalysisTools::CommonSmearingTool::m_eCheckTruth
protected

Definition at line 111 of file CommonSmearingTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_fX

double(* TauAnalysisTools::CommonSmearingTool::m_fX) (const xAOD::TauJet &xTau)
protected

Definition at line 89 of file CommonSmearingTool.h.

◆ m_fY

double(* TauAnalysisTools::CommonSmearingTool::m_fY) (const xAOD::TauJet &xTau)
protected

Definition at line 90 of file CommonSmearingTool.h.

◆ m_inputMetaStore

MetaStore_t asg::AsgMetadataTool::m_inputMetaStore
privateinherited

Object accessing the input metadata store.

Definition at line 119 of file AsgMetadataTool.h.

◆ m_mSF

std::map<std::string, TH1*> TauAnalysisTools::CommonSmearingTool::m_mSF
protected

Definition at line 82 of file CommonSmearingTool.h.

◆ m_mSystematics

std::map<std::string, int> TauAnalysisTools::CommonSmearingTool::m_mSystematics
protected

Definition at line 85 of file CommonSmearingTool.h.

◆ m_mSystematicSets

std::unordered_map< CP::SystematicSet, std::string > TauAnalysisTools::CommonSmearingTool::m_mSystematicSets
protected

Definition at line 83 of file CommonSmearingTool.h.

◆ m_mSystematicsHistNames

std::map<std::string, std::string> TauAnalysisTools::CommonSmearingTool::m_mSystematicsHistNames
protected

Definition at line 86 of file CommonSmearingTool.h.

◆ m_outputMetaStore

MetaStore_t asg::AsgMetadataTool::m_outputMetaStore
privateinherited

Object accessing the output metadata store.

Definition at line 121 of file AsgMetadataTool.h.

◆ m_sAffectingSystematics

CP::SystematicSet TauAnalysisTools::CommonSmearingTool::m_sAffectingSystematics
protected

Definition at line 112 of file CommonSmearingTool.h.

◆ m_sInputFilePath

std::string TauAnalysisTools::CommonSmearingTool::m_sInputFilePath
protected

Definition at line 101 of file CommonSmearingTool.h.

◆ m_sRecommendedSystematics

CP::SystematicSet TauAnalysisTools::CommonSmearingTool::m_sRecommendedSystematics
protected

Definition at line 113 of file CommonSmearingTool.h.

◆ m_sSystematicSet

const CP::SystematicSet* TauAnalysisTools::CommonSmearingTool::m_sSystematicSet
protected

Definition at line 84 of file CommonSmearingTool.h.

◆ m_tTauCombinedTES

asg::AnaToolHandle<ITauToolBase> TauAnalysisTools::CommonSmearingTool::m_tTauCombinedTES
protected

Definition at line 109 of file CommonSmearingTool.h.

◆ m_useIncidents

bool asg::AsgMetadataTool::m_useIncidents
privateinherited

Definition at line 128 of file AsgMetadataTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
asg::AnaToolHandle::initialize
StatusCode initialize()
initialize the tool
TauAnalysisTools::CommonSmearingTool::ReadInputs
void ReadInputs(TFile *fFile, std::map< std::string, T > &mMap)
Definition: CommonSmearingTool.cxx:388
TauAnalysisTools::TruthElectron
@ TruthElectron
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:100
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
TauCombinedTES::getUseCaloPtFlag
bool getUseCaloPtFlag(const xAOD::TauJet &tau) const
Whether to use calo pt, invoked by TauSmearing tool.
Definition: TauCombinedTES.cxx:185
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
asg::AsgMetadataTool::beginEvent
virtual StatusCode beginEvent()
Function called when a new events is loaded.
Definition: AsgMetadataTool.cxx:196
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
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:97
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CP::SystematicSet::empty
bool empty() const
returns: whether the set is empty
Definition: SystematicSet.h:67
xAOD::TauJet_v3::m
virtual double m() const
The invariant mass of the particle.
TauCombinedTES
Definition: TauCombinedTES.h:19
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
TauAnalysisTools::CommonSmearingTool::m_sSystematicSet
const CP::SystematicSet * m_sSystematicSet
Definition: CommonSmearingTool.h:84
xAOD::TauJet_v3::nTracks
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
Definition: TauJet_v3.cxx:526
skel.it
it
Definition: skel.GENtoEVGEN.py:423
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
TauAnalysisTools::CommonSmearingTool::m_sRecommendedSystematics
CP::SystematicSet m_sRecommendedSystematics
Definition: CommonSmearingTool.h:113
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
asg::AsgMetadataTool::m_beginInputFileCalled
bool m_beginInputFileCalled
Flag helping to discover when the tool misses the opening of the first input file.
Definition: AsgMetadataTool.h:126
SG::ConstAccessor< float >
asg::AsgMetadataTool::endInputFile
virtual StatusCode endInputFile()
Function called when the currently open input file got completely processed.
Definition: AsgMetadataTool.cxx:188
asg::AsgMetadataTool::m_outputMetaStore
MetaStore_t m_outputMetaStore
Object accessing the output metadata store.
Definition: AsgMetadataTool.h:121
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
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
TauAnalysisTools::TruthJet
@ TruthJet
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:101
CP::SystematicVariation
Definition: SystematicVariation.h:47
TauAnalysisTools::Unknown
@ Unknown
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:96
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:172
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
TauAnalysisTools::CommonSmearingTool::m_sInputFilePath
std::string m_sInputFilePath
Definition: CommonSmearingTool.h:101
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TauAnalysisTools::CommonSmearingTool::applyCorrection
virtual CP::CorrectionCode applyCorrection(xAOD::TauJet &xTau) const
Apply the correction on a modifyable object.
Definition: CommonSmearingTool.cxx:148
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
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.
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
xAOD::TauJet_v3::ptTauEnergyScale
double ptTauEnergyScale() const
AthCommonDataStore
Definition: AthCommonDataStore.h:52
TauAnalysisTools::CommonSmearingTool::m_eCheckTruth
TruthMatchedParticleType m_eCheckTruth
Definition: CommonSmearingTool.h:111
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TauAnalysisTools::CommonSmearingTool::m_bApplyFading
bool m_bApplyFading
Definition: CommonSmearingTool.h:105
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:312
asg::AsgMetadataTool::beginInputFile
virtual StatusCode beginInputFile()
Function called when a new input file is opened.
Definition: AsgMetadataTool.cxx:180
master.flag
bool flag
Definition: master.py:29
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:112
asg::AsgMetadataTool::metaDataStop
virtual StatusCode metaDataStop()
Function called when the tool should write out its metadata.
Definition: AsgMetadataTool.cxx:204
CP::SystematicSet::end
const_iterator end() const
description: const iterator to the end of the set
Definition: SystematicSet.h:59
python.xAODType.dummy
dummy
Definition: xAODType.py:4
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
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:109
TauAnalysisTools::CommonSmearingTool::getValue
virtual CP::CorrectionCode getValue(const std::string &sHistName, const xAOD::TauJet &xTau, double &dEfficiencyScaleFactor) const
Definition: CommonSmearingTool.cxx:507
min
#define min(a, b)
Definition: cfImp.cxx:40
TauAnalysisTools::TruthMuon
@ TruthMuon
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:99
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
TauAnalysisTools::CommonSmearingTool::m_bApplyMVATESQualityCheck
bool m_bApplyMVATESQualityCheck
Definition: CommonSmearingTool.h:106
TauAnalysisTools::CommonSmearingTool::m_bIsData
bool m_bIsData
Definition: CommonSmearingTool.h:102
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
asg::AsgMetadataTool::m_inputMetaStore
MetaStore_t m_inputMetaStore
Object accessing the input metadata store.
Definition: AsgMetadataTool.h:119
CP::SystematicSet::insert
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
Definition: SystematicSet.cxx:88
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TauAnalysisTools::CommonSmearingTool::m_bIsConfigured
bool m_bIsConfigured
Definition: CommonSmearingTool.h:103
TauAnalysisTools::CommonSmearingTool::m_fX
double(* m_fX)(const xAOD::TauJet &xTau)
Definition: CommonSmearingTool.h:89
SG::AuxElement::makePrivateStore
void makePrivateStore()
Create a new (empty) private store for this object.
Definition: AuxElement.cxx:172
TauAnalysisTools::CommonSmearingTool::m_fY
double(* m_fY)(const xAOD::TauJet &xTau)
Definition: CommonSmearingTool.h:90
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:431
TauAnalysisTools::CommonSmearingTool::m_mSF
std::map< std::string, TH1 * > m_mSF
Definition: CommonSmearingTool.h:82
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:83
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
TauAnalysisTools::CommonSmearingTool::m_bSkipTruthMatchCheck
bool m_bSkipTruthMatchCheck
Definition: CommonSmearingTool.h:104
a
TList * a
Definition: liststreamerinfos.cxx:10
h
TauAnalysisTools::finalTauAbsEta
double finalTauAbsEta(const xAOD::TauJet &xTau)
return MVA based absolute tau eta
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:127
asg::AsgMetadataTool
Base class for dual-use tools that provide file metadata access.
Definition: AsgMetadataTool.h:48
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:572
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
TauAnalysisTools::CommonSmearingTool::m_bApplyInsituCorrection
bool m_bApplyInsituCorrection
Definition: CommonSmearingTool.h:107
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
TauAnalysisTools::CommonSmearingTool::generateSystematicSets
void generateSystematicSets()
Definition: CommonSmearingTool.cxx:440
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
TauAnalysisTools::CommonSmearingTool::m_mSystematicsHistNames
std::map< std::string, std::string > m_mSystematicsHistNames
Definition: CommonSmearingTool.h:86
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
TauAnalysisTools::CommonSmearingTool::ConvertProngToString
std::string ConvertProngToString(const int iProngness) const
Definition: CommonSmearingTool.cxx:381
TauAnalysisTools::CommonSmearingTool::affectingSystematics
virtual CP::SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by
Definition: CommonSmearingTool.cxx:287
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
TauGNNUtils::Variables::Track::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:525
SG::DataProxy
Definition: DataProxy.h:44
xAOD::TauJetParameters::FinalCalib
@ FinalCalib
Definition: TauDefs.h:346
xAOD::TauJet_v3::ptFinalCalib
double ptFinalCalib() const
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
asg::AnaToolHandle::get
T * get()
access the tool
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
TauAnalysisTools::finalTauEta
double finalTauEta(const xAOD::TauJet &xTau)
return MVA based tau eta
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:120
fitman.k
k
Definition: fitman.py:528
xAOD::EventInfo_v1::eventType
bool eventType(EventType type) const
Check for one particular bitmask value.
ServiceHandle< IIncidentSvc >
TauAnalysisTools::split
void split(const std::string &sInput, const char cDelim, std::vector< std::string > &vOut)
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:23
asg::AsgMetadataTool::m_useIncidents
bool m_useIncidents
Definition: AsgMetadataTool.h:128