diff --git a/algo/ca/core/pars/CaInitManager.cxx b/algo/ca/core/pars/CaInitManager.cxx index 47562e049149410c8f2f5c1565a23b34822b40db..703ca675404b98fb4ae9f7793c3618c98263e651 100644 --- a/algo/ca/core/pars/CaInitManager.cxx +++ b/algo/ca/core/pars/CaInitManager.cxx @@ -160,19 +160,6 @@ bool InitManager::FormParametersContainer() } } - // Create an instance for active setup - { - fParameters.fActiveSetup = fParameters.fGeometrySetup; - for (const auto& station : fvStationInfo) { - if (!station.GetTrackingStatus()) { - fParameters.fActiveSetup.DisableLayer(station.GetDetectorID(), station.GetStationID()); - } - } - LOG(info) << "CA: Geometry setup\n" << fParameters.fGeometrySetup.ToString(3); - LOG(info) << "CA: Active setup\n" << fParameters.fActiveSetup.ToString(3); - } - - // Check the consistency of the parameters object. If object inconsistent, it throws std::logic_error try { fParameters.CheckConsistency(); diff --git a/algo/ca/core/pars/CaInitManager.h b/algo/ca/core/pars/CaInitManager.h index b2b141a803e2e44a14e2822babf06f428fd8ceda..09ed81e0305b0ad3d8af206c568b099c38d5a75d 100644 --- a/algo/ca/core/pars/CaInitManager.h +++ b/algo/ca/core/pars/CaInitManager.h @@ -250,6 +250,16 @@ namespace cbm::algo::ca void SetGeometrySetup(const cbm::algo::kf::Setup<DataT>& setup) { fParameters.fGeometrySetup = kf::Setup<fvec>(setup); + fParameters.fActiveSetup = fParameters.fGeometrySetup; + for (int iStGeo = 0; iStGeo < setup.GetNofLayers(); ++iStGeo) { + auto [detID, locID] = fParameters.GetStationIndexLocal(iStGeo); + int iStActive = fParameters.GetStationIndexActive(locID, detID); + if (iStActive < 0) { + fParameters.fActiveSetup.DisableLayer(detID, locID); + } + } + LOG(info) << "Geometry setup:" << fParameters.fGeometrySetup.ToString(1); + LOG(info) << "Active setup:" << fParameters.fActiveSetup.ToString(1); fInitController.SetFlag(EInitKey::kSetupInitialized, true); } diff --git a/algo/ca/core/pars/CaParameters.cxx b/algo/ca/core/pars/CaParameters.cxx index af9522bd4fd2edcfef48acd44e1456bb81fa3bd9..610dbc181c232d86fec2d3a7988b3fed3b0412ff 100644 --- a/algo/ca/core/pars/CaParameters.cxx +++ b/algo/ca/core/pars/CaParameters.cxx @@ -45,7 +45,7 @@ void Parameters<DataT>::CheckConsistency() const int nStationsCheck = std::count_if(fvGeoToActiveMap.cbegin(), fvGeoToActiveMap.cend(), filterInactiveStationIDs); if (nStationsCheck != fNstationsActiveTotal) { std::stringstream msg; - msg << "L1Parameters: invalid object condition: array of active station IDs is not consistent " + msg << "ca::Parameters: invalid object condition: array of active station IDs is not consistent " << "with the total number of stations (" << nStationsCheck << " vs. " << fNstationsActiveTotal << ' ' << "expected)"; throw std::logic_error(msg.str()); @@ -63,7 +63,7 @@ void Parameters<DataT>::CheckConsistency() const } if (!isStationIDsOk) { std::stringstream msg; - msg << "L1Parameters: invalid object condition: array of active station IDs is not a gapless subset " + msg << "ca::Parameters: invalid object condition: array of active station IDs is not a gapless subset " << "of integer numbers starting from 0:\n\t"; for (auto id : fvGeoToActiveMap) { msg << std::setw(3) << std::setfill(' ') << id << ' '; @@ -88,7 +88,7 @@ void Parameters<DataT>::CheckConsistency() const if (!ifFieldStatusFlagsOk) { std::stringstream msg; - msg << "L1Parameters: invalid object condition: L1 tracking is impossible for a given field configuration:\n"; + msg << "ca::Parameters: invalid object condition: L1 tracking is impossible for a given field configuration:\n"; for (int iSt = 0; iSt < fNstationsActiveTotal; ++iSt) { msg << "- station ID: " << iSt << ", field status: " << fStations[iSt].fieldStatus << '\n'; } @@ -124,7 +124,7 @@ void Parameters<DataT>::CheckConsistency() const fStations[iSt].CheckConsistency(); if (kfutils::simd::Cast<DataT, float>(fStations[iSt].fZ, 0) < kfutils::simd::Cast<DataT, float>(fTargetPos[2], 0)) { std::stringstream msg; - msg << "L1Parameters: station with global ID = " << iSt << " is placed before target " + msg << "ca::Parameters: station with global ID = " << iSt << " is placed before target " << "(z_st = " << kfutils::simd::Cast<DataT, float>(fStations[iSt].fZ, 0) << " [cm] < z_targ = " << kfutils::simd::Cast<DataT, float>(fTargetPos[2], 0) << " [cm])"; throw std::logic_error(msg.str()); @@ -142,6 +142,65 @@ void Parameters<DataT>::CheckConsistency() const fThickMap[iSt].CheckConsistency(); } + /* + * Check equality of station indices in setups: + */ + { + if (fActiveSetup.GetNofLayers() != this->GetNstationsActive()) { + std::stringstream msg; + msg << "ca::Parameters: number of stations in active kf setup (" << fActiveSetup.GetNofLayers() + << ") differes from the actual number of active tracking stations (" << GetNstationsActive() << ')'; + throw std::logic_error(msg.str()); + } + + if (fGeometrySetup.GetNofLayers() != this->GetNstationsGeometry()) { + std::stringstream msg; + msg << "ca::Parameters: number of stations in geometry kf setup (" << fGeometrySetup.GetNofLayers() + << ") differes from the actual number of geometry tracking stations (" << GetNstationsGeometry() << ')'; + throw std::logic_error(msg.str()); + } + + { + std::stringstream msg; + msg << "ca::Parameters: inconsistency in geometry station indexing in kf-setup and old init:"; + bool bConsistent = true; + for (int iStGeo = 0; iStGeo < GetNstationsGeometry(); ++iStGeo) { + auto [detId, locId] = GetStationIndexLocal(iStGeo); + auto [detIdSetup, locIdSetup] = fGeometrySetup.GetIndexMap().template GlobalToLocal<EDetectorID>(iStGeo); + if (detId != detIdSetup || locId != locIdSetup) { + bConsistent = false; + } + msg << "\n- (old) detId = " << static_cast<int>(detId) << ", locId = " << locId + << " ---- (kf) detId = " << static_cast<int>(detIdSetup) << ", locId = " << locIdSetup; + } + if (!bConsistent) { + throw std::logic_error(msg.str()); + } + } + + { + std::stringstream msg; + msg << "ca::Parameters: inconsistency in active station indexing in kf-setup and old init:"; + bool bConsistent = true; + for (int iStGeo = 0; iStGeo < GetNstationsGeometry(); ++iStGeo) { + auto [detId, locId] = GetStationIndexLocal(iStGeo); + int iStActive = GetStationIndexActive(locId, detId); + if (iStActive < 0) { + continue; + } + auto [detIdSetup, locIdSetup] = fActiveSetup.GetIndexMap().template GlobalToLocal<EDetectorID>(iStActive); + if (detId != detIdSetup || locId != locIdSetup) { + bConsistent = false; + } + msg << "\n- (old) detId = " << static_cast<int>(detId) << ", locId = " << locId + << " ---- (kf) detId = " << static_cast<int>(detIdSetup) << ", locId = " << locIdSetup; + } + if (!bConsistent) { + throw std::logic_error(msg.str()); + } + } + } + /* * Check iterations sequence diff --git a/algo/kf/core/geo/KfField.h b/algo/kf/core/geo/KfField.h index d35db8d3e96bdf37ed0c3d0b4ca5ba67bf00c443..df48b5c5095f2a2f9e0ffa7eea5f4d9e2dd60bff 100644 --- a/algo/kf/core/geo/KfField.h +++ b/algo/kf/core/geo/KfField.h @@ -394,6 +394,9 @@ namespace cbm::algo::kf /// \brief Resets the instance void Reset() { *this = FieldFactory(); } + /// \brief Resets slicer references + void ResetSliceReferences() { fSliceReferences.clear(); } + /// \brief Sets magnetic field function /// \param fieldFn Magnetic field function (KF-format) void SetFieldFunction(const FieldFn_t& fieldFn, EFieldType fldType) diff --git a/algo/kf/core/geo/KfModuleIndexMap.h b/algo/kf/core/geo/KfModuleIndexMap.h index 68917257c6d67420cd70023d1450037a45f29883..29b7a92ca113e52368c62735131e2301dd5f0e45 100644 --- a/algo/kf/core/geo/KfModuleIndexMap.h +++ b/algo/kf/core/geo/KfModuleIndexMap.h @@ -97,8 +97,6 @@ namespace cbm::algo::kf ar& fvDetExtToInt; } - /// \brief Map of global component index to local (localId, intDetId) - std::vector<int> fvLocToGlb{}; std::vector<std::pair<int, int>> fvGlbToLoc{}; std::vector<int> fvDetLocOffset{}; ///< First index of component for det diff --git a/algo/kf/core/geo/KfSetup.cxx b/algo/kf/core/geo/KfSetup.cxx index 3854fd48dc24d9fa6d6b73f06c16f51941c0b894..8474932476694e59f728e88f2c5f9c5d2a264bf4 100644 --- a/algo/kf/core/geo/KfSetup.cxx +++ b/algo/kf/core/geo/KfSetup.cxx @@ -23,7 +23,6 @@ std::string Setup<T>::ToString(int verbosity, int indentLevel) const if (verbosity > 0) { constexpr char indentCh = '\t'; std::string indent(indentLevel, indentCh); - msg << indent << "\n ----- KF Setup -----\n"; msg << indent << "\nFloating-point type: " << typeid(T).name(); msg << indent << "\nTARGET:\n" << fTarget.ToString(indentLevel + 1, verbosity); msg << indent << "\nMODULE INDEXING SCHEME:\n" << fModuleIndexMap.ToString(indentLevel + 1); diff --git a/algo/kf/core/geo/KfSetup.h b/algo/kf/core/geo/KfSetup.h index a147f0b9778e299dbd23c3e746011d46fc746346..7cf10ce8a00a6291cf5f254f23b9377801917593 100644 --- a/algo/kf/core/geo/KfSetup.h +++ b/algo/kf/core/geo/KfSetup.h @@ -95,10 +95,10 @@ namespace cbm::algo::kf } /// \brief Gets module index map - const ModuleIndexMap& GetModuleIndexMap() const { return fModuleIndexMap; } + const ModuleIndexMap& GetIndexMap() const { return fModuleIndexMap; } - /// \brief Gets number of defined material layers - int GetNofMaterialLayers() const { return static_cast<int>(fvMaterialLayers.size()); } + /// \brief Gets number of geometry layers + int GetNofLayers() const { return static_cast<int>(fvMaterialLayers.size()); } /// \brief Gets target const Target<T>& GetTarget() const { return fTarget; } diff --git a/algo/kf/core/geo/KfSetupBuilder.cxx b/algo/kf/core/geo/KfSetupBuilder.cxx index e8cff76b4ccde208de08f84d9c7f0b74f7dcc884..c5a599cd75e2f7584c00c7595a3fd3a361387af6 100644 --- a/algo/kf/core/geo/KfSetupBuilder.cxx +++ b/algo/kf/core/geo/KfSetupBuilder.cxx @@ -11,21 +11,37 @@ #include <sstream> +#include <fmt/format.h> + using cbm::algo::kf::SetupBuilder; // --------------------------------------------------------------------------------------------------------------------- // void SetupBuilder::Init() { - // Check setters - if (fGeoLayers.size() == 0) { - throw std::runtime_error("kf::SetupBuilder: no geometry layers initialized"); + LOG(info) << "kf::SetupBuilder initilization: ..."; + + if (!fbIfFieldFunctionSet) { + throw std::runtime_error("kf::SetupBuilder: no field is provided"); + } + if (fbIfSetFromSetup) { + LOG(info) << "kf::SetupBuilder initilization: done"; + fbReady = true; + return; } - if (!fpMaterialMapFactory.get()) { - throw std::runtime_error("kf::SetupBuilder: no material map factory provided"); + else { + if (fGeoLayers.size() == 0) { + throw std::runtime_error("kf::SetupBuilder: no geometry layers initialized"); + } + if (!fpMaterialMapFactory.get()) { + throw std::runtime_error("kf::SetupBuilder: no material map factory provided"); + } + if (!fbIfTargetSet) { + throw std::runtime_error("kf::SetupBuilder: target properties were not set"); + } } - // Init target properties + // Add material to the target: { // Material budget double zMin{fTarget.GetZ() + kTargetCenterOffset}; @@ -33,9 +49,6 @@ void SetupBuilder::Init() double rMax{fTarget.GetR() * kTargetMaterialTransverseSizeMargin}; fTarget.SetMaterial( fpMaterialMapFactory->GenerateMaterialMap(fTarget.GetZ(), zMin, zMax, rMax, kTargetMaterialMapNofBins)); - - // Field region - fFieldFactory.SetStep(kTargetFieldInitStep); } // Init geometry layers @@ -66,16 +79,36 @@ void SetupBuilder::Init() zLast = zNew; } } - LOG(info) << "Initialized"; - fbPropertiesInitialized = true; + fbIfGeoLayersInit = true; + fbReady = true; + LOG(info) << "kf::SetupBuilder initilization: done"; +} + +// --------------------------------------------------------------------------------------------------------------------- +// +std::string SetupBuilder::InitStatusMsg() const +{ + std::stringstream msg; + msg << "kf::SetupBuilder initialization: failed:\n"; + msg << fmt::format("\n - {<30} {}", "target property set:", fbIfTargetSet); + msg << fmt::format("\n - {<30} {}", "geo layers added:", fbIfGeoLayersInit); + msg << fmt::format("\n - {<30} {}", "field function set:", fbIfFieldFunctionSet); + msg << fmt::format("\n - {<30} {}", "set from setup:", fbIfSetFromSetup); + msg << fmt::format("\n - {<30} {}", "material map creator set:", bool(fpMaterialMapFactory.get())); + return msg.str(); } // --------------------------------------------------------------------------------------------------------------------- // void SetupBuilder::Reset() { - fbPropertiesInitialized = false; + fbReady = false; + fbIfTargetSet = false; + fbIfGeoLayersInit = false; + fbIfFieldFunctionSet = false; + fbIfSetFromSetup = false; fFieldFactory.Reset(); + fModuleIndexFactory.Reset(); fGeoLayers.clear(); fpMaterialMapFactory = nullptr; } @@ -84,13 +117,14 @@ void SetupBuilder::Reset() // void SetupBuilder::SetTargetProperty(double x, double y, double z, double dz, double r) { - fbPropertiesInitialized = false; + fbReady = false; fTarget.SetX(x); fTarget.SetY(y); fTarget.SetZ(z); fTarget.SetDz(dz); fTarget.SetR(r); fFieldFactory.SetTarget(x, y, z); + fbIfTargetSet = true; } // --------------------------------------------------------------------------------------------------------------------- diff --git a/algo/kf/core/geo/KfSetupBuilder.h b/algo/kf/core/geo/KfSetupBuilder.h index a9bb0375d766d553973f62e233023972db31e710..0476750743fff8a7b64284b3d761756c3a1b2264 100644 --- a/algo/kf/core/geo/KfSetupBuilder.h +++ b/algo/kf/core/geo/KfSetupBuilder.h @@ -51,6 +51,16 @@ namespace cbm::algo::kf /// \class SetupBuilder /// \brief Creates a valid initialized Setup instance + /// + /// Initialization scenarios: + /// (a) Manual: + /// - adding geometry layers one by one + /// - setting target + /// - setting field function (function + field type) + /// (b) From setup: + /// - adding source setup (material layers, field slices and target) + /// - adding field function (if field -- interpolated) + /// class SetupBuilder { public: /// \brief Default constructor @@ -77,35 +87,37 @@ namespace cbm::algo::kf template<class EDetID> void AddLayer(const GeoLayer<EDetID>& geoLayer); - /// \brief Initializes, validates and cashes the parameters - /// \throw std::runtime_error If pre-initialization was incomplete - /// \note Does not touch the field function and field type/mode - void Init(); - /// \brief Creates a setup instance + /// \param fldMode Field mode of the setup template<typename T> - Setup<T> MakeSetup() const; + Setup<T> MakeSetup(EFieldMode fldMode); /// \brief Resets the instance void Reset(); /// \brief Sets magnetic field function - /// \param fieldMode Magnetic field mode: /// \param fieldFn Magnetic field function /// \param fieldType Magnetic field type - void SetFieldProperty(EFieldMode fieldMode, const FieldFn_t& fieldFn, EFieldType fieldType) + void SetFieldFunction(const FieldFn_t& fieldFn, EFieldType fieldType) { - fbPropertiesInitialized = false; + fbReady = false; fFieldFactory.SetFieldFunction(fieldFn, fieldType); - fFieldFactory.SetFieldMode(fieldMode); + fFieldFactory.SetStep(kTargetFieldInitStep); + fbIfFieldFunctionSet = true; } + /// \brief Initializes the setup builder from existing setup + /// \tparam T Underlying data type of the setup + /// \param inSetup + template<typename T> + void SetFromSetup(const Setup<T>& inSetup); + /// \brief Sets material map creator /// \param pMaterialFactory Pointer to the actual material map creator instance void SetMaterialMapFactory(const std::shared_ptr<IMaterialMapFactory>& pMaterialFactory) { - fbPropertiesInitialized = false; - fpMaterialMapFactory = pMaterialFactory; + fbReady = false; + fpMaterialMapFactory = pMaterialFactory; } /// \brief Sets target initialization properties @@ -116,7 +128,6 @@ namespace cbm::algo::kf /// \param r Target transverse size (XYmax) void SetTargetProperty(double x, double y, double z, double dz, double r); - // ******************** // ** Static methods ** // ******************** @@ -138,6 +149,14 @@ namespace cbm::algo::kf static Setup<T> Load(const std::string& fileName); private: + /// \brief Initializes, validates and cashes the parameters + /// \throw std::runtime_error If pre-initialization was incomplete + /// \note Does not touch the field function and field type/mode + void Init(); + + /// \brief Prints initialization status message + std::string InitStatusMsg() const; + // TODO: Define target material more precisely static constexpr double kTargetCenterOffset{0.05}; // Offset from target center [cm] static constexpr double kTargetMaterialOffset{2.}; // Offset of the target material [in dz] @@ -152,7 +171,12 @@ namespace cbm::algo::kf FieldFactory fFieldFactory; ///< Instance of field factory Target<double> fTarget; ///< Target properties int fMatMapNofBins{100}; ///< Number of bins in material maps - bool fbPropertiesInitialized{false}; ///< Flag: if all the necessary fields are initialized + + bool fbIfTargetSet{false}; ///< Target initialized + bool fbIfGeoLayersInit{false}; ///< Geo layers initialized + bool fbIfFieldFunctionSet{false}; ///< Field function initialized + bool fbIfSetFromSetup{false}; + bool fbReady{false}; ///< Instance is ready for setup generation }; @@ -166,7 +190,7 @@ namespace cbm::algo::kf template<class EDetID> void SetupBuilder::AddLayer(const GeoLayer<EDetID>& geoLayer) { - fbPropertiesInitialized = false; + fbReady = false; auto layer = fGeoLayers.emplace(static_cast<int>(geoLayer.fDetID), geoLayer.fLocID, geoLayer.fZref, geoLayer.fZmin, geoLayer.fZmax, geoLayer.fXmax, geoLayer.fYmax); if (!layer.second) { @@ -188,14 +212,41 @@ namespace cbm::algo::kf // --------------------------------------------------------------------------------------------------------------------- // template<typename T> - Setup<T> SetupBuilder::MakeSetup() const + void SetupBuilder::SetFromSetup(const Setup<T>& inSetup) { - Setup<T> setup(fFieldFactory.GetFieldMode()); - - if (!fbPropertiesInitialized) { - throw std::logic_error("kf::SetupBuilder: attempt to create an uninitialized setup"); + fbReady = false; + // Reset geo layer information + fGeoLayers.clear(); + fvMaterial.clear(); + fModuleIndexFactory.Reset(); + fFieldFactory.ResetSliceReferences(); + + // Init target properties + fTarget = Target<double>(inSetup.fTarget); + + // Init geometry layers + for (int iLayer{0}; iLayer < inSetup.GetNofMaterialLayers(); ++iLayer) { + const auto& material{inSetup.GetMaterial(iLayer)}; + fvMaterial.push_back(material); + fFieldFactory.AddSliceReference(material.GetXYmax(), material.GetXYmax(), material.GetZref()); + const auto& [iDetExt, iLoc] = inSetup.GetIndexMap().template GlobalToLocal<int>(iLayer); + fModuleIndexFactory.AddComponent(iDetExt, iLoc, material.GetZref()); } + fbIfGeoLayersInit = true; + fbIfTargetSet = true; + fbIfSetFromSetup = true; + } + + // --------------------------------------------------------------------------------------------------------------------- + // + template<typename T> + Setup<T> SetupBuilder::MakeSetup(EFieldMode fldMode) + { + Setup<T> setup(fldMode); + if (!fbReady) { + this->Init(); + } setup.fTarget = this->fTarget; for (const auto& material : this->fvMaterial) { setup.fvMaterialLayers.push_back(material); diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index cebb1bc4df1015b8af02099504bba903da6e1a22..4bc801f48148ea6db3445ebac759e03d5d99d677 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -499,8 +499,7 @@ try { { auto* pSetupBuilder = TrackingSetupBuilder::Instance(); pSetupBuilder->Use(fUseMVD, fUseSTS, fUseMUCH, fUseTRD, fUseTOF); - pSetupBuilder->SetFieldMode(cbm::algo::kf::EFieldMode::Intrpl); - auto trackerSetup = pSetupBuilder->MakeSetup<float>(); + auto trackerSetup = pSetupBuilder->MakeSetup<float>(cbm::algo::kf::EFieldMode::Intrpl); TString outputFile = fSTAPDataDir + "/" + fSTAPDataPrefix + "." + TString(kSTAPSetupSuffix.data()); cbm::algo::kf::SetupBuilder::Store(trackerSetup, outputFile.Data()); fInitManager.SetGeometrySetup(trackerSetup); diff --git a/reco/kfnew/CbmKfTrackingSetupBuilder.cxx b/reco/kfnew/CbmKfTrackingSetupBuilder.cxx index c19f97ed5789921ba4ffabbba07b5a1960d1532b..a231d54e9de72985b202c4fb86aec629ca818c26 100644 --- a/reco/kfnew/CbmKfTrackingSetupBuilder.cxx +++ b/reco/kfnew/CbmKfTrackingSetupBuilder.cxx @@ -53,14 +53,17 @@ try { pField->GetType() == 0 && fabs(pField->GetBx(0., 0., 0.)) < MinField< double> && fabs(pField->GetBy(0., 0., 0.)) < MinField<double> && fabs(pField->GetBz(0., 0., 0.)) < MinField<double>) { - fBuilder.SetFieldProperty(fFieldMode, ZeroField(), EFieldType::Null); + LOG(info) << "!!!!!!!!!!!!!!!!!!! A"; + fBuilder.SetFieldFunction(ZeroField(), EFieldType::Null); } else { - fBuilder.SetFieldProperty(fFieldMode, OriginalField(), EFieldType::Normal); + LOG(info) << "!!!!!!!!!!!!!!!!!!! B"; + fBuilder.SetFieldFunction(OriginalField(), EFieldType::Normal); } } else { - fBuilder.SetFieldProperty(fFieldMode, ZeroField(), EFieldType::Null); + LOG(info) << "!!!!!!!!!!!!!!!!!!! C"; + fBuilder.SetFieldFunction(ZeroField(), EFieldType::Null); } // Tracking station property initialization @@ -95,7 +98,6 @@ try { pMaterialFactory->SetDoRadialProjection(pTarget->GetZ()); pMaterialFactory->SetNraysPerDim(kMatCreatorNrays); fBuilder.SetMaterialMapFactory(pMaterialFactory); - fBuilder.Init(); // Set the initialization flags back fbInitialized = true; @@ -119,14 +121,6 @@ TrackingSetupBuilder* TrackingSetupBuilder::Instance() return fpInstance; } -// --------------------------------------------------------------------------------------------------------------------- -// -void TrackingSetupBuilder::SetFieldMode(cbm::algo::kf::EFieldMode fldMode) -{ - fFieldMode = fldMode; - fbInitialized = false; -} - // --------------------------------------------------------------------------------------------------------------------- // void TrackingSetupBuilder::Use(bool mvd, bool sts, bool much, bool trd, bool tof) diff --git a/reco/kfnew/CbmKfTrackingSetupBuilder.h b/reco/kfnew/CbmKfTrackingSetupBuilder.h index 5aadffec75a97627ce09d026ef94400fb448f5ea..b9ee379660e20c8615bc24ee4d8fd8a9d206fa75 100644 --- a/reco/kfnew/CbmKfTrackingSetupBuilder.h +++ b/reco/kfnew/CbmKfTrackingSetupBuilder.h @@ -40,19 +40,16 @@ namespace cbm::kf static TrackingSetupBuilder* Instance(); /// \brief Makes setup object + /// \param fldMode Field mode (kf::EFiledMode) template<typename T> - cbm::algo::kf::Setup<T> MakeSetup() + cbm::algo::kf::Setup<T> MakeSetup(cbm::algo::kf::EFieldMode fldMode) { if (!fbInitialized) { this->Init(); } - return fBuilder.MakeSetup<T>(); + return fBuilder.MakeSetup<T>(fldMode); } - /// \brief Sets field mode - /// \param fldMode Field mode - void SetFieldMode(cbm::algo::kf::EFieldMode fldMode); - /// \brief Enables/disables detector subsystems in the setup /// \param mvd Is MVD used /// \param sts Is STS used