Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
DD4hepGeometryService.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file DD4hepGeometryService.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2017 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#pragma once
10
11
#include "
Acts/Geometry/GeometryContext.hpp
"
12
#include "
Acts/Geometry/GeometryIdentifier.hpp
"
13
#include "
ActsExamples/Framework/ProcessCode.hpp
"
14
#include <
Acts/Definitions/Units.hpp
>
15
#include <
Acts/Geometry/TrackingGeometry.hpp
>
16
#include <
Acts/Material/IMaterialDecorator.hpp
>
17
#include <
Acts/Utilities/BinningType.hpp
>
18
#include <
Acts/Utilities/Logger.hpp
>
19
20
#include <functional>
21
#include <memory>
22
#include <string>
23
#include <vector>
24
25
#include <DD4hep/DetElement.h>
26
#include <DD4hep/Detector.h>
27
#include <TGeoNode.h>
28
29
class
TGeoNode;
30
namespace
Acts {
31
class
IMaterialDecorator;
32
class
TrackingGeometry
;
33
}
// namespace Acts
34
namespace
dd4hep {
35
class
Detector;
36
}
// namespace dd4hep
37
38
namespace
ActsExamples {
39
namespace
DD4hep {
40
41
void
sortFCChhDetElements
(std::vector<dd4hep::DetElement>& det);
42
50
class
DD4hepGeometryService
{
51
public
:
52
struct
Config
{
54
Acts::Logging::Level
logLevel
=
Acts::Logging::Level::INFO
;
56
Acts::Logging::Level
dd4hepLogLevel
=
Acts::Logging::Level::INFO
;
58
std::vector<std::string>
xmlFileNames
;
60
std::string
name
;
62
Acts::BinningType
bTypePhi
=
Acts::equidistant
;
64
Acts::BinningType
bTypeR
=
Acts::arbitrary
;
66
Acts::BinningType
bTypeZ
=
Acts::equidistant
;
73
double
envelopeR
= 1 *
Acts::UnitConstants::mm
;
79
double
envelopeZ
= 1 *
Acts::UnitConstants::mm
;
80
double
defaultLayerThickness
= 10
e
-10;
81
std::function<void(std::vector<dd4hep::DetElement>&
detectors
)>
82
sortDetectors
=
sortFCChhDetElements
;
84
std::shared_ptr<const Acts::IMaterialDecorator>
matDecorator
;
85
87
std::shared_ptr<const Acts::GeometryIdentifierHook>
geometryIdentifierHook
=
88
std::make_shared<const Acts::GeometryIdentifierHook>();
89
};
90
91
DD4hepGeometryService
(
const
Config
&
cfg
);
92
~DD4hepGeometryService
();
93
95
dd4hep::Detector&
detector
();
96
99
dd4hep::DetElement&
geometry
();
100
103
TGeoNode&
tgeoGeometry
();
104
108
std::shared_ptr<const Acts::TrackingGeometry>
trackingGeometry
(
109
const
Acts::GeometryContext
&
gctx
);
110
111
private
:
113
ActsExamples::ProcessCode
buildDD4hepGeometry
();
114
116
ActsExamples::ProcessCode
buildTrackingGeometry
(
117
const
Acts::GeometryContext
&
gctx
);
118
120
Config
m_cfg
;
122
dd4hep::Detector*
m_detector
=
nullptr
;
124
dd4hep::DetElement
m_geometry
;
126
std::shared_ptr<const Acts::TrackingGeometry>
m_trackingGeometry
;
127
128
const
Acts::Logger
&
logger
()
const
{
return
*
m_logger
; }
129
130
std::unique_ptr<const Acts::Logger>
m_logger
;
131
};
132
133
}
// namespace DD4hep
134
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Detectors
DD4hepDetector
include
ActsExamples
DD4hepDetector
DD4hepGeometryService.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:37
using
1.8.2 with
sPHENIX GitHub integration