CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DtPhase2DigiToStubsConverterOmtf Class Reference

#include <InputMakerPhase2.h>

Inheritance diagram for DtPhase2DigiToStubsConverterOmtf:
DtPhase2DigiToStubsConverter DigiToStubsConverterBase

Public Member Functions

bool acceptDigi (const DTChamberId &dTChamberId, unsigned int iProcessor, l1t::tftype procType) override
 
void addDTetaStubs (MuonStubPtrs2D &muonStubsInLayers, const L1MuDTChambThDigi &thetaDigi, unsigned int iProcessor, l1t::tftype procTyp) override
 
void addDTphiDigi (MuonStubPtrs2D &muonStubsInLayers, const L1Phase2MuDTPhDigi &digi, const L1MuDTChambThContainer *dtThDigis, unsigned int iProcessor, l1t::tftype procTyp) override
 
 DtPhase2DigiToStubsConverterOmtf (const OMTFConfiguration *config, const OmtfAngleConverter *angleConverter, edm::EDGetTokenT< L1Phase2MuDTPhContainer > inputTokenDtPh, edm::EDGetTokenT< L1MuDTChambThContainer > inputTokenDtTh)
 
 ~DtPhase2DigiToStubsConverterOmtf () override=default
 
- Public Member Functions inherited from DtPhase2DigiToStubsConverter
 DtPhase2DigiToStubsConverter (edm::EDGetTokenT< L1Phase2MuDTPhContainer > inputTokenDtPh, edm::EDGetTokenT< L1MuDTChambThContainer > inputTokenDtTh)
 
void loadDigis (const edm::Event &event) override
 
void makeStubs (MuonStubPtrs2D &muonStubsInLayers, unsigned int iProcessor, l1t::tftype procTyp, int bxFrom, int bxTo, std::vector< std::unique_ptr< IOMTFEmulationObserver > > &observers) override
 
 ~DtPhase2DigiToStubsConverter () override
 
- Public Member Functions inherited from DigiToStubsConverterBase
virtual ~DigiToStubsConverterBase ()
 

Private Attributes

const OmtfAngleConverterangleConverter
 
const OMTFConfigurationconfig
 

Additional Inherited Members

- Protected Attributes inherited from DtPhase2DigiToStubsConverter
edm::Handle< L1Phase2MuDTPhContainerdtPhDigis
 
edm::Handle< L1MuDTChambThContainerdtThDigis
 
edm::EDGetTokenT< L1Phase2MuDTPhContainerinputTokenDtPh
 
edm::EDGetTokenT< L1MuDTChambThContainerinputTokenDtTh
 
bool mergePhiAndTheta = true
 

Detailed Description

Definition at line 67 of file InputMakerPhase2.h.

Constructor & Destructor Documentation

◆ DtPhase2DigiToStubsConverterOmtf()

DtPhase2DigiToStubsConverterOmtf::DtPhase2DigiToStubsConverterOmtf ( const OMTFConfiguration config,
const OmtfAngleConverter angleConverter,
edm::EDGetTokenT< L1Phase2MuDTPhContainer inputTokenDtPh,
edm::EDGetTokenT< L1MuDTChambThContainer inputTokenDtTh 
)
inline

Definition at line 69 of file InputMakerPhase2.h.

74  config(*config),
DtPhase2DigiToStubsConverter(edm::EDGetTokenT< L1Phase2MuDTPhContainer > inputTokenDtPh, edm::EDGetTokenT< L1MuDTChambThContainer > inputTokenDtTh)
const OMTFConfiguration & config
Definition: config.py:1
const OmtfAngleConverter & angleConverter
edm::EDGetTokenT< L1MuDTChambThContainer > inputTokenDtTh
edm::EDGetTokenT< L1Phase2MuDTPhContainer > inputTokenDtPh

◆ ~DtPhase2DigiToStubsConverterOmtf()

DtPhase2DigiToStubsConverterOmtf::~DtPhase2DigiToStubsConverterOmtf ( )
overridedefault

Member Function Documentation

◆ acceptDigi()

bool DtPhase2DigiToStubsConverterOmtf::acceptDigi ( const DTChamberId dTChamberId,
unsigned int  iProcessor,
l1t::tftype  procType 
)
overridevirtual

Reimplemented from DtPhase2DigiToStubsConverter.

Definition at line 144 of file InputMakerPhase2.cc.

References OMTFinputMaker::acceptDtDigi().

146  {
147  return OMTFinputMaker::acceptDtDigi(&config, dTChamberId, iProcessor, procType);
148 }
Definition: config.py:1
static bool acceptDtDigi(const OMTFConfiguration *config, const DTChamberId &dTChamberId, unsigned int iProcessor, l1t::tftype procType)

◆ addDTetaStubs()

void DtPhase2DigiToStubsConverterOmtf::addDTetaStubs ( MuonStubPtrs2D muonStubsInLayers,
const L1MuDTChambThDigi thetaDigi,
unsigned int  iProcessor,
l1t::tftype  procTyp 
)
overridevirtual

Implements DtPhase2DigiToStubsConverter.

Definition at line 136 of file InputMakerPhase2.cc.

139  {
140  //in the Phase1 omtf the theta stubs are merged with the phi in the addDTphiDigi
141  //TODO implement if needed
142 }

◆ addDTphiDigi()

void DtPhase2DigiToStubsConverterOmtf::addDTphiDigi ( MuonStubPtrs2D muonStubsInLayers,
const L1Phase2MuDTPhDigi digi,
const L1MuDTChambThContainer dtThDigis,
unsigned int  iProcessor,
l1t::tftype  procTyp 
)
overridevirtual

Implements DtPhase2DigiToStubsConverter.

Definition at line 68 of file InputMakerPhase2.cc.

References OMTFinputMaker::addStub(), angleConverter, L1Phase2MuDTPhDigi::bxNum(), ALCARECOPPSCalTrackBasedSel_cff::detid, MuonStub::DT_PHI_ETA, OmtfAngleConverter::getGlobalEta(), OMTFinputMaker::getInputNumber(), AngleConverterBase::getProcessorPhi(), OMTFinputMaker::getProcessorPhiZero(), ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::if(), LogTrace, OmtfName::name(), L1Phase2MuDTPhDigi::phi(), L1Phase2MuDTPhDigi::phiBend(), L1Phase2MuDTPhDigi::quality(), MuonStub::qualityHw, L1Phase2MuDTPhDigi::rpcFlag(), L1Phase2MuDTPhDigi::scNum(), L1Phase2MuDTPhDigi::slNum(), L1Phase2MuDTPhDigi::stNum(), and L1Phase2MuDTPhDigi::whNum().

72  {
73  DTChamberId detid(digi.whNum(), digi.stNum(), digi.scNum() + 1);
74 
75  MuonStub stub;
76 
77  //converting the quality to the same encoding as in phase-1, as it is important for extrapolation
78  if (digi.quality() >= 6)
79  stub.qualityHw = digi.quality() - 2;
80  else if (digi.quality() >= 3) {
81  if (digi.slNum() == 3)
82  stub.qualityHw = 3;
83  else if (digi.slNum() == 1)
84  stub.qualityHw = 2;
85  } else {
86  if (digi.slNum() == 3)
87  stub.qualityHw = 1;
88  else if (digi.slNum() == 1)
89  stub.qualityHw = 0;
90  }
91 
92  if (stub.qualityHw < config.getMinDtPhiQuality())
93  return;
94 
95  unsigned int hwNumber = config.getLayerNumber(detid.rawId());
96  if (config.getHwToLogicLayer().find(hwNumber) == config.getHwToLogicLayer().end())
97  return;
98 
99  auto iter = config.getHwToLogicLayer().find(hwNumber);
100  unsigned int iLayer = iter->second;
101  unsigned int iInput = OMTFinputMaker::getInputNumber(&config, detid.rawId(), iProcessor, procTyp);
102  //MuonStub& stub = muonStubsInLayers[iLayer][iInput];
103 
104  stub.type = MuonStub::DT_PHI_ETA;
105 
106  stub.phiHw = angleConverter.getProcessorPhi(
107  OMTFinputMaker::getProcessorPhiZero(&config, iProcessor), procTyp, digi.scNum(), digi.phi());
108 
109  //TODO the dtThDigis are not good yet,so passing an empty container to the angleConverter
110  //then it should return middle of chambers
111  //remove when the dtThDigis are fixed on the DT side
112  L1MuDTChambThContainer dtThDigisEmpty;
113  stub.etaHw = angleConverter.getGlobalEta(detid, &dtThDigisEmpty, digi.bxNum() - 20);
114  //in phase2, the phiB is 13 bits, and range is [-2, 2 rad] so 4 rad, 2^13 units/(4 rad) = 1^11/rad.
115  //need to convert them to 512units==1rad (to use OLD PATTERNS...)
116  stub.phiBHw = digi.phiBend() * config.dtPhiBUnitsRad() / 2048;
117  //the cut if (stub.qualityHw >= config.getMinDtPhiBQuality()) is done in the ProcessorBase<GoldenPatternType>::restrictInput
118  //as is is done like that in the firmware
119 
120  // need to shift 20-BX to roll-back the shift introduced by the DT TPs
121  stub.bx = digi.bxNum() - 20;
122  //stub.timing = digi.getTiming(); //TODO what about sub-bx timing, is is available?
123 
124  stub.logicLayer = iLayer;
125  stub.detId = detid;
126 
127  OmtfName board(iProcessor, &config);
128  LogTrace("l1tOmtfEventPrint") << board.name() << " L1Phase2MuDTPhDigi: detid " << detid << " digi "
129  << " whNum " << digi.whNum() << " scNum " << digi.scNum() << " stNum " << digi.stNum()
130  << " slNum " << digi.slNum() << " quality " << digi.quality() << " rpcFlag "
131  << digi.rpcFlag() << " phi " << digi.phi() << " phiBend " << digi.phiBend()
132  << std::endl;
133  OMTFinputMaker::addStub(&config, muonStubsInLayers, iLayer, iInput, stub);
134 }
virtual int getGlobalEta(const DTChamberId dTChamberId, const L1MuDTChambThContainer *dtThDigis, int bxNum) const
Definition: config.py:1
int qualityHw
Definition: MuonStub.h:47
#define LogTrace(id)
const OmtfAngleConverter & angleConverter
static int getProcessorPhiZero(const OMTFConfiguration *config, unsigned int iProcessor)
virtual int getProcessorPhi(int phiZero, l1t::tftype part, int dtScNum, int dtPhi) const
unsigned int getInputNumber(unsigned int rawId, unsigned int iProcessor, l1t::tftype type)
static void addStub(const OMTFConfiguration *config, MuonStubPtrs2D &muonStubsInLayers, unsigned int iLayer, unsigned int iInput, MuonStub &stub)
if(threadIdxLocalY==0 &&threadIdxLocalX==0)

Member Data Documentation

◆ angleConverter

const OmtfAngleConverter& DtPhase2DigiToStubsConverterOmtf::angleConverter
private

Definition at line 95 of file InputMakerPhase2.h.

Referenced by addDTphiDigi().

◆ config

const OMTFConfiguration& DtPhase2DigiToStubsConverterOmtf::config
private

Definition at line 94 of file InputMakerPhase2.h.