ATLAS Offline Software
DynamicDataHelper.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 /* Dear emacs, this is -*-c++-*- */
5 #ifndef _DynamicDataHelper_H_
6 #define _DynamicDataHelper_H_
7 
10 #include "GaudiKernel/StatusCode.h"
11 
12 // @TODO extend Gaudi's tool visitor to allow for an externally provided list of tools which have been visited already.
13 namespace Ath {
14 
16  std::size_t operator()( const DataObjID* k ) const { return DataObjID_Hasher()(*k); }
17  };
19  std::size_t operator()( const DataObjID* a, const DataObjID* b) const { return *a == *b; }
20  };
21  using DataObjIDPtrColl = std::unordered_set<const DataObjID *, DataObjID_PtrHasher, DataObjID_PtrEqual>;
22 
26  public:
33  void gatherDataHandlesAndDynamicConsumers(const std::string &parent_name, Gaudi::Algorithm *theAlgorithm);
34 
40  StatusCode addExtraDependencies(IClassIDSvc& clid_svc, std::vector<std::string> &undeclared_output_data, MsgStream &out);
41 
48  void updateDataNeeds(unsigned int max_pass,
49  MsgStream &out);
50 
51  protected:
59  bool updateDataNeeds(const std::vector<const DataObjID *> &input_data_in,
60  const std::vector<const DataObjID *> &output_data_in,
61  std::vector<const DataObjID *> &input_data_out,
62  std::vector<const DataObjID *> &output_data_out,
63  MsgStream &out);
64 
65  std::vector<DataObjID> m_extraOutputIDs;
68 
69  std::unordered_map< IDynamicDataConsumer *,std::vector<Gaudi::Algorithm *> > m_dynDataConsumer;
70 
71  };
72 }
73 #endif
Ath::DataObjID_PtrHasher::operator()
std::size_t operator()(const DataObjID *k) const
Definition: DynamicDataHelper.h:16
Ath::DynamicDataHelper
Helper class to gather all declared data IDs and propagate them to components which declare data depe...
Definition: DynamicDataHelper.h:25
Ath::DataObjID_PtrHasher
Definition: DynamicDataHelper.h:15
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
Ath::DataObjIDPtrColl
std::unordered_set< const DataObjID *, DataObjID_PtrHasher, DataObjID_PtrEqual > DataObjIDPtrColl
Definition: DynamicDataHelper.h:21
IDynamicDataConsumer.h
Ath::DynamicDataHelper::m_extraOutputIDs
std::vector< DataObjID > m_extraOutputIDs
Definition: DynamicDataHelper.h:65
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Ath
Definition: DynamicDataHelper.h:13
Ath::DataObjID_PtrEqual::operator()
std::size_t operator()(const DataObjID *a, const DataObjID *b) const
Definition: DynamicDataHelper.h:19
Ath::DynamicDataHelper::m_outputHandles
DataObjIDPtrColl m_outputHandles
Definition: DynamicDataHelper.h:67
Ath::DynamicDataHelper::gatherDataHandlesAndDynamicConsumers
void gatherDataHandlesAndDynamicConsumers(const std::string &parent_name, Gaudi::Algorithm *theAlgorithm)
Gather the input and output data declared by the given algorithm, its child algorithms and their tool...
Definition: DynamicDataHelper.cxx:65
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
Ath::DynamicDataHelper::m_inputHandles
DataObjIDPtrColl m_inputHandles
Definition: DynamicDataHelper.h:66
a
TList * a
Definition: liststreamerinfos.cxx:10
Ath::DataObjID_PtrEqual
Definition: DynamicDataHelper.h:18
Ath::DynamicDataHelper::updateDataNeeds
void updateDataNeeds(unsigned int max_pass, MsgStream &out)
Update the data dependencies of all components which dynamically declare tehm.
Definition: DynamicDataHelper.cxx:100
Ath::DynamicDataHelper::m_dynDataConsumer
std::unordered_map< IDynamicDataConsumer *, std::vector< Gaudi::Algorithm * > > m_dynDataConsumer
Definition: DynamicDataHelper.h:69
Ath::DynamicDataHelper::addExtraDependencies
StatusCode addExtraDependencies(IClassIDSvc &clid_svc, std::vector< std::string > &undeclared_output_data, MsgStream &out)
Add extra output data which is not declared by any of the gathered components.
Definition: DynamicDataHelper.cxx:26
GaudiComponentVisitor.h
fitman.k
k
Definition: fitman.py:528