17 if(payload.size() != 8) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload size in 'SP Output Data Record' is different than expected"; }
20 if(
GetHexBits(payload[0], 16, 31) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload[0] has more than 16 bits in 'SP Output Data Record'"; }
21 if(
GetHexBits(payload[1], 16, 31) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload[1] has more than 16 bits in 'SP Output Data Record'"; }
22 if(
GetHexBits(payload[2], 16, 31) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload[2] has more than 16 bits in 'SP Output Data Record'"; }
23 if(
GetHexBits(payload[3], 16, 31) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload[3] has more than 16 bits in 'SP Output Data Record'"; }
24 if(
GetHexBits(payload[4], 16, 31) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload[4] has more than 16 bits in 'SP Output Data Record'"; }
25 if(
GetHexBits(payload[5], 16, 31) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload[5] has more than 16 bits in 'SP Output Data Record'"; }
26 if(
GetHexBits(payload[6], 16, 31) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload[6] has more than 16 bits in 'SP Output Data Record'"; }
27 if(
GetHexBits(payload[7], 16, 31) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload[7] has more than 16 bits in 'SP Output Data Record'"; }
29 uint16_t SP1a = payload[0];
30 uint16_t SP1b = payload[1];
31 uint16_t SP1c = payload[2];
32 uint16_t SP1d = payload[3];
33 uint16_t SP2a = payload[4];
34 uint16_t SP2b = payload[5];
35 uint16_t SP2c = payload[6];
36 uint16_t SP2d = payload[7];
39 if(
GetHexBits(SP1a, 15, 15) != 1) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1a are incorrect"; }
40 if(
GetHexBits(SP1b, 15, 15) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1b are incorrect"; }
41 if(
GetHexBits(SP1c, 15, 15) != 1) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1c are incorrect"; }
42 if(
GetHexBits(SP1d, 15, 15) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1d are incorrect"; }
43 if(
GetHexBits(SP2a, 15, 15) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2a are incorrect"; }
44 if(
GetHexBits(SP2b, 15, 15) != 1) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2b are incorrect"; }
45 if(
GetHexBits(SP2c, 15, 15) != 1) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2c are incorrect"; }
46 if(
GetHexBits(SP2d, 15, 15) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2d are incorrect"; }
55 int new_sector = _sector;
57 if (_csc_ID < 0) {
int arr[] = {_csc_ID, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
58 else if (_csc_ID == 0) {
int arr[] = { -1, -1, -1, -1}; std::vector<int> vec(arr, arr+4);
return vec; }
59 else if (_csc_ID <= 9) {
int arr[] = {_csc_ID, new_sector, _subsector+1, 0}; std::vector<int> vec(arr, arr+4);
return vec; }
60 else new_sector = (_sector != 1) ? _sector-1 : 6;
62 if (_csc_ID == 10) {
int arr[] = {3, new_sector, 2, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
63 else if (_csc_ID == 11) {
int arr[] = {6, new_sector, 2, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
64 else if (_csc_ID == 12) {
int arr[] = {9, new_sector, 2, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
65 else {
int arr[] = {_csc_ID, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
67 else if (_station == 2 || _station == 3 || _station == 4) {
68 if (_csc_ID < 0) {
int arr[] = {_csc_ID, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
69 else if (_csc_ID == 0) {
int arr[] = { -1, -1, -1, -1}; std::vector<int> vec(arr, arr+4);
return vec; }
70 else if (_csc_ID <= 9) {
int arr[] = {_csc_ID, new_sector, -1, 0}; std::vector<int> vec(arr, arr+4);
return vec; }
71 else new_sector = (_sector != 1) ? _sector-1 : 6;
73 if (_csc_ID == 10) {
int arr[] = {3, new_sector, -1, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
74 else if (_csc_ID == 11) {
int arr[] = {9, new_sector, -1, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
75 else {
int arr[] = {_csc_ID, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
77 else {
int arr[] = {-99, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
95 uint16_t SP1a = payload[0];
96 uint16_t SP1b = payload[1];
97 uint16_t SP1c = payload[2];
98 uint16_t SP1d = payload[3];
99 uint16_t SP2a = payload[4];
100 uint16_t SP2b = payload[5];
101 uint16_t SP2c = payload[6];
102 uint16_t SP2d = payload[7];
108 int iOut = res->size() - 1;
109 std::vector<int> conv_vals_SP;
110 std::vector<int> conv_vals_pT_LUT;
165 Track_.
ImportSP( SP_, (res->at(iOut)).PtrEventHeader()->Sector() );
167 Track_.
set_endcap ( ((res->at(iOut)).PtrEventHeader()->Endcap() == 1) ? 1 : -1 );
170 if ( (res->at(iOut)).PtrSPCollection()->size() > 0 )
171 if ( SP_.
TBIN() == (res->at(iOut)).PtrSPCollection()->at( (res->at(iOut)).PtrSPCollection()->size() - 1 ).TBIN() )
172 Track_.
set_track_num( (res->at(iOut)).PtrSPCollection()->size() );
200 int St_hits[4] = {0, 0, 0, 0};
202 int dBX[5] = {0, -1, 1, -2, 2};
214 for (uint iBX = 0; iBX < 5; iBX++) {
215 for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
220 if ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) && (res_hit->at(iHit)).Sector() == conv_vals_SP.at(1) &&
221 (res_hit->at(iHit)).Subsector() == conv_vals_SP.at(2) && (res_hit->at(iHit)).Neighbor() == conv_vals_SP.at(3) &&
222 (res_hit->at(iHit)).Station() == 1 && (res_hit->at(iHit)).Stub_num() == SP_.
ME1_stub_num() &&
223 (res_hit->at(iHit)).
Endcap() == Track_.
Endcap() && (res_hit->at(iHit)).
BX() - (SP_.
TBIN() - 3) == dBX[iBX] ) {
224 if (St_hits[0] == 0 ) Track_.
push_Hit( res_hit->at(iHit) );
227 if (St_hits[0] > 0)
break;
235 for (uint iBX = 0; iBX < 5; iBX++) {
236 for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
237 if ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) && (res_hit->at(iHit)).Sector() == conv_vals_SP.at(1) &&
240 (res_hit->at(iHit)).Neighbor() == conv_vals_SP.at(3) && (res_hit->at(iHit)).Station() == 2 &&
242 (res_hit->at(iHit)).
BX() - (SP_.
TBIN() - 3) == dBX[iBX] ) {
243 if (St_hits[1] == 0 ) Track_.
push_Hit( res_hit->at(iHit) );
246 if (St_hits[1] > 0)
break;
254 for (uint iBX = 0; iBX < 5; iBX++) {
255 for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
256 if ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) && (res_hit->at(iHit)).Sector() == conv_vals_SP.at(1) &&
259 (res_hit->at(iHit)).Neighbor() == conv_vals_SP.at(3) && (res_hit->at(iHit)).Station() == 3 &&
261 (res_hit->at(iHit)).
BX() - (SP_.
TBIN() - 3) == dBX[iBX] ) {
262 if (St_hits[2] == 0 ) Track_.
push_Hit( res_hit->at(iHit) );
265 if (St_hits[2] > 0)
break;
273 for (uint iBX = 0; iBX < 5; iBX++) {
274 for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
275 if ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) && (res_hit->at(iHit)).Sector() == conv_vals_SP.at(1) &&
278 (res_hit->at(iHit)).Neighbor() == conv_vals_SP.at(3) && (res_hit->at(iHit)).Station() == 4 &&
280 (res_hit->at(iHit)).
BX() - (SP_.
TBIN() - 3) == dBX[iBX] ) {
281 if (St_hits[3] == 0 ) Track_.
push_Hit( res_hit->at(iHit) );
284 if (St_hits[3] > 0)
break;
322 (res->at(iOut)).push_SP(SP_);
324 res_track->push_back( Track_ );
void set_me3_stub_num(int bits)
void setHwPhi(int bits)
Set compressed relative phi as transmitted by hardware LSB = 2*pi/576 (8 bits)
void set_me2_stub_num(int bits)
void set_me3_CSC_ID(int bits)
virtual int checkFormat(const Block &block)
int calc_uGMT_chamber(int _csc_ID, int _subsector, int _neighbor, int _station)
void push_Hit(EMTFHit bits)
void ImportSP(const emtf::SP _SP, int _sector)
std::vector< uint32_t > payload() const
void set_me2_CSC_ID(int bits)
void set_me1_stub_num(int bits)
void set_pt_GMT(int bits)
void set_me4_delay(int bits)
void set_phi_GMT(int bits)
int TwosCompl(int nBits, int bits)
void set_me1_delay(int bits)
int ME1_subsector() const
void ImportPtLUT(int _mode, unsigned long _address)
void set_me2_delay(int bits)
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
std::vector< EMTFHit > EMTFHitCollection
void set_sector_index(int bits)
void set_all_neighbor(int bits)
std::vector< EMTFDaqOut > EMTFDaqOutCollection
void setTrackSubAddress(bmtfAddress subAddress, int value)
Set a part of the muon candidates track address; specialised for BMTF.
void set_track_num(int bits)
void set_eta_GMT(int bits)
DEFINE_L1T_UNPACKER(l1t::stage2::MPUnpacker_0x10010033)
void setHwQual(int bits)
Set compressed quality code as transmitted by hardware (4 bits)
void setHwPt(int bits)
Set compressed pT as transmitted by hardware LSB = 0.5 (9 bits)
void set_me4_CSC_ID(int bits)
void setHwEta(int bits)
Set compressed eta as transmitted by hardware LSB = 0.010875 (9 bits)
void set_has_neighbor(int bits)
unsigned long Pt_LUT_addr() const
void set_me4_stub_num(int bits)
virtual bool unpack(const Block &block, UnpackerCollections *coll) override
void set_me3_delay(int bits)
void setBXRange(int bxFirst, int bxLast)
void set_endcap(int bits)
void set_pt_LUT_addr(unsigned long bits)
void set_me1_CSC_ID(int bits)
void setHwSignValid(int bits)
Set whether charge measurement is valid (0 for high pT muons)
std::vector< int > convert_SP_location(int _csc_ID, int _sector, int _subsector, int _station)
std::vector< EMTFTrack > EMTFTrackCollection
uint16_t GetHexBits(uint16_t word, uint16_t lowBit, uint16_t highBit)
void set_me1_subsector(int bits)
void set_quality_GMT(int bits)
void push_back(int bx, T object)
void set_phi_full(int bits)
void setHwSign(int bits)
Set charge sign bit (charge = (-1)^(sign))