ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDTools
AnaAlgorithm
Root
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
13
#include <
AnaAlgorithm/AnaAlgorithmConfig.h
>
14
15
#include <
AnaAlgorithm/AnaAlgorithm.h
>
16
#include <
AnaAlgorithm/AlgorithmWorkerData.h
>
17
#include <
AnaAlgorithm/MessageCheck.h
>
18
#include <
AsgTools/AsgTool.h
>
19
20
//
21
// method implementations
22
//
23
24
namespace
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
}
AlgorithmWorkerData.h
AnaAlgorithmConfig.h
AnaAlgorithm.h
AsgTool.h
ANA_MSG_DEBUG
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:288
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
MessageCheck.h
EL::AnaAlgorithmConfig::m_isPublicTool
bool m_isPublicTool
the value of isPublicTool
Definition
AnaAlgorithmConfig.h:131
EL::AnaAlgorithmConfig::AnaAlgorithmConfig
AnaAlgorithmConfig()
standard constructor
Definition
AnaAlgorithmConfig.cxx:27
EL::AnaAlgorithmConfig::m_useXAODs
bool m_useXAODs
the value of useXAODs
Definition
AnaAlgorithmConfig.h:127
EL::AnaAlgorithmConfig::makeAlgorithm
::StatusCode makeAlgorithm(std::unique_ptr< AnaAlgorithm > &algorithm, const AlgorithmWorkerData &workerData) const
make an algorithm from this configuration
Definition
AnaAlgorithmConfig.cxx:82
asg::AsgComponentConfig::name
const std::string & name() const noexcept
the name of the component
Definition
AsgComponentConfig.cxx:90
asg::AsgComponentConfig::type
const std::string & type() const noexcept
the type of the component
Definition
AsgComponentConfig.cxx:74
asg::AsgComponentConfig::AsgComponentConfig
AsgComponentConfig()=default
standard constructor
algorithm
std::string algorithm
Definition
hcg.cxx:87
const
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition
AsgComponentFactories.h:16
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EL::AlgorithmWorkerData
all the external components an algorithm needs before initialization (in EventLoop)
Definition
AlgorithmWorkerData.h:34
EL::AlgorithmWorkerData::m_filterWorker
IFilterWorker * m_filterWorker
Definition
AlgorithmWorkerData.h:38
EL::AlgorithmWorkerData::m_treeWorker
ITreeWorker * m_treeWorker
Definition
AlgorithmWorkerData.h:37
EL::AlgorithmWorkerData::m_evtStore
asg::SgEvent * m_evtStore
Definition
AlgorithmWorkerData.h:35
EL::AlgorithmWorkerData::m_wk
IWorker * m_wk
Definition
AlgorithmWorkerData.h:39
EL::AlgorithmWorkerData::m_histogramWorker
IHistogramWorker * m_histogramWorker
Definition
AlgorithmWorkerData.h:36
Generated on
for ATLAS Offline Software by
1.17.0