CbmRoot
Loading...
Searching...
No Matches
KfFieldValue.cxx
Go to the documentation of this file.
1/* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#include "KfFieldValue.h"
11
12#include <sstream>
13
14namespace cbm::algo::kf
15{
16
17 // -------------------------------------------------------------------------------------------------------------------
18 //
19 template<typename T>
21 {
22 // Check SIMD data vectors for consistent initialization
23 utils::CheckSimdVectorEquality(fB[0], "FieldValue::x");
24 utils::CheckSimdVectorEquality(fB[1], "FieldValue::y");
25 utils::CheckSimdVectorEquality(fB[2], "FieldValue::z");
26
27 // TODO: Any other checks? (S.Zharko)
28 }
29
30 // -------------------------------------------------------------------------------------------------------------------
31 //
32 template<typename T>
33 std::string FieldValue<T>::ToString(int indentLevel) const
34 {
35 constexpr char IndentChar = '\t';
36 std::stringstream msg;
37 std::string indent(indentLevel, IndentChar);
38 msg << indent << "B = {" << fB[0] << ", " << fB[1] << ", " << fB[2] << "} [kG]";
39 return msg.str();
40 }
41
42 template class FieldValue<float>;
43 template class FieldValue<double>;
44 template class FieldValue<fvec>;
45} // namespace cbm::algo::kf
Magnetic flux density vector representation.
Magnetic flux density vector.
void CheckConsistency() const
Consistency checker.
std::string ToString(int indentLevel=0) const
String representation of the field.
void CheckSimdVectorEquality(fvec v, const char *name)
Checks, if a SIMD vector horizontally equal TODO: Find this method in the VC!
Definition KfUtils.cxx:29