CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< RPCDigiCollection
inputTokenRpc
 
bool mergePhiAndTheta = true
 
const RpcClusterizationrpcClusterization
 
edm::Handle< RPCDigiCollectionrpcDigis
 

Detailed Description

Definition at line 73 of file OMTFinputMaker.h.

Constructor & Destructor Documentation

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

Definition at line 75 of file OMTFinputMaker.h.

79  : RpcDigiToStubsConverter(config, inputTokenRpc, rpcClusterization),
80  config(config),
81  angleConverter(angleConverter){};
const OMTFConfiguration * config
const OmtfAngleConverter * angleConverter
RpcDigiToStubsConverter(const ProcConfigurationBase *config, edm::EDGetTokenT< RPCDigiCollection > inputTokenRpc, const RpcClusterization *rpcClusterization)
RpcDigiToStubsConverterOmtf::~RpcDigiToStubsConverterOmtf ( )
inlineoverride

Definition at line 83 of file OMTFinputMaker.h.

83 {};

Member Function Documentation

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 217 of file OMTFinputMaker.cc.

References l1t::bmtf, config, l1t::emtf_neg, l1t::emtf_pos, OMTFConfiguration::getBarrelMax(), OMTFConfiguration::getBarrelMin(), OMTFConfiguration::getEndcap10DegMax(), OMTFConfiguration::getEndcap10DegMin(), 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().

217  {
218  unsigned int aMin = config->getBarrelMin()[iProcessor];
219  unsigned int aMax = config->getBarrelMax()[iProcessor];
220 
221  unsigned int aSector = rpcDetId.sector();
222 
224  if (procType == l1t::tftype::omtf_pos &&
225  (rpcDetId.region() < 0 || (rpcDetId.region() == 0 && rpcDetId.ring() != 2) ||
226  (rpcDetId.region() == 0 && rpcDetId.station() == 4) ||
227  (rpcDetId.region() == 0 && rpcDetId.station() == 2 && rpcDetId.layer() == 2 && rpcDetId.roll() == 1) ||
228  (rpcDetId.region() == 0 && rpcDetId.station() == 3 && rpcDetId.roll() == 1) ||
229  (rpcDetId.region() == 1 && rpcDetId.station() == 4) ||
231  (rpcDetId.region() == 1 && rpcDetId.station() > 0 && rpcDetId.ring() < 3)))
232  return false;
233 
234  if (procType == l1t::tftype::omtf_neg &&
235  (rpcDetId.region() > 0 || (rpcDetId.region() == 0 && rpcDetId.ring() != -2) ||
236  (rpcDetId.region() == 0 && rpcDetId.station() == 4) ||
237  (rpcDetId.region() == 0 && rpcDetId.station() == 2 && rpcDetId.layer() == 2 && rpcDetId.roll() == 1) ||
238  (rpcDetId.region() == 0 && rpcDetId.station() == 3 && rpcDetId.roll() == 1) ||
239  (rpcDetId.region() == -1 && rpcDetId.station() == 4) ||
240  //RPC RE1/2 temporarily not used (rpcDetId.region()==1 && rpcDetId.station()==1 && rpcDetId.ring()<2) ||
241  (rpcDetId.region() == -1 && rpcDetId.station() > 0 && rpcDetId.ring() < 3)))
242  return false;
243 
244  if (procType == l1t::tftype::omtf_pos || procType == l1t::tftype::omtf_neg) {
245  if (rpcDetId.region() != 0 && rpcDetId.station() == 3) { //endcaps, layer 17
246  unsigned int iInput = OMTFinputMaker::getInputNumber(config, rpcDetId.rawId(), iProcessor, procType);
247  if (iInput == 0 || iInput == 1)
248  return false; // FIXME (MK) there is no RPC link for that input, because it is taken by DAQ link
249  }
250  }
251 
252  if (procType == l1t::tftype::bmtf && rpcDetId.region() != 0)
253  return false;
254 
255  if (procType == l1t::tftype::emtf_pos &&
256  (rpcDetId.region() <= 0 || (rpcDetId.station() == 1 && rpcDetId.ring() == 3)))
257  return false;
258  if (procType == l1t::tftype::emtf_neg &&
259  (rpcDetId.region() >= 0 || (rpcDetId.station() == 1 && rpcDetId.ring() == 3)))
260  return false;
262  if (rpcDetId.region() == 0)
263  aSector = rpcDetId.sector();
264  if (rpcDetId.region() != 0) {
265  aSector = (rpcDetId.sector() - 1) * 6 + rpcDetId.subsector();
266  aMin = config->getEndcap10DegMin()[iProcessor];
267  aMax = config->getEndcap10DegMax()[iProcessor];
268  }
269 
270  if (aMax > aMin && aSector >= aMin && aSector <= aMax)
271  return true;
272  if (aMax < aMin && (aSector >= aMin || aSector <= aMax))
273  return true;
274 
275  return false;
276 }
const OMTFConfiguration * config
const std::vector< unsigned int > & getBarrelMax() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const std::vector< unsigned int > & getEndcap10DegMin() const
int roll() const
Definition: RPCDetId.h:92
int ring() const
Definition: RPCDetId.h:59
const std::vector< unsigned int > & getEndcap10DegMax() const
int layer() const
Definition: RPCDetId.h:85
const std::vector< unsigned int > & getBarrelMin() const
unsigned int getInputNumber(unsigned int rawId, unsigned int iProcessor, l1t::tftype type)
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
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
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
int station() const
Definition: RPCDetId.h:78
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, config, MuonStub::detId, MuonStub::etaHw, RpcCluster::firstStrip, OmtfAngleConverter::getGlobalEtaRpc(), OMTFConfiguration::getHwToLogicLayer(), OMTFinputMaker::getInputNumber(), OMTFConfiguration::getLayerNumber(), AngleConverterBase::getProcessorPhi(), OMTFinputMaker::getProcessorPhiZero(), ProcConfigurationBase::getRpcDropAllClustersIfMoreThanMax(), ProcConfigurationBase::getRpcMaxClusterSize(), RpcCluster::lastStrip, MuonStub::logicLayer, LogTrace, MuonStub::phiHw, MuonStub::qualityHw, DetId::rawId(), 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
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  else {
197  //no stub was added at this input already, so adding a stub and marking it as dropped
198  muonStubsInLayers.at(iLayer).at(iInput) = std::make_shared<MuonStub>(stub);
199  muonStubsInLayers[iLayer][iInput]->type = MuonStub::RPC_DROPPED;
200  }
201  } else
202  OMTFinputMaker::addStub(config, muonStubsInLayers, iLayer, iInput, stub);
203  } else {
204  if (cluster.size() <= config->getRpcMaxClusterSize())
205  OMTFinputMaker::addStub(config, muonStubsInLayers, iLayer, iInput, stub);
206  }
207 
208  std::ostringstream str;
209  str << " RPC halfDigi "
210  << " begin: " << cluster.firstStrip << " end: " << cluster.lastStrip << " iPhi: " << stub.phiHw
211  << " iEta: " << stub.etaHw << " hwNumber: " << hwNumber << " iInput: " << iInput << " iLayer: " << iLayer
212  << std::endl;
213 
214  LogTrace("l1tOmtfEventPrint") << str.str();
215 }
const OMTFConfiguration * config
int timing
Definition: MuonStub.h:50
unsigned int size() const
virtual int getGlobalEtaRpc(unsigned int rawid, const unsigned int &aDigi) const
Convert local eta coordinate to global digital microGMT scale.
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int detId
Definition: MuonStub.h:57
const OmtfAngleConverter * angleConverter
Type type
Definition: MuonStub.h:38
int qualityHw
error of the eta measurement
Definition: MuonStub.h:47
#define LogTrace(id)
static int getProcessorPhiZero(const OMTFConfiguration *config, unsigned int iProcessor)
const std::map< int, int > & getHwToLogicLayer() const
virtual bool getRpcDropAllClustersIfMoreThanMax() const
int etaHw
Definition: MuonStub.h:45
virtual int getProcessorPhi(int phiZero, l1t::tftype part, int dtScNum, int dtPhi) const
uint32_t getLayerNumber(uint32_t rawId) 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)
virtual unsigned int getRpcMaxClusterSize() const

Member Data Documentation

const OmtfAngleConverter* RpcDigiToStubsConverterOmtf::angleConverter = nullptr
private

Definition at line 95 of file OMTFinputMaker.h.

Referenced by addRPCstub().

const OMTFConfiguration* RpcDigiToStubsConverterOmtf::config = nullptr
private