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
0dba7d39
Commit
0dba7d39
authored
6 years ago
by
Markus Frank
Committed by
MarkusFrankATcernch
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Elaborate a bit more the DDG4_MySensDet example and fix the persistency of the Geant4 hits
parent
83505249
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/DDCodex/src/CODEXb_geo.cpp
+16
-16
16 additions, 16 deletions
examples/DDCodex/src/CODEXb_geo.cpp
with
16 additions
and
16 deletions
examples/DDCodex/src/CODEXb_geo.cpp
+
16
−
16
View file @
0dba7d39
...
...
@@ -52,19 +52,19 @@ static Ref_t create_element(Detector& description, xml_h e, Ref_t sens) {
int
num_sensitive
=
0
;
for
(
xml_coll_t
i
(
x_det
,
_U
(
shield
));
i
;
++
i
)
{
xml_comp_t
s
=
i
;
double
z
=
s
.
z
(),
dz
=
s
.
dz
();
xml_comp_t
s
hield
=
i
;
double
z
=
s
hield
.
z
(),
dz
=
s
hield
.
dz
();
double
r1
=
sin_cone
*
z
,
r2
=
sin_cone
*
(
z
+
dz
);
string
nam
=
s
.
nameStr
();
string
nam
=
s
hield
.
nameStr
();
Cone
con
(
dz
/
2.
,
0.
,
r1
,
0.
,
r2
);
Material
mat
(
description
.
material
(
s
.
attr
<
string
>
(
_U
(
material
))));
Material
mat
(
description
.
material
(
s
hield
.
attr
<
string
>
(
_U
(
material
))));
Volume
vol
(
nam
,
con
,
mat
);
printout
(
INFO
,
"CODEX-b"
,
"%s Shield: %-12s %-12s z=%7g dz=%7g r1=%7g r2=%7g"
,
det_name
.
c_str
(),
vol
.
name
(),
(
'['
+
string
(
mat
.
name
())
+
']'
).
c_str
(),
z
,
dz
,
r1
,
r2
);
vol
.
setVisAttributes
(
description
,
s
.
visStr
());
vol
.
setVisAttributes
(
description
,
s
hield
.
visStr
());
pv
=
env_vol
.
placeVolume
(
vol
,
Position
(
0
,
0
,
-
env_dz
+
z
+
dz
/
2.0
));
if
(
s
.
isSensitive
()
)
{
if
(
s
hield
.
isSensitive
()
)
{
DetElement
det
(
sdet
,
"shield_"
+
nam
,
x_det
.
id
());
pv
.
addPhysVolID
(
"type"
,
0
);
pv
.
addPhysVolID
(
"module"
,
num_sensitive
);
...
...
@@ -76,25 +76,25 @@ static Ref_t create_element(Detector& description, xml_h e, Ref_t sens) {
int
type_num
=
0
,
station_number
=
0
;
double
z0
=
0.0
,
x0
=
0.0
,
x_tot
=
0.0
;
for
(
xml_coll_t
i
(
x_det
,
_U
(
station
));
i
;
++
i
,
++
type_num
)
{
xml_comp_t
s
=
i
;
x_tot
+=
double
(
s
.
repeat
())
*
(
s
.
distance
()
+
s
.
thickness
());
xml_comp_t
s
tation
=
i
;
x_tot
+=
double
(
s
tation
.
repeat
())
*
(
s
tation
.
distance
()
+
s
tation
.
thickness
());
}
printout
(
INFO
,
"CODEX-b"
,
"%s X_tot= %g"
,
det_name
.
c_str
(),
x_tot
);
for
(
xml_coll_t
i
(
x_det
,
_U
(
station
));
i
;
++
i
,
++
type_num
)
{
xml_comp_t
s
=
i
;
int
repeat
=
s
.
repeat
();
xml_comp_t
s
tation
=
i
;
int
repeat
=
s
tation
.
repeat
();
string
nam
=
_toString
(
station_number
,
"CODEX_station_type%d"
);
Box
box
(
s
.
width
()
/
2.
,
s
.
height
()
/
2.
,
s
.
thickness
()
/
2.
);
Material
mat
(
description
.
material
(
s
.
attr
<
string
>
(
_U
(
material
))));
Box
box
(
s
tation
.
width
()
/
2.
,
s
tation
.
height
()
/
2.
,
s
tation
.
thickness
()
/
2.
);
Material
mat
(
description
.
material
(
s
tation
.
attr
<
string
>
(
_U
(
material
))));
Volume
vol
(
nam
,
box
,
mat
);
double
dist
=
s
.
thickness
()
+
s
.
distance
();
double
dist
=
s
tation
.
thickness
()
+
s
tation
.
distance
();
double
dx
=
dist
/
sin_beam
;
double
dz
=
dist
/
cos_beam
;
if
(
s
.
hasAttr
(
_U
(
z
))
)
{
z0
=
s
.
z
()
+
x_tot
/
2.0
/
cos_beam
;
if
(
s
tation
.
hasAttr
(
_U
(
z
))
)
{
z0
=
s
tation
.
z
()
+
x_tot
/
2.0
/
cos_beam
;
x0
=
-
x_tot
/
2.0
/
sin_beam
;
}
vol
.
setVisAttributes
(
description
,
s
.
visStr
());
vol
.
setVisAttributes
(
description
,
s
tation
.
visStr
());
for
(
int
j
=
0
;
j
<
repeat
;
++
j
)
{
DetElement
det
(
sdet
,
_toString
(
station_number
,
"module%d"
),
station_number
);
pv
=
env_vol
.
placeVolume
(
vol
,
Transform3D
(
RotationZYX
(
0
,
M_PI
/
2.0
-
env_angle
,
0
),
Position
(
x0
,
0
,
z0
)));
...
...
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