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
GridDensityVertexFinder.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file GridDensityVertexFinder.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/DummyVertexFitter.hpp
"
15
#include "
Acts/Vertexing/GaussianGridTrackDensity.hpp
"
16
#include "
Acts/Vertexing/Vertex.hpp
"
17
#include "
Acts/Vertexing/VertexingOptions.hpp
"
18
19
#include <map>
20
21
namespace
Acts {
22
34
template
<
int
mainGridSize = 2000,
int
trkGridSize = 15,
35
typename
vfitter_t = DummyVertexFitter<>>
36
class
GridDensityVertexFinder
{
37
// Assert odd trkGridSize
38
static_assert(trkGridSize % 2);
39
// Assert bigger main grid than track grid
40
static_assert(mainGridSize > trkGridSize);
41
42
using
InputTrack_t
=
typename
vfitter_t::InputTrack_t;
43
using
GridDensity
=
GaussianGridTrackDensity<mainGridSize, trkGridSize>
;
44
45
public
:
46
using
MainGridVector
=
typename
GridDensity::MainGridVector
;
47
using
TrackGridVector
=
typename
GridDensity::TrackGridVector
;
48
50
struct
Config
{
52
Config
(
float
zMinMax = 100)
53
:
gridDensity
(typename
GridDensity
::
Config
(zMinMax)) {}
55
Config
(
const
GridDensity
& gDensity) :
gridDensity
(gDensity) {}
56
57
// The grid density object
58
GridDensity
gridDensity
;
59
60
// Cache the main grid and the density contributions (trackGrid and z-bin)
61
// for every single track.
62
// This option enables the possibility to calculate the entire main grid
63
// only once in the first iteration. If tracks are removed from the track
64
// collection, the individual track density contributions to the main grid
65
// can just be removed without calculating the entire grid from scratch.
66
bool
cacheGridStateForTrackRemoval
=
true
;
67
68
// Maximum d0 impact parameter significance to use a track
69
double
maxD0TrackSignificance
= 3.5;
70
// Maximum z0 impact parameter significance to use a track
71
double
maxZ0TrackSignificance
= 12.;
72
// The actual corresponding cut values in the algorithm
73
double
d0SignificanceCut
=
maxD0TrackSignificance
*
maxD0TrackSignificance
;
74
double
z0SignificanceCut
=
maxZ0TrackSignificance
*
maxZ0TrackSignificance
;
75
bool
estimateSeedWidth
=
false
;
76
};
77
81
struct
State
{
82
// The main density grid
83
MainGridVector
mainGrid
= MainGridVector::Zero();
84
// Map to store z-bin and track grid (i.e. the density contribution of
85
// a single track to the main grid) for every single track
86
std::map<const InputTrack_t*, std::pair<int, TrackGridVector>>
87
binAndTrackGridMap
;
88
89
// Map to store bool if track has passed track selection or not
90
std::map<const InputTrack_t*, bool>
trackSelectionMap
;
91
92
// Store tracks that have been removed from track collection. These
93
// track will be removed from the main grid
94
std::vector<const InputTrack_t*>
tracksToRemove
;
95
96
bool
isInitialized
=
false
;
97
};
98
109
Result<std::vector<Vertex<InputTrack_t>
>>
find
(
110
const
std::vector<const InputTrack_t*>& trackVector,
111
const
VertexingOptions<InputTrack_t>
& vertexingOptions,
112
State
&
state
)
const
;
113
117
template
<
118
typename
T
=
InputTrack_t
,
119
std::enable_if_t<std::is_same<T, BoundTrackParameters>::value
,
int
> = 0>
120
GridDensityVertexFinder
(
const
Config
&
cfg
)
121
:
m_cfg
(cfg),
m_extractParameters
([](
T
params) {
return
params; }) {}
122
125
template
<
126
typename
T
=
InputTrack_t
,
127
std::enable_if_t<std::is_same<T, BoundTrackParameters>::value
,
int
> = 0>
128
GridDensityVertexFinder
()
129
:
m_extractParameters
([](
T
params) {
return
params; }) {}
130
137
GridDensityVertexFinder
(
138
const
Config
&
cfg
,
139
const
std::function<
BoundTrackParameters
(
InputTrack_t
)>& func)
140
:
m_cfg
(cfg),
m_extractParameters
(func) {}
141
147
GridDensityVertexFinder
(
148
const
std::function<
BoundTrackParameters
(
InputTrack_t
)>& func)
149
:
m_extractParameters
(func) {}
150
151
private
:
157
bool
doesPassTrackSelection
(
const
BoundTrackParameters
& trk)
const
;
158
159
// The configuration object
160
const
Config
m_cfg
;
161
165
std::function<BoundTrackParameters(InputTrack_t)>
m_extractParameters
;
166
};
167
168
}
// namespace Acts
169
170
#include "
GridDensityVertexFinder.ipp
"
acts
blob
sPHENIX
Core
include
Acts
Vertexing
GridDensityVertexFinder.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:35
using
1.8.2 with
sPHENIX GitHub integration