CbmRoot
Loading...
Searching...
No Matches
CaConfig.cxx
Go to the documentation of this file.
1/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#include "CaConfig.h"
11
12#include <sstream>
13
14#include <fmt/format.h>
15
18
19// ---------------------------------------------------------------------------------------------------------------------
20//
22 Config::MisalignmentTolArray_t&& misalignment)
23 : fvCaIterations(std::move(iterations))
24 , fControl(std::move(controlFlags))
25 , fDev(std::move(devFlags))
26 , fvMisalignment(std::move(misalignment))
27{
28}
29
30
31// ---------------------------------------------------------------------------------------------------------------------
32//
33std::string Config::ToString(int indentLevel) const
34{
35 auto Indent = [indentLevel](int level) -> std::string {
36 constexpr char indentCh = '\t';
37 return std::string(indentLevel + level, indentCh);
38 };
39
40 auto DumpMisalignmentTolerances = [&]() -> std::string {
41 std::stringstream msg;
42 msg << fmt::format("{}{:5} {:10} {:10} {:10}", Indent(indentLevel + 2), "det Id.", "x [cm]", "y [cm]", "time [ns]");
43 for (int iDet = 0; iDet < constants::size::MaxNdetectors; ++iDet) {
44 const auto& m = fvMisalignment[iDet];
45 msg << fmt::format("\n{}{:5} {:10.4} {:10.4} {:10.4}", Indent(indentLevel + 2), iDet, m.GetX(), m.GetY(),
46 m.GetTime());
47 }
48 return msg.str();
49 };
50
51 // clang-format off
52 return
53 fmt::format("{}CONFIG:\n", Indent(0)) +
54 fmt::format("{}CONTROL FLAGS:\n", Indent(1)) +
55 fmt::format("{}Max nof doublets per singlet: {}\n", Indent(2), fControl.maxDoubletsPerSinglet) +
56 fmt::format("{}Max nof triplets per doublet: {}\n", Indent(2), fControl.maxTripletsPerDoublet) +
57 fmt::format("{}Default particle mass: {} GeV/c2\n", Indent(2), fControl.defaultMass) +
58 fmt::format("{}Ghost suppression: {}\n", Indent(2), fControl.ghostSuppression) +
59 fmt::format("{}TRACKING ITERATIONS:\n", Indent(1)) +
61 fmt::format("{}DEVELOPMENT FLAGS:\n", Indent(1)) +
62 fmt::format("{}Extend tracks using MC: {}\n", Indent(2), fDev.extendTracksViaMc) +
63 fmt::format("{}Force using original magnetic field: {}\n", Indent(2), fDev.forceUseOriginalField) +
64 fmt::format("{}Ignore hit search areas: {}\n", Indent(2), fDev.ignoreHitSearchAreas) +
65 fmt::format("{}Match doublets using MC: {}\n", Indent(2), fDev.matchDoubletsViaMc) +
66 fmt::format("{}Match triplets using MC: {}\n", Indent(2), fDev.matchTripletsViaMc) +
67 fmt::format("{}Suppress hits in overlaps using MC: {}\n", Indent(2), fDev.suppressOverlapHitsViaMc) +
68 fmt::format("{}MISALIGNMENT TOLERANCES:\n", Indent(1)) +
69 DumpMisalignmentTolerances();
70 // clang-format on
71}
Configuration for the CA tracking algorithm (source)
Config()=default
Configuration of the CA tracking (excluding geometry)
Definition CaConfig.h:36
Dev fDev
Development flags.
Definition CaConfig.h:185
std::string ToString(int indentLevel=0) const
String representation of the class.
Definition CaConfig.cxx:33
MisalignmentTolArray_t fvMisalignment
Misalignment tolerances vs. detID.
Definition CaConfig.h:186
std::array< MisalignmentTolerance, constants::size::MaxNdetectors > MisalignmentTolArray_t
Definition CaConfig.h:41
std::vector< T > DynArray_t
A type of container for a dynamic array.
Definition CaConfig.h:39
Control fControl
Control flags.
Definition CaConfig.h:184
DynArray_t< Iteration > fvCaIterations
Vector of CA iteration properties.
Definition CaConfig.h:183
A set of parameters for the CA Track finder iteration.
Definition CaIteration.h:31
static std::string ToTableFromVector(const Vector< Iteration > &vIterations, int indentLevel=0)
Forms a string, representing a table of iterations from the vector of iterations.
constexpr int MaxNdetectors
Max number of tracking detectors.
Definition CaDefs.h:43
Hash for CbmL1LinkKey.
CA control flags and parametrs.
Definition CaConfig.h:46
CA development flags.
Definition CaConfig.h:80