ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
BookkeeperTool Class Reference

#include <BookkeeperTool.h>

Inheritance diagram for BookkeeperTool:
Collaboration diagram for BookkeeperTool:

Public Member Functions

 BookkeeperTool (const std::string &name="BookkeeperTool")
 Declare the correct constructor for Athena. More...
 
virtual ~BookkeeperTool ()=default
 Destructor. More...
 
virtual StatusCode initialize () override
 Standard reimplemented functions. More...
 
virtual StatusCode metaDataStop () override
 Function called when the tool should prepare to write its metadata. More...
 
virtual StatusCode beginInputFile () override
 Function called when a new input file is opened. More...
 
virtual StatusCode endInputFile () override
 Function called when the currently open input file got completely processed. More...
 
virtual StatusCode beginInputFile (const SG::SourceID &source) override
 Function called when a new input file is opened. More...
 
virtual StatusCode endInputFile (const SG::SourceID &source) override
 Function called when the currently open input file got completely processed. 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Gaudi boilerplate. 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 copyInputContainersToOutput (CutBookkeepersLocalCache &target, const SG::SourceID &source="")
 Copy input containers to the output. More...
 
StatusCode copyCutflowFromService ()
 Fill Cutflow information from the service. More...
 
StatusCode loadXAODMetaData ()
 Initialisation helpers. More...
 
StatusCode loadPOOLMetaData ()
 
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

ServiceHandle< ICutFlowSvcm_cutFlowSvc { this, "CutFlowSvc", "CutFlowSvc/CutFlowSvc", "Pointer to the CutFlowSvc"}
 Pointer to the public CutFlowSvc interface. More...
 
CutFlowSvcm_cutFlowSvcPrivate {}
 Direct pointer to the CutFlowSvc for "private" methods access. More...
 
Gaudi::Property< std::string > m_inputCollName
 The name of the input CutBookkeeperContainer. More...
 
Gaudi::Property< std::string > m_outputCollName
 The name of the output CutBookkeeperContainer. More...
 
size_t m_numberOfWeightVariations {}
 Number of event weight variations. More...
 
std::unordered_map< SG::SourceID, CutBookkeepersLocalCachem_inputContainers
 Input CutBookkeeperContainers. More...
 
CutBookkeepersLocalCache m_completeContainers
 Local CutBookkeeperContainers. More...
 
CutBookkeepersLocalCache m_incompleteContainers
 
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 beginEvent ()
 Function called when a new events is loaded. More...
 

Detailed Description

Definition at line 42 of file BookkeeperTool.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

◆ BookkeeperTool()

BookkeeperTool::BookkeeperTool ( const std::string &  name = "BookkeeperTool")

Declare the correct constructor for Athena.

Standard Service Constructor

Definition at line 25 of file BookkeeperTool.cxx.

27 {
28 #ifndef XAOD_STANDALONE
29  declareInterface< ::IMetaDataTool >( this );
30 #endif // XAOD_STANDALONE
31 }

◆ ~BookkeeperTool()

virtual BookkeeperTool::~BookkeeperTool ( )
virtualdefault

Destructor.

Member Function Documentation

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

196  {
197 
198  // Return gracefully:
199  return StatusCode::SUCCESS;
200  }

◆ beginInputFile() [1/2]

virtual StatusCode BookkeeperTool::beginInputFile ( )
inlineoverridevirtual

Function called when a new input file is opened.

Dummy implementation that can be overridden by the derived tool.

Reimplemented from asg::AsgMetadataTool.

Definition at line 66 of file BookkeeperTool.h.

66 {return StatusCode::SUCCESS;}

◆ beginInputFile() [2/2]

StatusCode BookkeeperTool::beginInputFile ( const SG::SourceID sid)
overridevirtual

Function called when a new input file is opened.

Implements IMetaDataTool.

Definition at line 54 of file BookkeeperTool.cxx.

56 {
57  // OPENING NEW INPUT FILE
58  // Things to do:
59  // 1) Load CutBookkeepers from input file
60  // a) if incomplete from input, directly propagate to output
61  // b) if complete from input, wait for EndInputFile to decide what to do in output
62 
63  // Get number of event weight variations if needed
64  if (m_numberOfWeightVariations == 0) {
65  ATH_MSG_DEBUG("Determining number of weight variations");
66 #ifndef GENERATIONBASE
67  if (inputMetaStore()->contains<xAOD::TruthMetaDataContainer>("TruthMetaData")) {
69  if (!status.isSuccess()) {
70  if (status.isRecoverable()) {
72  } else {
73  return StatusCode::FAILURE;
74  }
75  }
76  } else {
78  }
79 #else
81 #endif
82 
83  if (m_numberOfWeightVariations == 0) {
84  ATH_MSG_ERROR("Could not determine the number of weight variations");
85  return StatusCode::FAILURE;
86  }
87 
88  ATH_MSG_INFO("Using number of event weight variations " << m_numberOfWeightVariations);
89 
90 #ifndef XAOD_STANDALONE
92 #endif
93  }
94 
95 #ifdef XAOD_STANDALONE
96  SG::SourceID source{"file"};
97 #endif
98 
99  // Prepare local cache
100  ATH_MSG_INFO("Preparing local cache for source '" << source << "' with " << m_numberOfWeightVariations << " variations");
103 
104  // Check if a local container is there. IT SHOULD NOT BE
105  auto sit = m_inputContainers.find(source);
106  if (sit != m_inputContainers.end()) {
107  ATH_MSG_ERROR("Undefined behaviour: this file has already been processed");
108  return StatusCode::FAILURE;
109  }
110 
111  const xAOD::CutBookkeeperContainer *inputCollection{};
112  // Get the incomplete bookkeeper collections of the input metadata store
113  std::string incompleteCollName = "Incomplete" + m_inputCollName;
114  if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(incompleteCollName)) {
115  for (size_t i{}; i < m_numberOfWeightVariations; ++i) {
116  std::string name = incompleteCollName;
117  if (i != 0) {
118  name.append("_weight_");
119  name.append(std::to_string(i));
120  }
121  if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(name)
122  && inputMetaStore()->retrieve(inputCollection, name).isSuccess()) {
124  }
125  }
126  ATH_MSG_DEBUG("Successfully merged input incomplete bookkeepers with output");
127  } else {
128  ATH_MSG_INFO("No incomplete bookkeepers with name '" << incompleteCollName << "' in this file");
129  }
130 
131  // Get the complete bookkeeper collections of the input metadata store
132  if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(m_inputCollName)) {
133  // Create the temporary container
136 
137  for (size_t i{}; i < m_numberOfWeightVariations; ++i) {
138  std::string name = m_inputCollName;
139  if (i != 0) {
140  name.append("_weight_");
141  name.append(std::to_string(i));
142  }
143  if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(name)
144  && inputMetaStore()->retrieve(inputCollection, name).isSuccess()) {
145  xAOD::CutFlowHelpers::updateContainer(it->second.at(i), inputCollection);
146  }
147  }
148  ATH_MSG_DEBUG("Successfully copied complete bookkeepers to temp container");
149  } else {
150  ATH_MSG_INFO("No complete bookkeepers with name '" << m_inputCollName.value() << "' in this file");
151  }
152 
153  return StatusCode::SUCCESS;
154 }

◆ copyCutflowFromService()

StatusCode BookkeeperTool::copyCutflowFromService ( )
private

Fill Cutflow information from the service.

Definition at line 269 of file BookkeeperTool.cxx.

270 {
271 #ifndef XAOD_STANDALONE
272  ATH_MSG_DEBUG("Copying cutflow from CutFlowSvc");
273 
274  // Get the bookkeeper from the current processing
276  if (!cache.empty()) {
277  ATH_MSG_DEBUG("Cache size: " << cache.size());
278 
279  // sync the size
282 
283  for (std::size_t i = 0; i < cache.size(); ++i) {
285  }
286  } else {
287  ATH_MSG_ERROR("No cutflow container in the CutFlowSvc");
288  return StatusCode::FAILURE;
289  }
290 #endif
291 
292  return StatusCode::SUCCESS;
293 }

◆ copyInputContainersToOutput()

StatusCode BookkeeperTool::copyInputContainersToOutput ( CutBookkeepersLocalCache target,
const SG::SourceID source = "" 
)
private

Copy input containers to the output.

Definition at line 232 of file BookkeeperTool.cxx.

234 {
236 
237  if (msgLvl(MSG::DEBUG)) {
238  ATH_MSG_DEBUG("Available sources:");
239  for (const auto &[sourceID, list] : m_inputContainers) {
240  ATH_MSG_DEBUG(" " << sourceID);
241  }
242  }
243 
244  if (!source.empty()) {
245  auto it = m_inputContainers.find(source);
246  if (it == m_inputContainers.end()) {
247  ATH_MSG_DEBUG("No input containers for this file");
248  return StatusCode::SUCCESS;
249  }
250 
251  for (std::size_t i = 0; i < it->second.size(); ++i) {
253  }
254  m_inputContainers.erase(it);
255 
256  return StatusCode::SUCCESS;
257  }
258 
259  for (auto &[s, list] : m_inputContainers) {
260  for (std::size_t i = 0; i < list.size(); ++i) {
262  }
263  }
264  m_inputContainers.clear();
265 
266  return StatusCode::SUCCESS;
267 }

◆ 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() [1/2]

virtual StatusCode BookkeeperTool::endInputFile ( )
inlineoverridevirtual

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

Dummy implementation that can be overridden by the derived tool.

Reimplemented from asg::AsgMetadataTool.

Definition at line 67 of file BookkeeperTool.h.

67 {return StatusCode::SUCCESS;}

◆ endInputFile() [2/2]

StatusCode BookkeeperTool::endInputFile ( const SG::SourceID sid)
overridevirtual

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

Implements IMetaDataTool.

Definition at line 159 of file BookkeeperTool.cxx.

161 {
162 #ifdef XAOD_STANDALONE
163  SG::SourceID source{"file"};
164 #endif
165  ATH_MSG_INFO("Copying input containers for source '" << source << "'");
167 
168  return StatusCode::SUCCESS;
169 }

◆ 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

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

◆ 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 BookkeeperTool::initialize ( )
overridevirtual

Standard reimplemented functions.

Reimplemented from asg::AsgTool.

Definition at line 34 of file BookkeeperTool.cxx.

35 {
36  ATH_MSG_DEBUG("Initializing " << name());
37 
38  ATH_MSG_DEBUG("InputCollName = " << m_inputCollName);
39  ATH_MSG_DEBUG("OutputCollName = " << m_outputCollName);
40 
41 #ifndef XAOD_STANDALONE
42  ATH_CHECK(m_cutFlowSvc.retrieve());
43  // Access "private" CutFlowSvc methods
44  m_cutFlowSvcPrivate = dynamic_cast<CutFlowSvc *>(&*(m_cutFlowSvc));
45 #endif
46 
47  return StatusCode::SUCCESS;
48 }

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

◆ interfaceID()

const InterfaceID & IMetaDataTool::interfaceID ( )
inlinestaticinherited

Gaudi boilerplate.

Definition at line 39 of file IMetaDataTool.h.

39  {
40  static const InterfaceID IID("IMetaDataTool", 1, 0);
41  return(IID);
42 }

◆ loadPOOLMetaData()

StatusCode BookkeeperTool::loadPOOLMetaData ( )
private

Definition at line 363 of file BookkeeperTool.cxx.

364 {
365  // AnalysisBase can only use the xAOD::TruthMetaDataContainer, so skip this
366 #ifdef XAOD_STANDALONE
367  return StatusCode::SUCCESS;
368 #else
369 
370  const IOVMetaDataContainer *container
371  = inputMetaStore()->tryConstRetrieve<IOVMetaDataContainer>("/Generation/Parameters");
372  if (container == nullptr) {
373  // set variations to 1 and exit quietly...
375  return StatusCode::SUCCESS;
376  }
377  // payload is a collection of CondAttrListCollections
378  // only look a the first one, assuming it exists, and within that only look at the first channel;
379  if (!(container->payloadContainer()->size() > 0
380  && container->payloadContainer()->at(0)->size() > 0)) {
381  return StatusCode::FAILURE;
382  }
383 
384  // we take the first collection of weights
385  // TODO: improve this
387  const coral::Attribute& attr
388  = container->payloadContainer()->at(0)->attributeList(chanNum)["HepMCWeightNames"];
389 
390  ATH_MSG_DEBUG("Attempting to load weight meta data from /Generation/Parameters");
391  std::map<std::string, int> truthWeightMap;
392  ATH_CHECK(Gaudi::Parsers::parse(truthWeightMap, attr.data<std::string>()));
393 
394  m_numberOfWeightVariations = truthWeightMap.size();
395 
396  return StatusCode::SUCCESS;
397 #endif // XAOD_STANDALONE
398 }

◆ loadXAODMetaData()

StatusCode BookkeeperTool::loadXAODMetaData ( )
private

Initialisation helpers.

Definition at line 296 of file BookkeeperTool.cxx.

297 {
298 #ifdef GENERATIONBASE
299  return StatusCode::RECOVERABLE;
300 #else
301 
302  // Try to load MC channel number from file metadata
303  ATH_MSG_DEBUG("Attempting to retrieve MC channel number...");
304  const xAOD::FileMetaData *fileMetaData{};
306  if (inputMetaStore()->contains<xAOD::FileMetaData>("FileMetaData")) {
307  ATH_CHECK(inputMetaStore()->retrieve(fileMetaData, "FileMetaData"));
308  float fltChannelNumber{-1};
309  if (fileMetaData->value(xAOD::FileMetaData::mcProcID, fltChannelNumber)) {
310  mcChannelNumber = static_cast<uint32_t>(fltChannelNumber);
311  }
312  }
313  if (mcChannelNumber == uint32_t(-1)) {
314  ATH_MSG_WARNING("... MC channel number could not be loaded from FileMetaData");
315 #ifdef XAOD_STANDALONE
316  mcChannelNumber = 0;
317 #else
318  return StatusCode::RECOVERABLE;
319 #endif
320  }
321 
322  // Find the correct truth meta data object
323  ATH_MSG_DEBUG("Attempting to load weight meta data from xAOD TruthMetaData for channel " << mcChannelNumber);
324  const xAOD::TruthMetaDataContainer *metaDataContainer{};
325  ATH_CHECK(inputMetaStore()->retrieve(metaDataContainer, "TruthMetaData"));
326 
327  // If we only have one metadata item take MC channel from there if needed
328  if (mcChannelNumber == 0 && metaDataContainer->size() == 1) {
329  mcChannelNumber = metaDataContainer->at(0)->mcChannelNumber();
330  ATH_MSG_WARNING("... MC channel number taken from the metadata as " << mcChannelNumber);
331  }
332 
333  auto itTruthMetaDataPtr = std::find_if(metaDataContainer->begin(), metaDataContainer->end(),
334  [mcChannelNumber] (const auto& it) { return it->mcChannelNumber() == mcChannelNumber; }
335  );
336 
337  // If no such object is found then return
338  if (itTruthMetaDataPtr == metaDataContainer->end()) {
339 #ifdef XAOD_STANDALONE
341  ATH_MSG_DEBUG("Could not load weight meta data! Assuming 1 variation.");
342  return StatusCode::SUCCESS;
343 #else
344  ATH_MSG_DEBUG("Could not load weight meta data from TruthMetaData!");
345  return StatusCode::RECOVERABLE;
346 #endif
347  }
348 
349  // Update cached weight data
350  const std::vector<std::string> &truthWeightNames = (*itTruthMetaDataPtr)->weightNames();
351 
352  m_numberOfWeightVariations = truthWeightNames.size();
353  if (m_numberOfWeightVariations == 0) {
354  ATH_MSG_DEBUG("No variations present, setting to 1.");
356  }
357 
358  return StatusCode::SUCCESS;
359 #endif
360 }

◆ metaDataStop()

StatusCode BookkeeperTool::metaDataStop ( )
overridevirtual

Function called when the tool should prepare to write its metadata.

Implements IMetaDataTool.

Definition at line 171 of file BookkeeperTool.cxx.

172 {
173  // TERMINATING THE JOB (EndRun)
174  // Things to do:
175  // 1) Create new incomplete CutBookkeepers if relevant
176  // 2) Copy cutflow from the service
177  // 3) Copy containers to output
178 
179  // All files that have not been fully processed are incomplete
181 
182  // Copy cutflow from the service
184 
185  // Write out the containers
186  for (std::size_t i = 0; i < m_completeContainers.size(); ++i) {
187  std::string name = m_outputCollName;
188  if (i != 0) {
189  name.append("_weight_");
190  name.append(std::to_string(i));
191  }
192  std::string incompleteName = "Incomplete" + name;
193 
194  // In MP we might already have them written out
195  if (outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(name)) {
196  xAOD::CutBookkeeperContainer *complete{};
197  if (!outputMetaStore()->retrieve(complete, name).isSuccess()) {
198  ATH_MSG_ERROR("Could not get " << name << " CutBookkeepers from output MetaDataStore");
199  return StatusCode::FAILURE;
200  }
202  } else {
203  ATH_CHECK(outputMetaStore()->record(std::move(m_completeContainers.cont[i]), name));
204  ATH_CHECK(outputMetaStore()->record(std::move(m_completeContainers.aux[i]), name + "Aux."));
205  }
206 
207  if (outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(incompleteName)) {
209  if (!outputMetaStore()->retrieve(incomplete, incompleteName).isSuccess()) {
210  ATH_MSG_ERROR("Could not get " << incompleteName << " CutBookkeepers from output MetaDataStore");
211  return StatusCode::FAILURE;
212  }
214  } else {
215  // Only write non-empty incomplete containers for variations
216  if (i == 0 || !m_incompleteContainers.at(i)->empty()) {
217  ATH_CHECK(outputMetaStore()->record(std::move(m_incompleteContainers.cont[i]), incompleteName));
218  ATH_CHECK(outputMetaStore()->record(std::move(m_incompleteContainers.aux[i]), incompleteName + "Aux."));
219  }
220  }
221  }
222 
225 
226  ATH_MSG_INFO("Successfully copied CutBookkeepers to the output MetaDataStore");
227 
228  return StatusCode::SUCCESS;
229 }

◆ 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()

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

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

CutBookkeepersLocalCache BookkeeperTool::m_completeContainers
private

Local CutBookkeeperContainers.

Definition at line 106 of file BookkeeperTool.h.

◆ m_cutFlowSvc

ServiceHandle<ICutFlowSvc> BookkeeperTool::m_cutFlowSvc { this, "CutFlowSvc", "CutFlowSvc/CutFlowSvc", "Pointer to the CutFlowSvc"}
private

Pointer to the public CutFlowSvc interface.

Definition at line 86 of file BookkeeperTool.h.

◆ m_cutFlowSvcPrivate

CutFlowSvc* BookkeeperTool::m_cutFlowSvcPrivate {}
private

Direct pointer to the CutFlowSvc for "private" methods access.

Definition at line 88 of file BookkeeperTool.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_incompleteContainers

CutBookkeepersLocalCache BookkeeperTool::m_incompleteContainers
private

Definition at line 107 of file BookkeeperTool.h.

◆ m_inputCollName

Gaudi::Property<std::string> BookkeeperTool::m_inputCollName
private
Initial value:
{this, "InputCollName", "CutBookkeepers",
"The default name of the xAOD::CutBookkeeperContainer for input files"}

The name of the input CutBookkeeperContainer.

Definition at line 92 of file BookkeeperTool.h.

◆ m_inputContainers

std::unordered_map<SG::SourceID, CutBookkeepersLocalCache> BookkeeperTool::m_inputContainers
private

Input CutBookkeeperContainers.

Definition at line 103 of file BookkeeperTool.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_numberOfWeightVariations

size_t BookkeeperTool::m_numberOfWeightVariations {}
private

Number of event weight variations.

Definition at line 100 of file BookkeeperTool.h.

◆ m_outputCollName

Gaudi::Property<std::string> BookkeeperTool::m_outputCollName
private
Initial value:
{this, "OutputCollName", "CutBookkeepers",
"The default name of the xAOD::CutBookkeeperContainer for output files"}

The name of the output CutBookkeeperContainer.

Definition at line 96 of file BookkeeperTool.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_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
IOVMetaDataContainer::payloadContainer
const IOVPayloadContainer * payloadContainer() const
Access to payload container.
Definition: IOVMetaDataContainer.h:141
IOVPayloadContainer::at
CondAttrListCollection * at(unsigned int i) const
Element access.
Definition: IOVPayloadContainer.h:128
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
IOVMetaDataContainer
This class is a container for conditions data. It is intended to be used to store conditions data fro...
Definition: IOVMetaDataContainer.h:37
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
Gaudi::Parsers::parse
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)
Definition: CaloGPUClusterAndCellDataMonitorOptions.h:284
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CutFlowSvc::getCutBookkeepers
const CutBookkeepersLocalCache & getCutBookkeepers() const
Get CutBookkeepers cache.
Definition: CutFlowSvc.cxx:385
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
BookkeeperTool::m_incompleteContainers
CutBookkeepersLocalCache m_incompleteContainers
Definition: BookkeeperTool.h:107
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
CutBookkeepersLocalCache::size
std::size_t size() const
Definition: CutBookkeepersLocalCache.h:20
skel.it
it
Definition: skel.GENtoEVGEN.py:396
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::inputMetaStore
MetaStorePtr_t inputMetaStore() const
Accessor for the input metadata store.
Definition: AsgMetadataTool.cxx:88
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
CutBookkeepersLocalCache::cont
std::vector< std::unique_ptr< xAOD::CutBookkeeperContainer > > cont
Definition: CutBookkeepersLocalCache.h:16
BookkeeperTool::loadXAODMetaData
StatusCode loadXAODMetaData()
Initialisation helpers.
Definition: BookkeeperTool.cxx:296
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: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
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
xAOD::mcChannelNumber
mcChannelNumber
Definition: EventInfo_v1.cxx:197
BookkeeperTool::copyCutflowFromService
StatusCode copyCutflowFromService()
Fill Cutflow information from the service.
Definition: BookkeeperTool.cxx:269
CutBookkeepersLocalCache::clear
void clear()
Definition: CutBookkeepersLocalCache.h:22
BookkeeperTool::copyInputContainersToOutput
StatusCode copyInputContainersToOutput(CutBookkeepersLocalCache &target, const SG::SourceID &source="")
Copy input containers to the output.
Definition: BookkeeperTool.cxx:232
IOVPayloadContainer::size
size_type size() const
size of payload vector
Definition: IOVPayloadContainer.h:121
BookkeeperTool::loadPOOLMetaData
StatusCode loadPOOLMetaData()
Definition: BookkeeperTool.cxx:363
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
CutBookkeepersLocalCache::prepareContainers
static void prepareContainers(CutBookkeepersLocalCache &target, size_t size, bool extend=false)
Definition: CutBookkeepersLocalCache.h:25
BookkeeperTool::m_cutFlowSvc
ServiceHandle< ICutFlowSvc > m_cutFlowSvc
Pointer to the public CutFlowSvc interface.
Definition: BookkeeperTool.h:86
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
CutBookkeepersLocalCache
Helper in-memory structure.
Definition: CutBookkeepersLocalCache.h:15
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
checkCoolLatestUpdate.chanNum
chanNum
Definition: checkCoolLatestUpdate.py:27
lumiFormat.i
int i
Definition: lumiFormat.py:85
CutFlowSvc
This implements the methods for ICutFlowSvc.
Definition: CutFlowSvc.h:47
CutBookkeepersLocalCache::aux
std::vector< std::unique_ptr< xAOD::CutBookkeeperAuxContainer > > aux
Definition: CutBookkeepersLocalCache.h:17
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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
BookkeeperTool::m_cutFlowSvcPrivate
CutFlowSvc * m_cutFlowSvcPrivate
Direct pointer to the CutFlowSvc for "private" methods access.
Definition: BookkeeperTool.h:88
asg::AsgMetadataTool::metaDataStop
virtual StatusCode metaDataStop()
Function called when the tool should write out its metadata.
Definition: AsgMetadataTool.cxx:204
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
CondAttrListCollection::chanNum
ChanNum chanNum(unsigned int index) const
channel number for index: (index = 0 to size-1)
Definition: CondAttrListCollection.h:384
xAOD::CutBookkeeperContainer_v1
Container that holds the Container of all CutBookkeepers.
Definition: CutBookkeeperContainer_v1.h:27
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
xAOD::FileMetaData_v1::mcProcID
@ mcProcID
Same as mc_channel_number [float].
Definition: FileMetaData_v1.h:74
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
xAOD::CutFlowHelpers::updateContainer
void updateContainer(xAOD::CutBookkeeperContainer *contToUpdate, const xAOD::CutBookkeeperContainer *otherCont)
Helper function to update a container with information from another one.
Definition: xAODCutFlowHelpers.cxx:105
CondAttrListCollection::attributeList
const AttributeList & attributeList(ChanNum chanNum) const
attribute list for a given channel number
Definition: CondAttrListCollection.h:401
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
BookkeeperTool::m_inputContainers
std::unordered_map< SG::SourceID, CutBookkeepersLocalCache > m_inputContainers
Input CutBookkeeperContainers.
Definition: BookkeeperTool.h:103
CondAttrListCollection::ChanNum
unsigned int ChanNum
Definition: CondAttrListCollection.h:55
xAOD::FileMetaData_v1
Class holding file-level metadata about an xAOD file.
Definition: FileMetaData_v1.h:34
CutBookkeepersLocalCache::at
xAOD::CutBookkeeperContainer * at(std::size_t n) const
Definition: CutBookkeepersLocalCache.h:21
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
Muon::nsw::incomplete
@ incomplete
Definition: NSWTriggerElink.h:37
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
CutBookkeepersLocalCache::empty
bool empty() const
Definition: CutBookkeepersLocalCache.h:19
CondAttrListCollection::size
size_type size() const
number of Chan/AttributeList pairs
Definition: CondAttrListCollection.h:322
BookkeeperTool::m_inputCollName
Gaudi::Property< std::string > m_inputCollName
The name of the input CutBookkeeperContainer.
Definition: BookkeeperTool.h:92
CutFlowSvc::setNumberOfWeightVariations
StatusCode setNumberOfWeightVariations(size_t count)
Set number of weight variations.
Definition: CutFlowSvc.cxx:377
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
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
copySelective.target
string target
Definition: copySelective.py:37
asg::AsgMetadataTool::outputMetaStore
MetaStorePtr_t outputMetaStore() const
Accessor for the output metadata store.
Definition: AsgMetadataTool.cxx:97
SG::SourceID
std::string SourceID
Definition: AthenaKernel/AthenaKernel/SourceID.h:25
DEBUG
#define DEBUG
Definition: page_access.h:11
BookkeeperTool::m_outputCollName
Gaudi::Property< std::string > m_outputCollName
The name of the output CutBookkeeperContainer.
Definition: BookkeeperTool.h:96
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
copySelective.source
string source
Definition: copySelective.py:32
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
merge.status
status
Definition: merge.py:17
BookkeeperTool::m_completeContainers
CutBookkeepersLocalCache m_completeContainers
Local CutBookkeeperContainers.
Definition: BookkeeperTool.h:106
SG::DataProxy
Definition: DataProxy.h:45
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
fitman.k
k
Definition: fitman.py:528
BookkeeperTool::m_numberOfWeightVariations
size_t m_numberOfWeightVariations
Number of event weight variations.
Definition: BookkeeperTool.h:100
ServiceHandle< IIncidentSvc >
asg::AsgMetadataTool::m_useIncidents
bool m_useIncidents
Definition: AsgMetadataTool.h:128