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) 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 223 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().

223  {
224  unsigned int aMin = config->getBarrelMin()[iProcessor];
225  unsigned int aMax = config->getBarrelMax()[iProcessor];
226 
227  unsigned int aSector = rpcDetId.sector();
228 
230  if (procType == l1t::tftype::omtf_pos &&
231  (rpcDetId.region() < 0 || (rpcDetId.region() == 0 && rpcDetId.ring() != 2) ||
232  (rpcDetId.region() == 0 && rpcDetId.station() == 4) ||
233  (rpcDetId.region() == 0 && rpcDetId.station() == 2 && rpcDetId.layer() == 2 && rpcDetId.roll() == 1) ||
234  (rpcDetId.region() == 0 && rpcDetId.station() == 3 && rpcDetId.roll() == 1) ||
235  (rpcDetId.region() == 1 && rpcDetId.station() == 4) ||
237  (rpcDetId.region() == 1 && rpcDetId.station() > 0 && rpcDetId.ring() < 3)))
238  return false;
239 
240  if (procType == l1t::tftype::omtf_neg &&
241  (rpcDetId.region() > 0 || (rpcDetId.region() == 0 && rpcDetId.ring() != -2) ||
242  (rpcDetId.region() == 0 && rpcDetId.station() == 4) ||
243  (rpcDetId.region() == 0 && rpcDetId.station() == 2 && rpcDetId.layer() == 2 && rpcDetId.roll() == 1) ||
244  (rpcDetId.region() == 0 && rpcDetId.station() == 3 && rpcDetId.roll() == 1) ||
245  (rpcDetId.region() == -1 && rpcDetId.station() == 4) ||
246  //RPC RE1/2 temporarily not used (rpcDetId.region()==1 && rpcDetId.station()==1 && rpcDetId.ring()<2) ||
247  (rpcDetId.region() == -1 && rpcDetId.station() > 0 && rpcDetId.ring() < 3)))
248  return false;
249 
250  if (procType == l1t::tftype::omtf_pos || procType == l1t::tftype::omtf_neg) {
251  if (rpcDetId.region() != 0 && rpcDetId.station() == 3) { //endcaps, layer 17
252  unsigned int iInput = OMTFinputMaker::getInputNumber(config, rpcDetId.rawId(), iProcessor, procType);
253  if (iInput == 0 || iInput == 1)
254  return false; // FIXME (MK) there is no RPC link for that input, because it is taken by DAQ link
255  }
256  }
257 
258  if (procType == l1t::tftype::bmtf && rpcDetId.region() != 0)
259  return false;
260 
261  if (procType == l1t::tftype::emtf_pos &&
262  (rpcDetId.region() <= 0 || (rpcDetId.station() == 1 && rpcDetId.ring() == 3)))
263  return false;
264  if (procType == l1t::tftype::emtf_neg &&
265  (rpcDetId.region() >= 0 || (rpcDetId.station() == 1 && rpcDetId.ring() == 3)))
266  return false;
268  if (rpcDetId.region() == 0)
269  aSector = rpcDetId.sector();
270  if (rpcDetId.region() != 0) {
271  aSector = (rpcDetId.sector() - 1) * 6 + rpcDetId.subsector();
272  aMin = config->getEndcap10DegMin()[iProcessor];
273  aMax = config->getEndcap10DegMax()[iProcessor];
274  }
275 
276  if (aMax > aMin && aSector >= aMin && aSector <= aMax)
277  return true;
278  if (aMax < aMin && (aSector >= aMin || aSector <= aMax))
279  return true;
280 
281  return false;
282 }
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 150 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, nano_mu_digi_cff::roll, MuonStub::RPC, MuonStub::RPC_DROPPED, RpcCluster::size(), str, RpcCluster::timing, MuonStub::timing, and MuonStub::type.

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