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
DigitizationAlgorithm.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file DigitizationAlgorithm.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2021 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/Definitions/Algebra.hpp
"
12
#include "
Acts/Definitions/TrackParametrization.hpp
"
13
#include "
Acts/Geometry/GeometryContext.hpp
"
14
#include "
Acts/Geometry/GeometryHierarchyMap.hpp
"
15
#include "
Acts/Utilities/Logger.hpp
"
16
#include "
ActsExamples/Digitization/DigitizationConfig.hpp
"
17
#include "
ActsExamples/Digitization/MeasurementCreation.hpp
"
18
#include "
ActsExamples/Digitization/SmearingConfig.hpp
"
19
#include "
ActsExamples/EventData/Cluster.hpp
"
20
#include "
ActsExamples/EventData/Index.hpp
"
21
#include "
ActsExamples/EventData/IndexSourceLink.hpp
"
22
#include "
ActsExamples/EventData/Measurement.hpp
"
23
#include "
ActsExamples/EventData/SimHit.hpp
"
24
#include "
ActsExamples/Framework/DataHandle.hpp
"
25
#include "
ActsExamples/Framework/IAlgorithm.hpp
"
26
#include "
ActsExamples/Framework/ProcessCode.hpp
"
27
#include "
ActsExamples/Framework/RandomNumbers.hpp
"
28
#include "
ActsFatras/Digitization/Channelizer.hpp
"
29
#include "
ActsFatras/Digitization/PlanarSurfaceDrift.hpp
"
30
#include "
ActsFatras/Digitization/PlanarSurfaceMask.hpp
"
31
#include "
ActsFatras/Digitization/UncorrelatedHitSmearer.hpp
"
32
33
#include <cstddef>
34
#include <memory>
35
#include <string>
36
#include <tuple>
37
#include <utility>
38
#include <variant>
39
#include <vector>
40
41
namespace
ActsFatras {
42
class
Barcode
;
43
}
// namespace ActsFatras
44
45
namespace
Acts {
46
class
Surface
;
47
class
TrackingGeometry
;
48
}
// namespace Acts
49
50
namespace
ActsExamples {
51
struct
AlgorithmContext;
52
54
class
DigitizationAlgorithm
final :
public
IAlgorithm
{
55
public
:
60
DigitizationAlgorithm
(
DigitizationConfig
config
,
Acts::Logging::Level
level
);
61
66
ProcessCode
execute
(
const
AlgorithmContext
& ctx)
const override
;
67
69
const
DigitizationConfig
&
config
()
const
{
return
m_cfg
; }
70
71
private
:
81
std::vector<ActsFatras::Channelizer::ChannelSegment>
channelizing
(
82
const
GeometricConfig
& geoCfg,
const
SimHit
& hit,
83
const
Acts::Surface
&
surface
,
const
Acts::GeometryContext
&
gctx
,
84
RandomEngine
&
rng
)
const
;
85
94
DigitizedParameters
localParameters
(
95
const
GeometricConfig
& geoCfg,
96
const
std::vector<ActsFatras::Channelizer::ChannelSegment>& channels,
97
RandomEngine
&
rng
)
const
;
98
101
template
<
size_t
kSmearDIM>
102
struct
CombinedDigitizer
{
103
GeometricConfig
geometric
;
104
ActsFatras::BoundParametersSmearer<RandomEngine, kSmearDIM>
smearing
;
105
};
106
107
// Support max 4 digitization dimensions - either digital or smeared
108
using
Digitizer
= std::variant<CombinedDigitizer<0>,
CombinedDigitizer<1>
,
109
CombinedDigitizer<2>
,
CombinedDigitizer<3>
,
110
CombinedDigitizer<4>
>;
111
113
DigitizationConfig
m_cfg
;
115
Acts::GeometryHierarchyMap<Digitizer>
m_digitizers
;
117
ActsFatras::PlanarSurfaceDrift
m_surfaceDrift
;
118
ActsFatras::PlanarSurfaceMask
m_surfaceMask
;
119
ActsFatras::Channelizer
m_channelizer
;
120
121
ReadDataHandle<SimHitContainer>
m_simContainerReadHandle
{
this
,
122
"SimHitContainer"
};
123
124
WriteDataHandle<IndexSourceLinkContainer>
m_sourceLinkWriteHandle
{
125
this
,
"SourceLinks"
};
126
WriteDataHandle<MeasurementContainer>
m_measurementWriteHandle
{
127
this
,
"Measurements"
};
128
WriteDataHandle<ClusterContainer>
m_clusterWriteHandle
{
this
,
"Clusters"
};
129
WriteDataHandle<IndexMultimap<ActsFatras::Barcode>
>
130
m_measurementParticlesMapWriteHandle
{
this
,
"MeasurementParticlesMap"
};
131
WriteDataHandle<IndexMultimap<Index>
>
m_measurementSimHitsMapWriteHandle
{
132
this
,
"MeasurementSimHitsMap"
};
133
141
template
<
size_t
kSmearDIM>
142
static
Digitizer
makeDigitizer
(
const
DigiComponentsConfig
&
cfg
) {
143
CombinedDigitizer<kSmearDIM>
impl;
144
// Copy the geometric configuration
145
impl.
geometric
= cfg.
geometricDigiConfig
;
146
// Prepare the smearing configuration
147
for
(
int
i
= 0; i < static_cast<int>(kSmearDIM); ++
i
) {
148
impl.
smearing
.
indices
[
i
] = cfg.
smearingDigiConfig
.at(
i
).index;
149
impl.
smearing
.
smearFunctions
[
i
] =
150
cfg.
smearingDigiConfig
.at(
i
).smearFunction;
151
}
152
return
impl;
153
}
154
};
155
156
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Algorithms
Digitization
include
ActsExamples
Digitization
DigitizationAlgorithm.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:36
using
1.8.2 with
sPHENIX GitHub integration