40 if (
payload.size() != 4) { errors += 1;
41 edm::LogError(
"L1T|EMTF") <<
"Payload size in 'RPC Data Record' is different than expected"; }
44 for (
unsigned int i = 0;
i < 4;
i++) {
46 edm::LogError(
"L1T|EMTF") <<
"Payload[" << i <<
"] has more than 16 bits in 'RPC Data Record'"; }
55 if (
GetHexBits(RPCa, 15, 15) != 0) { errors += 1;
56 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in RPCa are incorrect"; }
57 if (
GetHexBits(RPCb, 15, 15) != 0) { errors += 1;
58 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in RPCb are incorrect"; }
59 if (
GetHexBits(RPCc, 15, 15) != 1) { errors += 1;
60 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in RPCc are incorrect"; }
61 if (
GetHexBits(RPCd, 15, 15) != 0) { errors += 1;
62 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in RPCd are incorrect"; }
70 const int evt_sector,
const int frame,
const int word,
const int link) {
80 sector = (link != 0 ? evt_sector : (evt_sector == 1 ? 6 : evt_sector - 1) );
81 subsector = (link != 0 ? link : 6);
82 neighbor = (link == 0 ? 1 : 0);
86 station = (word < 2 ? 1 : 2);
88 }
else if (frame == 1) {
90 ring = (word < 2 ? 2 : 3);
91 }
else if (frame == 2) {
93 ring = (word < 2 ? 2 : 3);
120 int iOut = res->size() - 1;
150 int _station, _ring, _sector, _subsector, _neighbor, _segment;
152 (res->at(iOut)).PtrEventHeader()->Sector(), RPC_.
Frame(), RPC_.
Word(), RPC_.
Link() );
158 Hit_.
set_sector_RPC ( _subsector < 5 ? _sector : (_sector % 6) + 1);
167 ImportRPC( Hit_, RPC_, (res->at(iOut)).PtrEventHeader()->Endcap(), (res->at(iOut)).PtrEventHeader()->Sector() );
174 bool exact_duplicate =
false;
175 for (
auto const & iHit : *res_hit) {
177 if ( Hit_.
BX() == iHit.BX() &&
178 Hit_.
Endcap() == iHit.Endcap() &&
179 Hit_.
Station() == iHit.Station() &&
180 Hit_.
Chamber() == iHit.Chamber() ) {
182 if ( (iHit.Is_CSC() == 1 && iHit.Ring() == 2) ||
183 (iHit.Is_RPC() == 1) ) {
184 if ( Hit_.
Neighbor() == iHit.Neighbor() ) {
186 if ( iHit.Is_RPC() == 1 &&
187 iHit.Ring() == Hit_.
Ring() &&
188 iHit.Theta_fp() == Hit_.
Theta_fp() &&
189 iHit.Phi_fp() == Hit_.
Phi_fp() ) {
190 exact_duplicate =
true;
197 if (exact_duplicate)
edm::LogWarning(
"L1T|EMTF") <<
"EMTF unpacked duplicate CPPF digis: BX " << Hit_.
BX()
198 <<
", endcap " << Hit_.
Endcap() <<
", station " << Hit_.
Station()
199 <<
", sector " << Hit_.
Sector() <<
", neighbor " << Hit_.
Neighbor()
200 <<
", ring " << Hit_.
Ring() <<
", chamber " << Hit_.
Chamber()
201 <<
", theta " << Hit_.
Theta_fp() / 4 <<
", phi " << Hit_.
Phi_fp() / 4 << std::endl;
204 (res->at(iOut)).push_RPC(RPC_);
205 if (!exact_duplicate)
206 res_hit->push_back(Hit_);
207 if (!exact_duplicate)
void set_subsector_RPC(int bits)
void set_neighbor(int bits)
const std::vector< uint32_t > & payload() const
void set_stub_num(int bits)
void set_station(int bits)
void convert_RPC_location(int &station, int &ring, int §or, int &subsector, int &neighbor, int &segment, const int evt_sector, const int frame, const int word, const int link)
bool unpack(const Block &block, UnpackerCollections *coll) override
void ImportRPC(EMTFHit &_hit, const l1t::emtf::RPC _RPC, const int _endcap, const int _evt_sector)
void set_bt_segment(int bits)
CPPFDigi CreateCPPFDigi() const
int Subsector_RPC() const
std::vector< EMTFHit > EMTFHitCollection
std::vector< EMTFDaqOut > EMTFDaqOutCollection
void set_pc_segment(int bits)
void set_fs_segment(int bits)
void set_sector_RPC(int bits)
void set_sector(int bits)
#define DEFINE_L1T_UNPACKER(type)
void set_rpc_bxn(int bits)
uint16_t GetHexBits(uint16_t word, uint16_t lowBit, uint16_t highBit)
void set_chamber(int bits)
virtual int checkFormat(const Block &block)
void set_subsector(int bits)
std::vector< CPPFDigi > CPPFDigiCollection