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
CsvMultiTrajectoryWriter.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file CsvMultiTrajectoryWriter.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/Units.hpp
"
12
#include "
Acts/EventData/MultiTrajectoryHelpers.hpp
"
13
#include "
Acts/Utilities/Logger.hpp
"
14
#include "
ActsExamples/EventData/Index.hpp
"
15
#include "
ActsExamples/EventData/Track.hpp
"
16
#include "
ActsExamples/EventData/Trajectories.hpp
"
17
#include "
ActsExamples/Framework/DataHandle.hpp
"
18
#include "
ActsExamples/Framework/ProcessCode.hpp
"
19
#include "
ActsExamples/Framework/WriterT.hpp
"
20
#include "
ActsFatras/EventData/Barcode.hpp
"
21
22
#include <cstddef>
23
#include <cstdint>
24
#include <fstream>
25
#include <string>
26
#include <vector>
27
28
namespace
ActsExamples {
29
struct
AlgorithmContext;
30
}
// namespace ActsExamples
31
32
using namespace
Acts::UnitLiterals;
33
34
namespace
ActsExamples {
35
49
class
CsvMultiTrajectoryWriter
:
public
WriterT
<TrajectoriesContainer> {
50
public
:
51
using
HitParticlesMap
=
ActsExamples::IndexMultimap<ActsFatras::Barcode>
;
52
53
struct
Config
{
54
std::string
inputTrajectories
;
55
std::string
outputDir
;
56
std::string
fileName =
"CKFtracks.csv"
;
57
std::string
58
inputMeasurementParticlesMap
;
59
size_t
outputPrecision = 6;
60
size_t
nMeasurementsMin
= 7;
61
bool
onlyTruthMatched =
false
;
62
double
truthMatchProbMin = 0.5;
63
double
ptMin = 1_GeV;
64
};
65
69
CsvMultiTrajectoryWriter
(
const
Config
&
config
,
70
Acts::Logging::Level
level
=
Acts::Logging::INFO
);
71
73
const
Config
&
config
()
const
{
return
m_cfg
; }
74
75
protected
:
79
ProcessCode
writeT(
const
AlgorithmContext
& context,
80
const
TrajectoriesContainer
& trajectories)
override
;
81
82
private
:
83
Config
m_cfg
;
84
85
ReadDataHandle<HitParticlesMap>
m_inputMeasurementParticlesMap{
86
this
,
"InputMeasurementParticlesMap"
};
87
90
struct
trackInfo
:
public
Acts::MultiTrajectoryHelpers::TrajectoryState
{
91
size_t
trackId = 0;
92
ActsFatras::Barcode
particleId
;
93
size_t
nMajorityHits = 0;
94
std::string
trackType
;
95
double
truthMatchProb = 0;
96
const
TrackParameters
* fittedParameters =
nullptr
;
97
std::vector<uint64_t>
measurementsID
;
98
};
// trackInfo struct
99
};
100
101
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Io
Csv
include
ActsExamples
Io
Csv
CsvMultiTrajectoryWriter.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:38
using
1.8.2 with
sPHENIX GitHub integration