The Gaudi Framework  master (37c0b60a)
CustomAppFromOptions.py
Go to the documentation of this file.
1 
14 
15 # Workaround for ROOT-10769
16 import warnings
17 
18 with warnings.catch_warnings():
19  warnings.simplefilter("ignore")
20  import cppyy
21 
22 # - we have to load GaudiKernel get the base class
23 cppyy.gbl.gSystem.Load("libGaudiKernel.so")
24 
25 # - pass to ROOT interpreter our code
26 cppyy.gbl.gInterpreter.Declare(
27  r"""
28 #include <Gaudi/Application.h>
29 #include <iostream>
30 
31 namespace Test {
32  class CustomApp : public Gaudi::Application {
33  using Application::Application;
34  int run() override {
35  std::cout << "=== Custom Application ===\n";
36  return EXIT_SUCCESS;
37  }
38  };
39 }
40 DECLARE_COMPONENT(Test::CustomApp)
41 """
42 )
43 
44 # IMPORTANT: gaudirun.py must be invoked passing "--application=Test::CustomApp"