Back to home page

EIC code displayed by LXR

 
 

    


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

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 /// Default SIGINT handler: trigger end-of-event-loop in Geant4Kernel object
0020 bool dd4hep::sim::Geant4Interrupts::default_sigint_handler(void* user_context, int)   {
0021   Geant4Kernel* krnl = (Geant4Kernel*)user_context;
0022   if ( krnl )  {
0023     krnl->triggerStop();
0024     return true;
0025   }
0026   except("Geant4Interrupts", "+++ Internal error: no user context in default SIGINT handler!");
0027   return true;
0028 }
0029 
0030 /// Install specialized handler for SIGINT
0031 bool dd4hep::sim::Geant4Interrupts::registerHandler_SIGINT()  {
0032   return this->registerHandler(SIGINT, &m_kernel, default_sigint_handler);
0033 }