CMS 3D CMS Logo

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

#include <OMTFinputMaker.h>

Inheritance diagram for RpcDigiToStubsConverterOmtf:
RpcDigiToStubsConverter DigiToStubsConverterBase

Public Member Functions

bool acceptDigi (const RPCDetId &rpcDetId, unsigned int iProcessor, l1t::tftype procType) override
 
void addRPCstub (MuonStubPtrs2D &muonStubsInLayers, const RPCDetId &roll, const RpcCluster &cluster, unsigned int iProcessor, l1t::tftype procTyp) override
 
 RpcDigiToStubsConverterOmtf (const OMTFConfiguration *config, const OmtfAngleConverter *angleConverter, const RpcClusterization *rpcClusterization, edm::EDGetTokenT< RPCDigiCollection > inputTokenRpc)
 
 ~RpcDigiToStubsConverterOmtf () override
 
- Public Member Functions inherited from RpcDigiToStubsConverter
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
 
 RpcDigiToStubsConverter (const ProcConfigurationBase *config, edm::EDGetTokenT< RPCDigiCollection > inputTokenRpc, const RpcClusterization *rpcClusterization)
 
 ~RpcDigiToStubsConverter () override
 
- Public Member Functions inherited from DigiToStubsConverterBase
virtual ~DigiToStubsConverterBase ()
 

Private Attributes

const OmtfAngleConverterangleConverter = nullptr
 
const OMTFConfigurationconfig = nullptr
 

Additional Inherited Members

- Protected Attributes inherited from RpcDigiToStubsConverter
const ProcConfigurationBaseconfig
 
edm::EDGetTokenT< RPCDigiCollectioninputTokenRpc
 
bool mergePhiAndTheta = true
 
const RpcClusterizationrpcClusterization
 
edm::Handle< RPCDigiCollectionrpcDigis
 

Detailed Description

Definition at line 73 of file OMTFinputMaker.h.

Constructor & Destructor Documentation

◆ RpcDigiToStubsConverterOmtf()

RpcDigiToStubsConverterOmtf::RpcDigiToStubsConverterOmtf ( const OMTFConfiguration config,
const OmtfAngleConverter angleConverter,
const RpcClusterization rpcClusterization,
edm::EDGetTokenT< RPCDigiCollection inputTokenRpc 
)
inline

Definition at line 75 of file OMTFinputMaker.h.

80  config(config),
const OMTFConfiguration * config
edm::EDGetTokenT< RPCDigiCollection > inputTokenRpc
const OmtfAngleConverter * angleConverter
Definition: config.py:1
RpcDigiToStubsConverter(const ProcConfigurationBase *config, edm::EDGetTokenT< RPCDigiCollection > inputTokenRpc, const RpcClusterization *rpcClusterization)
const RpcClusterization * rpcClusterization

◆ ~RpcDigiToStubsConverterOmtf()

RpcDigiToStubsConverterOmtf::~RpcDigiToStubsConverterOmtf ( )
inlineoverride

Definition at line 83 of file OMTFinputMaker.h.

83 {};

Member Function Documentation

◆ acceptDigi()

bool RpcDigiToStubsConverterOmtf::acceptDigi ( const RPCDetId rpcDetId,
unsigned int  iProcessor,
l1t::tftype  procType 
)
overridevirtual

Select RPC chambers connected to OMTF

RPC RE1/2 temporarily not used (rpcDetId.region()==1 && rpcDetId.station()==1 && rpcDetId.ring()<2) ||

Reimplemented from RpcDigiToStubsConverter.

Definition at line 235 of file OMTFinputMaker.cc.

References l1t::bmtf, l1t::emtf_neg, l1t::emtf_pos, OMTFinputMaker::getInputNumber(), RPCDetId::layer(), l1t::omtf_neg, l1t::omtf_pos, DetId::rawId(), RPCDetId::region(), RPCDetId::ring(), RPCDetId::roll(), RPCDetId::sector(), RPCDetId::station(), and RPCDetId::subsector().

235  {
236  unsigned int aMin = config->getBarrelMin()[iProcessor];
237  unsigned int aMax = config->getBarrelMax()[iProcessor];
238 
239  unsigned int aSector = rpcDetId.sector();
240 
242  if (procType == l1t::tftype::omtf_pos &&
243  (rpcDetId.region() < 0 || (rpcDetId.region() == 0 && rpcDetId.ring() != 2) ||
244  (rpcDetId.region() == 0 && rpcDetId.station() == 4) ||
245  (rpcDetId.region() == 0 && rpcDetId.station() == 2 && rpcDetId.layer() == 2 && rpcDetId.roll() == 1) ||
246  (rpcDetId.region() == 0 && rpcDetId.station() == 3 && rpcDetId.roll() == 1) ||
247  (rpcDetId.region() == 1 && rpcDetId.station() == 4) ||
249  (rpcDetId.region() == 1 && rpcDetId.station() > 0 && rpcDetId.ring() < 3)))
250  return false;
251 
252  if (procType == l1t::tftype::omtf_neg &&
253  (rpcDetId.region() > 0 || (rpcDetId.region() == 0 && rpcDetId.ring() != -2) ||
254  (rpcDetId.region() == 0 && rpcDetId.station() == 4) ||
255  (rpcDetId.region() == 0 && rpcDetId.station() == 2 && rpcDetId.layer() == 2 && rpcDetId.roll() == 1) ||
256  (rpcDetId.region() == 0 && rpcDetId.station() == 3 && rpcDetId.roll() == 1) ||
257  (rpcDetId.region() == -1 && rpcDetId.station() == 4) ||
258  //RPC RE1/2 temporarily not used (rpcDetId.region()==1 && rpcDetId.station()==1 && rpcDetId.ring()<2) ||
259  (rpcDetId.region() == -1 && rpcDetId.station() > 0 && rpcDetId.ring() < 3)))
260  return false;
261 
262  if (procType == l1t::tftype::omtf_pos || procType == l1t::tftype::omtf_neg) {
263  if (rpcDetId.region() != 0 && rpcDetId.station() == 3) { //endcaps, layer 17
264  unsigned int iInput = OMTFinputMaker::getInputNumber(config, rpcDetId.rawId(), iProcessor, procType);
265  if (iInput == 0 || iInput == 1)
266  return false; // FIXME (MK) there is no RPC link for that input, because it is taken by DAQ link
267  }
268  }
269 
270  if (procType == l1t::tftype::bmtf && rpcDetId.region() != 0)
271  return false;
272 
273  if (procType == l1t::tftype::emtf_pos &&
274  (rpcDetId.region() <= 0 || (rpcDetId.station() == 1 && rpcDetId.ring() == 3)))
275  return false;
276  if (procType == l1t::tftype::emtf_neg &&
277  (rpcDetId.region() >= 0 || (rpcDetId.station() == 1 && rpcDetId.ring() == 3)))
278  return false;
280  if (rpcDetId.region() == 0)
281  aSector = rpcDetId.sector();
282  if (rpcDetId.region() != 0) {
283  aSector = (rpcDetId.sector() - 1) * 6 + rpcDetId.subsector();
284  aMin = config->getEndcap10DegMin()[iProcessor];
285  aMax = config->getEndcap10DegMax()[iProcessor];
286  }
287 
288  if (aMax > aMin && aSector >= aMin && aSector <= aMax)
289  return true;
290  if (aMax < aMin && (aSector >= aMin || aSector <= aMax))
291  return true;
292 
293  return false;
294 }
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
int ring() const
Definition: RPCDetId.h:59
Definition: config.py:1
int roll() const
Definition: RPCDetId.h:92
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:88
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
unsigned int getInputNumber(unsigned int rawId, unsigned int iProcessor, l1t::tftype type)
int station() const
Definition: RPCDetId.h:78
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
int layer() const
Definition: RPCDetId.h:85

◆ addRPCstub()

void RpcDigiToStubsConverterOmtf::addRPCstub ( MuonStubPtrs2D muonStubsInLayers,
const RPCDetId roll,
const RpcCluster cluster,
unsigned int  iProcessor,
l1t::tftype  procTyp 
)
overridevirtual

Implements RpcDigiToStubsConverter.

Definition at line 159 of file OMTFinputMaker.cc.

References OMTFinputMaker::addStub(), angleConverter, RpcCluster::bx, MuonStub::bx, MuonStub::detId, MuonStub::etaHw, RpcCluster::firstStrip, OmtfAngleConverter::getGlobalEtaRpc(), OMTFinputMaker::getInputNumber(), AngleConverterBase::getProcessorPhi(), OMTFinputMaker::getProcessorPhiZero(), RpcCluster::lastStrip, MuonStub::logicLayer, LogTrace, MuonStub::phiHw, MuonStub::qualityHw, MuonStub::r, alignCSCRings::r, nano_mu_digi_cff::roll, MuonStub::RPC, MuonStub::RPC_DROPPED, RpcCluster::size(), str, RpcCluster::timing, MuonStub::timing, and MuonStub::type.

163  {
164  unsigned int rawid = roll.rawId();
165 
166  unsigned int hwNumber = config->getLayerNumber(rawid);
167  unsigned int iLayer = config->getHwToLogicLayer().at(hwNumber);
168  unsigned int iInput = OMTFinputMaker::getInputNumber(config, rawid, iProcessor, procTyp);
169 
170  //LogTrace("l1tOmtfEventPrint")<<"ADDING HIT: iLayer = " << iLayer << " iInput: " << iInput << " iPhi: " << iPhi << std::endl;
171 
172  //if (iLayer==17 && (iInput==0 || iInput==1)) continue; // FIXME (MK) there is no RPC link for that input, because it is taken by DAQ link
173 
174  MuonStub stub;
175  stub.type = MuonStub::RPC;
177  OMTFinputMaker::getProcessorPhiZero(config, iProcessor), procTyp, roll, cluster.firstStrip, cluster.lastStrip);
178 
179  float r = 0;
180  stub.etaHw = angleConverter->getGlobalEtaRpc(rawid, cluster.firstStrip, r);
181  stub.r = round(r);
182 
183  stub.qualityHw = cluster.size();
184 
185  stub.bx = cluster.bx;
186  stub.timing = cluster.timing;
187 
188  //stub.etaType = ?? TODO
189  stub.logicLayer = iLayer;
190  stub.detId = rawid;
191 
192  //This is very simple filtering of the clusters
193  //Till Nov 2021: unfortunately performance of the firmware cannot be easily emulated from digi
194  //(in principle would required raws, because in the firmware the clusterizaton is based on the 8-bit strip partitions)
195  //The FW from from Nov 2021 solved this problem - option dropAllClustersIfMoreThanMax:
196  //if any cluster is dropped in one barrel roll or endcap chamber - all are dropped for this roll/chamber.
197  //Beside better data-to-emulator agreement it provides better eff for high pt muons
198  if (config->getRpcDropAllClustersIfMoreThanMax()) {
199  //two clusters were already added, so as we have the next one, we mark as dropped the one that was added before
200  if (muonStubsInLayers[iLayer][iInput + 1]) {
201  //if iInput+1 is not null, iInput is not null as well
202  muonStubsInLayers[iLayer][iInput]->type = MuonStub::RPC_DROPPED;
203  muonStubsInLayers[iLayer][iInput + 1]->type = MuonStub::RPC_DROPPED;
204  } else if (cluster.size() > config->getRpcMaxClusterSize()) {
205  //marking as dropped the one that was added before on the iInput
206  if (muonStubsInLayers[iLayer][iInput]) {
207  muonStubsInLayers[iLayer][iInput]->type = MuonStub::RPC_DROPPED;
208 
209  muonStubsInLayers[iLayer][iInput + 1] = std::make_shared<MuonStub>(stub);
210  muonStubsInLayers[iLayer][iInput + 1]->type = MuonStub::RPC_DROPPED;
211  } else {
212  //no stub was added at this input already, so adding a stub and marking it as dropped
213  muonStubsInLayers[iLayer].at(iInput) = std::make_shared<MuonStub>(stub);
214  muonStubsInLayers[iLayer][iInput]->type = MuonStub::RPC_DROPPED;
215 
216  muonStubsInLayers[iLayer][iInput + 1] = std::make_shared<MuonStub>(stub);
217  muonStubsInLayers[iLayer][iInput + 1]->type = MuonStub::RPC_DROPPED;
218  }
219  } else
220  OMTFinputMaker::addStub(config, muonStubsInLayers, iLayer, iInput, stub);
221  } else {
222  if (cluster.size() <= config->getRpcMaxClusterSize())
223  OMTFinputMaker::addStub(config, muonStubsInLayers, iLayer, iInput, stub);
224  }
225 
226  std::ostringstream str;
227  str << " RPC halfDigi "
228  << " begin: " << cluster.firstStrip << " end: " << cluster.lastStrip << " iPhi: " << stub.phiHw
229  << " iEta: " << stub.etaHw << " hwNumber: " << hwNumber << " iInput: " << iInput << " iLayer: " << iLayer
230  << std::endl;
231 
232  LogTrace("l1tOmtfEventPrint") << str.str();
233 }
int timing
Definition: MuonStub.h:50
int detId
Definition: MuonStub.h:59
const OmtfAngleConverter * angleConverter
Definition: config.py:1
Type type
Definition: MuonStub.h:38
int qualityHw
Definition: MuonStub.h:47
#define LogTrace(id)
unsigned int size() const
static int getProcessorPhiZero(const OMTFConfiguration *config, unsigned int iProcessor)
int r
Definition: MuonStub.h:46
int etaHw
Definition: MuonStub.h:45
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)
virtual int getGlobalEtaRpc(unsigned int rawid, const unsigned int &aDigi, float &r) const
Convert local eta coordinate to global digital microGMT scale.
int bx
Definition: MuonStub.h:49
unsigned int logicLayer
Definition: MuonStub.h:53
static void addStub(const OMTFConfiguration *config, MuonStubPtrs2D &muonStubsInLayers, unsigned int iLayer, unsigned int iInput, MuonStub &stub)
int phiHw
Definition: MuonStub.h:40
#define str(s)

Member Data Documentation

◆ angleConverter

const OmtfAngleConverter* RpcDigiToStubsConverterOmtf::angleConverter = nullptr
private

Definition at line 95 of file OMTFinputMaker.h.

Referenced by addRPCstub().

◆ config

const OMTFConfiguration* RpcDigiToStubsConverterOmtf::config = nullptr
private

Definition at line 94 of file OMTFinputMaker.h.