39 if(payload.size() != 8) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Payload size in 'SP Output Data Record' is different than expected"; }
42 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'"; }
43 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'"; }
44 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'"; }
45 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'"; }
46 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'"; }
47 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'"; }
48 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'"; }
49 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'"; }
51 uint16_t SP1a = payload[0];
52 uint16_t SP1b = payload[1];
53 uint16_t SP1c = payload[2];
54 uint16_t SP1d = payload[3];
55 uint16_t SP2a = payload[4];
56 uint16_t SP2b = payload[5];
57 uint16_t SP2c = payload[6];
58 uint16_t SP2d = payload[7];
61 if(
GetHexBits(SP1a, 15, 15) != 1) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1a are incorrect"; }
62 if(
GetHexBits(SP1b, 15, 15) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1b are incorrect"; }
63 if(
GetHexBits(SP1c, 15, 15) != 1) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1c are incorrect"; }
64 if(
GetHexBits(SP1d, 15, 15) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1d are incorrect"; }
65 if(
GetHexBits(SP2a, 15, 15) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2a are incorrect"; }
66 if(
GetHexBits(SP2b, 15, 15) != 1) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2b are incorrect"; }
67 if(
GetHexBits(SP2c, 15, 15) != 1) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2c are incorrect"; }
68 if(
GetHexBits(SP2d, 15, 15) != 0) { errors += 1;
edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2d are incorrect"; }
77 int new_sector = _sector;
79 if (_csc_ID < 0) {
int arr[] = {_csc_ID, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
80 else if (_csc_ID == 0) {
int arr[] = { -1, -1, -1, -1}; std::vector<int> vec(arr, arr+4);
return vec; }
81 else if (_csc_ID <= 9) {
int arr[] = {_csc_ID, new_sector, _subsector+1, 0}; std::vector<int> vec(arr, arr+4);
return vec; }
82 else new_sector = (_sector != 1) ? _sector-1 : 6;
84 if (_csc_ID == 10) {
int arr[] = {3, new_sector, 2, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
85 else if (_csc_ID == 11) {
int arr[] = {6, new_sector, 2, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
86 else if (_csc_ID == 12) {
int arr[] = {9, new_sector, 2, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
87 else {
int arr[] = {_csc_ID, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
89 else if (_station == 2 || _station == 3 || _station == 4) {
90 if (_csc_ID < 0) {
int arr[] = {_csc_ID, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
91 else if (_csc_ID == 0) {
int arr[] = { -1, -1, -1, -1}; std::vector<int> vec(arr, arr+4);
return vec; }
92 else if (_csc_ID <= 9) {
int arr[] = {_csc_ID, new_sector, -1, 0}; std::vector<int> vec(arr, arr+4);
return vec; }
93 else new_sector = (_sector != 1) ? _sector-1 : 6;
95 if (_csc_ID == 10) {
int arr[] = {3, new_sector, -1, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
96 else if (_csc_ID == 11) {
int arr[] = {9, new_sector, -1, 1}; std::vector<int> vec(arr, arr+4);
return vec; }
97 else {
int arr[] = {_csc_ID, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
99 else {
int arr[] = {-99, -99, -99, -99}; std::vector<int> vec(arr, arr+4);
return vec; }
110 auto payload = block.
payload();
117 uint16_t SP1a = payload[0];
118 uint16_t SP1b = payload[1];
119 uint16_t SP1c = payload[2];
120 uint16_t SP1d = payload[3];
121 uint16_t SP2a = payload[4];
122 uint16_t SP2b = payload[5];
123 uint16_t SP2c = payload[6];
124 uint16_t SP2d = payload[7];
130 int iOut = res->size() - 1;
131 std::vector<int> conv_vals_SP;
132 std::vector<int> conv_vals_pT_LUT;
187 Track_.
ImportSP( SP_, (res->at(iOut)).PtrEventHeader()->Sector() );
189 Track_.
set_endcap ( ((res->at(iOut)).PtrEventHeader()->Endcap() == 1) ? 1 : -1 );
192 if ( (res->at(iOut)).PtrSPCollection()->size() > 0 )
193 if ( SP_.
TBIN() == (res->at(iOut)).PtrSPCollection()->at( (res->at(iOut)).PtrSPCollection()->size() - 1 ).TBIN() )
194 Track_.
set_track_num( (res->at(iOut)).PtrSPCollection()->size() );
222 int St_hits[4] = {0, 0, 0, 0};
224 int dBX[5] = {0, -1, 1, -2, 2};
236 for (uint iBX = 0; iBX < 5; iBX++) {
237 for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
242 if ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) && (res_hit->at(iHit)).Sector() == conv_vals_SP.at(1) &&
243 (res_hit->at(iHit)).Subsector() == conv_vals_SP.at(2) && (res_hit->at(iHit)).Neighbor() == conv_vals_SP.at(3) &&
244 (res_hit->at(iHit)).Station() == 1 && (res_hit->at(iHit)).Stub_num() == SP_.
ME1_stub_num() &&
245 (res_hit->at(iHit)).
Endcap() == Track_.
Endcap() && (res_hit->at(iHit)).
BX() - (SP_.
TBIN() - 3) == dBX[iBX] ) {
246 if (St_hits[0] == 0 ) Track_.
push_Hit( res_hit->at(iHit) );
249 if (St_hits[0] > 0)
break;
257 for (uint iBX = 0; iBX < 5; iBX++) {
258 for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
259 if ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) && (res_hit->at(iHit)).Sector() == conv_vals_SP.at(1) &&
262 (res_hit->at(iHit)).Neighbor() == conv_vals_SP.at(3) && (res_hit->at(iHit)).Station() == 2 &&
264 (res_hit->at(iHit)).
BX() - (SP_.
TBIN() - 3) == dBX[iBX] ) {
265 if (St_hits[1] == 0 ) Track_.
push_Hit( res_hit->at(iHit) );
268 if (St_hits[1] > 0)
break;
276 for (uint iBX = 0; iBX < 5; iBX++) {
277 for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
278 if ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) && (res_hit->at(iHit)).Sector() == conv_vals_SP.at(1) &&
281 (res_hit->at(iHit)).Neighbor() == conv_vals_SP.at(3) && (res_hit->at(iHit)).Station() == 3 &&
283 (res_hit->at(iHit)).
BX() - (SP_.
TBIN() - 3) == dBX[iBX] ) {
284 if (St_hits[2] == 0 ) Track_.
push_Hit( res_hit->at(iHit) );
287 if (St_hits[2] > 0)
break;
295 for (uint iBX = 0; iBX < 5; iBX++) {
296 for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
297 if ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) && (res_hit->at(iHit)).Sector() == conv_vals_SP.at(1) &&
300 (res_hit->at(iHit)).Neighbor() == conv_vals_SP.at(3) && (res_hit->at(iHit)).Station() == 4 &&
302 (res_hit->at(iHit)).
BX() - (SP_.
TBIN() - 3) == dBX[iBX] ) {
303 if (St_hits[3] == 0 ) Track_.
push_Hit( res_hit->at(iHit) );
306 if (St_hits[3] > 0)
break;
344 (res->at(iOut)).push_SP(SP_);
346 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
#define DEFINE_L1T_UNPACKER(type)
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)
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))