Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 09:38:17

0001 // $Id$
0002 //====================================================================
0003 //  AIDA Detector description implementation
0004 //--------------------------------------------------------------------
0005 //
0006 //  Run Geant4 using DDG4 from root prompt with test objects for
0007 //  Run/Event/Sensitive actions.
0008 //
0009 //  The Geant4 setup is programmed in the xml files to be parsed. Only
0010 //  the commands to parse these xml files is executed by root.
0011 //
0012 //  Usage:
0013 //  $> root.exe
0014 //  root[0] .x <installation-directory>/examples/LHeD/scripts/initACLick.C
0015 //  root[1] .L <installation-directory>/examples/LHeD/scripts/LHeDXML.C+
0016 //  root[2] LHeDACLick()
0017 //
0018 //
0019 //  Author     : M.Frank
0020 //
0021 //====================================================================
0022 #include "DDG4/Geant4Config.h"
0023 #include <iostream>
0024 
0025 using namespace std;
0026 using namespace dd4hep::sim;
0027 using namespace dd4hep::sim::Setup;
0028 
0029 int setupG4_XML(bool interactive)  {
0030   string install_dir = getenv("DD4hepExamplesINSTALL");
0031   string prefix = "file:"+install_dir+"/examples/";
0032   Kernel& kernel = Kernel::instance(dd4hep::Detector::getInstance());
0033   kernel.loadGeometry((prefix+"LHeD/compact/compact.xml").c_str());
0034   kernel.loadXML((prefix+"LHeD/sim/field.xml").c_str());
0035   kernel.loadXML((prefix+"LHeD/sim/sequences.xml").c_str());
0036   kernel.loadXML((prefix+"LHeD/sim/physics.xml").c_str());
0037   if ( interactive )  {
0038     kernel.property("UI") = "UI";
0039   }
0040   else  {
0041     kernel.property("NumEvents") = 3;
0042   }
0043   kernel.configure();
0044   kernel.initialize();
0045   kernel.run();
0046   cout << "Successfully executed application .... " << endl;
0047   kernel.terminate();
0048   cout << "TEST_PASSED" << endl;
0049   return 0;
0050 }
0051 
0052 #if defined(G__DICTIONARY) || defined(__CLING__) || defined(__CINT__) || defined(__MAKECINT__) // CINT script
0053 int LHeDXML()
0054 #else
0055 int main(int, char**)                              // Main program if linked standalone
0056 #endif
0057 {
0058   return setupG4_XML(false);
0059 }