ATLAS Offline Software
WorkerConfig.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 //
9 // includes
10 //
11 
12 #include <EventLoop/WorkerConfig.h>
13 
17 #include <AsgTools/SgTEventMeta.h>
20 #include <EventLoop/ModuleData.h>
21 
22 #include <EventLoop/MessageCheck.h>
23 
24 //
25 // method implementations
26 //
27 
29 
30 namespace EL
31 {
33  WorkerConfig (Detail::ModuleData *val_data) noexcept
34  : m_data (val_data),
35  m_metaStore (asg::SgTEventMeta::InputStore, nullptr)
36  {}
37 
38 
39 
40  // FIX ME: something bad happens in the linker step if this is not
41  // here and instead rely on the implicit destructor, which I don't
42  // want to debug.
43  WorkerConfig :: ~WorkerConfig () noexcept = default;
44 
45 
46 
47  void WorkerConfig ::
49  {
50  using namespace msgEventLoop;
51  ANA_MSG_INFO ("in add");
52  // no invariant used
53  std::unique_ptr<IAlgorithmWrapper> alg;
54  if (config.componentType() == "AnaAlgorithm")
55  alg = std::make_unique<AnaAlgorithmWrapper> (AnaAlgorithmConfig (config));
56  else if (config.componentType() == "AnaReentrantAlgorithm")
57  alg = std::make_unique<AnaReentrantAlgorithmWrapper> (AnaReentrantAlgorithmConfig (config));
58  else if (config.componentType() == "AsgTool")
59  alg = std::make_unique<AsgToolWrapper> (asg::AsgToolConfig (config));
60  else if (config.componentType() == "AsgService")
61  alg = std::make_unique<AsgServiceWrapper> (asg::AsgServiceConfig (config));
62  else
63  {
64  ANA_MSG_ERROR ("unknown component type: \"" << config.componentType() << "\"");
65  throw std::runtime_error ("unknown component type: \"" + config.componentType() + "\"");
66  }
67  m_data->m_algs.emplace_back (std::move (alg));
68  }
69 }
SGout2dot.alg
alg
Definition: SGout2dot.py:243
EL::WorkerConfig::m_data
Detail::ModuleData * m_data
Definition: WorkerConfig.h:57
m_data
std::vector< T > m_data
Definition: TrackTruthMatchingBaseAlg.cxx:660
EL::WorkerConfig::add
void add(const PythonConfigBase &config)
add the given component
PythonConfigBase.h
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
MessageCheck.h
EL::WorkerConfig
Definition: WorkerConfig.h:27
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
EL::WorkerConfig::~WorkerConfig
~WorkerConfig() noexcept
AsgToolWrapper.h
asg::AsgToolConfig
an object that can create a AsgTool
Definition: AsgToolConfig.h:22
AnaAlgorithmWrapper.h
EL::PythonConfigBase
the base class for the python configuration of any asg::AsgComponent
Definition: PythonConfigBase.h:36
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
AnaReentrantAlgorithmWrapper.h
SgTEventMeta.h
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
asg::AsgServiceConfig
an object that can create a AsgService
Definition: AsgServiceConfig.h:25
EL::Detail::ModuleData::m_algs
std::vector< Detail::AlgorithmData > m_algs
the list of algorithms
Definition: ModuleData.h:66
EL::WorkerConfig::WorkerConfig
WorkerConfig(Detail::ModuleData *val_data) noexcept
asg::SgTEventMeta::InputStore
@ InputStore
This store is used to access the input metadata.
Definition: SgTEventMeta.h:49
ClassImp
ClassImp(EL::WorkerConfig) namespace EL
Definition: WorkerConfig.cxx:28
ModuleData.h
WorkerConfig.h
AsgServiceWrapper.h