Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CEPCSW
Manage
Activity
Members
Labels
Plan
Issues
6
Issue boards
Milestones
Wiki
Code
Merge requests
7
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
cepc
CEPCSW
Commits
199b0ca9
Commit
199b0ca9
authored
4 years ago
by
guofangyi@ihep.ac.cn
Browse files
Options
Downloads
Patches
Plain Diff
Correct cellID in odd layers
parent
2cfafb45
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Detector/DetCRD/src/Calorimeter/CRDEcal.cpp
+3
-3
3 additions, 3 deletions
Detector/DetCRD/src/Calorimeter/CRDEcal.cpp
with
3 additions
and
3 deletions
Detector/DetCRD/src/Calorimeter/CRDEcal.cpp
+
3
−
3
View file @
199b0ca9
...
@@ -66,14 +66,14 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
...
@@ -66,14 +66,14 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
dd4hep
::
Material
air
(
theDetector
.
material
(
"Air"
));
dd4hep
::
Material
air
(
theDetector
.
material
(
"Air"
));
dd4hep
::
Volume
envelopeVol
(
det_name
,
envelope
,
air
);
dd4hep
::
Volume
envelopeVol
(
det_name
,
envelope
,
air
);
dd4hep
::
PlacedVolume
envelopePlv
=
motherVol
.
placeVolume
(
envelopeVol
,
Position
(
0
,
0
,
0
));
dd4hep
::
PlacedVolume
envelopePlv
=
motherVol
.
placeVolume
(
envelopeVol
,
Position
(
0
,
0
,
0
));
envelopeVol
.
setVisAttributes
(
theDetector
,
"
V
isible
Gre
en"
);
envelopeVol
.
setVisAttributes
(
theDetector
,
"
Inv
isible
WithChildr
en"
);
ECAL
.
setPlacement
(
envelopePlv
);
ECAL
.
setPlacement
(
envelopePlv
);
//Define specific material and volumen for detElement
//Define specific material and volumen for detElement
dd4hep
::
Material
mat_BGO
(
theDetector
.
material
(
"G4_BGO"
));
dd4hep
::
Material
mat_BGO
(
theDetector
.
material
(
"G4_BGO"
));
dd4hep
::
Trapezoid
trap
(
dim_x1
,
dim_x2
,
dim_y
,
dim_y
,
dim_z
);
dd4hep
::
Trapezoid
trap
(
dim_x1
,
dim_x2
,
dim_y
,
dim_y
,
dim_z
);
dd4hep
::
Volume
det_vol
(
"trap_vol"
,
trap
,
mat_BGO
);
dd4hep
::
Volume
det_vol
(
"trap_vol"
,
trap
,
mat_BGO
);
det_vol
.
setVisAttributes
(
theDetector
,
"Visible
Red
"
);
det_vol
.
setVisAttributes
(
theDetector
,
"Visible
Green
"
);
dd4hep
::
DetElement
stavedet
(
ECAL
,
"trap"
,
detid
);
dd4hep
::
DetElement
stavedet
(
ECAL
,
"trap"
,
detid
);
//Loop to place crystalls in one part
//Loop to place crystalls in one part
...
@@ -88,7 +88,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
...
@@ -88,7 +88,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
dd4hep
::
Volume
bar_odd
(
"box_bar"
,
dd4hep
::
Box
(
barz_odd
/
2
,
bary
/
2
,
barx
/
2
),
mat_BGO
);
dd4hep
::
Volume
bar_odd
(
"box_bar"
,
dd4hep
::
Box
(
barz_odd
/
2
,
bary
/
2
,
barx
/
2
),
mat_BGO
);
bar_odd
.
setSensitiveDetector
(
sens
);
bar_odd
.
setSensitiveDetector
(
sens
);
for
(
int
iz
=
1
;
iz
<=
Nbarz_odd
;
iz
++
){
for
(
int
iz
=
1
;
iz
<=
Nbarz_odd
;
iz
++
){
dd4hep
::
PlacedVolume
plv
=
det_vol
.
placeVolume
(
bar_odd
,
Position
((
2
*
iphi
-
1
)
*
barz_odd
/
2
-
lx
,
(
2
*
iz
-
1
)
*
barx
/
2
-
dim_y
,
(
2
*
ilayer
-
1
)
*
bary
/
2
-
dim_z
));
dd4hep
::
PlacedVolume
plv
=
det_vol
.
placeVolume
(
bar_odd
,
Position
(
lx
-
(
2
*
iphi
-
1
)
*
barz_odd
/
2
,
(
2
*
iz
-
1
)
*
barx
/
2
-
dim_y
,
(
2
*
ilayer
-
1
)
*
bary
/
2
-
dim_z
));
plv
.
addPhysVolID
(
"layer"
,
ilayer
).
addPhysVolID
(
"block"
,
iphi
).
addPhysVolID
(
"bar"
,
iz
);
plv
.
addPhysVolID
(
"layer"
,
ilayer
).
addPhysVolID
(
"block"
,
iphi
).
addPhysVolID
(
"bar"
,
iz
);
std
::
string
barname
=
"CrystalBar_"
+
std
::
to_string
(
ilayer
)
+
"_"
+
std
::
to_string
(
iphi
)
+
"_"
+
std
::
to_string
(
iz
);
std
::
string
barname
=
"CrystalBar_"
+
std
::
to_string
(
ilayer
)
+
"_"
+
std
::
to_string
(
iphi
)
+
"_"
+
std
::
to_string
(
iz
);
dd4hep
::
DetElement
sd
(
stavedet
,
barname
,
detid
);
dd4hep
::
DetElement
sd
(
stavedet
,
barname
,
detid
);
...
...
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