Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
dc73db66
Commit
dc73db66
authored
4 months ago
by
Markus Frank
Committed by
Andre Sailer
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Add test using signal DDCore handler
parent
17d70cdd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/ClientTests/compact/InterruptTrigger.xml
+104
-0
104 additions, 0 deletions
examples/ClientTests/compact/InterruptTrigger.xml
examples/ClientTests/src/InterruptTrigger.cpp
+50
-0
50 additions, 0 deletions
examples/ClientTests/src/InterruptTrigger.cpp
with
154 additions
and
0 deletions
examples/ClientTests/compact/InterruptTrigger.xml
0 → 100644
+
104
−
0
View file @
dc73db66
<?xml version="1.0" encoding="UTF-8"?>
<lccdd>
<!-- #==========================================================================
# AIDA Detector description implementation
#==========================================================================
# Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
# All rights reserved.
#
# For the licensing terms see $DD4hepINSTALL/LICENSE.
# For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
#
#==========================================================================
-->
<info
name=
"SiliconBlock"
title=
"Test with 2 simple silicon boxes"
author=
"Markus Frank"
url=
"http://www.cern.ch/lhcb"
status=
"development"
version=
"$Id: compact.xml 513 2013-04-05 14:31:53Z gaede $"
>
<comment>
Alignment test with 2 simple boxes
</comment>
</info>
<includes>
<gdmlFile
ref=
"${DD4hepINSTALL}/DDDetectors/compact/elements.xml"
/>
<gdmlFile
ref=
"${DD4hepINSTALL}/DDDetectors/compact/materials.xml"
/>
</includes>
<materials>
<material
name=
"G4_PbWO4"
>
<D
type=
"density"
unit=
"g/cm3"
value=
"8.28"
/>
<composite
n=
"4"
ref=
"O"
/>
<composite
n=
"1"
ref=
"Pb"
/>
<composite
n=
"1"
ref=
"W"
/>
</material>
</materials>
<define>
<constant
name=
"world_size"
value=
"30*m"
/>
<constant
name=
"world_x"
value=
"world_size"
/>
<constant
name=
"world_y"
value=
"world_size"
/>
<constant
name=
"world_z"
value=
"world_size"
/>
</define>
<display>
<vis
name=
"Invisible"
showDaughters=
"false"
visible=
"false"
/>
<vis
name=
"InvisibleWithChildren"
showDaughters=
"true"
visible=
"false"
/>
<vis
name=
"VisibleRed"
r=
"1.0"
g=
"0.0"
b=
"0.0"
showDaughters=
"true"
visible=
"true"
/>
<vis
name=
"VisibleBlue"
r=
"0.0"
g=
"0.0"
b=
"1.0"
showDaughters=
"false"
visible=
"true"
/>
<vis
name=
"VisibleGreen"
alpha=
"1.0"
r=
"0.0"
g=
"1.0"
b=
"0.0"
drawingStyle=
"solid"
lineStyle=
"solid"
showDaughters=
"true"
visible=
"true"
/>
</display>
<limits>
<limitset
name=
"SiRegionLimitSet"
>
<limit
name=
"step_length_max"
particles=
"*"
value=
"5.0"
unit=
"mm"
/>
<limit
name=
"track_length_max"
particles=
"*"
value=
"1.0"
unit=
"mm"
/>
</limitset>
</limits>
<regions>
<region
name=
"SiRegion"
eunit=
"MeV"
lunit=
"mm"
cut=
"0.001"
threshold=
"0.001"
>
<limitsetref
name=
"SiRegionLimitSet"
/>
</region>
</regions>
<detectors>
<detector
id=
"1"
name=
"SiliconBlockUpper"
type=
"DD4hep_BoxSegment"
readout=
"SiliconUpperHits"
vis=
"VisibleGreen"
sensitive=
"true"
region=
"SiRegion"
limits=
"SiRegionLimitSet"
>
<material
name=
"Silicon"
/>
<sensitive
type=
"tracker"
/>
<box
x=
"30*mm"
y=
"100*cm"
z=
"100*cm"
/>
<position
x=
"4*cm"
y=
"0"
z=
"0"
/>
<rotation
x=
"0"
y=
"0"
z=
"0"
/>
</detector>
<detector
id=
"2"
name=
"InterruptTrigger"
type=
"InterruptTrigger"
/>
<detector
id=
"3"
name=
"SiliconBlockDown"
type=
"DD4hep_BoxSegment"
readout=
"SiliconDownHits"
vis=
"VisibleRed"
sensitive=
"true"
region=
"SiRegion"
limits=
"SiRegionLimitSet"
>
<material
name=
"Silicon"
/>
<sensitive
type=
"tracker"
/>
<box
x=
"30*mm"
y=
"100*cm"
z=
"100*cm"
/>
<position
x=
"-4*cm"
y=
"0"
z=
"0"
/>
<rotation
x=
"0"
y=
"0"
z=
"0"
/>
</detector>
</detectors>
<readouts>
<readout
name=
"SiliconUpperHits"
>
<segmentation
type=
"CartesianGridXY"
grid_size_x=
"5*mm"
grid_size_y=
"5*mm"
/>
<id>
system:8,x:24:-12,y:-12
</id>
</readout>
<readout
name=
"SiliconDownHits"
>
<segmentation
type=
"CartesianGridXY"
grid_size_x=
"5*mm"
grid_size_y=
"5*mm"
/>
<id>
system:8,x:24:-12,y:-12
</id>
</readout>
</readouts>
<fields>
<field
name=
"GlobalSolenoid"
type=
"solenoid"
inner_field=
"5.0*tesla"
outer_field=
"-1.5*tesla"
zmax=
"2*m"
outer_radius=
"3*m"
>
</field>
</fields>
</lccdd>
This diff is collapsed.
Click to expand it.
examples/ClientTests/src/InterruptTrigger.cpp
0 → 100644
+
50
−
0
View file @
dc73db66
//==========================================================================
// AIDA Detector description implementation
//--------------------------------------------------------------------------
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
// All rights reserved.
//
// For the licensing terms see $DD4hepINSTALL/LICENSE.
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
//
// Author : M.Frank
//
//==========================================================================
// Framework includes
#include
"DD4hep/DetFactoryHelper.h"
#include
"DD4hep/SignalHandler.h"
#include
"DD4hep/Printout.h"
// C/C++ include files
#include
<cstdio>
#include
<csignal>
#include
<unistd.h>
using
namespace
dd4hep
;
static
bool
signal_handler
(
void
*
user_context
,
int
signal
)
{
printout
(
ALWAYS
,
"SignalHandler"
,
"+++ Caught signal: %d context: %p. exit process."
,
signal
,
user_context
);
::
fflush
(
stdout
);
::
exit
(
EINVAL
);
return
true
;
}
static
Ref_t
create_detector
(
Detector
&
,
xml_h
e
,
SensitiveDetector
)
{
// XML detector object: DDCore/XML/XMLDetector.h
xml_dim_t
x_det
=
e
;
//Create the DetElement for dd4hep
DetElement
d_det
(
x_det
.
nameStr
(),
x_det
.
id
());
SignalHandler
handler
;
handler
.
registerHandler
(
SIGINT
,
(
void
*
)
0xFEEDBABE
,
signal_handler
);
printout
(
ALWAYS
,
"SignalTrigger"
,
"+++ Sending interrupt signal to self..."
);
::
kill
(
::
getpid
(),
SIGINT
);
return
d_det
;
}
DECLARE_DETELEMENT
(
InterruptTrigger
,
create_detector
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment