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 () =
default
;
28
29
30
31
AnaAlgorithmConfig ::
32
AnaAlgorithmConfig (
const
std::string& val_typeAndName)
33
:
AsgComponentConfig
(val_typeAndName)
34
{
35
}
36
37
38
39
AnaAlgorithmConfig ::
40
AnaAlgorithmConfig (
const
AsgComponentConfig
& val_config)
41
:
AsgComponentConfig
(val_config)
42
{
43
}
44
45
46
47
bool
AnaAlgorithmConfig ::
48
useXAODs ()
const
noexcept
49
{
50
return
m_useXAODs
;
51
}
52
53
54
55
void
AnaAlgorithmConfig ::
56
setUseXAODs (
bool
val_useXAODs)
noexcept
57
{
58
m_useXAODs
= val_useXAODs;
59
}
60
61
62
63
bool
AnaAlgorithmConfig ::
64
isPublicTool ()
const
noexcept
65
{
66
return
m_isPublicTool
;
67
}
68
69
70
71
void
AnaAlgorithmConfig ::
72
setIsPublicTool (
bool
val_isPublicTool)
noexcept
73
{
74
m_isPublicTool
= val_isPublicTool;
75
}
76
77
78
79
::StatusCode
AnaAlgorithmConfig ::
80
makeAlgorithm (std::unique_ptr<AnaAlgorithm>&
algorithm
,
81
const
AlgorithmWorkerData
& workerData)
const
82
{
83
using namespace
msgAlgorithmConfig;
84
85
if
(
m_isPublicTool
==
false
)
86
{
87
ANA_CHECK
(makeComponentExpert (
algorithm
,
"new %1% (\"%2%\", nullptr)"
,
true
,
""
));
88
algorithm
->setHistogramWorker (workerData.
m_histogramWorker
);
89
algorithm
->setTreeWorker (workerData.
m_treeWorker
);
90
algorithm
->setFilterWorker (workerData.
m_filterWorker
);
91
algorithm
->setWk (workerData.
m_wk
);
92
if
(workerData.
m_evtStore
)
93
algorithm
->setEvtStore (workerData.
m_evtStore
);
94
ANA_CHECK
(
algorithm
->sysInitialize());
95
}
else
96
{
97
std::unique_ptr<asg::AsgTool> tool;
98
ANA_CHECK
(makeComponentExpert (tool,
"new %1% (\"%2%\")"
,
true
,
""
));
99
ANA_CHECK
(tool->initialize());
100
101
AnaAlgorithmConfig
dummyAlg (
"EL::AnaAlgorithm/DummyAlg."
+
name
());
102
ANA_CHECK
(dummyAlg.
makeAlgorithm
(
algorithm
, workerData));
103
algorithm
->addCleanup (std::move (tool));
104
}
105
106
ANA_MSG_DEBUG
(
"Created component of type "
<<
type
());
107
return
StatusCode::SUCCESS;
108
}
109
}
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:289
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:325
MessageCheck.h
EL::AnaAlgorithmConfig::m_isPublicTool
bool m_isPublicTool
the value of isPublicTool
Definition
AnaAlgorithmConfig.h:131
EL::AnaAlgorithmConfig::AnaAlgorithmConfig
AnaAlgorithmConfig()
standard constructor
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:80
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