diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/multififo_regionizer_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/multififo_regionizer_ref.h index 6d6477d12ba9b..c906a502c5caa 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/multififo_regionizer_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/multififo_regionizer_ref.h @@ -43,12 +43,14 @@ namespace l1ct { unsigned int outii, unsigned int pauseii, bool useAlsoVtxCoords); - - // note: this one will work only in CMSSW + // note: these ones will work only in CMSSW MultififoRegionizerEmulator(const edm::ParameterSet& iConfig); + MultififoRegionizerEmulator(const std::string& barrelSetup, const edm::ParameterSet& iConfig); ~MultififoRegionizerEmulator() override; + static BarrelSetup parseBarrelSetup(const std::string& setup); + void setEgInterceptMode(bool afterFifo, const l1ct::EGInputSelectorEmuConfig& interceptorConfig); void initSectorsAndRegions(const RegionizerDecodedInputs& in, const std::vector& out) override; diff --git a/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc b/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc index e173c3c773bdb..bf4a77c5c17b9 100644 --- a/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc +++ b/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc @@ -206,6 +206,10 @@ L1TCorrelatorLayer1Producer::L1TCorrelatorLayer1Producer(const edm::ParameterSet } else if (regalgo == "Multififo") { regionizer_ = std::make_unique( iConfig.getParameter("regionizerAlgoParameters")); + } else if (regalgo == "MultififoBarrel") { + const auto &pset = iConfig.getParameter("regionizerAlgoParameters"); + regionizer_ = + std::make_unique(pset.getParameter("barrelSetup"), pset); } else if (regalgo == "TDR") { regionizer_ = std::make_unique( iConfig.getParameter("regionizerAlgoParameters")); diff --git a/L1Trigger/Phase2L1ParticleFlow/src/regionizer/folded_multififo_regionizer_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/regionizer/folded_multififo_regionizer_ref.cpp index a3e9b4f8e34e2..cf5bba7229e72 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/regionizer/folded_multififo_regionizer_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/regionizer/folded_multififo_regionizer_ref.cpp @@ -35,7 +35,6 @@ l1ct::FoldedMultififoRegionizerEmulator::FoldedMultififoRegionizerEmulator(unsig // now we initialize the routes: track finder for (unsigned int ie = 0; ie < 2; ++ie) { fold_.emplace_back(ie, -#ifdef CMSSW_GIT_HASH std::make_unique( /*nendcaps=*/1, nclocks / 2, @@ -49,21 +48,6 @@ l1ct::FoldedMultififoRegionizerEmulator::FoldedMultififoRegionizerEmulator(unsig outii, pauseii, useAlsoVtxCoords)); -#else - std::unique_ptr(new l1ct::MultififoRegionizerEmulator( - /*nendcaps=*/1, - nclocks / 2, - NTK_LINKS, - NCALO_LINKS, - ntk, - ncalo, - nem, - nmu, - streaming, - outii, - pauseii, - useAlsoVtxCoords))); -#endif } clocksPerFold_ = nclocks / 2; } diff --git a/L1Trigger/Phase2L1ParticleFlow/src/regionizer/multififo_regionizer_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/regionizer/multififo_regionizer_ref.cpp index e6a3813aaddc6..cfe6ec7664565 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/regionizer/multififo_regionizer_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/regionizer/multififo_regionizer_ref.cpp @@ -4,6 +4,7 @@ #include #include +#include #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -27,6 +28,23 @@ l1ct::MultififoRegionizerEmulator::MultififoRegionizerEmulator(const edm::Parame setEgInterceptMode(emSelCfg.getParameter("afterFifo"), emSelCfg); } } + +l1ct::MultififoRegionizerEmulator::MultififoRegionizerEmulator(const std::string& barrelSetup, + const edm::ParameterSet& iConfig) + : MultififoRegionizerEmulator(parseBarrelSetup(barrelSetup), + iConfig.getParameter("nHCalLinks"), + iConfig.getParameter("nECalLinks"), + iConfig.getParameter("nClocks"), + iConfig.getParameter("nTrack"), + iConfig.getParameter("nCalo"), + iConfig.getParameter("nEmCalo"), + iConfig.getParameter("nMu"), + /*streaming=*/false, + /*outii=*/1, + /*pauseii=*/0, + iConfig.getParameter("useAlsoVtxCoords")) { + debug_ = iConfig.getUntrackedParameter("debug", false); +} #endif l1ct::MultififoRegionizerEmulator::MultififoRegionizerEmulator(unsigned int nendcaps, @@ -240,14 +258,20 @@ l1ct::MultififoRegionizerEmulator::MultififoRegionizerEmulator(BarrelSetup barre l1ct::MultififoRegionizerEmulator::~MultififoRegionizerEmulator() {} +l1ct::MultififoRegionizerEmulator::BarrelSetup l1ct::MultififoRegionizerEmulator::parseBarrelSetup( + const std::string& setup) { + if (setup == "Full54") + return BarrelSetup::Full54; + if (setup == "Full27") + return BarrelSetup::Full27; + throw std::invalid_argument("barrelSetup for CMSSW can only be Full54 or Full27"); + return BarrelSetup::Full54; +} + void l1ct::MultififoRegionizerEmulator::setEgInterceptMode(bool afterFifo, const l1ct::EGInputSelectorEmuConfig& interceptorConfig) { emInterceptMode_ = afterFifo ? interceptPostFifo : interceptPreFifo; -#ifdef CMSSW_GIT_HASH interceptor_ = std::make_unique(interceptorConfig); -#else - interceptor_.reset(new EGInputSelectorEmulator(interceptorConfig)); -#endif } void l1ct::MultififoRegionizerEmulator::initSectorsAndRegions(const RegionizerDecodedInputs& in,