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
CsvOptionsWriter.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file CsvOptionsWriter.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2019 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/Io/Csv/CsvOptionsWriter.hpp
"
10
11
#include <limits>
12
13
#include <boost/program_options.hpp>
14
#include <
dfe/dfe_io_dsv.hpp
>
15
16
void
ActsExamples::Options::addCsvWriterOptions
(
17
ActsExamples::Options::Description
& desc) {
18
using namespace
boost::program_options;
19
20
desc.add_options()(
21
"csv-output-precision"
,
22
value<size_t>()->default_value(std::numeric_limits<float>::max_digits10),
23
"Floating number output precision."
)(
24
"csv-tg-perevent"
, bool_switch(),
"Write tracking geometry per event."
);
25
}
26
27
ActsExamples::CsvParticleWriter::Config
28
ActsExamples::Options::readCsvParticleWriterConfig
(
29
const
ActsExamples::Options::Variables
& vm) {
30
ActsExamples::CsvParticleWriter::Config
cfg;
31
if
(not vm[
"output-dir"
].empty()) {
32
cfg.
outputDir
= vm[
"output-dir"
].as<std::string>();
33
}
34
cfg.
outputPrecision
= vm[
"csv-output-precision"
].as<
size_t
>();
35
return
cfg;
36
}
37
38
ActsExamples::CsvPlanarClusterWriter::Config
39
ActsExamples::Options::readCsvPlanarClusterWriterConfig
(
40
const
ActsExamples::Options::Variables
& vm) {
41
ActsExamples::CsvPlanarClusterWriter::Config
cfg;
42
if
(not vm[
"output-dir"
].empty()) {
43
cfg.
outputDir
= vm[
"output-dir"
].as<std::string>();
44
}
45
cfg.
outputPrecision
= vm[
"csv-output-precision"
].as<
size_t
>();
46
return
cfg;
47
}
48
49
ActsExamples::CsvTrackingGeometryWriter::Config
50
ActsExamples::Options::readCsvTrackingGeometryWriterConfig
(
51
const
ActsExamples::Options::Variables
& vm) {
52
ActsExamples::CsvTrackingGeometryWriter::Config
cfg;
53
if
(not vm[
"output-dir"
].empty()) {
54
cfg.
outputDir
= vm[
"output-dir"
].as<std::string>();
55
}
56
cfg.
outputPrecision
= vm[
"csv-output-precision"
].as<
size_t
>();
57
cfg.
writePerEvent
= vm.count(
"csv-tg-perevent"
);
58
return
cfg;
59
}
acts
blob
sPHENIX
Examples
Io
Csv
src
CsvOptionsWriter.cpp
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:25
using
1.8.2 with
EIC GitHub integration