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