EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
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/EventData/TrackParameters.hpp
"
12
#include "
Acts/Utilities/Definitions.hpp
"
13
#include "
Acts/Utilities/Result.hpp
"
14
#include "
Acts/Vertexing/GaussianGridTrackDensity.hpp
"
15
#include "
Acts/Vertexing/Vertex.hpp
"
16
#include "
Acts/Vertexing/VertexingOptions.hpp
"
17
18
#include "
DummyVertexFitter.hpp
"
19
20
namespace
Acts {
21
33
template
<
int
mainGridSize = 2000,
int
trkGridSize = 15,
34
typename
vfitter_t = DummyVertexFitter<>>
35
class
GridDensityVertexFinder
{
36
// Assert odd trkGridSize
37
static_assert(trkGridSize % 2);
38
// Assert bigger main grid than track grid
39
static_assert(mainGridSize > trkGridSize);
40
41
using
InputTrack_t
=
typename
vfitter_t::InputTrack_t;
42
using
GridDensity
=
GaussianGridTrackDensity<mainGridSize, trkGridSize>
;
43
44
public
:
46
struct
Config
{
48
Config
(
float
zMinMax = 100)
49
:
gridDensity
(typename
GridDensity
::
Config
(zMinMax)) {}
51
Config
(
const
GridDensity
& gDensity) :
gridDensity
(gDensity) {}
52
53
// The grid density object
54
GridDensity
gridDensity
;
55
56
// Cache the main grid and the density contributions (trackGrid and z-bin)
57
// for every single track.
58
// This option enables the possibility to calculate the entire main grid
59
// only once in the first iteration. If tracks are removed from the track
60
// collection, the individual track density contributions to the main grid
61
// can just be removed without calculating the entire grid from scratch.
62
bool
cacheGridStateForTrackRemoval
=
true
;
63
64
// Maximum d0 impact parameter significance to use a track
65
double
maxD0TrackSignificance
= 3.5;
66
// Maximum z0 impact parameter significance to use a track
67
double
maxZ0TrackSignificance
= 12.;
68
// The actual corresponding cut values in the algorithm
69
double
d0SignificanceCut
=
maxD0TrackSignificance
*
maxD0TrackSignificance
;
70
double
z0SignificanceCut
=
maxZ0TrackSignificance
*
maxZ0TrackSignificance
;
71
bool
estimateSeedWidth
=
false
;
72
};
73
77
struct
State
{
78
// The main density grid
79
ActsVectorF<mainGridSize>
mainGrid
=
ActsVectorF<mainGridSize>::Zero
();
80
// Map to store z-bin and track grid (i.e. the density contribution of
81
// a single track to the main grid) for every single track
82
std::map<const InputTrack_t*, std::pair<int, ActsVectorF<trkGridSize>>>
83
binAndTrackGridMap
;
84
85
// Map to store bool if track has passed track selection or not
86
std::map<const InputTrack_t*, bool>
trackSelectionMap
;
87
88
// Store tracks that have been removed from track collection. These
89
// track will be removed from the main grid
90
std::vector<const InputTrack_t*>
tracksToRemove
;
91
92
bool
isInitialized
=
false
;
93
};
94
105
Result<std::vector<Vertex<InputTrack_t>
>>
find
(
106
const
std::vector<const InputTrack_t*>& trackVector,
107
const
VertexingOptions<InputTrack_t>
& vertexingOptions,
108
State
& state)
const
;
109
113
template
<
114
typename
T
=
InputTrack_t
,
115
std::enable_if_t<std::is_same<T, BoundTrackParameters>::value
,
int
> = 0>
116
GridDensityVertexFinder
(
const
Config
& cfg)
117
:
m_cfg
(cfg),
m_extractParameters
([](
T
params) {
return
params; }) {}
118
121
template
<
122
typename
T
=
InputTrack_t
,
123
std::enable_if_t<std::is_same<T, BoundTrackParameters>::value
,
int
> = 0>
124
GridDensityVertexFinder
()
125
:
m_extractParameters
([](
T
params) {
return
params; }) {}
126
133
GridDensityVertexFinder
(
134
const
Config
& cfg,
135
const
std::function<
BoundTrackParameters
(
InputTrack_t
)>&
func
)
136
:
m_cfg
(cfg),
m_extractParameters
(
func
) {}
137
143
GridDensityVertexFinder
(
144
const
std::function<
BoundTrackParameters
(
InputTrack_t
)>&
func
)
145
:
m_extractParameters
(
func
) {}
146
147
private
:
153
bool
doesPassTrackSelection
(
const
BoundTrackParameters
& trk)
const
;
154
155
// The configuration object
156
const
Config
m_cfg
;
157
163
std::function<BoundTrackParameters(InputTrack_t)>
m_extractParameters
;
164
};
165
166
}
// namespace Acts
167
168
#include "
GridDensityVertexFinder.ipp
"
acts
blob
sPHENIX
Core
include
Acts
Vertexing
GridDensityVertexFinder.hpp
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:24
using
1.8.2 with
EIC GitHub integration