ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDTools
EventLoop
Root
FactoryPreloadModule.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
//
9
// includes
10
//
11
12
#include <
EventLoop/FactoryPreloadModule.h
>
13
14
#include <
AsgTools/MessageCheckAsgTools.h
>
15
#include <TInterpreter.h>
16
#include <TSystem.h>
17
#include <ranges>
18
19
//
20
// method implementations
21
//
22
23
namespace
EL
24
{
25
namespace
Detail
26
{
27
StatusCode
FactoryPreloadModule::onInitialize
(
ModuleData
&
/*data*/
)
28
{
29
std::vector<std::string> preloaderList;
30
for
(
auto
&& part : std::views::split(
preloader
.value(),
','
)) preloaderList.emplace_back(part.begin(), part.end());
31
32
if
(preloaderList.size() % 2 != 0)
33
{
34
ANA_MSG_ERROR
(
"Invalid preloader list"
);
35
return
StatusCode::FAILURE;
36
}
37
38
for
(std::size_t iter = 0; iter < preloaderList.size(); iter += 2)
39
{
40
const
std::string& libName = preloaderList[iter];
41
const
std::string& funcName = preloaderList[iter + 1];
42
43
if
(gSystem->Load(libName.c_str()) != 0)
44
{
45
ANA_MSG_ERROR
(
"Failed to load library "
<< libName);
46
return
StatusCode::FAILURE;
47
}
48
if
(gInterpreter->Calc((funcName +
"()"
).c_str()) != 1)
49
{
50
ANA_MSG_ERROR
(
"Failed to call function "
<< funcName <<
" from library "
<< libName);
51
return
StatusCode::FAILURE;
52
}
53
}
54
55
return
StatusCode::SUCCESS;
56
}
57
}
58
}
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
FactoryPreloadModule.h
MessageCheckAsgTools.h
EL::Detail::FactoryPreloadModule::preloader
Gaudi::Property< std::string > preloader
Definition
FactoryPreloadModule.h:33
EL::Detail::FactoryPreloadModule::onInitialize
StatusCode onInitialize(ModuleData &data) override
action just before algorithms are initialized
Definition
FactoryPreloadModule.cxx:27
EL::Detail
Definition
AsgComponentFactories.h:20
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::Detail::ModuleData
the data the EventLoop core classes are sharing with the Module implementation
Definition
ModuleData.h:65
Generated on
for ATLAS Offline Software by
1.17.0