diff --git a/reco/L1/L1Algo/L1InitManager.cxx b/reco/L1/L1Algo/L1InitManager.cxx index 00d5b610c870aee958420fdf508be149a882036f..0f0f49120eecc6e57d5c74bd5234c507ab0f1736 100644 --- a/reco/L1/L1Algo/L1InitManager.cxx +++ b/reco/L1/L1Algo/L1InitManager.cxx @@ -18,6 +18,7 @@ #include "L1Algo.h" #include "L1Assert.h" +#include "L1ConfigRW.h" using L1Constants::clrs::kCL; // end colored log using L1Constants::clrs::kGNb; // bold green log @@ -106,7 +107,7 @@ bool L1InitManager::FormParametersContainer() // Read configuration files LOG(info) << "L1InitManager: reading parameter configuration ..."; try { - fConfigRW.Read(); + this->ReadInputConfigs(); LOG(info) << "L1InitManager: reading parameter configuration ... \033[1;32mdone\033[0m"; } catch (const std::runtime_error& err) { @@ -289,6 +290,16 @@ void L1InitManager::PushBackCAIteration(const L1CAIteration& iteration) fParameters.fCAIterations.push_back(iteration); } +// --------------------------------------------------------------------------------------------------------------------- +// +void L1InitManager::ReadInputConfigs() +{ + L1ConfigRW configRW = L1ConfigRW(this, 4); + configRW.SetMainConfigPath(fsConfigInputMain); + configRW.SetUserConfigPath(fsConfigInputUser); + configRW.Read(); +} + // --------------------------------------------------------------------------------------------------------------------- // void L1InitManager::ReadParametersObject(const std::string& fileName) diff --git a/reco/L1/L1Algo/L1InitManager.h b/reco/L1/L1Algo/L1InitManager.h index d61e1230d3299292d4638b7d277e1aaedeb7e9ec..b73102b3fb8cc744fe4fec04d7197b0c8a42f9b0 100644 --- a/reco/L1/L1Algo/L1InitManager.h +++ b/reco/L1/L1Algo/L1InitManager.h @@ -19,7 +19,6 @@ #include "L1BaseStationInfo.h" #include "L1CAIteration.h" -#include "L1ConfigRW.h" #include "L1Constants.h" #include "L1EArray.h" #include "L1Field.h" @@ -139,10 +138,6 @@ public: /// \return Success flag bool FormParametersContainer(); - /// @brief Accessor to configuration module - /// @return Reference to configuration module - L1ConfigRW& GetConfigRW() { return fConfigRW; } - /// @brief Gets name of the detector /// @param detId Index of the detector /// @return Name of the detector @@ -151,8 +146,11 @@ public: /// Gets ghost suppression flag int GetGhostSuppression() const { return fParameters.fGhostSuppression; } - /// Gets a name of the input configuration file - const std::string& GetInputConfigName() const { return fConfigInputName; } + /// @brief Gets a name of the main input configuration file + const std::string& GetInputConfigMain() const { return fsConfigInputMain; } + + /// @brief Gets a name of the user input configuration file + const std::string& GetInputConfigUser() const { return fsConfigInputMain; } /// Gets a const reference to L1ObjectInitController const InitController_t& GetInitController() const { return fInitController; } @@ -196,6 +194,9 @@ public: /// Pushes an CA track finder iteration into a sequence of iteration using std::unique_ptr void PushBackCAIteration(const std::unique_ptr<L1CAIteration>& puIteration) { PushBackCAIteration(*puIteration); } + /// @brief Reads main and user parameters configs + void ReadInputConfigs(); + /// Reads parameters object from boost-serialized binary file /// \param fileName Name of input file void ReadParametersObject(const std::string& fileName); @@ -211,15 +212,15 @@ public: void SetCAIterationsNumberCrosscheck(int nIterations); /// @brief Sets base configuration file - /// @param baseConfig Path to base configuration file + /// @param mainConfig Path to main configuration file /// @note The base configuraiton file is mandatory until the tracking configuration is initialized from /// beforehand created L1Parameters file. - void SetConfigMain(const std::string& baseConfig) { fConfigRW.SetMainConfigPath(baseConfig); } + void SetConfigMain(const std::string& mainConfig) { fsConfigInputMain = mainConfig; } /// @brief Sets user configuration file /// @param userConfig Path to user configuration file /// @note The user configuraiton file is optional - void SetConfigUser(const std::string& userConfig) { fConfigRW.SetUserConfigPath(userConfig); } + void SetConfigUser(const std::string& userConfig) { fsConfigInputUser = userConfig; } /// @brief Sets detector names /// @param container Container of the detector names @@ -348,9 +349,10 @@ private: L1Parameters fParameters {}; ///< L1Algo parameters object // * Configuration related * - std::string fConfigInputName {""}; ///< name for the input configuration file - std::string fConfigOutputName {""}; ///< name for the output configuration file - L1ConfigRW fConfigRW {this, /*verbose = */ 4}; ///< configuration file reader and writer + std::string fsConfigInputMain = ""; ///< name for the input configuration file + std::string fsConfigInputUser = ""; ///< name for the input configuration file + std::string fConfigOutputName = ""; ///< name for the output configuration file + //L1ConfigRW fConfigRW {this, /*verbose = */ 4}; ///< configuration file reader and writer }; #endif