Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:14:30

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 
0014 // Framework include files
0015 #include "DDG4/Geant4Config.h"
0016 
0017 // C/C++ include files
0018 #include <stdexcept>
0019 #include <iostream>
0020 #include <cerrno>
0021 
0022 using namespace dd4hep::sim::Setup;
0023 
0024 int setupG4_XML()  {
0025   dd4hep::Detector& description = dd4hep::Detector::getInstance();
0026   Kernel& kernel = Kernel::instance(description);
0027   kernel.loadGeometry("file:../DD4hep.trunk/DDExamples/CLICSiD/compact/compact.xml");
0028   kernel.loadXML("DDG4_field.xml");
0029   kernel.loadXML("sequences.xml");
0030   kernel.loadXML("physics.xml");
0031   kernel.configure();
0032   kernel.initialize();
0033   kernel.run();
0034   std::cout << "Successfully executed application .... " << std::endl;
0035   kernel.terminate();
0036   return 1;
0037 }
0038 
0039 /// Main entry point as a program
0040 int main(int, char**)   {
0041   try  {
0042     return setupG4_XML();
0043   }
0044   catch(const std::exception& e)  {
0045     std::cout << "Got uncaught exception: " << e.what() << std::endl;
0046   }
0047   catch (...)  {
0048     std::cout << "Got UNKNOWN uncaught exception." << std::endl;
0049   }
0050   return EINVAL;    
0051 }