ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detector_reader_config.hpp
1// This file is part of the ACTS project.
2//
3// Copyright (C) 2016 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 https://mozilla.org/MPL/2.0/.
8
9#pragma once
10
11// Project include(s)
12#include "detray/builders/volume_builder_interface.hpp"
13
14// System include(s)
15#include <ostream>
16#include <string>
17#include <vector>
18
19namespace detray::io {
20
24 std::vector<std::string> m_files;
28 bool m_do_check{true};
30 bool m_verbose{false};
31
36 const std::vector<std::string>& files() const { return m_files; }
42
44 bool deduplicate() const { return m_builder_opts.deduplicate(); }
47 bool do_check() const { return m_do_check; }
50 bool verbose_check() const { return m_verbose; }
52
58 detector_reader_config& add_file(const std::string& file_name) {
59 m_files.push_back(file_name);
60 return *this;
61 }
62
66 m_builder_opts.deduplicate(toggle);
67 return *this;
68 }
69
72 detector_reader_config& do_check(const bool check) {
73 m_do_check = check;
74 return *this;
75 }
76
81 if (verbose && !m_do_check) {
82 m_do_check = true;
83 }
84 m_verbose = verbose;
85 return *this;
86 }
87
88
90 friend std::ostream& operator<<(std::ostream& out,
91 const detector_reader_config& cfg) {
92 out << "\nDetector reader\n"
93 << "----------------------------\n"
94 << " Detector files : \n";
95 for (const auto& file_name : cfg.files()) {
96 out << " -> " << file_name << "\n";
97 }
98 out << " Deduplicate data : " << std::boolalpha << cfg.deduplicate()
99 << std::noboolalpha << "\n";
100
101 return out;
102 }
103};
104
105} // namespace detray::io
The following enums are global for all detectors.
Definition concepts.hpp:18
config struct for detector reading.
Definition detector_reader_config.hpp:22
detector_reader_config & verbose_check(const bool verbose)
Enable detailed output from the consistency check.
Definition detector_reader_config.hpp:80
bool do_check() const
Return whether detector consistency checks are enabled.
Definition detector_reader_config.hpp:47
detector_reader_config & do_check(const bool check)
Enable or disable the post-read detector consistency check.
Definition detector_reader_config.hpp:72
friend std::ostream & operator<<(std::ostream &out, const detector_reader_config &cfg)
Print the detector reader configuration.
Definition detector_reader_config.hpp:90
detray::volume_builder_options m_builder_opts
Volume builder options.
Definition detector_reader_config.hpp:26
bool m_verbose
Verbosity of the detector consistency check.
Definition detector_reader_config.hpp:30
const std::vector< std::string > & files() const
GettersReturn the list of configured detector input files.
Definition detector_reader_config.hpp:36
bool verbose_check() const
Return whether consistency checks print detailed output.
Definition detector_reader_config.hpp:50
detector_reader_config & deduplicate(bool toggle)
Enable or disable deduplication in the volume builder.
Definition detector_reader_config.hpp:65
const detray::volume_builder_options & builder_options() const
Return the volume-builder options used during reconstruction.
Definition detector_reader_config.hpp:39
std::vector< std::string > m_files
Input files.
Definition detector_reader_config.hpp:24
detector_reader_config & add_file(const std::string &file_name)
SettersAdd a detector component file to the input list.
Definition detector_reader_config.hpp:58
bool m_do_check
Run detector consistency check after reading.
Definition detector_reader_config.hpp:28
bool deduplicate() const
Return whether duplicate detector components are removed.
Definition detector_reader_config.hpp:44
Options for the volume builder classes.
Definition volume_builder_interface.hpp:29