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
Merge requests
!10
Resolve "Implement ce_MRICH"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Resolve "Implement ce_MRICH"
12-implement-ce_mrich
into
master
Overview
2
Commits
5
Pipelines
5
Changes
1
Merged
Resolve "Implement ce_MRICH"
Chao Peng
requested to merge
12-implement-ce_mrich
into
master
Mar 19, 2021
Overview
2
Commits
5
Pipelines
5
Changes
1
Closes
#12 (closed)
Edited
Mar 31, 2021
by
Chao Peng
0
0
Merge request reports
Compare
master
version 4
70707aa2
Mar 31, 2021
version 3
d68a8376
Mar 31, 2021
version 2
9395cd37
Mar 31, 2021
version 1
c2077ec0
Mar 30, 2021
master (base)
and
version 1
latest version
63be8857
5 commits,
Mar 31, 2021
version 4
70707aa2
4 commits,
Mar 31, 2021
version 3
d68a8376
2 commits,
Mar 31, 2021
version 2
9395cd37
2 commits,
Mar 31, 2021
version 1
c2077ec0
1 commit,
Mar 30, 2021
1 file
+
61
−
0
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/ce_MRICH.cpp
0 → 100644
+
61
−
0
View file @ c2077ec0
Edit in single-file editor
Open in Web IDE
#include
<XML/Helper.h>
#include
"TMath.h"
#include
"TString.h"
#include
"Math/Point2D.h"
#include
"DDRec/Surface.h"
#include
"DDRec/DetectorData.h"
#include
"DD4hep/OpticalSurfaces.h"
#include
"DD4hep/DetFactoryHelper.h"
#include
"DD4hep/Printout.h"
using
namespace
std
;
using
namespace
dd4hep
;
using
namespace
dd4hep
::
rec
;
typedef
ROOT
::
Math
::
XYPoint
Point
;
// create the detector
static
Ref_t
createDetector
(
Detector
&
desc
,
xml
::
Handle_t
handle
,
SensitiveDetector
sens
)
{
xml
::
DetElement
detElem
=
handle
;
std
::
string
detName
=
detElem
.
nameStr
();
int
detID
=
detElem
.
id
();
DetElement
det
(
detName
,
detID
);
xml
::
Component
dims
=
detElem
.
dimensions
();
xml
::
Component
mods
=
detElem
.
child
(
_Unicode
(
modules
));
xml
::
Component
rads
=
detElem
.
child
(
_Unicode
(
radiator
));
auto
RIn
=
dims
.
attr
<
double
>
(
_Unicode
(
r_in
));
auto
ROut
=
dims
.
attr
<
double
>
(
_Unicode
(
r_out
));
auto
SizeZ
=
dims
.
attr
<
double
>
(
_Unicode
(
size_z
));
auto
PosZ
=
dims
.
z
();
auto
InnerR
=
dims
.
attr
<
double
>
(
_Unicode
(
inner_r
));
auto
mThick
=
mods
.
attr
<
double
>
(
_Unicode
(
thickness
));
auto
mWidth
=
mods
.
attr
<
double
>
(
_Unicode
(
width
));
auto
mGap
=
mods
.
attr
<
double
>
(
_Unicode
(
gap
));
auto
envMat
=
desc
.
material
(
detElem
.
materialStr
());
// detector envelope
auto
envShape
=
Tube
(
RIn
,
ROut
,
SizeZ
/
2.
,
0.
,
2
*
M_PI
);
Volume
envVol
(
"ce_MRICH_GVol"
,
envShape
,
envMat
);
envVol
.
setVisAttributes
(
desc
.
visAttributes
(
detElem
.
visStr
()));
// modules
// place envelope
Volume
motherVol
=
desc
.
pickMotherVolume
(
det
);
PlacedVolume
envPV
=
motherVol
.
placeVolume
(
envVol
,
Position
(
0
,
0
,
PosZ
));
envPV
.
addPhysVolID
(
"system"
,
detID
);
det
.
setPlacement
(
envPV
);
return
det
;
}
// clang-format off
DECLARE_DETELEMENT
(
ce_MRICH
,
createDetector
)
Loading