Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Reference Detector
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
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
EIC
detectors
Reference Detector
Commits
a76a641a
Commit
a76a641a
authored
Mar 29, 2021
by
Marshall Scott
Browse files
Options
Downloads
Patches
Plain Diff
Testing .cpp with w/o using xml
parent
2b4ad3ed
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ci_GEM.xml
+0
-5
0 additions, 5 deletions
ci_GEM.xml
src/ci_GEM.cpp
+54
-1
54 additions, 1 deletion
src/ci_GEM.cpp
with
54 additions
and
6 deletions
ci_GEM.xml
+
0
−
5
View file @
a76a641a
...
@@ -20,11 +20,6 @@
...
@@ -20,11 +20,6 @@
<!-- Define the dimensions of the world volume -->
<!-- Define the dimensions of the world volume -->
<define>
<define>
<constant
name=
"world_side"
value=
"50*m"
/>
<constant
name=
"world_x"
value=
"world_side"
/>
<constant
name=
"world_y"
value=
"world_side"
/>
<constant
name=
"world_z"
value=
"world_side"
/>
<constant
name=
"ci_GEM_id"
value=
"1"
>
<constant
name=
"ci_GEM_id"
value=
"1"
>
<constant
name=
"ci_GEM_rin"
value=
"10 * cm"
>
<constant
name=
"ci_GEM_rin"
value=
"10 * cm"
>
<constant
name=
"ci_GEM_rout"
value=
"95 * cm"
>
<constant
name=
"ci_GEM_rout"
value=
"95 * cm"
>
...
...
This diff is collapsed.
Click to expand it.
src/ci_GEM.cpp
+
54
−
1
View file @
a76a641a
...
@@ -7,6 +7,7 @@ using namespace dd4hep;
...
@@ -7,6 +7,7 @@ using namespace dd4hep;
static
Ref_t
createDetector
(
Detector
&
desc
,
xml_h
handle
,
SensitiveDetector
sens
)
static
Ref_t
createDetector
(
Detector
&
desc
,
xml_h
handle
,
SensitiveDetector
sens
)
{
{
/*
xml::DetElement detElem = handle;
xml::DetElement detElem = handle;
std::string detName = detElem.nameStr();
std::string detName = detElem.nameStr();
int detID = detElem.id();
int detID = detElem.id();
...
@@ -20,15 +21,17 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
...
@@ -20,15 +21,17 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
double Z = dims.z();
double Z = dims.z();
int Nlayers = dims.nlayers();
int Nlayers = dims.nlayers();
Material mat = desc.material(detElem.materialStr());
Material mat = desc.material(detElem.materialStr());
Material air = desc.material("Air");
Tube ci_GEM_GVol_Solid(RIn, ROut, SizeZ / 2., 0., 360 * deg);
Tube ci_GEM_GVol_Solid(RIn, ROut, SizeZ / 2., 0., 360 * deg);
Volume
detVol
(
"ci_GEM_GVol_Logic"
,
ci_GEM_GVol_Solid
,
mat
);
Volume detVol("ci_GEM_GVol_Logic", ci_GEM_GVol_Solid,
air
);
detVol.setVisAttributes(desc.visAttributes(detElem.visStr()));
detVol.setVisAttributes(desc.visAttributes(detElem.visStr()));
DetElement det(detName, detID);
DetElement det(detName, detID);
Volume motherVol = desc.pickMotherVolume(det);
Volume motherVol = desc.pickMotherVolume(det);
Transform3D tr(RotationZYX(0., 0., 0.), Position(0., 0., ShiftZ));
Transform3D tr(RotationZYX(0., 0., 0.), Position(0., 0., ShiftZ));
PlacedVolume detPV = motherVol.placeVolume(detVol, tr);
PlacedVolume detPV = motherVol.placeVolume(detVol, tr);
det.setPlacement(detPV);
//Adding layers to placed volume
//Adding layers to placed volume
...
@@ -44,6 +47,56 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
...
@@ -44,6 +47,56 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
det.setPlacement(detPV);
det.setPlacement(detPV);
return det;
*/
xml
::
DetElement
detElem
=
handle
;
std
::
string
detName
=
"ci_GEM"
;
int
detID
=
1
;
xml
::
Component
dims
=
detElem
.
dimensions
();
double
SizeZ
=
30.
*
dd4hep
::
cm
;
// Size in Z direction
double
ROut
=
95.
*
dd4hep
::
cm
;
// Outer radius
double
RIn
=
10.
*
dd4hep
::
cm
;
// Inner radius
double
ShiftZ
=
0.
*
dd4hep
::
cm
;
double
X
=
0.
*
dd4hep
::
cm
;
double
Z
=
0.
*
dd4hep
::
cm
;
int
Nlayers
=
8
;
Material
mat
=
desc
.
material
(
detElem
.
materialStr
());
Material
air
=
desc
.
material
(
"Air"
);
DetElement
det
(
detName
,
detID
);
Volume
motherVol
=
desc
.
pickMotherVolume
(
det
);
Tube
ci_GEM_GVol_Solid
(
RIn
,
ROut
,
SizeZ
/
2.
,
0.
,
360
*
deg
);
Volume
detVol
(
"ci_GEM_GVol_Logic"
,
ci_GEM_GVol_Solid
,
air
);
PlacedVolume
detPV
=
motherVol
.
placeVolume
(
detVol
,
RotationZYX
(
0
,
0
,
0
));
detPV
.
addPhysVolID
(
"system"
,
detID
);
det
.
setPlacement
(
detPV
);
//detVol.setVisAttributes(desc.visAttributes(detElem.visStr()));
//Adding layers to placed volume
int
layerNum
=
0
;
for
(
cml_coll_t
c
(
detElem
,
_U
(
layer
));
c
;
c
++
)
{
xml_comp_t
x_layer
=
c
;
string
layer_name
=
detName
+
_toString
(
layerNum
,
"_layer%d"
);
double
lrmin
,
lrmax
,
lz
;
lrmin
=
RIn
+
(
1.0
+
0.5
*
layerNum
)
*
dd4hep
::
cm
;
lrmax
=
ROut
+
(
-
25.0
+
2.0
*
layerNum
)
*
dd4hep
::
cm
;
lz
=
sizez
*
0.5
+
(
5.0
+
3.
*
layerNum
)
*
dd4hep
::
cm
;
Volume
layer_vol
(
layer_name
,
Tube
(
lrmin
,
lrmax
,
lz
),
mat
);
Position
layer_pos
(
0
,
0
,
lz
);
DetElement
layer
(
det
,
layer_name
,
detID
);
//layer.setAttributes(desc, layer_vol, , , );//(region, limits, visable).
PlacedVolume
layer_phv
=
detVol
.
placeVolume
(
layer_vol
,
layer_pos
);
layer_phv
.
addPhysVolID
(
"layer"
,
layerNum
);
layer
.
setPlacement
(
layer_phv
);
layerNum
++
;
}
return
det
;
return
det
;
}
}
// clang-format off
// clang-format off
...
...
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