diff --git a/algo/ca/core/CMakeLists.txt b/algo/ca/core/CMakeLists.txt index 6504c0ec84a05b735730b71ae00ff5c043e0eb87..91e88e555cf715ff1c030c9977eda94e4feb6808 100644 --- a/algo/ca/core/CMakeLists.txt +++ b/algo/ca/core/CMakeLists.txt @@ -10,6 +10,7 @@ set(SRCS ${CMAKE_CURRENT_SOURCE_DIR}/data/CaTrack.cxx ${CMAKE_CURRENT_SOURCE_DIR}/data/CaField.cxx ${CMAKE_CURRENT_SOURCE_DIR}/data/CaMaterialMap.cxx + ${CMAKE_CURRENT_SOURCE_DIR}/data/CaStation.cxx ) add_library(CaCore SHARED ${SRCS}) @@ -42,6 +43,7 @@ install( data/CaHit.h data/CaField.h data/CaMaterialMap.h + data/CaStation.h pars/CaConstants.h utils/CaSimd.h utils/CaSimdVc.h diff --git a/reco/L1/L1Algo/L1Station.cxx b/algo/ca/core/data/CaStation.cxx similarity index 77% rename from reco/L1/L1Algo/L1Station.cxx rename to algo/ca/core/data/CaStation.cxx index d0b2c3cafb5f6497ed81458011bd901ed50f3d10..8399fe9698389f2e7125ac1c185bbb119112a463 100644 --- a/reco/L1/L1Algo/L1Station.cxx +++ b/algo/ca/core/data/CaStation.cxx @@ -2,67 +2,60 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Sergey Gorbunov, Sergei Zharko [committer] */ -#include "L1Station.h" - -#include <Logger.h> +#include "CaStation.h" #include <iomanip> #include <sstream> +#include "AlgoFairloggerCompat.h" #include "CaUtils.h" +using namespace cbm::algo::ca; + //------------------------------------------------------------------------------------------------------------------------------------ // -void L1Station::CheckConsistency() const +void Station::CheckConsistency() const { - /* - * Integer fields initialization checks - */ + /// Integer fields initialization checks if (type < 0) { std::stringstream msg; - msg << "L1Station: station type was not initialized (type = " << type << ", type > 0)"; + msg << "CaStation: station type was not initialized (type = " << type << ", type > 0)"; throw std::logic_error(msg.str()); } if (timeInfo != 0 && timeInfo != 1) { std::stringstream msg; - msg << "L1Station: illegal time information flag (timeInfo = " << timeInfo << ", " + msg << "CaStation: illegal time information flag (timeInfo = " << timeInfo << ", " << "0 [time information is not used] or 1 [time information is used] expected)"; throw std::logic_error(msg.str()); } if (fieldStatus != 0 && fieldStatus != 1) { std::stringstream msg; - msg << "L1Station: illegal field status flag (fieldStatus = " << fieldStatus << ", " + msg << "CaStation: illegal field status flag (fieldStatus = " << fieldStatus << ", " << "0 [station is outside the field] or 1 [station is inside the field] expected"; throw std::logic_error(msg.str()); } - /* - * SIMD vector checks: all the words in a SIMD vector must be equal - */ + /// SIMD vector checks: all the words in a SIMD vector must be equal - cbm::algo::ca::utils::CheckSimdVectorEquality(fZ, "L1Station::fZ"); - cbm::algo::ca::utils::CheckSimdVectorEquality(Xmax, "L1Station::Xmax"); - cbm::algo::ca::utils::CheckSimdVectorEquality(Ymax, "L1Station::Ymax"); + utils::CheckSimdVectorEquality(fZ, "CaStation::fZ"); + utils::CheckSimdVectorEquality(Xmax, "CaStation::Xmax"); + utils::CheckSimdVectorEquality(Ymax, "CaStation::Ymax"); - /* - * Inner and outer radia checks: - * (i) both Xmax and Ymax must be > 0 - */ + + /// Inner and outer radia checks: + /// (i) both Xmax and Ymax must be > 0 if (Xmax[0] < 0. || Ymax[0] < 0.) { std::stringstream msg; - msg << "L1Station: " << this->ToString() << " has incorrect sizes: " + msg << "CaStation: " << this->ToString() << " has incorrect sizes: " << "Xmax = " << Xmax[0] << " [cm], Ymax = " << Ymax[0] << " [cm] (0 < Xmax && 0 < Ymax expected)"; throw std::logic_error(msg.str()); } - - /* - * Check consistency of other members - */ + /// Check consistency of other members //materialInfo.CheckConsistency(); // TODO: Temporarily switched off, because Much has RL = 0, which is actually incorrect, but really is not used. @@ -72,7 +65,7 @@ void L1Station::CheckConsistency() const //------------------------------------------------------------------------------------------------------------------------------------ // -std::string L1Station::ToString(int verbosityLevel, int indentLevel, bool isHeader) const +std::string Station::ToString(int verbosityLevel, int indentLevel, bool isHeader) const { std::stringstream msg {}; constexpr char indentChar = '\t'; diff --git a/algo/ca/core/data/CaStation.h b/algo/ca/core/data/CaStation.h new file mode 100644 index 0000000000000000000000000000000000000000..e3b5826d84d07e56498ce7eb77c2df32b27d0766 --- /dev/null +++ b/algo/ca/core/data/CaStation.h @@ -0,0 +1,92 @@ +/* Copyright (C) 2007-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergey Gorbunov [committer], Igor Kulakov, Sergei Zharko */ + +#ifndef CaStation_h +#define CaStation_h 1 + +#include <string> + +#include "CaConstants.h" +#include "CaField.h" +#include "CaSimd.h" + +namespace cbm::algo::ca +{ + + /// Structure Station + /// Contains a set of geometry parameters for a particular station + /// + class Station { + public: + // TODO: SZh 12.05.2022: Rewrite type into L1DetectorID, change detector indexing scheme + // TODO: SZh 12.05.2022: Provide getters to stations + + int type = constants::Undef<int>; // ? Detector type? + int timeInfo = constants::Undef<int>; ///< flag: if time information can be used + int fieldStatus = + constants::Undef<int>; ///< flag: 1 - station is INSIDE the field, 0 - station is OUTSIDE the field + fvec fZ = constants::Undef<fvec>; ///< z position of station [cm] + fvec Xmax = constants::Undef<fvec>; ///< min radius of the station [cm] + fvec Ymax = constants::Undef<fvec>; ///< max radius of the station [cm] + + FieldSlice fieldSlice {}; + + // Serialization block + friend class boost::serialization::access; + template<class Archive> + void serialize(Archive& ar, const unsigned int) + { + ar& type; + ar& timeInfo; + ar& fieldStatus; + + ar& fZ; + ar& Xmax; + ar& Ymax; + + ar& fieldSlice; + } + + /// \brief Verifies class invariant consistency + /// \note Object is considered undefined in the creation time, so this function should be called after the object + /// initialization + void CheckConsistency() const; + + /// \brief Gets type of the station + int GetType() const { return type; } + + /// \brief Gets time-measurement flag + int GetTimeStatus() const { return timeInfo; } + + /// \brief Gets field status flag + int GetFieldStatus() const { return fieldStatus; } + + /// \brief Gets simdized z-position of the station + fvec GetZSimd() const { return fZ; } + + /// \brief Gets scalar z-position of the station + fscal GetZScal() const { return fZ[0]; } + + /// \brief Gets simdized limit of the station size in x-axis direction + fvec GetXmaxSimd() const { return Xmax; } + + /// \brief Gets scalar limit of the station size in x-axis direction + fscal GetXmaxScal() const { return Xmax[0]; } + + /// \brief Gets simdized limit of the station size in y-axis direction + fvec GetYmaxSimd() const { return Ymax; } + + /// \brief Gets scalar limit of the station size in y-axis direction + fscal GetYmaxScal() const { return Ymax[0]; } + + /// \brief String representation of class contents + /// \param verbosityLevel Verbosity level of the output + /// \param indentLevel Number of indent characters in the output + std::string ToString(int verbosityLevel = 0, int indentLevel = 0, bool isHeader = false) const; + + } _fvecalignment; + +} // namespace cbm::algo::ca + +#endif // CaStation_h diff --git a/reco/KF/ParticleFitter/CbmL1PFFitter.cxx b/reco/KF/ParticleFitter/CbmL1PFFitter.cxx index fcc622372b58e8ea5ebeee24da2e5fe80f5e894f..751d2965678fbbb1fcf9b1278fb691839a3dcb19 100644 --- a/reco/KF/ParticleFitter/CbmL1PFFitter.cxx +++ b/reco/KF/ParticleFitter/CbmL1PFFitter.cxx @@ -35,12 +35,12 @@ #include "TDatabasePDG.h" #include "CaField.h" +#include "CaStation.h" #include "CaTrackParam.h" #include "KFParticleDatabase.h" #include "L1Algo.h" // Also defines L1Parameters #include "L1Def.h" #include "L1Fit.h" -#include "L1Station.h" //typedef L1Fit1 L1Fit; @@ -170,7 +170,7 @@ void CbmL1PFFitter::Fit(std::vector<CbmStsTrack>& Tracks, const std::vector<CbmM CbmStsTrack* tr[fvec::size()] {nullptr}; int ista; - const L1Station* sta = CbmL1::Instance()->fpAlgo->GetParameters()->GetStations().begin(); + const ca::Station* sta = CbmL1::Instance()->fpAlgo->GetParameters()->GetStations().begin(); fvec x[nHits]; fvec y[nHits]; @@ -462,7 +462,7 @@ void CbmL1PFFitter::GetChiToVertex(vector<CbmStsTrack>& Tracks, vector<PFFieldRe int nStations = fNmvdStationsActive + fNstsStationsActive; - const L1Station* sta = CbmL1::Instance()->fpAlgo->GetParameters()->GetStations().begin(); + const ca::Station* sta = CbmL1::Instance()->fpAlgo->GetParameters()->GetStations().begin(); fvec* zSta = new fvec[nStations]; for (int iSta = 0; iSta < nStations; iSta++) { zSta[iSta] = sta[iSta].fZ; @@ -610,7 +610,7 @@ void CbmL1PFFitter::CalculateFieldRegion(vector<CbmStsTrack>& Tracks, vector<PFF CbmStsTrack* tr[fvec::size()]; int ista; - const L1Station* sta = CbmL1::Instance()->fpAlgo->GetParameters()->GetStations().begin(); + const ca::Station* sta = CbmL1::Instance()->fpAlgo->GetParameters()->GetStations().begin(); ca::FieldValue fB[3], fB_temp _fvecalignment; fvec zField[3]; @@ -681,7 +681,7 @@ void CbmL1PFFitter::CalculateFieldRegionAtLastPoint(vector<CbmStsTrack>& Tracks, CbmStsTrack* tr[fvec::size()]; int ista; - const L1Station* sta = CbmL1::Instance()->fpAlgo->GetParameters()->GetStations().begin(); + const ca::Station* sta = CbmL1::Instance()->fpAlgo->GetParameters()->GetStations().begin(); ca::FieldValue fB[3], fB_temp _fvecalignment; fvec zField[3]; diff --git a/reco/L1/CMakeLists.txt b/reco/L1/CMakeLists.txt index 21d50382c8bcb0027a45577a2ef237761392358f..5b0c1bdcb05d9d7379f3fce50486bbffa8953391 100644 --- a/reco/L1/CMakeLists.txt +++ b/reco/L1/CMakeLists.txt @@ -42,7 +42,6 @@ set(SRCS CbmL1ReadEvent.cxx CbmCaMCModule.cxx CbmCaTimeSliceReader.cxx - L1Algo/L1Station.cxx L1Algo/L1Fit.cxx L1Algo/L1MCEvent.cxx CbmL1MCTrack.cxx diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index 6777ec06c952d23cd16ddc9de00dbe3016e91406..f8129c4642cc29dc86083e82bb99d8337f646be7 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -1266,7 +1266,7 @@ void CbmL1::DumpMaterialToFile(TString fileName) const L1Parameters& param = *fpAlgo->GetParameters(); const L1MaterialContainer_t& map = param.GetThicknessMaps(); for (int ist = 0; ist < param.GetNstationsActive(); ist++) { - //const L1Station& st = param.GetStation(ist); + //const ca::Station& st = param.GetStation(ist); const ca::MaterialMap& mat = map[ist]; TString name = Form("tracking_station%d", ist); diff --git a/reco/L1/CbmL1DetectorID.h b/reco/L1/CbmL1DetectorID.h index 9c7e42a49eb3d2adffbbe85e4ce89380bfd52a30..c5b006e1a0d0450441805a3b271dc21e08078675 100644 --- a/reco/L1/CbmL1DetectorID.h +++ b/reco/L1/CbmL1DetectorID.h @@ -25,7 +25,7 @@ namespace cbm::ca /// Enumeration for the detector subsystems used in L1 tracking /// It is important for the subsystems to be specified in the actual order. The order is used -/// for the L1Station array filling. +/// for the ca::Station array filling. /// Note: L1DetectorID has a forward declaration in L1InitManager.h and L1BaseStationInfo.h /// TODO: Probably, we need to move everything into a single CbmCaConst.h header /// NOTE: The enumeration must not contain jumps in ordering and the first entry must be equal 0 diff --git a/reco/L1/CbmL1Performance.cxx b/reco/L1/CbmL1Performance.cxx index 9657daa9ff25c85ba3a405ea76cf526fc249226a..3d396d0feb7d2afee94814112417f36a0858995b 100644 --- a/reco/L1/CbmL1Performance.cxx +++ b/reco/L1/CbmL1Performance.cxx @@ -1635,7 +1635,7 @@ void CbmL1::FieldApproxCheck() for (int ist = 0; ist < fpAlgo->GetParameters()->GetNstationsActive(); ist++) { - const L1Station& st = fpAlgo->GetParameters()->GetStation(ist); + const ca::Station& st = fpAlgo->GetParameters()->GetStation(ist); double z = st.fZ[0]; double Xmax = st.Xmax[0]; diff --git a/reco/L1/L1Algo/L1Algo.cxx b/reco/L1/L1Algo/L1Algo.cxx index 1c127c2e2d96482bd4f6bee8e8e89258d11a7755..e9b200c874988ac4f8b273da08b0fcb48465ce6f 100644 --- a/reco/L1/L1Algo/L1Algo.cxx +++ b/reco/L1/L1Algo/L1Algo.cxx @@ -85,7 +85,7 @@ void L1Algo::ReceiveParameters(L1Parameters&& parameters) fNfieldStations = std::lower_bound(fParameters.GetStations().cbegin(), fParameters.GetStations().cbegin() + fParameters.GetNstationsActive(), 0, // we are looking for the first zero element - [](const L1Station& s, int edge) { return bool(s.fieldStatus) > edge; }) + [](const ca::Station& s, int edge) { return bool(s.fieldStatus) > edge; }) - fParameters.GetStations().cbegin(); fGhostSuppression = fParameters.GetGhostSuppression(); diff --git a/reco/L1/L1Algo/L1Algo.h b/reco/L1/L1Algo/L1Algo.h index 3ad4e384acacd13a918e9350738427e53f7a3b4e..aa9c80344024d42f4238eca1d974b940bfc053a7 100644 --- a/reco/L1/L1Algo/L1Algo.h +++ b/reco/L1/L1Algo/L1Algo.h @@ -31,6 +31,7 @@ class L1AlgoDraw; #include "CaConstants.h" #include "CaField.h" #include "CaHit.h" +#include "CaStation.h" #include "CaTrack.h" #include "CaTrackParam.h" #include "CaVector.h" @@ -41,7 +42,6 @@ class L1AlgoDraw; #include "L1HitPoint.h" #include "L1InputData.h" #include "L1Parameters.h" -#include "L1Station.h" #include "L1Triplet.h" #include "L1Utils.h" // ? DEPRECATED ? @@ -59,7 +59,7 @@ namespace // ** Types definition (global) ** // ******************************* -using L1StationsArray_t = std::array<L1Station, constants::size::MaxNstations>; +using L1StationsArray_t = std::array<ca::Station, constants::size::MaxNstations>; using L1MaterialArray_t = std::array<ca::MaterialMap, constants::size::MaxNstations>; using Tindex = int; // TODO: Replace with ca::HitIndex_t, if suitable @@ -273,7 +273,7 @@ private: int fNstationsBeforePipe {0}; ///< number of stations before pipe (MVD stations in CBM) int fNfieldStations {0}; ///< number of stations in the field region - //alignas(16) L1StationsArray_t fStations {}; ///< array of L1Station objects + //alignas(16) L1StationsArray_t fStations {}; ///< array of ca::Station objects //alignas(16) L1MaterialArray_t fRadThick {}; ///< material for each station float fDefaultMass {constants::phys::MuonMass}; ///< mass of the propagated particle [GeV/c2] diff --git a/reco/L1/L1Algo/L1BaseStationInfo.cxx b/reco/L1/L1Algo/L1BaseStationInfo.cxx index 3b46f6c30cac05796963614889a331ac5f03e7b6..1421d3b7b6abb4e563a34be4cf1982615dc5d30a 100644 --- a/reco/L1/L1Algo/L1BaseStationInfo.cxx +++ b/reco/L1/L1Algo/L1BaseStationInfo.cxx @@ -77,7 +77,7 @@ void L1BaseStationInfo::Reset() //------------------------------------------------------------------------------------------------------------------------ // -const L1Station& L1BaseStationInfo::GetL1Station() const +const ca::Station& L1BaseStationInfo::GetL1Station() const { // TODO: replace L1MASSERT with throw std::logic_error std::stringstream aStream; @@ -389,7 +389,7 @@ std::string L1BaseStationInfo::ToString(int verbosityLevel, int indentLevel) con aStream << indent << "L1BaseStationInfo object: at " << this << '\n'; aStream << indent << indentChar << "Station ID: " << fStationID << '\n'; aStream << indent << indentChar << "Detector ID: " << static_cast<int>(fDetectorID) << '\n'; - aStream << indent << indentChar << "L1Station object:" << '\n'; + aStream << indent << indentChar << "ca::Station object:" << '\n'; aStream << fL1Station.ToString(verbosityLevel - 1, indentLevel + 1) << '\n'; aStream << indent << indentChar << "Additional fields:\n"; aStream << indent << indentChar << indentChar << "Zmin: " << fZmin << '\n'; diff --git a/reco/L1/L1Algo/L1BaseStationInfo.h b/reco/L1/L1Algo/L1BaseStationInfo.h index 5f9cc4110cfd2729b3dc535fe0abeb32f947adc6..b7b0863548070f35f2daaae8fc6eceda7514750a 100644 --- a/reco/L1/L1Algo/L1BaseStationInfo.h +++ b/reco/L1/L1Algo/L1BaseStationInfo.h @@ -17,13 +17,18 @@ // L1 Core #include "CaMaterialMap.h" +#include "CaSimd.h" +#include "CaStation.h" #include "L1ObjectInitController.h" -#include "L1Station.h" + // C++ std #include <bitset> #include <functional> #include <string> +using namespace cbm::algo; // TODO: remove this line +using namespace cbm::algo::ca; // TODO: remove this line + enum class L1DetectorID; /// A base class which provides interface to L1Algo station geometry @@ -46,7 +51,7 @@ public: kTrackingStatus, ///< flag, if station is used in tracking or not kXmax, ///< max size in X direction kYmax, ///< max size in Y direction - // L1Station initialization + // ca::Station initialization kType, ///< station type kTimeInfo, ///< if time info is used (flag) kFieldStatus, ///< if station is placed in field (flag) @@ -54,7 +59,7 @@ public: kZmin, ///< min z of the station kZmax, ///< max z of the station kThicknessMap, ///< thickness map of the station (optional?) - kFieldSlice, ///< L1Station.ca::FieldSlice object initialization + kFieldSlice, ///< ca::Station.ca::FieldSlice object initialization // The last item is equal to the number of bits in fInitFlags kEnd }; @@ -107,8 +112,8 @@ public: /// Gets a const reference to the L1ObjectInitController object const InitController_t& GetInitController() const { return fInitController; } - /// Gets a reference to L1Station info field of the L1BaseStation info - const L1Station& GetL1Station() const; + /// Gets a reference to ca::Station info field of the L1BaseStation info + const ca::Station& GetL1Station() const; /// Gets a reference to ca::MaterialMap map const ca::MaterialMap& GetMaterialMap() const; @@ -142,7 +147,7 @@ public: /// Prints registered fields /// verbosity = 0: print only station id, detector id and address in one line - /// verbosity = 1: print basic L1Station fields + /// verbosity = 1: print basic ca::Station fields /// verbosity = 2: print all L1Staion fields void Print(int verbosity = 0) const; @@ -217,7 +222,7 @@ private: double fZref {0}; ///< reference z double fZmin {0}; ///< min z double fZmax {0}; ///< max z - L1Station fL1Station {}; ///< L1Station structure, describes a station in L1Algo + ca::Station fL1Station {}; ///< ca::Station structure, describes a station in L1Algo ca::MaterialMap fThicknessMap {}; ///< Map of station thickness in units of radiation length InitController_t fInitController {}; ///< Class fileds initialization flags ManagementFlags_t fManagementFlags {}; ///< bitset flags to manage internal behaviour of the class diff --git a/reco/L1/L1Algo/L1BranchExtender.cxx b/reco/L1/L1Algo/L1BranchExtender.cxx index d95994ce780653de1b02e17c58c381795e1a1232..d0cb946a4fcf5f0a15a2533b302b9bd6f90605ed 100644 --- a/reco/L1/L1Algo/L1BranchExtender.cxx +++ b/reco/L1/L1Algo/L1BranchExtender.cxx @@ -49,9 +49,9 @@ void L1Algo::BranchFitterFast(const L1Branch& t, TrackParamV& Tout, const bool u int ista1 = hit1.iSt; int ista2 = hit2.iSt; - const L1Station& sta0 = fParameters.GetStation(ista0); - const L1Station& sta1 = fParameters.GetStation(ista1); - const L1Station& sta2 = fParameters.GetStation(ista2); + const ca::Station& sta0 = fParameters.GetStation(ista0); + const ca::Station& sta1 = fParameters.GetStation(ista1); + const ca::Station& sta2 = fParameters.GetStation(ista2); fvec x0 = hit0.x; fvec y0 = hit0.y; @@ -101,7 +101,7 @@ void L1Algo::BranchFitterFast(const L1Branch& t, TrackParamV& Tout, const bool u for (int i = iFirstHit + step; step * i <= step * iLastHit; i += step) { const ca::Hit& hit = fInputData.GetHit(hits[i]); int ista = hit.iSt; - const L1Station& sta = fParameters.GetStation(ista); + const ca::Station& sta = fParameters.GetStation(ista); fit.Extrapolate(hit.z, fld); fit.FilterHit(sta, hit); @@ -159,9 +159,9 @@ void L1Algo::FindMoreHits(L1Branch& t, TrackParamV& Tout, const bool upstream, c const int ista1 = hit1.iSt; const int ista2 = hit2.iSt; - const L1Station& sta0 = fParameters.GetStation(ista0); - const L1Station& sta1 = fParameters.GetStation(ista1); - const L1Station& sta2 = fParameters.GetStation(ista2); + const ca::Station& sta0 = fParameters.GetStation(ista0); + const ca::Station& sta1 = fParameters.GetStation(ista1); + const ca::Station& sta2 = fParameters.GetStation(ista2); fvec x0 = hit0.x; fvec y0 = hit0.y; @@ -191,7 +191,7 @@ void L1Algo::FindMoreHits(L1Branch& t, TrackParamV& Tout, const bool upstream, c for (; (ista < fParameters.GetNstationsActive()) && (ista >= 0); ista += step) { // CHECKME why ista2? - const L1Station& sta = fParameters.GetStation(ista); + const ca::Station& sta = fParameters.GetStation(ista); fit.Extrapolate(sta.fZ, fld); diff --git a/reco/L1/L1Algo/L1CaTrackFinder.cxx b/reco/L1/L1Algo/L1CaTrackFinder.cxx index 19d81566bcc53e69171efbc7b0240663ad6258f4..d054875c4550588b47f1445e240e0029471c6fd1 100644 --- a/reco/L1/L1Algo/L1CaTrackFinder.cxx +++ b/reco/L1/L1Algo/L1CaTrackFinder.cxx @@ -76,7 +76,7 @@ void L1Algo::CaTrackFinder() ca::HitIndex_t caHitId = fInputData.GetStreamStartIndex(iStream) + ih; const ca::Hit& h = fInputData.GetHit(caHitId); - const L1Station& st = fParameters.GetStation(h.iSt); + const ca::Station& st = fParameters.GetStation(h.iSt); fscal dx = h.x - targX; fscal dy = h.y - targY; diff --git a/reco/L1/L1Algo/L1Fit.cxx b/reco/L1/L1Algo/L1Fit.cxx index 2b9b5b770b176d02f200fa4634f450d000d0d0b2..a6ba2bf0d47e0e4b012ad945cfe3ea1d38c59ab4 100644 --- a/reco/L1/L1Algo/L1Fit.cxx +++ b/reco/L1/L1Algo/L1Fit.cxx @@ -5,7 +5,7 @@ #include "L1Fit.h" #include "CaHit.h" -#include "L1Station.h" +#include "CaStation.h" #define cnst const fvec @@ -305,7 +305,7 @@ void L1Fit::FilterXY(const L1XYMeasurementInfo& info, cnst& x, cnst& y) fTr.C66() -= K60 * F60 + K61 * F61; } -void L1Fit::FilterHit(const L1Station& sta, const ca::Hit& hit) +void L1Fit::FilterHit(const ca::Station& sta, const ca::Hit& hit) { L1XYMeasurementInfo info; info.C00 = hit.dx2; diff --git a/reco/L1/L1Algo/L1Fit.h b/reco/L1/L1Algo/L1Fit.h index a5d77ebb223ffcae7f2fff79871413ead5fab9b0..e0386ee9914eefc67cb3cf0ca4464320751ce557 100644 --- a/reco/L1/L1Algo/L1Fit.h +++ b/reco/L1/L1Algo/L1Fit.h @@ -25,9 +25,9 @@ namespace namespace cbm::algo::ca { class Hit; -} + class Station; +} // namespace cbm::algo::ca -class L1Station; #define cnst const fvec @@ -98,7 +98,7 @@ public: void FilterU(const L1UMeasurementInfo& info, cnst& u, cnst& sigma2); void FilterXY(const L1XYMeasurementInfo& info, cnst& x, cnst& y); void FilterTime(cnst& t, cnst& dt2, cnst& timeInfo); - void FilterHit(const L1Station& s, const ca::Hit& h); + void FilterHit(const ca::Station& s, const ca::Hit& h); void FilterVi(fvec vi); diff --git a/reco/L1/L1Algo/L1InitManager.h b/reco/L1/L1Algo/L1InitManager.h index 2f3f47a55c4d76556cf7fe6b0b3cf5f044a486f5..6c5240d65481f712403bde7af01a86405a0f4804 100644 --- a/reco/L1/L1Algo/L1InitManager.h +++ b/reco/L1/L1Algo/L1InitManager.h @@ -29,6 +29,7 @@ using namespace cbm::algo::ca; //TODO: remove +using namespace cbm::algo; //TODO: remove class L1ConfigRW; class L1Algo; diff --git a/reco/L1/L1Algo/L1Parameters.cxx b/reco/L1/L1Algo/L1Parameters.cxx index 59c5e842fb7924f0639bd88c327223289d98e0de..793e0c05b5282bbd7e1c61b1cee1b6f1a872ae1f 100644 --- a/reco/L1/L1Algo/L1Parameters.cxx +++ b/reco/L1/L1Algo/L1Parameters.cxx @@ -75,7 +75,7 @@ void L1Parameters::CheckConsistency() const */ bool ifFieldStatusFlagsOk = std::is_sorted( fStations.cbegin(), fStations.cbegin() + fNstationsActiveTotal, - [&](const L1Station& lhs, const L1Station& rhs) { return bool(lhs.fieldStatus) > bool(rhs.fieldStatus); }); + [&](const ca::Station& lhs, const ca::Station& rhs) { return bool(lhs.fieldStatus) > bool(rhs.fieldStatus); }); if (!ifFieldStatusFlagsOk) { std::stringstream msg; @@ -107,7 +107,7 @@ void L1Parameters::CheckConsistency() const * NOTE: If a station was not set up, it is accounted inconsistent (uninitialized). In the array of stations there are uninitialized * stations possible (with id > NstationsActiveTotal), thus one should NOT run the loop above over all the stations in array * but only until *(fNstationsActive.cend() - 1) (== NstationsActiveTotal). - * TODO: Probably, we should introduce methods, which check the consistency of fully initialized objects such as L1Station, + * TODO: Probably, we should introduce methods, which check the consistency of fully initialized objects such as ca::Station, * L1MaterialInfo, etc. (S.Zharko) */ diff --git a/reco/L1/L1Algo/L1Parameters.h b/reco/L1/L1Algo/L1Parameters.h index 3a5a24d623ea1442b5d0e44ace96b7e93817daa2..9fd1405b5f451fae5f496a1ae198b8706192617f 100644 --- a/reco/L1/L1Algo/L1Parameters.h +++ b/reco/L1/L1Algo/L1Parameters.h @@ -21,20 +21,21 @@ #include "CaConstants.h" #include "CaField.h" #include "CaMaterialMap.h" +#include "CaStation.h" #include "CaVector.h" #include "L1CAIteration.h" #include "L1SearchWindow.h" -#include "L1Station.h" #include "L1Utils.h" // IS DEPRECATED? using namespace cbm::algo; // TODO: remove +using namespace cbm::algo::ca; // TODO: remove class L1InitManager; enum class L1DetectorID; /// Type definitions for used containers using L1IterationsContainer_t = cbm::algo::ca::Vector<L1CAIteration>; -using L1StationsContainer_t = std::array<L1Station, constants::size::MaxNstations>; +using L1StationsContainer_t = std::array<ca::Station, constants::size::MaxNstations>; using L1MaterialContainer_t = std::array<ca::MaterialMap, constants::size::MaxNstations>; @@ -135,7 +136,7 @@ public: /// @brief Gets reference to the particular station /// @param iStation Index of station in the active stations container - const L1Station& GetStation(int iStation) const { return fStations[iStation]; } + const ca::Station& GetStation(int iStation) const { return fStations[iStation]; } /// @brief Gets a search window for a selected station and track group /// @note For a particular track finder iteration one can select a track group, which is defined by the minimal diff --git a/reco/L1/L1Algo/L1Station.h b/reco/L1/L1Algo/L1Station.h deleted file mode 100644 index 4836928169cc8d06a9cede5ec1af5489e43b770a..0000000000000000000000000000000000000000 --- a/reco/L1/L1Algo/L1Station.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (C) 2007-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt - SPDX-License-Identifier: GPL-3.0-only - Authors: Sergey Gorbunov [committer], Igor Kulakov, Sergei Zharko */ - -#ifndef L1Station_h -#define L1Station_h 1 - -#include <string> -#include <type_traits> - -#include "CaConstants.h" -#include "CaField.h" -#include "CaSimd.h" - -using namespace cbm::algo; // TODO: Remove this line -using namespace cbm::algo::ca; // TODO: Remove this line - -/// Structure L1Station -/// Contains a set of geometry parameters for a particular station -/// -class L1Station { -public: - // TODO: SZh 12.05.2022: Rewrite type into L1DetectorID, change detector indexing scheme - // TODO: SZh 12.05.2022: Provide getters to stations - - int type = ca::constants::Undef<int>; // ? Detector type? - int timeInfo = ca::constants::Undef<int>; ///< flag: if time information can be used - int fieldStatus = - ca::constants::Undef<int>; ///< flag: 1 - station is INSIDE the field, 0 - station is OUTSIDE the field - fvec fZ = ca::constants::Undef<fvec>; ///< z position of station [cm] - fvec Xmax = ca::constants::Undef<fvec>; ///< min radius of the station [cm] - fvec Ymax = ca::constants::Undef<fvec>; ///< max radius of the station [cm] - - ca::FieldSlice fieldSlice {}; - - // Serialization block - friend class boost::serialization::access; - template<class Archive> - void serialize(Archive& ar, const unsigned int) - { - ar& type; - ar& timeInfo; - ar& fieldStatus; - - ar& fZ; - ar& Xmax; - ar& Ymax; - - ar& fieldSlice; - } - - /// @brief Verifies class invariant consistency - /// @note Object is considered undefined in the creation time, so this function should be called after the object - /// initialization - void CheckConsistency() const; - - /// @brief Gets type of the station - int GetType() const { return type; } - - /// @brief Gets time-measurement flag - int GetTimeStatus() const { return timeInfo; } - - /// @brief Gets field status flag - int GetFieldStatus() const { return fieldStatus; } - - /// @brief Gets simdized z-position of the station - fvec GetZSimd() const { return fZ; } - - /// @brief Gets scalar z-position of the station - fscal GetZScal() const { return fZ[0]; } - - /// @brief Gets simdized limit of the station size in x-axis direction - fvec GetXmaxSimd() const { return Xmax; } - - /// @brief Gets scalar limit of the station size in x-axis direction - fscal GetXmaxScal() const { return Xmax[0]; } - - /// @brief Gets simdized limit of the station size in y-axis direction - fvec GetYmaxSimd() const { return Ymax; } - - /// @brief Gets scalar limit of the station size in y-axis direction - fscal GetYmaxScal() const { return Ymax[0]; } - - /// @brief String representation of class contents - /// @param verbosityLevel Verbosity level of the output - /// @param indentLevel Number of indent characters in the output - std::string ToString(int verbosityLevel = 0, int indentLevel = 0, bool isHeader = false) const; - -} _fvecalignment; - - -#endif // L1Station_h diff --git a/reco/L1/L1Algo/L1TrackFitter.cxx b/reco/L1/L1Algo/L1TrackFitter.cxx index 2e3f2d582e8b66e819256f8ada31b00196a98f88..5353b385b03c1ccf2a8a1714254899f1c6457a42 100644 --- a/reco/L1/L1Algo/L1TrackFitter.cxx +++ b/reco/L1/L1Algo/L1TrackFitter.cxx @@ -45,7 +45,7 @@ void L1Algo::L1KFTrackFitter() Track* t[fvec::size()] {nullptr}; - const L1Station* sta = fParameters.GetStations().begin(); + const ca::Station* sta = fParameters.GetStations().begin(); // Spatial-time position of a hit vs. station and track in the portion @@ -177,7 +177,7 @@ void L1Algo::L1KFTrackFitter() for (int ih = nHitsTrack - 1; ih >= 0; ih--) { const int ista = iSta[ih]; - const L1Station& st = fParameters.GetStation(ista); + const ca::Station& st = fParameters.GetStation(ista); By[ista][iVec] = st.fieldSlice.cy[0][0]; } } diff --git a/reco/L1/L1Algo/L1Triplet.h b/reco/L1/L1Algo/L1Triplet.h index 09a1ab3fc6dd9d92fd0ccef0b8872cb75930597d..4bc10d1f0c94edaea098df2a39acdcea95196d28 100644 --- a/reco/L1/L1Algo/L1Triplet.h +++ b/reco/L1/L1Algo/L1Triplet.h @@ -15,6 +15,7 @@ namespace { using namespace cbm::algo; + using namespace cbm::algo::ca; // TODO: remove } /// L1Triplet class represents a short 3-hit track segment called a "triplet". diff --git a/reco/L1/L1Algo/L1TripletConstructor.cxx b/reco/L1/L1Algo/L1TripletConstructor.cxx index 636f4b63e3eb82d7fe26b928dffabd889522c362..d1ea9dfabdca80e2aefe9adddf18bfd423421329 100644 --- a/reco/L1/L1Algo/L1TripletConstructor.cxx +++ b/reco/L1/L1Algo/L1TripletConstructor.cxx @@ -391,7 +391,7 @@ void L1TripletConstructor::FitTriplets() // prepare data int ista[NHits] = {fIstaL, fIstaM, fIstaR}; - L1Station sta[3]; + ca::Station sta[3]; for (int is = 0; is < NHits; ++is) { sta[is] = fAlgo->fParameters.GetStation(ista[is]); }; @@ -614,7 +614,7 @@ void L1TripletConstructor::CollectHits(const TrackParamV& Tr, const int iSta, co collectedHits.clear(); collectedHits.reserve(maxNhits); - const L1Station& sta = fAlgo->fParameters.GetStation(iSta); + const ca::Station& sta = fAlgo->fParameters.GetStation(iSta); const L1HitPoint* hits = &(fAlgo->fGridPoints[0]) + fAlgo->fGridHitStartIndex[iSta]; const ca::HitIndex_t nHits = fAlgo->fGridHitStopIndex[iSta] - fAlgo->fGridHitStartIndex[iSta]; diff --git a/reco/L1/L1Algo/L1TripletConstructor.h b/reco/L1/L1Algo/L1TripletConstructor.h index c6d795717f4279fd3ccf369eda06154f6ad1b00b..a098b1acda46282bd84baa6c41d827575184f3e9 100644 --- a/reco/L1/L1Algo/L1TripletConstructor.h +++ b/reco/L1/L1Algo/L1TripletConstructor.h @@ -6,12 +6,12 @@ #define L1TripletConstructor_h #include "CaField.h" +#include "CaStation.h" #include "CaTrackParam.h" #include "CaVector.h" #include "L1Algo.h" #include "L1Fit.h" #include "L1HitPoint.h" -#include "L1Station.h" #include "L1Triplet.h" namespace @@ -76,11 +76,11 @@ public: private: /// left station - const L1Station& staL() { return *fStaL; } + const ca::Station& staL() { return *fStaL; } /// middle station - const L1Station& staM() { return *fStaM; } + const ca::Station& staM() { return *fStaM; } /// right station - const L1Station& staR() { return *fStaR; } + const ca::Station& staR() { return *fStaR; } private: bool fIsInitialized {false}; ///< is initialized; @@ -90,16 +90,16 @@ private: int fIstaM {-1}; ///< middle station index int fIstaR {-1}; ///< right station index - const L1Station* fStaL {nullptr}; ///< left station - const L1Station* fStaM {nullptr}; ///< mid station - const L1Station* fStaR {nullptr}; ///< right station + const ca::Station* fStaL {nullptr}; ///< left station + const ca::Station* fStaM {nullptr}; ///< mid station + const ca::Station* fStaR {nullptr}; ///< right station L1HitPoint* fHitsL {nullptr}; ///< hits on the left station L1HitPoint* fHitsM {nullptr}; ///< hits on the middle station L1HitPoint* fHitsR {nullptr}; ///< hits on the right station - const L1Station* fFld0Sta[2]; // two stations for approximating the field between the target and the left hit - const L1Station* fFld1Sta[3]; // three stations for approximating the field between the left and the right hit + const ca::Station* fFld0Sta[2]; // two stations for approximating the field between the target and the left hit + const ca::Station* fFld1Sta[3]; // three stations for approximating the field between the left and the right hit ca::HitIndex_t fIhitL; TrackParamV fTrL; diff --git a/reco/L1/L1Algo/utils/L1AlgoDraw.cxx b/reco/L1/L1Algo/utils/L1AlgoDraw.cxx index 555d4563823fb113f889de7d9b3b383969877e82..c381d686c9d39817dde380e01f39f9e582be540b 100644 --- a/reco/L1/L1Algo/utils/L1AlgoDraw.cxx +++ b/reco/L1/L1Algo/utils/L1AlgoDraw.cxx @@ -557,7 +557,7 @@ void L1AlgoDraw::DrawInputHits() for (int ista = NStations - 1; ista >= 0; ista--) { // //start downstream chambers - L1Station& st = vStations[ista]; + ca::Station& st = vStations[ista]; Int_t n_poly = 0; Int_t n_poly_fake = 0; for (int ih = HitsStartIndex[ista]; ih < HitsStopIndex[ista]; ih++) { @@ -689,7 +689,7 @@ void L1AlgoDraw::DrawRestHits(ca::HitIndex_t* StsRestHitsStartIndex, ca::HitInde for (int ista = NStations - 1; ista >= 0; ista--) { // //start downstream chambers - L1Station& st = vStations[ista]; + ca::Station& st = vStations[ista]; Int_t n_poly = 0; Int_t n_poly_fake = 0; for (ca::HitIndex_t iRestHit = StsRestHitsStartIndex[ista]; iRestHit < StsRestHitsStopIndex[ista]; iRestHit++) { diff --git a/reco/L1/L1Algo/utils/L1AlgoDraw.h b/reco/L1/L1Algo/utils/L1AlgoDraw.h index ee3255a9e2033fa23029bd0cfff9f398cf8b06ec..326ccbcbd684f68a7c99bcf249e8de7d46bd69d6 100644 --- a/reco/L1/L1Algo/utils/L1AlgoDraw.h +++ b/reco/L1/L1Algo/utils/L1AlgoDraw.h @@ -11,8 +11,8 @@ #include <vector> #include "CaHit.h" +#include "CaStation.h" #include "L1Def.h" -#include "L1Station.h" #include "L1Triplet.h" namespace @@ -71,7 +71,7 @@ private: int HitsStopIndex[20] {0}; int NStations {0}; - L1Station vStations[20] {}; + ca::Station vStations[20] {}; int mcolor[10] {5, 7, 3, 8, 6, 2, 4, 1, 9, 14}; // color for hits on i-station int StaColor {17}; // color for stantions