DD4hep
1.36.0
Detector Description Toolkit for High Energy Physics
DDG4
src
Geant4Interrupts.cpp
Go to the documentation of this file.
1
//==========================================================================
2
// AIDA Detector description implementation
3
//--------------------------------------------------------------------------
4
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5
// All rights reserved.
6
//
7
// For the licensing terms see $DD4hepINSTALL/LICENSE.
8
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9
//
10
// Author : M.Frank
11
//
12
//==========================================================================
13
14
// Framework include files
15
#include <
DD4hep/Printout.h
>
16
#include <
DDG4/Geant4Kernel.h
>
17
#include <
DDG4/Geant4Interrupts.h
>
18
19
#include <csignal>
20
22
bool
dd4hep::sim::Geant4Interrupts::default_sigint_handler
(
void
* user_context,
int
) {
23
Geant4Kernel
* krnl = (
Geant4Kernel
*)user_context;
24
if
( krnl ) {
25
krnl->
triggerStop
();
26
return
true
;
27
}
28
except(
"Geant4Interrupts"
,
"+++ Internal error: no user context in default SIGINT handler!"
);
29
return
true
;
30
}
31
33
bool
dd4hep::sim::Geant4Interrupts::registerHandler_SIGINT
() {
34
return
this->registerHandler(SIGINT, &m_kernel, default_sigint_handler);
35
}
dd4hep::sim::Geant4Kernel::triggerStop
void triggerStop()
Trigger smooth end-of-event-loop with finishing currently processing event.
Definition:
Geant4Kernel.cpp:184
Geant4Interrupts.h
dd4hep::sim::Geant4Kernel
Class, which allows all Geant4Action derivatives to access the DDG4 kernel structures.
Definition:
Geant4Kernel.h:64
Geant4Kernel.h
dd4hep::sim::Geant4Interrupts::default_sigint_handler
static bool default_sigint_handler(void *user_context, int signum)
Default SIGINT handler: trigger end-of-event-loop in Geant4Kernel object.
Definition:
Geant4Interrupts.cpp:22
dd4hep::sim::Geant4Interrupts::registerHandler_SIGINT
bool registerHandler_SIGINT()
Specialized handler for SIGINT.
Definition:
Geant4Interrupts.cpp:33
Printout.h
Generated on Mon Mar 23 2026 15:55:18 for DD4hep by
1.8.18