18 if(payload.size() != 8) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload size in 'SP Output 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 'SP Output Data Record'"; }
22 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'"; }
23 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'"; }
24 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'"; }
25 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'"; }
26 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'"; }
27 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'"; }
28 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'"; }
30 uint16_t SP1a = payload[0];
31 uint16_t SP1b = payload[1];
32 uint16_t SP1c = payload[2];
33 uint16_t SP1d = payload[3];
34 uint16_t SP2a = payload[4];
35 uint16_t SP2b = payload[5];
36 uint16_t SP2c = payload[6];
37 uint16_t SP2d = payload[7];
40 if(
GetHexBits(SP1a, 15, 15) != 1) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1a are incorrect"; }
41 if(
GetHexBits(SP1b, 15, 15) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1b are incorrect"; }
42 if(
GetHexBits(SP1c, 15, 15) != 1) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1c are incorrect"; }
43 if(
GetHexBits(SP1d, 15, 15) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1d are incorrect"; }
44 if(
GetHexBits(SP2a, 15, 15) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2a are incorrect"; }
45 if(
GetHexBits(SP2b, 15, 15) != 1) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2b are incorrect"; }
46 if(
GetHexBits(SP2c, 15, 15) != 1) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2c are incorrect"; }
47 if(
GetHexBits(SP2d, 15, 15) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2d are incorrect"; }
56 int new_sector = _sector;
58 if (_csc_ID < 0) {
int arr[] = {_csc_ID, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
59 else if (_csc_ID == 0) {
int arr[] = { -1, -1, -1, -1}; std::vector<int> vec(arr, arr+4);
return vec; }
60 else if (_csc_ID <= 9) {
int arr[] = {_csc_ID, new_sector, _subsector+1, 0}; std::vector<int> vec(arr, arr+4);
return vec; }
61 else new_sector = (_sector != 1) ? _sector-1 : 6;
63 if (_csc_ID == 10) {
int arr[] = {3, new_sector, 2, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
64 else if (_csc_ID == 11) {
int arr[] = {6, new_sector, 2, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
65 else if (_csc_ID == 12) {
int arr[] = {9, new_sector, 2, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
66 else {
int arr[] = {_csc_ID, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
68 else if (_station == 2 || _station == 3 || _station == 4) {
69 if (_csc_ID < 0) {
int arr[] = {_csc_ID, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
70 else if (_csc_ID == 0) {
int arr[] = { -1, -1, -1, -1}; std::vector<int> vec(arr, arr+4);
return vec; }
71 else if (_csc_ID <= 9) {
int arr[] = {_csc_ID, new_sector, -1, 0}; std::vector<int> vec(arr, arr+4);
return vec; }
72 else new_sector = (_sector != 1) ? _sector-1 : 6;
74 if (_csc_ID == 10) {
int arr[] = {3, new_sector, -1, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
75 else if (_csc_ID == 11) {
int arr[] = {9, new_sector, -1, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
76 else {
int arr[] = {_csc_ID, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
78 else {
int arr[] = {-99, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
96 uint16_t SP1a = payload[0];
97 uint16_t SP1b = payload[1];
98 uint16_t SP1c = payload[2];
99 uint16_t SP1d = payload[3];
100 uint16_t SP2a = payload[4];
101 uint16_t SP2b = payload[5];
102 uint16_t SP2c = payload[6];
103 uint16_t SP2d = payload[7];
109 int iOut = res->size() - 1;
110 std::vector<int> conv_vals_SP;
111 std::vector<int> conv_vals_pT_LUT;
166 Track_.
ImportSP( SP_, (res->at(iOut)).PtrEventHeader()->Sector() );
168 Track_.
set_endcap ( ((res->at(iOut)).PtrEventHeader()->Endcap() == 1) ? 1 : -1 );
171 if ( (res->at(iOut)).PtrSPCollection()->size() > 0 )
172 if ( SP_.
TBIN() == (res->at(iOut)).PtrSPCollection()->at( (res->at(iOut)).PtrSPCollection()->size() - 1 ).TBIN() )
173 Track_.
set_track_num( (res->at(iOut)).PtrSPCollection()->size() );
201 int St_hits[4] = {0, 0, 0, 0};
203 int dBX[5] = {0, -1, 1, -2, 2};
215 for (uint iBX = 0; iBX < 5; iBX++) {
216 for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
221 if ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) && (res_hit->at(iHit)).Sector() == conv_vals_SP.at(1) &&
222 (res_hit->at(iHit)).Subsector() == conv_vals_SP.at(2) && (res_hit->at(iHit)).Neighbor() == conv_vals_SP.at(3) &&
223 (res_hit->at(iHit)).Station() == 1 && (res_hit->at(iHit)).Stub_num() == SP_.
ME1_stub_num() &&
224 (res_hit->at(iHit)).
Endcap() == Track_.
Endcap() && (res_hit->at(iHit)).
BX() - (SP_.
TBIN() - 3) == dBX[iBX] ) {
225 if (St_hits[0] == 0 ) Track_.
push_Hit( res_hit->at(iHit) );
228 if (St_hits[0] > 0)
break;
236 for (uint iBX = 0; iBX < 5; iBX++) {
237 for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
238 if ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) && (res_hit->at(iHit)).Sector() == conv_vals_SP.at(1) &&
241 (res_hit->at(iHit)).Neighbor() == conv_vals_SP.at(3) && (res_hit->at(iHit)).Station() == 2 &&
243 (res_hit->at(iHit)).
BX() - (SP_.
TBIN() - 3) == dBX[iBX] ) {
244 if (St_hits[1] == 0 ) Track_.
push_Hit( res_hit->at(iHit) );
247 if (St_hits[1] > 0)
break;
255 for (uint iBX = 0; iBX < 5; iBX++) {
256 for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
257 if ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) && (res_hit->at(iHit)).Sector() == conv_vals_SP.at(1) &&
260 (res_hit->at(iHit)).Neighbor() == conv_vals_SP.at(3) && (res_hit->at(iHit)).Station() == 3 &&
262 (res_hit->at(iHit)).
BX() - (SP_.
TBIN() - 3) == dBX[iBX] ) {
263 if (St_hits[2] == 0 ) Track_.
push_Hit( res_hit->at(iHit) );
266 if (St_hits[2] > 0)
break;
274 for (uint iBX = 0; iBX < 5; iBX++) {
275 for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
276 if ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) && (res_hit->at(iHit)).Sector() == conv_vals_SP.at(1) &&
279 (res_hit->at(iHit)).Neighbor() == conv_vals_SP.at(3) && (res_hit->at(iHit)).Station() == 4 &&
281 (res_hit->at(iHit)).
BX() - (SP_.
TBIN() - 3) == dBX[iBX] ) {
282 if (St_hits[3] == 0 ) Track_.
push_Hit( res_hit->at(iHit) );
285 if (St_hits[3] > 0)
break;
323 (res->at(iOut)).push_SP(SP_);
325 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)
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)
#define DEFINE_L1T_UNPACKER(type)
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))