Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-02 08:10: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 <DD4hep/Printout.h>
0016 #include <DDG4/Geant4Kernel.h>
0017 #include <DDG4/Geant4Interrupts.h>
0018 
0019 #include <csignal>
0020 
0021 /// Default SIGINT handler: trigger end-of-event-loop in Geant4Kernel object
0022 bool dd4hep::sim::Geant4Interrupts::default_sigint_handler(void* user_context, int)   {
0023   Geant4Kernel* krnl = (Geant4Kernel*)user_context;
0024   if ( krnl )  {
0025     krnl->triggerStop();
0026     return true;
0027   }
0028   except("Geant4Interrupts", "+++ Internal error: no user context in default SIGINT handler!");
0029   return true;
0030 }
0031 
0032 /// Install specialized handler for SIGINT
0033 bool dd4hep::sim::Geant4Interrupts::registerHandler_SIGINT()  {
0034   return this->registerHandler(SIGINT, &m_kernel, default_sigint_handler);
0035 }