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
AdaptiveGridDensityVertexFinder.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file AdaptiveGridDensityVertexFinder.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2020 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/EventData/TrackParameters.hpp
"
13
#include "
Acts/Utilities/Result.hpp
"
14
#include "
Acts/Vertexing/AdaptiveGridTrackDensity.hpp
"
15
#include "
Acts/Vertexing/DummyVertexFitter.hpp
"
16
#include "
Acts/Vertexing/Vertex.hpp
"
17
#include "
Acts/Vertexing/VertexingOptions.hpp
"
18
19
#include <unordered_map>
20
21
namespace
Acts {
22
36
template
<
int
trkGr
id
Size = 15,
typename
vfitter_t = DummyVertexFitter<>>
37
class
AdaptiveGridDensityVertexFinder
{
38
// Assert odd trkGridSize
39
static_assert(trkGridSize % 2);
40
41
using
InputTrack_t
=
typename
vfitter_t::InputTrack_t;
42
using
GridDensity
=
AdaptiveGridTrackDensity<trkGridSize>
;
43
44
public
:
45
using
DensityMap
=
typename
GridDensity::DensityMap
;
46
48
struct
Config
{
50
Config
(
float
binSize = 0.1)
51
:
gridDensity
(typename
GridDensity
::
Config
(binSize)) {}
53
Config
(
const
GridDensity
& gDensity) :
gridDensity
(gDensity) {}
54
55
// The grid density object
56
GridDensity
gridDensity
;
57
58
// Cache the main grid and the density contributions (trackGrid and z-bin)
59
// for every single track.
60
// This option enables the possibility to calculate the entire main grid
61
// only once in the first iteration. If tracks are removed from the track
62
// collection, the individual track density contributions to the main grid
63
// can just be removed without calculating the entire grid from scratch.
64
bool
cacheGridStateForTrackRemoval
=
true
;
65
66
// Maximum d0 impact parameter significance to use a track
67
double
maxD0TrackSignificance
= 3.5;
68
// Maximum z0 impact parameter significance to use a track
69
double
maxZ0TrackSignificance
= 12.;
70
// The actual corresponding cut values in the algorithm
71
double
d0SignificanceCut
=
maxD0TrackSignificance
*
maxD0TrackSignificance
;
72
double
z0SignificanceCut
=
maxZ0TrackSignificance
*
maxZ0TrackSignificance
;
73
bool
estimateSeedWidth
=
false
;
74
};
75
79
struct
State
{
80
// Map from the z bin values to the corresponding track density
81
DensityMap
mainDensityMap
;
82
83
// Map from input track to corresponding track density map
84
std::unordered_map<const InputTrack_t*, DensityMap>
trackDensities
;
85
86
// Map to store bool if track has passed track selection or not
87
std::unordered_map<const InputTrack_t*, bool>
trackSelectionMap
;
88
89
// Store tracks that have been removed from track collection. These
90
// tracks will be removed from the main grid
91
std::vector<const InputTrack_t*>
tracksToRemove
;
92
93
bool
isInitialized
=
false
;
94
};
95
106
Result<std::vector<Vertex<InputTrack_t>
>>
find
(
107
const
std::vector<const InputTrack_t*>& trackVector,
108
const
VertexingOptions<InputTrack_t>
& vertexingOptions,
109
State
&
state
)
const
;
110
114
template
<
115
typename
T
=
InputTrack_t
,
116
std::enable_if_t<std::is_same<T, BoundTrackParameters>::value
,
int
> = 0>
117
AdaptiveGridDensityVertexFinder
(
const
Config
&
cfg
)
118
:
m_cfg
(cfg),
m_extractParameters
([](
T
params) {
return
params; }) {}
119
122
template
<
123
typename
T
=
InputTrack_t
,
124
std::enable_if_t<std::is_same<T, BoundTrackParameters>::value
,
int
> = 0>
125
AdaptiveGridDensityVertexFinder
()
126
:
m_extractParameters
([](
T
params) {
return
params; }) {}
127
134
AdaptiveGridDensityVertexFinder
(
135
const
Config
&
cfg
,
136
const
std::function<
BoundTrackParameters
(
InputTrack_t
)>& func)
137
:
m_cfg
(cfg),
m_extractParameters
(func) {}
138
144
AdaptiveGridDensityVertexFinder
(
145
const
std::function<
BoundTrackParameters
(
InputTrack_t
)>& func)
146
:
m_extractParameters
(func) {}
147
148
private
:
154
bool
doesPassTrackSelection
(
const
BoundTrackParameters
& trk)
const
;
155
156
// The configuration object
157
const
Config
m_cfg
;
158
162
std::function<BoundTrackParameters(InputTrack_t)>
m_extractParameters
;
163
};
164
165
}
// namespace Acts
166
167
#include "
AdaptiveGridDensityVertexFinder.ipp
"
acts
blob
sPHENIX
Core
include
Acts
Vertexing
AdaptiveGridDensityVertexFinder.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:35
using
1.8.2 with
sPHENIX GitHub integration