From beef867c272e85a0d58e69409dfb88cd74ee1e44 Mon Sep 17 00:00:00 2001 From: "s.zharko@gsi.de" <s.zharko@gsi.de> Date: Tue, 15 Feb 2022 20:59:08 +0100 Subject: [PATCH] L1Algo CA track finder iterations: updates --- reco/L1/CMakeLists.txt | 1 + reco/L1/L1Algo/L1InitManager.h | 2 +- reco/L1/L1Algo/L1MaterialInfo.h | 9 ++++- reco/L1/L1Algo/L1Station.cxx | 53 +++++++++++++------------- reco/L1/L1Algo/L1UMeasurementInfo.cxx | 5 +++ reco/L1/L1Algo/L1XYMeasurementInfo.cxx | 19 +++++++++ reco/L1/L1Algo/L1XYMeasurementInfo.h | 8 +++- 7 files changed, 65 insertions(+), 32 deletions(-) create mode 100644 reco/L1/L1Algo/L1UMeasurementInfo.cxx create mode 100644 reco/L1/L1Algo/L1XYMeasurementInfo.cxx diff --git a/reco/L1/CMakeLists.txt b/reco/L1/CMakeLists.txt index a4a5479dec..f7feafae4d 100644 --- a/reco/L1/CMakeLists.txt +++ b/reco/L1/CMakeLists.txt @@ -141,6 +141,7 @@ L1Algo/L1EventMatch.cxx L1Algo/L1MCEvent.cxx L1Algo/L1Fit.cxx CbmL1MCTrack.cxx +L1Algo/L1XYMeasurementInfo.cxx L1Algo/L1CAIteration.cxx L1Algo/L1BaseStationInfo.cxx L1Algo/L1InitManager.cxx diff --git a/reco/L1/L1Algo/L1InitManager.h b/reco/L1/L1Algo/L1InitManager.h index bf2f731e62..29986cbba3 100644 --- a/reco/L1/L1Algo/L1InitManager.h +++ b/reco/L1/L1Algo/L1InitManager.h @@ -203,7 +203,7 @@ private: int fCAIterationsNumberCrosscheck {-1}; ///> Number of iterations to be passed (must be used for cross-checks) /// Pointer to L1Parameters object, which will be copied to L1Algo after checks - L1Parameters * fParametersPtr {nullptr}; + L1Parameters* fParametersPtr {nullptr}; }; #endif diff --git a/reco/L1/L1Algo/L1MaterialInfo.h b/reco/L1/L1Algo/L1MaterialInfo.h index d0da3ebbca..7eb96b76dc 100644 --- a/reco/L1/L1Algo/L1MaterialInfo.h +++ b/reco/L1/L1Algo/L1MaterialInfo.h @@ -5,17 +5,22 @@ #ifndef L1MaterialInfo_h #define L1MaterialInfo_h +#include <string> #include <vector> #include "L1Def.h" class L1MaterialInfo { public: - L1MaterialInfo() : thick(0), RL(0), RadThick(0), logRadThick(0) {}; + fvec thick {0}; + fvec RL {0}; + fvec RadThick {0}; + fvec logRadThick {0}; - fvec thick, RL, RadThick, logRadThick; + std::string } _fvecalignment; + class L1Material { public: L1Material() : table(0), NBins(0), RMax(0.), iD(0.) {}; diff --git a/reco/L1/L1Algo/L1Station.cxx b/reco/L1/L1Algo/L1Station.cxx index b37b25a276..ed52627737 100644 --- a/reco/L1/L1Algo/L1Station.cxx +++ b/reco/L1/L1Algo/L1Station.cxx @@ -13,45 +13,44 @@ void L1Station::Print(int verbosity) const { // TODO: Probably, it would be nice to use constexpr char indent (S.Zh.) LOG(info) << "\tL1Station object at " << this; - LOG(info) << "\t\tStation type ID: " << fL1Station.type; - LOG(info) << "\t\tTime info ID: " << fL1Station.timeInfo; - LOG(info) << "\t\tz position: " << fL1Station.z[0]; - LOG(info) << "\t\tRmin: " << fL1Station.Rmin[0]; - LOG(info) << "\t\tRmax: " << fL1Station.Rmax[0]; + LOG(info) << "\t\tStation type ID: " << type; + LOG(info) << "\t\tTime info ID: " << timeInfo; + LOG(info) << "\t\tz position: " << z[0]; + LOG(info) << "\t\tRmin: " << Rmin[0]; + LOG(info) << "\t\tRmax: " << Rmax[0]; // TODO: Insert correct units (S.Zh.) - LOG(info) << "\t\tThickness (X) : " << fL1Station.materialInfo.thick[0]; - LOG(info) << "\t\tRadiational length (X0): " << fL1Station.materialInfo.RL[0]; + LOG(info) << "\t\tThickness (X) : " << materialInfo.thick[0]; + LOG(info) << "\t\tRadiational length (X0): " << materialInfo.RL[0]; if (verbosity > 0) { - LOG(info) << "\t\tX / X0: " << fL1Station.materialInfo.RadThick[0]; - LOG(info) << "\t\tlog(X / X0): " << fL1Station.materialInfo.logRadThick[0]; + LOG(info) << "\t\tX / X0: " << materialInfo.RadThick[0]; + LOG(info) << "\t\tlog(X / X0): " << materialInfo.logRadThick[0]; LOG(info) << "\t\tField approximation coefficients:"; LOG(info) << " idx CX CY CZ"; for (int idx = 0; idx < L1Parameters::kMaxNFieldApproxCoefficients; ++idx) { LOG(info) << std::setw(9) << std::setfill(' ') << idx << ' ' << std::setw(10) << std::setfill(' ') - << fL1Station.fieldSlice.cx[idx][0] << ' ' << std::setw(10) << std::setfill(' ') - << fL1Station.fieldSlice.cy[idx][0] << ' ' << std::setw(10) << std::setfill(' ') - << fL1Station.fieldSlice.cz[idx][0]; + << fieldSlice.cx[idx][0] << ' ' << std::setw(10) << std::setfill(' ') << fieldSlice.cy[idx][0] << ' ' + << std::setw(10) << std::setfill(' ') << fieldSlice.cz[idx][0]; } LOG(info) << "\t\tStrips geometry:"; LOG(info) << "\t\t\tFront:"; - LOG(info) << "\t\t\t\tcos(phi): " << fL1Station.frontInfo.cos_phi[0]; - LOG(info) << "\t\t\t\tsin(phi): " << fL1Station.frontInfo.sin_phi[0]; - LOG(info) << "\t\t\t\tsigma2: " << fL1Station.frontInfo.sigma2[0]; + LOG(info) << "\t\t\t\tcos(phi): " << frontInfo.cos_phi[0]; + LOG(info) << "\t\t\t\tsin(phi): " << frontInfo.sin_phi[0]; + LOG(info) << "\t\t\t\tsigma2: " << frontInfo.sigma2[0]; LOG(info) << "\t\t\tBack:"; - LOG(info) << "\t\t\t\tcos(phi): " << fL1Station.backInfo.cos_phi[0]; - LOG(info) << "\t\t\t\tsin(phi): " << fL1Station.backInfo.sin_phi[0]; - LOG(info) << "\t\t\t\tsigma2: " << fL1Station.backInfo.sigma2[0]; + LOG(info) << "\t\t\t\tcos(phi): " << backInfo.cos_phi[0]; + LOG(info) << "\t\t\t\tsin(phi): " << backInfo.sin_phi[0]; + LOG(info) << "\t\t\t\tsigma2: " << backInfo.sigma2[0]; LOG(info) << "\t\t\tXY cov matrix:"; - LOG(info) << "\t\t\t\tC00: " << fL1Station.XYInfo.C00[0]; - LOG(info) << "\t\t\t\tC10: " << fL1Station.XYInfo.C10[0]; - LOG(info) << "\t\t\t\tC11: " << fL1Station.XYInfo.C11[0]; + LOG(info) << "\t\t\t\tC00: " << XYInfo.C00[0]; + LOG(info) << "\t\t\t\tC10: " << XYInfo.C10[0]; + LOG(info) << "\t\t\t\tC11: " << XYInfo.C11[0]; LOG(info) << "\t\t\tX layer:"; - LOG(info) << "\t\t\t\tcos(phi): " << fL1Station.xInfo.cos_phi[0]; - LOG(info) << "\t\t\t\tsin(phi): " << fL1Station.xInfo.sin_phi[0]; - LOG(info) << "\t\t\t\tsigma2: " << fL1Station.xInfo.sigma2[0]; + LOG(info) << "\t\t\t\tcos(phi): " << xInfo.cos_phi[0]; + LOG(info) << "\t\t\t\tsin(phi): " << xInfo.sin_phi[0]; + LOG(info) << "\t\t\t\tsigma2: " << xInfo.sigma2[0]; LOG(info) << "\t\t\tY layer:"; - LOG(info) << "\t\t\t\tcos(phi): " << fL1Station.yInfo.cos_phi[0]; - LOG(info) << "\t\t\t\tsin(phi): " << fL1Station.yInfo.sin_phi[0]; - LOG(info) << "\t\t\t\tsigma2: " << fL1Station.yInfo.sigma2[0]; + LOG(info) << "\t\t\t\tcos(phi): " << yInfo.cos_phi[0]; + LOG(info) << "\t\t\t\tsin(phi): " << yInfo.sin_phi[0]; + LOG(info) << "\t\t\t\tsigma2: " << yInfo.sigma2[0]; } } diff --git a/reco/L1/L1Algo/L1UMeasurementInfo.cxx b/reco/L1/L1Algo/L1UMeasurementInfo.cxx new file mode 100644 index 0000000000..52b54f6a2b --- /dev/null +++ b/reco/L1/L1Algo/L1UMeasurementInfo.cxx @@ -0,0 +1,5 @@ +/* Copyright (C) 2007-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergey Gorbunov, Sergei Zharko */ + +#include "L1UMeasurementInfo.h" diff --git a/reco/L1/L1Algo/L1XYMeasurementInfo.cxx b/reco/L1/L1Algo/L1XYMeasurementInfo.cxx new file mode 100644 index 0000000000..89de9e1dfc --- /dev/null +++ b/reco/L1/L1Algo/L1XYMeasurementInfo.cxx @@ -0,0 +1,19 @@ +/* Copyright (C) 2007-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergey Gorbunov, Sergei Zharko [committer] */ + +#include "L1XYMeasurementInfo.h" + +#include <sstream> // for stringstream + +std::string L1XYMeasurementInfo::ToString(int indentLevel) const +{ + std::stringstream aStream {}; + // TODO: possibly is better to be place indentChar into L1Parameters (S.Zharko) + constexpr char indentChar = '\t'; + std::string indent(indentLevel, indentChar); + aStream << indent << "C00: " << std::setw(12) << std::setfill(' ') << C00 << '\n'; + aStream << indent << "C10: " << std::setw(12) << std::setfill(' ') << C10 << '\n'; + aStream << indent << "C11: " << std::setw(12) << std::setfill(' ') << C11; + return aStream.str(); +} diff --git a/reco/L1/L1Algo/L1XYMeasurementInfo.h b/reco/L1/L1Algo/L1XYMeasurementInfo.h index c452408fb5..08bfc35a4c 100644 --- a/reco/L1/L1Algo/L1XYMeasurementInfo.h +++ b/reco/L1/L1Algo/L1XYMeasurementInfo.h @@ -11,8 +11,12 @@ class L1XYMeasurementInfo { public: - L1XYMeasurementInfo() : C00(0), C10(0), C11(0) {} - fvec C00, C10, C11; + fvec C00 {0}; + fvec C10 {0}; + fvec C11 {0}; + /// String representation of class contents + /// \param indentLevel number of indent characters in the output + std::string ToString(int indentLevel = 0) const; } _fvecalignment; -- GitLab