Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
athena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
detectors
athena
Commits
e1bef9a0
Commit
e1bef9a0
authored
4 years ago
by
Whitney Armstrong
Browse files
Options
Downloads
Patches
Plain Diff
Updated cmake and added TestDetector
modified: CMakeLists.txt new file: src/TestDetector.cpp
parent
6322189f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+17
-9
17 additions, 9 deletions
CMakeLists.txt
src/TestDetector.cpp
+36
-0
36 additions, 0 deletions
src/TestDetector.cpp
with
53 additions
and
9 deletions
CMakeLists.txt
+
17
−
9
View file @
e1bef9a0
cmake_minimum_required
(
VERSION 3.3 FATAL_ERROR
)
PROJECT
(
detector_template
VERSION 0.0.1
LANGUAGES CXX
DESCRIPTION
"A template dd4hep+acts detector"
)
find_package
(
DD4hep REQUIRED COMPONENTS DDCore DDG4
)
#set(CMAKE_PREFIX_PATH $ENV{HOME}/lib CMAKE_PREFIX_PATH)
#find_package(Acts REQUIRED COMPONENTS Core IdentificationPlugin TGeoPlugin DD4hepPlugin PATHS /home/whit/lib/cmake NO_DEFAULT_PATH)
find_package
(
Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginDD4hep
)
#
find_package(Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginDD4hep )
#-----------------------------------------------------------------------------------
set
(
a_lib_name topside2
)
set
(
a_lib_name detector_template
)
if
(
"
${
PROJECT_NAME
}
"
STREQUAL
"detector_template"
)
message
(
WARNING
"
Current project and library is named detector_template!
Please rename library to match corresponding detector implmentation."
)
endif
()
dd4hep_configure_output
()
#dd4hep_package (${a_lib_name} MAJOR 0 MINOR 0 PATCH 1
# USES [ROOT REQUIRED COMPONENTS Geom GenVector]
# [DD4hep REQUIRED COMPONENTS DDCore DDRec]
# OPTIONAL XERCESC
# INCLUDE_DIRS include
# )
dd4hep_add_plugin
(
${
a_lib_name
}
SOURCES src/*.cpp
USES ActsCore ActsPluginDD4hep
...
...
@@ -22,6 +29,7 @@ target_link_libraries(${a_lib_name}
)
#-----------------------------------------------------------------------------------
# Install the detector description files.
install
(
DIRECTORY compact/
DESTINATION share/
${
PROJECT_NAME
}
/
${
a_lib_name
}
FILES_MATCHING PATTERN
"*.xml"
...
...
This diff is collapsed.
Click to expand it.
src/TestDetector.cpp
0 → 100644
+
36
−
0
View file @
e1bef9a0
#include
<XML/Helper.h>
using
namespace
dd4hep
;
static
Ref_t
createDetector
(
Detector
&
desc
,
xml_h
handle
,
SensitiveDetector
sens
)
{
xml
::
DetElement
detElem
=
handle
;
std
::
string
detName
=
detElem
.
nameStr
();
int
detID
=
detElem
.
id
();
xml
::
Component
dims
=
detElem
.
dimensions
();
double
rInner
=
dims
.
inner_radius
();
double
rMin
=
dims
.
rmin
();
double
thickness
=
dims
.
thickness
();
double
innerZ
=
dims
.
inner_z
();
double
angle
=
dims
.
angle
();
Material
mat
=
desc
.
material
(
detElem
.
materialStr
());
Tube
outerTubeShape
(
rMin
,
rInner
+
thickness
,
innerZ
+
thickness
);
Tube
innerTubeShape
(
0
,
rInner
,
innerZ
);
SubtractionSolid
unchamferedShape
(
outerTubeShape
,
innerTubeShape
);
Cone
chamferShape
(
thickness
,
0
,
rMin
,
0
,
rMin
+
2
*
tan
(
angle
)
*
thickness
);
SubtractionSolid
detShape
(
unchamferedShape
,
chamferShape
,
Position
(
0
,
0
,
innerZ
+
thickness
));
Volume
detVol
(
detName
,
detShape
,
mat
);
detVol
.
setVisAttributes
(
desc
.
visAttributes
(
detElem
.
visStr
()));
DetElement
det
(
detName
,
detID
);
Volume
motherVol
=
desc
.
pickMotherVolume
(
det
);
PlacedVolume
detPV
=
motherVol
.
placeVolume
(
detVol
);
det
.
setPlacement
(
detPV
);
return
det
;
}
// clang-format off
DECLARE_DETELEMENT
(
TestDetector
,
createDetector
)
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