ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
PMGTools::PMGHFProductionFractionTool Class Referenceabstract

Implementation for xAOD Truth Weight Tool which retrieves the charm / bottom hadron content of an event and derives an event weight based on the HF production fractions. More...

#include <PMGHFProductionFractionTool.h>

Inheritance diagram for PMGTools::PMGHFProductionFractionTool:
Collaboration diagram for PMGTools::PMGHFProductionFractionTool:

Classes

struct  ParameterSet
 Struct for the production fractions. More...
 

Public Member Functions

 PMGHFProductionFractionTool (const std::string &name)
 Create a proper constructor for Athena. 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, V, H > &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
 
Function(s) implementing the asg::IAsgTool interface
virtual StatusCode initialize () override
 Function initialising the tool. More...
 
Function(s) implementing the ISysTruthWeightTool interface
virtual float getSysWeight (const xAOD::TruthParticleContainer *truthParticles, const CP::SystematicSet &sys) const override
 Implements interface from ISysTruthWeightTool. More...
 
virtual CP::SystematicSet affectingSystematics () const override
 Which systematics have an effect on the tool's behaviour? More...
 
virtual CP::SystematicSet recommendedSystematics () const override
 Copied from SystematicsTool.cxx. More...
 

Protected Member Functions

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...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode setupProductionFractions ()
 Setup weights. More...
 
StatusCode readProductionFractionsFile (const std::string &, std::map< CP::SystematicVariation, std::map< unsigned int, float >> &)
 Read production fractions from input file. More...
 
bool fromBdecay (const xAOD::TruthParticle *particle) const
 Checks if a particle originates from a bottom decay. More...
 
const xAOD::TruthParticlegetInitialParticle (const xAOD::TruthParticle *tp) const
 Loops back the decay chain through particles with the same pdgId (e.g. photon emission) More...
 
void printCurrentProdFractions () const
 Print the current production fractions. More...
 
float getWeight (const xAOD::TruthParticleContainer *truthParticles, const ParameterSet &prod_fracs) const
 
StatusCode setSystematicVariation (const CP::SystematicSet &systConfig, ParameterSet &param) const
 calculate the parameter set for the given systematic More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

std::string m_calibrationAreaPath
 Path to calibration area. More...
 
std::map< std::string, std::string > m_showerGeneratorMap
 MC Shower generator map. More...
 
std::string m_showerGeneratorMapFile
 MC Shower generator map file name. More...
 
std::string m_showerGenerator
 MC Shower generator software (valid options: Pythia8) More...
 
std::string m_charmFilename
 Input file with charm production fractions. More...
 
std::string m_bottomFilename
 Input file with bottom production fractions. More...
 
float m_fiducialPtCut
 The fiducial charm/bottom pT cut (in GeV) More...
 
float m_fiducialEtaCut
 The fiducial charm/bottom eta cut. More...
 
std::map< CP::SystematicVariation, std::map< unsigned int, float > > m_charmProdFractionWeights
 Charm production fraction weights. More...
 
std::map< CP::SystematicVariation, std::map< unsigned int, float > > m_bottomProdFractionWeights
 Bottom production fraction weights. More...
 
CP::SystematicsCache< ParameterSetm_Parameters {this}
 The SystematicsCache object. More...
 
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 beginEvent ()
 Function called when a new events is loaded. More...
 
virtual StatusCode metaDataStop ()
 Function called when the tool should write out its metadata. More...
 

Detailed Description

Implementation for xAOD Truth Weight Tool which retrieves the charm / bottom hadron content of an event and derives an event weight based on the HF production fractions.

Author
Miha Muskinja

Definition at line 25 of file PMGHFProductionFractionTool.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

◆ PMGHFProductionFractionTool()

PMGTools::PMGHFProductionFractionTool::PMGHFProductionFractionTool ( const std::string &  name)

Create a proper constructor for Athena.

Create a constructor for standalone usage

Definition at line 25 of file PMGHFProductionFractionTool.cxx.

25  :
31  m_charmFilename(""),
32  m_bottomFilename(""),
35 {
36  // Calibration area path
37  declareProperty("CalibrationAreaPath", m_calibrationAreaPath = "xAODBTaggingEfficiency/13TeV/HFReweighting-2022-04-19_v1",
38  "Path to the calibration area");
39 
40  // MC Shower generator map
41  declareProperty("ShowerGeneratorMapFile", m_showerGeneratorMapFile = "HFProductionFractionsMap.txt",
42  "Input file name for the MC shower generator map");
43 
44  // MC Shower generator software
45  declareProperty("ShowerGenerator", m_showerGenerator = "",
46  "MC Shower generator software");
47 
48  // The fiducial charm/bottom pT cut (in MeV)
49  declareProperty("FiducialPtCut", m_fiducialPtCut = 5000,
50  "The fiducial charm/bottom pT cut. The recommended value is 5000 (MeV).");
51 
52  // The fiducial charm/bottom eta cut
53  declareProperty("FiducialEtaCut", m_fiducialEtaCut = 2.5,
54  "The fiducial charm/bottom eta cut. The recommended value is 2.5.");
55 }

Member Function Documentation

◆ affectingSystematics()

CP::SystematicSet PMGTools::PMGHFProductionFractionTool::affectingSystematics ( ) const
overridevirtual

Which systematics have an effect on the tool's behaviour?

Systematics set of the weight systematics

Implements CP::IReentrantSystematicsTool.

Definition at line 448 of file PMGHFProductionFractionTool.cxx.

449 {
451  ATH_MSG_ERROR("The production fraction weights were not properly initialized!");
452  throw std::runtime_error("Charm or bottom production fraction weight map is empty!");
453  }
455  for (const auto &kv : m_charmProdFractionWeights) {
456  if(!kv.first.empty())
457  result.insert(kv.first);
458  }
459  for (const auto &kv : m_bottomProdFractionWeights) {
460  if(!kv.first.empty())
461  result.insert(kv.first);
462  }
463 
465  return result;
466 }

◆ beginEvent()

StatusCode asg::AsgMetadataTool::beginEvent ( )
protectedvirtualinherited

Function called when a new events is loaded.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in AsgElectronEfficiencyCorrectionTool, TrigConf::xAODConfigTool, TauAnalysisTools::TauSelectionTool, TauAnalysisTools::DiTauSelectionTool, TauAnalysisTools::CommonSmearingTool, TauAnalysisTools::DiTauEfficiencyCorrectionsTool, Trig::TrigDecisionTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, Trig::TrigConfBunchCrossingTool, xAODMaker::TriggerMenuMetaDataTool, and Trig::xAODBunchCrossingTool.

Definition at line 201 of file AsgMetadataTool.cxx.

201  {
202 
203  // Return gracefully:
204  return StatusCode::SUCCESS;
205  }

◆ 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, BookkeeperDumperTool, Trig::TrigDecisionTool, xAODMaker::TriggerMenuMetaDataTool, xAODMaker::TruthMetaDataTool, Trig::xAODBunchCrossingTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, and TauAnalysisTools::TauSmearingTool.

Definition at line 185 of file AsgMetadataTool.cxx.

185  {
186 
187  // Return gracefully:
188  return StatusCode::SUCCESS;
189  }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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, BookkeeperDumperTool, xAODMaker::TriggerMenuMetaDataTool, and xAODMaker::TruthMetaDataTool.

Definition at line 193 of file AsgMetadataTool.cxx.

193  {
194 
195  // Return gracefully:
196  return StatusCode::SUCCESS;
197  }

◆ 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

◆ fromBdecay()

bool PMGTools::PMGHFProductionFractionTool::fromBdecay ( const xAOD::TruthParticle particle) const
private

Checks if a particle originates from a bottom decay.

Definition at line 283 of file PMGHFProductionFractionTool.cxx.

283  {
284  for (unsigned int i = 0; i < particle->nParents(); i++) {
285  if (particle->parent(i)->isHeavyHadron()) {
286  if (particle->parent(i)->isBottomHadron()) {
287  return true;
288  } else {
289  return fromBdecay(particle->parent(i));
290  }
291  }
292  }
293  return false;
294 }

◆ getInitialParticle()

const xAOD::TruthParticle * PMGTools::PMGHFProductionFractionTool::getInitialParticle ( const xAOD::TruthParticle tp) const
private

Loops back the decay chain through particles with the same pdgId (e.g. photon emission)

Definition at line 296 of file PMGHFProductionFractionTool.cxx.

296  {
297  if (tp->nParents() < 1) {
298  return tp;
299  }
300 
301  const xAOD::TruthParticle *out = nullptr;
302  for (unsigned int i = 0; i < tp->nParents(); i++) {
303  if (tp->parent(i) && (tp->parent(i)->absPdgId() == tp->absPdgId())) {
304  const xAOD::TruthParticle *initialParticle = getInitialParticle(tp->parent(i));
305  if (initialParticle && out && (initialParticle != out)) {
306  // this should never happen, but if it does crash the program
307  throw std::runtime_error("Contradictory information in the truth decay chain!");
308  }
309  out = initialParticle;
310  }
311  }
312 
313  if (out) {
314  return out;
315  }
316  return tp;
317 }

◆ 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.

◆ getSysWeight()

float PMGTools::PMGHFProductionFractionTool::getSysWeight ( const xAOD::TruthParticleContainer truthParticles,
const CP::SystematicSet sys 
) const
overridevirtual

Implements interface from ISysTruthWeightTool.

Implements PMGTools::ISysTruthWeightTool.

Definition at line 379 of file PMGHFProductionFractionTool.cxx.

379  {
380  if (m_showerGenerator == "000000") { return 1.0; }
381  const ParameterSet *prod_fracs = nullptr;
382  ANA_CHECK_THROW (m_Parameters.get(sys, prod_fracs));
383  return getWeight(truthParticles, *prod_fracs);
384 }

◆ getWeight()

float PMGTools::PMGHFProductionFractionTool::getWeight ( const xAOD::TruthParticleContainer truthParticles,
const ParameterSet prod_fracs 
) const
private

Definition at line 319 of file PMGHFProductionFractionTool.cxx.

319  {
320  // Clear vectors
321  std::set<const xAOD::TruthParticle *> bottomHadrons;
322  std::set<const xAOD::TruthParticle *> charmHadrons;
323 
324  // Find truth particles hadrons
325  for (const xAOD::TruthParticle *tp : *truthParticles) {
326  // if (!(tp->status() == 2 || tp->status() == 1)) {
327  // continue;
328  // }
329  if (tp->isBottomHadron())
330  {
331  if (tp->pt() >= m_fiducialPtCut && std::abs(tp->eta()) < m_fiducialEtaCut) {
332  bottomHadrons.insert(getInitialParticle(tp));
333  }
334  }
335  if (tp->isCharmHadron()) {
336  if (!fromBdecay(getInitialParticle(tp)) && tp->pt() >= m_fiducialPtCut && std::abs(tp->eta()) < m_fiducialEtaCut) {
337  charmHadrons.insert(getInitialParticle(tp));
338  }
339  }
340  }
341 
342  // The weight
343  float weight = 1.0;
344 
345  // Calculate the charm weight
346  for (auto *tp : charmHadrons) {
347  int pdgId = tp->absPdgId();
348  float w = 1.0;
349  if (tp->isCharmMeson() && prod_fracs.charmWeights.find(pdgId) != prod_fracs.charmWeights.end()) {
350  w = prod_fracs.charmWeights.at(pdgId);
351  } else if (pdgId == 4122 || // Lambda_c+
352  pdgId == 4232 || // Xi_c+
353  pdgId == 4132 || // Xi_c0
354  pdgId == 4332) { // Omega_c0
355  w = prod_fracs.charmWeights.at(4000);
356  }
357  ATH_MSG_DEBUG("Charm weight for pdgId " << pdgId << ", pT " << tp->pt() << ", eta " << tp->eta() << ": " << w);
358  weight *= w;
359  }
360 
361  // Calculate the bottom weight
362  for (auto *tp : bottomHadrons) {
363  int pdgId = tp->absPdgId();
364  float w = 1.0;
365  if (tp->isBottomMeson() && prod_fracs.bottomWeights.find(pdgId) != prod_fracs.bottomWeights.end()) {
366  w = prod_fracs.bottomWeights.at(pdgId);
367  } else if (pdgId == 5122 || // Lambda_b0
368  pdgId == 5132 || // Xi_b-
369  pdgId == 5232 || // Xi_b0
370  pdgId == 5332) { // Omega_b-
371  w = prod_fracs.bottomWeights.at(5000);
372  }
373  ATH_MSG_DEBUG("Bottom weight for pdgId " << pdgId << ", pT " << tp->pt() << ", eta " << tp->eta() << ": " << w);
374  weight *= w;
375  }
376  return weight;
377 }

◆ handle()

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

Function receiving incidents from IncidentSvc/TEvent.

Reimplemented in Trig::TrigDecisionTool.

Definition at line 135 of file AsgMetadataTool.cxx.

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

◆ initialize()

StatusCode PMGTools::PMGHFProductionFractionTool::initialize ( )
overridevirtual

Function initialising the tool.

Reimplemented from asg::AsgTool.

Definition at line 57 of file PMGHFProductionFractionTool.cxx.

57  {
58  // Tell the user what's happening:
59  ATH_MSG_INFO("Initializing " << name() << "...");
60 
61  // Check for correct settings
62  if (m_showerGenerator.empty())
63  {
64  ATH_MSG_WARNING("The property `ShowerGenerator' was not set!");
65  return StatusCode::FAILURE;
66  }
67 
68  // read input files and calculate weights
69  // populates m_charmProdFractionWeights and m_bottomProdFractionWeights
70  if (m_showerGenerator != "000000") {
72 
73  // setup the SystematicsCache object
74  m_Parameters.initialize(affectingSystematics(),
75  [this](const CP::SystematicSet &sys, ParameterSet &prod_fracs) {
76  return setSystematicVariation(sys, prod_fracs);
77  }
78  );
79 
80  // Register systematics with the registry
82  if (registry.registerSystematics(*this) != StatusCode::SUCCESS) {
83  ATH_MSG_ERROR("Unknown systematic list");
84  return StatusCode::FAILURE;
85  }
86 
87  // print
89 
90  } else {
91  ATH_MSG_WARNING("The property `ShowerGenerator' was set to 000000, which means that the tool will return dummy weights of 1.0");
92  }
93 
94  // Return gracefully
95  return StatusCode::SUCCESS;
96 }

◆ 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 93 of file AsgMetadataTool.cxx.

93  {
94 
95 #ifdef XAOD_STANDALONE
96  return &m_inputMetaStore;
97 #else // XAOD_STANDALONE
98  return m_inputMetaStore;
99 #endif // XAOD_STANDALONE
100  }

◆ 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 BookkeeperTool, BookkeeperDumperTool, xAODMaker::TriggerMenuMetaDataTool, and xAODMaker::TruthMetaDataTool.

Definition at line 209 of file AsgMetadataTool.cxx.

209  {
210 
211  // Return gracefully:
212  return StatusCode::SUCCESS;
213  }

◆ 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 102 of file AsgMetadataTool.cxx.

102  {
103 
104 #ifdef XAOD_STANDALONE
105  return &m_outputMetaStore;
106 #else // XAOD_STANDALONE
107  return m_outputMetaStore;
108 #endif // XAOD_STANDALONE
109  }

◆ print() [1/2]

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

◆ print() [2/2]

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

◆ printCurrentProdFractions()

void PMGTools::PMGHFProductionFractionTool::printCurrentProdFractions ( ) const
private

Print the current production fractions.

Definition at line 386 of file PMGHFProductionFractionTool.cxx.

386  {
387  // MC Shower
388  ATH_MSG_INFO("The tool is currently configured to give weights for " << m_showerGenerator);
389 
390  // Charm production fraction weights
391  ATH_MSG_INFO("Currently set weights for charm production fractions:");
392  for (auto const &generator : m_charmProdFractionWeights) {
393  ATH_MSG_INFO("sys: " << generator.first.name());
394  for (auto const &kv : generator.second) {
395  ATH_MSG_INFO(" - " << kv.first << " " << kv.second);
396  }
397  }
398 
399  // Bottom production fraction weights
400  ATH_MSG_INFO("Currently set weights for bottom production fractions:");
401  for (auto const &generator : m_bottomProdFractionWeights) {
402  ATH_MSG_INFO("sys: " << generator.first.name());
403  for (auto const &kv : generator.second) {
404  ATH_MSG_INFO(" - " << kv.first << " " << kv.second);
405  }
406  }
407 }

◆ readProductionFractionsFile()

StatusCode PMGTools::PMGHFProductionFractionTool::readProductionFractionsFile ( const std::string &  filename,
std::map< CP::SystematicVariation, std::map< unsigned int, float >> &  weights 
)
private

Read production fractions from input file.

Definition at line 98 of file PMGHFProductionFractionTool.cxx.

98  {
99  /* Example file structure:
100  # Charm production fraction from literature (Eur. Phys. J. C (2016) 76:397)
101  411 421 431 4000
102  NOSYS 0.2404 0.6086 0.0802 0.0623
103  PROD_FRAC_CHARM_EIG_1 0.2405 0.6087 0.0770 0.0650
104  PROD_FRAC_CHARM_EIG_2 0.2439 0.6108 0.0779 0.0593
105  PROD_FRAC_CHARM_EIG_3 0.2461 0.6013 0.0808 0.0632
106  */
107  std::ifstream infile(filename);
108  std::string line;
109  int pdg1 = -1, pdg2 = -1, pdg3 = -1, pdg4 = -1;
110  while (std::getline(infile, line)) {
111  std::istringstream iss(line);
112  if (line.rfind("#", 0) == 0 || line.empty()) {
113  continue;
114  }
115  if (pdg1 < 0) {
116  if (!(iss >> pdg1 >> pdg2 >> pdg3 >> pdg4)) {
117  ATH_MSG_ERROR("Invalid formatting: " << line);
118  return StatusCode::FAILURE;
119  }
120  } else {
121  std::string sys;
122  float f1, f2, f3, f4;
123  if (!(iss >> sys >> f1 >> f2 >> f3 >> f4)) {
124  ATH_MSG_ERROR("Invalid formatting: " << line);
125  return StatusCode::FAILURE;
126  }
127  if (sys == "NOSYS") {
128  sys = "";
129  }
130  weights.insert({CP::SystematicVariation(sys), {{pdg1, f1}, {pdg2, f2}, {pdg3, f3}, {pdg4, f4}}});
131  }
132  }
133 
134  // Close file
135  infile.close();
136 
137  // return
138  return StatusCode::SUCCESS;
139 }

◆ recommendedSystematics()

virtual CP::SystematicSet PMGTools::PMGHFProductionFractionTool::recommendedSystematics ( ) const
inlineoverridevirtual

Copied from SystematicsTool.cxx.

Implements CP::IReentrantSystematicsTool.

Definition at line 52 of file PMGHFProductionFractionTool.h.

52 { return affectingSystematics(); };

◆ 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  }

◆ setSystematicVariation()

StatusCode PMGTools::PMGHFProductionFractionTool::setSystematicVariation ( const CP::SystematicSet systConfig,
ParameterSet param 
) const
private

calculate the parameter set for the given systematic

Definition at line 409 of file PMGHFProductionFractionTool.cxx.

409  {
410  if (systConfig.size() > 1) {
411  ATH_MSG_ERROR("Multiple systematic variations in one SystematicsSet are not supported");
412  return StatusCode::FAILURE;
413  }
414 
415  // set charm and bottom weights to nominal by default
417  ATH_MSG_ERROR("Nominal charm weights not found");
418  return StatusCode::FAILURE;
419  }
420 
422  ATH_MSG_ERROR("Nominal bottom weights not found");
423  return StatusCode::FAILURE;
424  }
425 
426  auto charmWeights = m_charmProdFractionWeights.at(CP::SystematicVariation(""));
427  auto bottomWeights = m_bottomProdFractionWeights.at(CP::SystematicVariation(""));
428 
429  // if a sys variation is passed that affects the weights, choose the appropriate weight set
430  if (systConfig.size() == 1) {
431  const CP::SystematicVariation &current_variation = *(systConfig.begin());
432  if (m_charmProdFractionWeights.find(current_variation) != m_charmProdFractionWeights.end()) {
433  charmWeights = m_charmProdFractionWeights.at(current_variation);
434  }
435 
436  if (m_bottomProdFractionWeights.find(current_variation) != m_bottomProdFractionWeights.end()) {
437  bottomWeights = m_bottomProdFractionWeights.at(current_variation);
438  }
439  }
440 
441  // set the ParameterSet (weights set) for use in weight calculation
442  param.charmWeights = std::move(charmWeights);
443  param.bottomWeights = std::move(bottomWeights);
444 
445  return StatusCode::SUCCESS;
446 }

◆ setupProductionFractions()

StatusCode PMGTools::PMGHFProductionFractionTool::setupProductionFractions ( )
private

Setup weights.

Definition at line 141 of file PMGHFProductionFractionTool.cxx.

141  {
142  // Step 0: find available files
143  // ________________________________________________________________
144 
145  // Charm production fractions data file
147  if (mapFilename.empty()) {
148  ATH_MSG_ERROR("Input file not found " << m_showerGeneratorMapFile);
149  return StatusCode::FAILURE;
150  }
151  ATH_MSG_INFO("Found input file " << mapFilename);
152 
153  // Find all available MC generators
154  std::ifstream infile(mapFilename);
155  std::string line;
156  while (std::getline(infile, line)) {
157  std::istringstream iss(line);
158  if (line.rfind("#", 0) == 0 || line.empty()) {
159  continue;
160  }
161 
162  std::string id, name;
163  if (!(iss >> id >> name)) {
164  ATH_MSG_ERROR("Invalid formatting: " << line);
165  return StatusCode::FAILURE;
166  } if (id == "4") {
167  m_charmFilename = std::move(name);
168  } else if (id == "5") {
169  m_bottomFilename = std::move(name);
170  } else {
171  m_showerGeneratorMap[id] = std::move(name);
172  }
173  }
174 
175  // Close file
176  infile.close();
177 
178  // Check if the requested MC shower version is available
180  ATH_MSG_ERROR("MC shower generator " << m_showerGenerator << " not found!");
181  ATH_MSG_INFO("Available generators are:");
182  for (auto &gen : m_showerGeneratorMap) {
183  ATH_MSG_INFO(gen.first);
184  }
185  return StatusCode::FAILURE;
186  }
187 
188  // Step 1: read HF production fractions from literature
189  // ________________________________________________________________
190 
191  // Charm production fractions data file
192  std::string charmFilename = PathResolverFindCalibFile((fs::path(m_calibrationAreaPath) / fs::path(m_charmFilename)).string());
193  if (charmFilename.empty()) {
194  ATH_MSG_ERROR("Input file not found " << m_charmFilename);
195  return StatusCode::FAILURE;
196  }
197  ATH_MSG_INFO("Found input file " << charmFilename);
198 
199  // Bottom production fractions data file
200  std::string bottomFilename = PathResolverFindCalibFile((fs::path(m_calibrationAreaPath) / fs::path(m_bottomFilename)).string());
201  if (bottomFilename.empty()) {
202  ATH_MSG_ERROR("Input file not found " << m_bottomFilename);
203  return StatusCode::FAILURE;
204  }
205  ATH_MSG_INFO("Found input file " << bottomFilename);
206 
207  // Configure the production fractions from files
210 
211  // Step 2: read HF production fractions for a given MC shower
212  // ________________________________________________________________
213 
214  // Read the config files from cvmfs
216  if (filename.empty()) {
217  ATH_MSG_ERROR("Input file not found " << m_showerGeneratorMap[m_showerGenerator]);
218  return StatusCode::FAILURE;
219  }
220  ATH_MSG_INFO("Found input file " << filename);
221 
222  // Configure the weights from the file
223  /* Example file structure:
224  #Sherpa(v2.2.1) (DSID 410250)
225  #PDG ID | Production Fraction
226  511 0.27243
227  521 0.273029
228  531 0.0893853
229  5000 0.365034
230  411 0.142884
231  421 0.379585
232  431 0.113005
233  4000 0.364526
234  */
235  infile = std::ifstream(filename);
236  std::map<unsigned int, float> charm;
237  std::map<unsigned int, float> bottom;
238  while (std::getline(infile, line)) {
239  std::istringstream iss(line);
240  if (line.rfind("#", 0) == 0 || line.empty()) {
241  continue;
242  }
243 
244  int pdgId;
245  float fraction;
246  if (!(iss >> pdgId >> fraction)) {
247  ATH_MSG_ERROR("Invalid formatting: " << line);
248  return StatusCode::FAILURE;
249  }
250  if (pdgId == 4000 || pdgId < 500) {
251  ATH_MSG_DEBUG("Charm meson " << pdgId << " has a fraction of " << fraction);
252  charm[pdgId] = fraction;
253  } else {
254  ATH_MSG_DEBUG("Bottom meson " << pdgId << " has a fraction of " << fraction);
255  bottom[pdgId] = fraction;
256  }
257  }
258 
259  // Close file
260  infile.close();
261 
262  // Step 3: calculate the weight as `w = f(literature) / f(MC)'
263  // ________________________________________________________________
264 
265  // charm weights
266  for (auto &sys : m_charmProdFractionWeights) {
267  for (auto &kv : charm) {
268  m_charmProdFractionWeights[sys.first][kv.first] /= kv.second;
269  }
270  }
271 
272  // bottom weights
273  for (auto &sys : m_bottomProdFractionWeights) {
274  for (auto &kv : bottom) {
275  m_bottomProdFractionWeights[sys.first][kv.first] /= kv.second;
276  }
277  }
278 
279  // Return gracefully
280  return StatusCode::SUCCESS;
281 }

◆ 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 115 of file AsgMetadataTool.cxx.

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

◆ 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_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_bottomFilename

std::string PMGTools::PMGHFProductionFractionTool::m_bottomFilename
private

Input file with bottom production fractions.

Definition at line 96 of file PMGHFProductionFractionTool.h.

◆ m_bottomProdFractionWeights

std::map<CP::SystematicVariation, std::map<unsigned int, float> > PMGTools::PMGHFProductionFractionTool::m_bottomProdFractionWeights
private

Bottom production fraction weights.

Definition at line 108 of file PMGHFProductionFractionTool.h.

◆ m_calibrationAreaPath

std::string PMGTools::PMGHFProductionFractionTool::m_calibrationAreaPath
private

Path to calibration area.

Definition at line 81 of file PMGHFProductionFractionTool.h.

◆ m_charmFilename

std::string PMGTools::PMGHFProductionFractionTool::m_charmFilename
private

Input file with charm production fractions.

Definition at line 93 of file PMGHFProductionFractionTool.h.

◆ m_charmProdFractionWeights

std::map<CP::SystematicVariation, std::map<unsigned int, float> > PMGTools::PMGHFProductionFractionTool::m_charmProdFractionWeights
private

Charm production fraction weights.

Definition at line 105 of file PMGHFProductionFractionTool.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_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_fiducialEtaCut

float PMGTools::PMGHFProductionFractionTool::m_fiducialEtaCut
private

The fiducial charm/bottom eta cut.

Definition at line 102 of file PMGHFProductionFractionTool.h.

◆ m_fiducialPtCut

float PMGTools::PMGHFProductionFractionTool::m_fiducialPtCut
private

The fiducial charm/bottom pT cut (in GeV)

Definition at line 99 of file PMGHFProductionFractionTool.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_outputMetaStore

MetaStore_t asg::AsgMetadataTool::m_outputMetaStore
privateinherited

Object accessing the output metadata store.

Definition at line 121 of file AsgMetadataTool.h.

◆ m_Parameters

CP::SystematicsCache<ParameterSet> PMGTools::PMGHFProductionFractionTool::m_Parameters {this}
private

The SystematicsCache object.

Definition at line 114 of file PMGHFProductionFractionTool.h.

◆ m_showerGenerator

std::string PMGTools::PMGHFProductionFractionTool::m_showerGenerator
private

MC Shower generator software (valid options: Pythia8)

Definition at line 90 of file PMGHFProductionFractionTool.h.

◆ m_showerGeneratorMap

std::map<std::string, std::string> PMGTools::PMGHFProductionFractionTool::m_showerGeneratorMap
private

MC Shower generator map.

Definition at line 84 of file PMGHFProductionFractionTool.h.

◆ m_showerGeneratorMapFile

std::string PMGTools::PMGHFProductionFractionTool::m_showerGeneratorMapFile
private

MC Shower generator map file name.

Definition at line 87 of file PMGHFProductionFractionTool.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.Dso.registry
registry
Definition: Control/AthenaServices/python/Dso.py:158
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:79
PMGTools::PMGHFProductionFractionTool::m_showerGenerator
std::string m_showerGenerator
MC Shower generator software (valid options: Pythia8)
Definition: PMGHFProductionFractionTool.h:90
asg::AsgMetadataTool::beginEvent
virtual StatusCode beginEvent()
Function called when a new events is loaded.
Definition: AsgMetadataTool.cxx:201
get_generator_info.result
result
Definition: get_generator_info.py:21
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:407
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
run.infile
string infile
Definition: run.py:13
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CP::SystematicSet::size
size_t size() const
returns: size of the set
Definition: SystematicSet.h:71
PMGTools::PMGHFProductionFractionTool::m_Parameters
CP::SystematicsCache< ParameterSet > m_Parameters
The SystematicsCache object.
Definition: PMGHFProductionFractionTool.h:114
PMGTools::PMGHFProductionFractionTool::m_bottomProdFractionWeights
std::map< CP::SystematicVariation, std::map< unsigned int, float > > m_bottomProdFractionWeights
Bottom production fraction weights.
Definition: PMGHFProductionFractionTool.h:108
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:70
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
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
ParticleTest.tp
tp
Definition: ParticleTest.py:25
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
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
asg::AsgMetadataTool::endInputFile
virtual StatusCode endInputFile()
Function called when the currently open input file got completely processed.
Definition: AsgMetadataTool.cxx:193
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
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
CP::SystematicVariation
Definition: SystematicVariation.h:47
dq_defect_bulk_create_defects.line
line
Definition: dq_defect_bulk_create_defects.py:27
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
master.gen
gen
Definition: master.py:32
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
PMGTools::PMGHFProductionFractionTool::m_showerGeneratorMapFile
std::string m_showerGeneratorMapFile
MC Shower generator map file name.
Definition: PMGHFProductionFractionTool.h:87
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:190
read_hist_ntuple.f2
f2
Definition: read_hist_ntuple.py:20
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
ANA_CHECK_THROW
#define ANA_CHECK_THROW(EXP)
check whether the given expression was successful, throwing an exception on failure
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:339
xAOD::EgammaParameters::f3
@ f3
fraction of energy reconstructed in 3rd sampling
Definition: EgammaEnums.h:54
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
PMGTools::PMGHFProductionFractionTool::m_showerGeneratorMap
std::map< std::string, std::string > m_showerGeneratorMap
MC Shower generator map.
Definition: PMGHFProductionFractionTool.h:84
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
PMGTools::PMGHFProductionFractionTool::m_calibrationAreaPath
std::string m_calibrationAreaPath
Path to calibration area.
Definition: PMGHFProductionFractionTool.h:81
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PMGTools::PMGHFProductionFractionTool::readProductionFractionsFile
StatusCode readProductionFractionsFile(const std::string &, std::map< CP::SystematicVariation, std::map< unsigned int, float >> &)
Read production fractions from input file.
Definition: PMGHFProductionFractionTool.cxx:98
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
asg::AsgMetadataTool::beginInputFile
virtual StatusCode beginInputFile()
Function called when a new input file is opened.
Definition: AsgMetadataTool.cxx:185
master.flag
bool flag
Definition: master.py:29
CalibDbCompareRT.dummy
dummy
Definition: CalibDbCompareRT.py:59
PMGTools::PMGHFProductionFractionTool::affectingSystematics
virtual CP::SystematicSet affectingSystematics() const override
Which systematics have an effect on the tool's behaviour?
Definition: PMGHFProductionFractionTool.cxx:448
asg::AsgMetadataTool::metaDataStop
virtual StatusCode metaDataStop()
Function called when the tool should write out its metadata.
Definition: AsgMetadataTool.cxx:209
PMGTools::PMGHFProductionFractionTool::setSystematicVariation
StatusCode setSystematicVariation(const CP::SystematicSet &systConfig, ParameterSet &param) const
calculate the parameter set for the given systematic
Definition: PMGHFProductionFractionTool.cxx:409
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
PMGTools::PMGHFProductionFractionTool::fromBdecay
bool fromBdecay(const xAOD::TruthParticle *particle) const
Checks if a particle originates from a bottom decay.
Definition: PMGHFProductionFractionTool.cxx:283
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
PMGTools::PMGHFProductionFractionTool::m_fiducialPtCut
float m_fiducialPtCut
The fiducial charm/bottom pT cut (in GeV)
Definition: PMGHFProductionFractionTool.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
PMGTools::PMGHFProductionFractionTool::getInitialParticle
const xAOD::TruthParticle * getInitialParticle(const xAOD::TruthParticle *tp) const
Loops back the decay chain through particles with the same pdgId (e.g. photon emission)
Definition: PMGHFProductionFractionTool.cxx:296
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
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
PMGTools::PMGHFProductionFractionTool::m_fiducialEtaCut
float m_fiducialEtaCut
The fiducial charm/bottom eta cut.
Definition: PMGHFProductionFractionTool.h:102
PMGTools::PMGHFProductionFractionTool::printCurrentProdFractions
void printCurrentProdFractions() const
Print the current production fractions.
Definition: PMGHFProductionFractionTool.cxx:386
runIDPVM.pdgId
pdgId
Definition: runIDPVM.py:91
weights
Definition: herwig7_interface.h:38
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:283
PMGTools::PMGHFProductionFractionTool::getWeight
float getWeight(const xAOD::TruthParticleContainer *truthParticles, const ParameterSet &prod_fracs) const
Definition: PMGHFProductionFractionTool.cxx:319
mc.generator
generator
Configure Herwig7 These are the commands corresponding to what would go into the regular Herwig infil...
Definition: mc.MGH7_FxFx_H71-DEFAULT_test.py:18
a
TList * a
Definition: liststreamerinfos.cxx:10
h
asg::AsgMetadataTool
Base class for dual-use tools that provide file metadata access.
Definition: AsgMetadataTool.h:48
PMGTools::PMGHFProductionFractionTool::m_charmFilename
std::string m_charmFilename
Input file with charm production fractions.
Definition: PMGHFProductionFractionTool.h:93
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CP::SystematicRegistry
This module implements the central registry for handling systematic uncertainties with CP tools.
Definition: SystematicRegistry.h:25
CP::SystematicSet::begin
const_iterator begin() const
description: const iterator to the beginning of the set
Definition: SystematicSet.h:55
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:23
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
PMGTools::PMGHFProductionFractionTool::setupProductionFractions
StatusCode setupProductionFractions()
Setup weights.
Definition: PMGHFProductionFractionTool.cxx:141
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:198
SG::DataProxy
Definition: DataProxy.h:45
PMGTools::PMGHFProductionFractionTool::m_charmProdFractionWeights
std::map< CP::SystematicVariation, std::map< unsigned int, float > > m_charmProdFractionWeights
Charm production fraction weights.
Definition: PMGHFProductionFractionTool.h:105
fitman.k
k
Definition: fitman.py:528
PMGTools::PMGHFProductionFractionTool::m_bottomFilename
std::string m_bottomFilename
Input file with bottom production fractions.
Definition: PMGHFProductionFractionTool.h:96
CP::SystematicRegistry::getInstance
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Definition: SystematicRegistry.cxx:25
read_hist_ntuple.f1
f1
Definition: read_hist_ntuple.py:4
ServiceHandle< IIncidentSvc >
asg::AsgMetadataTool::m_useIncidents
bool m_useIncidents
Definition: AsgMetadataTool.h:128