|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef EVGENPRODTOOLS_HEPMCWEIGHTSVC_H
6 #define EVGENPRODTOOLS_HEPMCWEIGHTSVC_H
16 #include "GaudiKernel/ToolHandle.h"
27 using base_class::base_class;
45 const EventContext& ctx = Gaudi::Hive::currentContext())
override;
52 weightNames (
const EventContext& ctx = Gaudi::Hive::currentContext())
override;
58 virtual std::vector<std::string>
59 weightNameVec (
const EventContext& ctx = Gaudi::Hive::currentContext())
override;
69 unsigned long getChanNum (
const EventContext& ctx)
const;
92 {
this,
"IOVDbMetaDataTool",
"IOVDbMetaDataTool" };
97 {
this,
"Enable",
true,
"If false, will return failure on loadWeights" };
127 {
this,
"EventInfoKey",
"EventInfo",
"SG key for EventInfo object." };
Property holding a SG store/key/clid from which a ReadHandle is made.
size_t m_nextWeight
Index of next set of weights to overwrite.
static const unsigned int NWEIGHTS
Array of weights.
Gaudi::Property< bool > m_enabled
PublicToolHandle< IIOVDbMetaDataTool > m_metaDataTool
Handle to metadata tool.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Used to get MC channel for the current event.
Service to read/write HepMC's WeightContainer key names from/to IOVMetaDataContainers author: will bu...
virtual StatusCode initialize() override
Standard Gaudi initialize.
unsigned int loadWeights(unsigned long chanNum)
Try to load weight names from metadata.
WeightInfo m_weights[NWEIGHTS]
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< std::string > m_weightNameVec
Sorted vector of weight names.
unsigned int getWeightIndex(const EventContext &ctx)
Return the index in m_weights for the current event.
WeightMap m_weightNames
Map of weight names.
virtual StatusCode setWeightNames(const WeightMap &weightNames, const EventContext &ctx=Gaudi::Hive::currentContext()) override
Record weight names to metadata if none have yet been set.
unsigned long getChanNum(const EventContext &ctx) const
Return the ‘channel number’ for the current event.
virtual WeightMap weightNames(const EventContext &ctx=Gaudi::Hive::currentContext()) override
Return the current weight names.
virtual std::vector< std::string > weightNameVec(const EventContext &ctx=Gaudi::Hive::currentContext()) override
Return the current weight names.
unsigned long m_chanNum
Channel number for this set of weights.
std::mutex m_mutex
Serialize access to this service.
void fillVec()
Initialize sorted vector from map.