diff --git a/macro/run/run_reco.C b/macro/run/run_reco.C index 2b309f2139dba88cb916faa858f66bd6f7ea0b4e..af3e5e3df036ab078b16c5a1a76edd92f3491256 100644 --- a/macro/run/run_reco.C +++ b/macro/run/run_reco.C @@ -391,10 +391,6 @@ void run_reco(TString input = "", Int_t nTimeSlices = -1, Int_t firstTimeSlice = l1->SetStsMaterialBudgetFileName(parFile.Data()); } - // ---- L1Algo runtime constants selection interface example ------ - l1->GetL1Parameters()->SetMaxDoubletsPerSinglet(149); - // ---------------------------------------------------------------- - run->AddTask(l1); std::cout << "-I- " << myName << ": Added task " << l1->GetName() << std::endl; diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index 8c6f16537cbec47cf7a47555788dd833a5616591..36af489e599669557892167a17933c75aca10c44 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -752,15 +752,7 @@ InitStatus CbmL1::Init() LOG(error) << "-E- CbmL1: Read geometry from file " << fSTAPDataDir + "geo_algo.txt was NOT successful."; } - if (fL1ParametersPtr) { - algo->SetL1Parameters(*fL1ParametersPtr); - delete fL1ParametersPtr; - } - else { - LOG(error) << "-E- CbmL1: L1Parameters object was not transfered to the L1Algo core. Default parameters " - << "will be used."; - } - + algo->SetL1Parameters(fL1Parameters); algo->Init(geo, fUseHitErrors, fTrackingMode, fMissingHits); geo.clear(); diff --git a/reco/L1/CbmL1.h b/reco/L1/CbmL1.h index 6ce48fc37c41b97a6a7dd312291df8f66d9e568d..c8dea94ed07d9869cbe7e297c3d8ca0269845e3d 100644 --- a/reco/L1/CbmL1.h +++ b/reco/L1/CbmL1.h @@ -81,7 +81,12 @@ public: int Det; }; - +// TODO: insert documentation! +// +/// L1Algo runtime constants modification can be performed in run_reco.C. Example: +/// +/// l1->GetL1Parameters()->SetMaxDoubletsPerSinglet(149); +/// class CbmL1 : public FairTask { private: CbmL1(const CbmL1&); @@ -118,7 +123,7 @@ public: ~CbmL1(/*if (targetFieldSlice) delete;*/); - L1Parameters* GetL1Parameters() { return fL1ParametersPtr; } + L1Parameters* GetL1Parameters() { return &fL1Parameters; } void SetStsMaterialBudgetFileName(TString fileName) { fStsMatBudgetFileName = fileName; } void SetMvdMaterialBudgetFileName(TString fileName) { fMvdMatBudgetFileName = fileName; } @@ -217,7 +222,7 @@ public: private: static CbmL1* fInstance; - L1Parameters* fL1ParametersPtr {new L1Parameters()}; ///< pointer to L1Algo parameters class instance + L1Parameters fL1Parameters; L1AlgoInputData* fData {nullptr}; diff --git a/reco/L1/L1Algo/L1Algo.h b/reco/L1/L1Algo/L1Algo.h index 78c91cca3d461ef2eb4a09c6634eee37977012f8..b445714872c96af069657b087ce38b193ccb47e0 100644 --- a/reco/L1/L1Algo/L1Algo.h +++ b/reco/L1/L1Algo/L1Algo.h @@ -95,23 +95,7 @@ public: float GetDefaultParticleMass2() const { return fDefaultMass * fDefaultMass; } float fDefaultMass = 0.10565800; // muon mass - // NOTE: technically it is a default value, so it can be modified - // with a setter. But on other hand it is a phys constant, so we must - // think again whether to handle the numerical literal as constexpr or not - //float fDefaultMass = L1Parameters::kMuonMass; // muon mass - - /////--> moved to L1Parameters - /////static constexpr unsigned int fkStationBits = 6; - /////static constexpr unsigned int fkThreadBits = 6; - /////static constexpr unsigned int fkTripletBits = 32 - fkStationBits - fkThreadBits; - - /////static constexpr unsigned int fkMaxNstations = (1 << fkStationBits); // 2^6 =64 - /////static constexpr unsigned int fkMaxNthreads = (1 << fkThreadBits); // 2^6 = 64 - /////static constexpr unsigned int fkMaxNtriplets = (1 << fkTripletBits); // 2^20 = 262,144 - - /////--> moved to L1Parameters - /////unsigned int fMaxDoubletsPerSinglet = 150; - /////unsigned int fMaxTripletPerDoublets = 15; + // TODO: make fDefaultMass a private member /// pack station, thread and triplet indices to an unique triplet ID static unsigned int PackTripletId(unsigned int Station, unsigned int Thread, unsigned int Triplet)