Skip to content

Commit

Permalink
Merge pull request #43687 from mbluj/CMSSW_14_0_0_mbluj_OMTF
Browse files Browse the repository at this point in the history
Refactoring of Phase1 OMTF emulator code
  • Loading branch information
cmsbuild authored Feb 29, 2024
2 parents 2648035 + e7de87b commit 329c046
Show file tree
Hide file tree
Showing 69 changed files with 3,724 additions and 913 deletions.
59 changes: 0 additions & 59 deletions L1Trigger/L1TMuonOverlapPhase1/interface/AlgoMuonBase.h

This file was deleted.

6 changes: 2 additions & 4 deletions L1Trigger/L1TMuonOverlapPhase1/interface/AngleConverterBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@ class AngleConverterBase {
/// phiZero - desired phi where the scale should start, should be in the desired scale, use getProcessorPhiZero to obtain it
virtual int getProcessorPhi(int phiZero, l1t::tftype part, int dtScNum, int dtPhi) const;

virtual int getProcessorPhi(int phiZero,
l1t::tftype part,
const CSCDetId& csc,
const CSCCorrelatedLCTDigi& digi) const;
virtual int getProcessorPhi(
int phiZero, l1t::tftype part, const CSCDetId& csc, const CSCCorrelatedLCTDigi& digi, unsigned int iInput) const;

virtual int getProcessorPhi(unsigned int iProcessor,
l1t::tftype part,
Expand Down
4 changes: 3 additions & 1 deletion L1Trigger/L1TMuonOverlapPhase1/interface/MuonStub.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct MuonStub {
static const int EMTPY_PHI = 0xffffff;

int etaHw = 0;
int etaSigmaHw = 0; ///error of the eta measurement
int r = 0; //[cm] distance from beam pipe
int qualityHw = 0;

int bx = 0;
Expand All @@ -52,6 +52,8 @@ struct MuonStub {
//used to address LUTs
unsigned int logicLayer = 0;

unsigned int input = 0;

//int roll = 0; //TODO remove

int detId = 0;
Expand Down
41 changes: 31 additions & 10 deletions L1Trigger/L1TMuonOverlapPhase1/interface/MuonStubMakerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/MuonStub.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/RpcClusterization.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/IOMTFEmulationObserver.h"
#include <cstdint>
#include <memory>
#include <vector>
Expand All @@ -37,8 +38,12 @@ class DigiToStubsConverterBase {

virtual void loadDigis(const edm::Event& event) = 0;

virtual void makeStubs(
MuonStubPtrs2D& muonStubsInLayers, unsigned int iProcessor, l1t::tftype procTyp, int bxFrom, int bxTo) = 0;
virtual void makeStubs(MuonStubPtrs2D& muonStubsInLayers,
unsigned int iProcessor,
l1t::tftype procTyp,
int bxFrom,
int bxTo,
std::vector<std::unique_ptr<IOMTFEmulationObserver> >& observers) = 0;
};

class DtDigiToStubsConverter : public DigiToStubsConverterBase {
Expand All @@ -53,8 +58,12 @@ class DtDigiToStubsConverter : public DigiToStubsConverterBase {

void loadDigis(const edm::Event& event) override;

void makeStubs(
MuonStubPtrs2D& muonStubsInLayers, unsigned int iProcessor, l1t::tftype procTyp, int bxFrom, int bxTo) override;
void makeStubs(MuonStubPtrs2D& muonStubsInLayers,
unsigned int iProcessor,
l1t::tftype procTyp,
int bxFrom,
int bxTo,
std::vector<std::unique_ptr<IOMTFEmulationObserver> >& observers) override;

//dtThDigis is provided as argument, because in the OMTF implementation the phi and eta digis are merged (even thought it is artificial)
virtual void addDTphiDigi(MuonStubPtrs2D& muonStubsInLayers,
Expand Down Expand Up @@ -94,8 +103,12 @@ class CscDigiToStubsConverter : public DigiToStubsConverterBase {

void loadDigis(const edm::Event& event) override { event.getByToken(inputTokenCsc, cscDigis); }

void makeStubs(
MuonStubPtrs2D& muonStubsInLayers, unsigned int iProcessor, l1t::tftype procTyp, int bxFrom, int bxTo) override;
void makeStubs(MuonStubPtrs2D& muonStubsInLayers,
unsigned int iProcessor,
l1t::tftype procTyp,
int bxFrom,
int bxTo,
std::vector<std::unique_ptr<IOMTFEmulationObserver> >& observers) override;

//can add both phi and eta stubs
virtual void addCSCstubs(MuonStubPtrs2D& muonStubsInLayers,
Expand Down Expand Up @@ -128,8 +141,12 @@ class RpcDigiToStubsConverter : public DigiToStubsConverterBase {

void loadDigis(const edm::Event& event) override { event.getByToken(inputTokenRpc, rpcDigis); }

void makeStubs(
MuonStubPtrs2D& muonStubsInLayers, unsigned int iProcessor, l1t::tftype procTyp, int bxFrom, int bxTo) override;
void makeStubs(MuonStubPtrs2D& muonStubsInLayers,
unsigned int iProcessor,
l1t::tftype procTyp,
int bxFrom,
int bxTo,
std::vector<std::unique_ptr<IOMTFEmulationObserver> >& observers) override;

virtual void addRPCstub(MuonStubPtrs2D& muonStubsInLayers,
const RPCDetId& roll,
Expand Down Expand Up @@ -166,8 +183,12 @@ class MuonStubMakerBase {
void loadAndFilterDigis(const edm::Event& event);

///Method translating trigger digis into input matrix with global phi coordinates, fills the muonStubsInLayers
void buildInputForProcessor(
MuonStubPtrs2D& muonStubsInLayers, unsigned int iProcessor, l1t::tftype procTyp, int bxFrom = 0, int bxTo = 0);
void buildInputForProcessor(MuonStubPtrs2D& muonStubsInLayers,
unsigned int iProcessor,
l1t::tftype procTyp,
int bxFrom,
int bxTo,
std::vector<std::unique_ptr<IOMTFEmulationObserver> >& observers);

protected:
const ProcConfigurationBase* config = nullptr;
Expand Down
Loading

0 comments on commit 329c046

Please sign in to comment.