ATLAS Offline Software
Loading...
Searching...
No Matches
AnaAlgorithmConfig.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8
9//
10// includes
11//
12
14
18#include <AsgTools/AsgTool.h>
19
20//
21// method implementations
22//
23
24namespace EL
25{
26 AnaAlgorithmConfig ::
27 AnaAlgorithmConfig ()
28 {
29 }
30
31
32
33 AnaAlgorithmConfig ::
34 AnaAlgorithmConfig (const std::string& val_typeAndName)
35 : AsgComponentConfig (val_typeAndName)
36 {
37 }
38
39
40
41 AnaAlgorithmConfig ::
42 AnaAlgorithmConfig (const AsgComponentConfig& val_config)
43 : AsgComponentConfig (val_config)
44 {
45 }
46
47
48
49 bool AnaAlgorithmConfig ::
50 useXAODs () const noexcept
51 {
52 return m_useXAODs;
53 }
54
55
56
57 void AnaAlgorithmConfig ::
58 setUseXAODs (bool val_useXAODs) noexcept
59 {
60 m_useXAODs = val_useXAODs;
61 }
62
63
64
65 bool AnaAlgorithmConfig ::
66 isPublicTool () const noexcept
67 {
68 return m_isPublicTool;
69 }
70
71
72
73 void AnaAlgorithmConfig ::
74 setIsPublicTool (bool val_isPublicTool) noexcept
75 {
76 m_isPublicTool = val_isPublicTool;
77 }
78
79
80
81 ::StatusCode AnaAlgorithmConfig ::
82 makeAlgorithm (std::unique_ptr<AnaAlgorithm>& algorithm,
83 const AlgorithmWorkerData& workerData) const
84 {
85 using namespace msgAlgorithmConfig;
86
87 if (m_isPublicTool == false)
88 {
89 ANA_CHECK (makeComponentExpert (algorithm, "new %1% (\"%2%\", nullptr)", true, ""));
90 algorithm->setHistogramWorker (workerData.m_histogramWorker);
91 algorithm->setTreeWorker (workerData.m_treeWorker);
92 algorithm->setFilterWorker (workerData.m_filterWorker);
93 algorithm->setWk (workerData.m_wk);
94 if (workerData.m_evtStore)
95 algorithm->setEvtStore (workerData.m_evtStore);
96 ANA_CHECK (algorithm->sysInitialize());
97 } else
98 {
99 std::unique_ptr<asg::AsgTool> tool;
100 ANA_CHECK (makeComponentExpert (tool, "new %1% (\"%2%\")", true, ""));
101 ANA_CHECK (tool->initialize());
102
103 AnaAlgorithmConfig dummyAlg ("EL::AnaAlgorithm/DummyAlg." + name());
104 ANA_CHECK (dummyAlg.makeAlgorithm (algorithm, workerData));
105 algorithm->addCleanup (std::move (tool));
106 }
107
108 ANA_MSG_DEBUG ("Created component of type " << type());
109 return StatusCode::SUCCESS;
110 }
111}
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
bool m_isPublicTool
the value of isPublicTool
AnaAlgorithmConfig()
standard constructor
bool m_useXAODs
the value of useXAODs
::StatusCode makeAlgorithm(std::unique_ptr< AnaAlgorithm > &algorithm, const AlgorithmWorkerData &workerData) const
make an algorithm from this configuration
const std::string & name() const noexcept
the name of the component
const std::string & type() const noexcept
the type of the component
AsgComponentConfig()=default
standard constructor
std::string algorithm
Definition hcg.cxx:85
This module defines the arguments passed from the BATCH driver to the BATCH worker.
::StatusCode StatusCode
StatusCode definition for legacy code.
all the external components an algorithm needs before initialization (in EventLoop)
IHistogramWorker * m_histogramWorker