13 m_label{iConfig.getParameter<
std::string>(
"label")},
14 m_rpcDigiToken{consumes<RPCDigiCollection>(m_label)},
16 m_brlCandPutToken{produces<std::vector<L1MuRegionalCand> >(
"RPCb")},
17 m_fwdCandPutToken{produces<std::vector<L1MuRegionalCand> >(
"RPCf")},
19 m_brlLinksPutToken{produces<std::vector<RPCDigiL1Link> >(
"RPCb")},
20 m_fwdLinksPutToken{produces<std::vector<RPCDigiL1Link> >(
"RPCf")},
21 m_configToken(esConsumes<L1RPCConfig, L1RPCConfigRcd>()),
22 m_coneBuilderToken(esConsumes<L1RPCConeBuilder, L1RPCConeBuilderRcd>()),
23 m_coneDefinitionToken(esConsumes<L1RPCConeDefinition, L1RPCConeDefinitionRcd>()),
24 m_hwConfigToken(esConsumes<L1RPCHwConfig, L1RPCHwConfigRcd>()),
25 m_BxOrConfigToken(esConsumes<L1RPCBxOrConfig, L1RPCBxOrConfigRcd>()),
26 m_hsbConfigToken(esConsumes<L1RPCHsbConfig, L1RPCHsbConfigRcd>()) {
28 usesResource(
"MuonsGrabber");
57 std::vector<L1MuRegionalCand> candBarell;
58 std::vector<L1MuRegionalCand> candForward;
61 <<
"\nWarning: RPCDigiCollection with input tag " <<
m_label 62 <<
"\nrequested in configuration, but not found in the event. Emulator will produce empty collection \n ";
70 if (rpcDigis->begin() == rpcDigis->end()) {
71 LogDebug(
"RPCTrigger") <<
"\nWarning: RPCDigiCollection with input tag " <<
m_label 72 <<
"\n seems to be empty for this event. Emulator will run on empty collection ";
75 std::vector<RPCDigiL1Link> brlLinks;
76 std::vector<RPCDigiL1Link> fwdLinks;
88 for (
int iBx = -1; iBx < 2; ++iBx) {
112 std::vector<RPCDigiL1Link> dlBrl;
113 std::vector<RPCDigiL1Link> dlFwd;
117 brlLinks.insert(brlLinks.end(), dlBrl.begin(), dlBrl.end());
118 fwdLinks.insert(fwdLinks.end(), dlFwd.begin(), dlFwd.end());
120 candBarell.insert(candBarell.end(), RPCb.begin(), RPCb.end());
121 candForward.insert(candForward.end(), RPCf.begin(), RPCf.end());
145 std::vector<RPCDigiL1Link>& retRPCDigiLink) {
146 std::vector<L1MuRegionalCand> RPCCand;
148 for (
unsigned int iMu = 0; iMu <
finalMuons.size(); iMu++) {
159 short int digiIndex = 0;
161 for (detUnitIt = rpcDigis->begin(); detUnitIt != rpcDigis->end(); ++detUnitIt) {
162 const RPCDetId&
id = (*detUnitIt).first;
163 uint32_t
rawId =
id.rawId();
169 RPCMuon::TDigiLinkVec::iterator
it = digiIVec.begin();
170 for (;
it != digiIVec.end(); ++
it) {
171 if (digiIndex ==
it->m_digiIdx) {
172 newDigiLink.
setLink(
it->m_layer + 1,
rawId, digiIt->strip(), digiIt->bx());
179 retRPCDigiLink.push_back(newDigiLink);
221 signed short etaAddr =
finalMuons[iMu].getEtaAddr();
241 RPCCand.push_back(l1Cand);
243 LogDebug(
"RPCTrigger") <<
"Found muonf of pt " <<
finalMuons[iMu].getPtCode() <<
" bx " << l1Cand.
bx()
const edm::EDPutTokenT< std::vector< L1MuRegionalCand > > m_fwdCandPutToken
unsigned int quality() const
return quality
void setLink(unsigned int layer, unsigned int rpcdetId, int strip, int bx)
std::unique_ptr< RPCBasicTrigConfig > m_trigConfig
const edm::ESGetToken< L1RPCBxOrConfig, L1RPCBxOrConfigRcd > m_BxOrConfigToken
const edm::EDPutTokenT< std::vector< RPCDigiL1Link > > m_brlLinksPutToken
L1RpcLogConesVec getConesFromES(edm::Handle< RPCDigiCollection > rpcDigis, edm::ESHandle< L1RPCConeBuilder > coneBuilder, edm::ESHandle< L1RPCConeDefinition > coneDef, edm::ESHandle< L1RPCBxOrConfig > bxOrDef, edm::ESHandle< L1RPCHwConfig > hwConfig, int bx)
unsigned charge_packed() const
return charge packed as in hardware (0=pos, 1=neg)
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< L1MuRegionalCand > giveFinallCandindates(const L1RpcTBMuonsVec &finalMuons, int type, int bx, edm::Handle< RPCDigiCollection > rpcDigis, std::vector< RPCDigiL1Link > &retRPCDigiLink)
Returns vector of L1MuRegionalCand (input of L1GMT)
unsigned phi_packed() const
return phi packed as in hardware
const std::string m_label
unsigned long long cacheIdentifier() const
T getUntrackedParameter(std::string const &, T const &) const
static MuonsGrabber & Instance()
void setRPCBasicTrigConfig(RPCBasicTrigConfig *c)
void setBx(int bx)
Set Bunch Crossing.
T const * product() const
std::vector< RPCTBMuon > L1RpcTBMuonsVec
void startNewEvent(int event, int bx)
RPCPacManager< RPCPacData > m_pacManager
std::vector< L1RpcTBMuonsVec > L1RpcTBMuonsVec2
const edm::ESGetToken< L1RPCHsbConfig, L1RPCHsbConfigRcd > m_hsbConfigToken
unsigned eta_packed() const
return eta packed as in hardware
void setType(unsigned type)
Set Type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC.
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
RPCConeBuilderFromES m_theLinksystemFromES
std::vector< TDigiLink > TDigiLinkVec
const edm::EDPutTokenT< std::vector< RPCDigiL1Link > > m_fwdLinksPutToken
void setChargePacked(unsigned ch)
Set Charge (0=pos, 1=neg)
const edm::ESGetToken< L1RPCHwConfig, L1RPCHwConfigRcd > m_hwConfigToken
void setPtPacked(unsigned pt)
Set Pt: 0..31.
std::pair< const_iterator, const_iterator > Range
std::vector< RPCDigi >::const_iterator const_iterator
const edm::EDPutTokenT< std::vector< L1MuRegionalCand > > m_brlCandPutToken
RPCTrigger(const edm::ParameterSet &)
void setPhiPacked(unsigned phi)
Set Phi: 0..143.
void init(std::string patFilesDirectory, L1RpcPACsCntEnum _PACsCnt)
void setQualityPacked(unsigned qual)
Set Quality: 0..7.
void setEtaPacked(unsigned eta)
Set Eta: 6-bit code.
std::unique_ptr< RPCPacTrigger > m_pacTrigger
const edm::ESGetToken< L1RPCConeDefinition, L1RPCConeDefinitionRcd > m_coneDefinitionToken
void setChargeValid(bool valid)
Set Charge Valid.
const edm::EDGetTokenT< RPCDigiCollection > m_rpcDigiToken
const edm::ESGetToken< L1RPCConeBuilder, L1RPCConeBuilderRcd > m_coneBuilderToken
void writeDataForRelativeBX(int bx)
std::vector< RPCLogCone > L1RpcLogConesVec
int bx() const
return bunch crossing identifier
const edm::ESGetToken< L1RPCConfig, L1RPCConfigRcd > m_configToken
unsigned long long m_cacheID
unsigned type_idx() const
return type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC