18 if(payload.size() != 4) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload size in 'ME Data Record' is different than expected"; }
21 if(
GetHexBits(payload[0], 16, 31) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload[0] has more than 16 bits in 'ME Data Record'"; }
22 if(
GetHexBits(payload[1], 16, 31) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload[1] has more than 16 bits in 'ME Data Record'"; }
23 if(
GetHexBits(payload[2], 16, 31) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload[2] has more than 16 bits in 'ME Data Record'"; }
24 if(
GetHexBits(payload[3], 16, 31) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload[3] has more than 16 bits in 'ME Data Record'"; }
26 uint16_t MEa = payload[0];
27 uint16_t MEb = payload[1];
28 uint16_t MEc = payload[2];
29 uint16_t MEd = payload[3];
32 if(
GetHexBits(MEa, 15, 15) != 1) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in MEa are incorrect"; }
33 if(
GetHexBits(MEb, 15, 15) != 1) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in MEb are incorrect"; }
34 if(
GetHexBits(MEc, 15, 15) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in MEc are incorrect"; }
35 if(
GetHexBits(MEd, 15, 15) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in MEd are incorrect"; }
43 int new_sector = _sector;
44 int new_csc_ID = _csc_ID;
45 if (_station == 0) {
int arr[] = { 1, new_csc_ID, new_sector, 1, 0}; std::vector<int> vec(arr, arr+5);
return vec; }
46 else if (_station == 1) {
int arr[] = { 1, new_csc_ID, new_sector, 2, 0}; std::vector<int> vec(arr, arr+5);
return vec; }
47 else if (_station <= 4) {
int arr[] = {_station, new_csc_ID, new_sector, -1, 0}; std::vector<int> vec(arr, arr+5);
return vec; }
48 else if (_station == 5) new_sector = (_sector != 1) ? _sector-1 : 6;
49 else {
int arr[] = {_station, _csc_ID, _sector, -99, -99}; std::vector<int> vec(arr, arr+5);
return vec; }
51 if (new_csc_ID == 1) {
int arr[] = {1, 3, new_sector, 2, 1}; std::vector<int> vec(arr, arr+5);
return vec; }
52 else if (new_csc_ID == 2) {
int arr[] = {1, 6, new_sector, 2, 1}; std::vector<int> vec(arr, arr+5);
return vec; }
53 else if (new_csc_ID == 3) {
int arr[] = {1, 9, new_sector, 2, 1}; std::vector<int> vec(arr, arr+5);
return vec; }
54 else if (new_csc_ID == 4) {
int arr[] = {2, 3, new_sector, -1, 1}; std::vector<int> vec(arr, arr+5);
return vec; }
55 else if (new_csc_ID == 5) {
int arr[] = {2, 9, new_sector, -1, 1}; std::vector<int> vec(arr, arr+5);
return vec; }
56 else if (new_csc_ID == 6) {
int arr[] = {3, 3, new_sector, -1, 1}; std::vector<int> vec(arr, arr+5);
return vec; }
57 else if (new_csc_ID == 7) {
int arr[] = {3, 9, new_sector, -1, 1}; std::vector<int> vec(arr, arr+5);
return vec; }
58 else if (new_csc_ID == 8) {
int arr[] = {4, 3, new_sector, -1, 1}; std::vector<int> vec(arr, arr+5);
return vec; }
59 else if (new_csc_ID == 9) {
int arr[] = {4, 9, new_sector, -1, 1}; std::vector<int> vec(arr, arr+5);
return vec; }
60 else {
int arr[] = {_station, _csc_ID, _sector, -99, -99}; std::vector<int> vec(arr, arr+5);
return vec; }
74 uint16_t MEa = payload[0];
75 uint16_t MEb = payload[1];
76 uint16_t MEc = payload[2];
77 uint16_t MEd = payload[3];
87 int iOut = res->size() - 1;
131 Hit_.
set_endcap ( ((res->at(iOut)).PtrEventHeader()->Endcap() == 1) ? 1 : -1 );
135 (res->at(iOut)).PtrEventHeader()->Sector() );
143 ? (res->at(iOut)).PtrEventHeader()->Sector() - 1
144 : (res->at(iOut)).PtrEventHeader()->Sector() + 5 );
158 bool duplicate_hit_exists =
false;
159 for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
161 if ( Hit_.
BX() == res_hit->at(iHit).BX() && Hit_.
Station() == res_hit->at(iHit).Station() &&
162 ( Hit_.
Ring() == res_hit->at(iHit).Ring() ||
abs(Hit_.
Ring() - res_hit->at(iHit).Ring()) == 3 ) &&
163 Hit_.
Chamber() == res_hit->at(iHit).Chamber() ) {
165 if ( Hit_.
Neighbor() == res_hit->at(iHit).Neighbor() ) {
168 else if ( Hit_.
Ring() == res_hit->at(iHit).Ring() && Hit_.
Strip() == res_hit->at(iHit).Strip() &&
169 Hit_.
Wire() == res_hit->at(iHit).Wire() )
170 duplicate_hit_exists =
true;
175 (res->at(iOut)).push_ME(ME_);
176 res_hit->push_back(Hit_);
177 if (not duplicate_hit_exists)
void set_neighbor(int bits)
void SetCSCLCTDigi(CSCCorrelatedLCTDigi digi)
void set_sector_index(int bits)
void set_stub_num(int bits)
void set_station(int bits)
void ImportME(const emtf::ME _ME)
int calc_chamber(int _station, int _sector, int _subsector, int _ring, int _csc_ID)
CSCCorrelatedLCTDigi CSC_LCTDigi() const
std::vector< uint32_t > payload() const
void set_endcap(int bits)
virtual int checkFormat(const Block &block)
virtual bool unpack(const Block &block, UnpackerCollections *coll) override
CSCCorrelatedLCTDigi CreateCSCCorrelatedLCTDigi()
void set_stub_num(int bits)
void set_csc_ID(int bits)
void set_quality(int bits)
std::vector< EMTFHit > EMTFHitCollection
std::vector< EMTFDaqOut > EMTFDaqOutCollection
Abs< T >::type abs(const T &t)
void set_csc_ID(int bits)
CSCDetId CSC_DetId() const
std::vector< int > convert_ME_location(int _station, int _csc_ID, int _sector)
void set_sector(int bits)
void SetCSCDetId(CSCDetId id)
CSCDetId CreateCSCDetId()
int calc_ring(int _station, int _csc_ID, int _strip)
void set_station(int bits)
#define DEFINE_L1T_UNPACKER(type)
void set_me_bxn(int bits)
uint16_t GetHexBits(uint16_t word, uint16_t lowBit, uint16_t highBit)
void set_clct_pattern(int bits)
void set_chamber(int bits)
void set_subsector(int bits)