ATLAS Offline Software
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 
13 
15 #include <TInterpreter.h>
16 #include <TSystem.h>
17 #include <boost/algorithm/string.hpp>
18 
19 //
20 // method implementations
21 //
22 
23 namespace EL
24 {
25  namespace Detail
26  {
28  {
29  std::vector<std::string> preloaderList;
30  boost::split (preloaderList, preloader, boost::is_any_of (","));
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 }
checkPlugins.libName
libName
Definition: checkPlugins.py:143
EL::Detail::FactoryPreloadModule::preloader
std::string preloader
Definition: FactoryPreloadModule.h:32
EL::Detail::ModuleData
the data the EventLoop core classes are sharing with the Module implementation
Definition: ModuleData.h:64
FactoryPreloadModule.h
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
EL::Detail::FactoryPreloadModule::onInitialize
StatusCode onInitialize(ModuleData &data) override
action just before algorithms are initialized
Definition: FactoryPreloadModule.cxx:27
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
xAOD::DiTauJetParameters::Detail
Detail
Definition: DiTauDefs.h:38
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
MessageCheckAsgTools.h