40 edm::LogError(
"L1T|EMTF") <<
"Payload size in 'GEM Data Record' is different than expected";
44 for (
size_t i = 0;
i < 4; ++
i) {
47 edm::LogError(
"L1T|EMTF") <<
"Payload[" <<
i <<
"] has more than 16 bits in 'GEM Data Record'";
59 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in GEMa are incorrect";
63 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in GEMb are incorrect";
67 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in GEMc are incorrect";
71 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in GEMd are incorrect";
108 sector = (
link != 6 ? evt_sector : (evt_sector == 1 ? 6 : evt_sector - 1));
110 neighbor = (
link == 6 ? 1 : 0);
111 layer = (cluster_id % 8);
146 int iOut =
res->size() - 1;
154 res_GEM =
static_cast<EMTFCollections*
>(coll)->getEMTFGEMPadClusters();
177 int _station, _ring, _sector, _subsector, _neighbor, _layer;
184 (
res->at(iOut)).PtrEventHeader()->Sector(),
190 int _sector_gem = _sector;
192 int _subsector_gem = ((_subsector + 1) % 6) + 1;
194 int _chamber = (_sector_gem - 1) * 6 + _subsector_gem;
196 int _subsector_csc = (_station != 1) ? 0 : ((_chamber % 6 > 2) ? 1 : 2);
206 ImportGEM(Hit_, GEM_, (
res->at(iOut)).PtrEventHeader()->Endcap(), (
res->at(iOut)).PtrEventHeader()->Sector());
213 bool exact_duplicate =
false;
214 for (
auto const& iHit : *res_hit) {
215 if (Hit_.
BX() == iHit.BX() && Hit_.
Endcap() == iHit.Endcap() && Hit_.
Station() == iHit.Station() &&
216 Hit_.
Chamber() == iHit.Chamber()) {
217 if ((iHit.Is_CSC() == 1 && iHit.Ring() == 2) ||
218 (iHit.Is_GEM() == 1)) {
219 if (Hit_.
Neighbor() == iHit.Neighbor()) {
221 if (iHit.Is_GEM() == 1 && iHit.Ring() == Hit_.
Ring() && iHit.Roll() == Hit_.
Roll() &&
222 iHit.Pad() == Hit_.
Pad()) {
223 exact_duplicate =
true;
237 (
res->at(iOut)).push_GEM(GEM_);
238 if (!exact_duplicate)
239 res_hit->push_back(Hit_);
241 if (!exact_duplicate)
void set_neighbor(int bits)
void set_stub_num(int bits)
void set_station(int bits)
void set_gem_bxn(const int bits)
GEMPadDigiCluster CreateGEMPadDigiCluster() const
virtual int checkFormat(const Block &block)
Log< level::Error, false > LogError
void ImportGEM(EMTFHit &_hit, const l1t::emtf::GEM &_GEM, const int _endcap, const int _evt_sector)
constexpr std::array< uint8_t, layerIndexSize > layer
int Pad() const
Repurpose "strip" as GEM pad for GEM sourced hits.
void set_bc0(const int bits)
void set_link(const int bits)
void set_tbin(const int bits)
std::vector< EMTFHit > EMTFHitCollection
void set_cluster_id(const int bits)
int ClusterID() const
Returns the the cluster ID within the link.
std::vector< EMTFDaqOut > EMTFDaqOutCollection
void set_partition(const int bits)
bool unpack(const Block &block, UnpackerCollections *coll) override
Unpack the GEM payload in the EMTF DAQ payload.
void set_vp(const int bits)
void set_pad(const int bits)
void set_sector(int bits)
GEMDetId GEM_DetId() const
void convert_GEM_location(int &station, int &ring, int §or, int &subsector, int &neighbor, int &layer, const int evt_sector, const int cluster_id, const int link)
Converts station, ring, sector, subsector, neighbor, and segment from the GEM output.
#define DEFINE_L1T_UNPACKER(type)
uint16_t GetHexBits(uint16_t word, uint16_t lowBit, uint16_t highBit)
void set_chamber(int bits)
void set_subsector(int bits)
void set_cluster_size(const int bits)
int Link() const
Returns the input link of the cluster.