ATLAS Offline Software
Functions
asg_tools_test_init.cxx File Reference
#include <AsgTools/StandaloneToolHandle.h>
#include <AsgTools/IAsgTool.h>
Include dependency graph for asg_tools_test_init.cxx:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)
Author
Nils Krumnack

Definition at line 20 of file asg_tools_test_init.cxx.

21 {
22  using namespace asg::msgUserCode;
23  ANA_CHECK_SET_TYPE (int);
24 
25  if (argc < 2)
26  {
27  ANA_MSG_ERROR ("missing argument: [type]");
28  return -1;
29  }
30 
31  asg::StandaloneToolHandle<asg::IAsgTool> tool (std::string (argv[1]) + "/tool");
32  for (int iter = 2; iter != argc; ++ iter)
33  {
34  const std::string arg = argv[iter];
35  const auto split = arg.find ("=");
36  if (split == std::string::npos)
37  {
38  ANA_MSG_ERROR ("argument doesn't match name=value syntax: \"" << arg << "\"");
39  return -1;
40  }
41  ANA_CHECK (tool.setProperty (arg.substr (0, split), arg.substr (split + 1)));
42  }
43  ANA_CHECK (tool.initialize());
44  ANA_MSG_INFO ("successfully initialized tool");
45  return 0;
46 }
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
asg::StandaloneToolHandle
an "initializing" ToolHandle for stand-alone applications
Definition: StandaloneToolHandle.h:44
LArCellNtuple.argv
argv
Definition: LArCellNtuple.py:152
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:20
create_dcsc_inputs_sqlite.arg
list arg
Definition: create_dcsc_inputs_sqlite.py:48
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
ANA_CHECK_SET_TYPE
#define ANA_CHECK_SET_TYPE(TYPE)
set the type for ANA_CHECK to report failures
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:314
Trk::split
@ split
Definition: LayerMaterialProperties.h:38