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
PrototracksToSeeds.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PrototracksToSeeds.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2023 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
#include "
ActsExamples/Utilities/PrototracksToSeeds.hpp
"
10
11
#include "
ActsExamples/EventData/IndexSourceLink.hpp
"
12
#include "
ActsExamples/EventData/ProtoTrack.hpp
"
13
#include "
ActsExamples/EventData/SimSeed.hpp
"
14
#include "
ActsExamples/Framework/WhiteBoard.hpp
"
15
#include "
ActsExamples/Utilities/EventDataTransforms.hpp
"
16
17
#include <algorithm>
18
19
namespace
ActsExamples {
20
21
PrototracksToSeeds::PrototracksToSeeds
(
Config
cfg
,
Acts::Logging::Level
lvl)
22
:
IAlgorithm
(
"PrototracksToSeeds"
, lvl),
m_cfg
(std::
move
(cfg)) {
23
m_outputSeeds
.
initialize
(
m_cfg
.
outputSeeds
);
24
m_outputProtoTracks
.
initialize
(
m_cfg
.
outputProtoTracks
);
25
m_inputProtoTracks
.
initialize
(
m_cfg
.
inputProtoTracks
);
26
m_inputSpacePoints
.
initialize
(
m_cfg
.
inputSpacePoints
);
27
}
28
29
ProcessCode
PrototracksToSeeds::execute
(
const
AlgorithmContext
& ctx)
const
{
30
auto
prototracks =
m_inputProtoTracks
(ctx);
31
32
const
auto
nBefore = prototracks.size();
33
prototracks.erase(std::remove_if(prototracks.begin(), prototracks.end(),
34
[](
const
auto
&
t
) {
return
t
.size() < 3; }),
35
prototracks.end());
36
ACTS_DEBUG
(
"Discarded "
<< prototracks.size() - nBefore
37
<<
" prototracks with less then 3 hits"
);
38
39
SimSeedContainer
seeds;
40
seeds.reserve(prototracks.size());
41
42
const
auto
& sps =
m_inputSpacePoints
(ctx);
43
std::transform
(prototracks.begin(), prototracks.end(),
44
std::back_inserter(seeds),
45
[&](
const
auto
&
pt
) {
return
prototrackToSeed
(
pt
, sps); });
46
47
m_outputSeeds
(ctx,
std::move
(seeds));
48
m_outputProtoTracks
(ctx,
std::move
(prototracks));
49
50
return
ProcessCode::SUCCESS
;
51
}
52
53
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Algorithms
Utilities
src
PrototracksToSeeds.cpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:37
using
1.8.2 with
sPHENIX GitHub integration