CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EMTFBlockSP.cc
Go to the documentation of this file.
2 
3 #include "EMTFCollections.h"
4 #include "EMTFUnpackerTools.h"
5 #include "EMTFBlockSP.h"
6 
7 namespace l1t {
8  namespace stage2 {
9  namespace emtf {
10 
12 
13  auto payload = block.payload();
14  int errors = 0;
15 
16  //Check the number of 16-bit words
17  if(payload.size() != 8) { errors += 1; edm::LogError("L1T|EMTF") << "Payload size in 'SP Output Data Record' is different than expected"; }
18 
19  //Check that each word is 16 bits
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'"; }
28 
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];
37 
38  //Check Format
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"; }
47 
48  return errors;
49 
50  }
51 
52 
53  // Converts CSC_ID, sector, subsector, and neighbor
54  std::vector<int> convert_SP_location(int _csc_ID, int _sector, int _subsector, int _station) {
55  int new_sector = _sector;
56  if (_station == 1) {
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;
61 
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; }
66  }
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;
72 
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; }
76  }
77  else { int arr[] = {-99, -99, -99, -99}; std::vector<int> vec(arr, arr+4); return vec; }
78  }
79 
81 
82  // std::cout << "Inside EMTFBlockSP.cc: unpack" << std::endl;
83  // LogDebug("L1T|EMTF") << "Inside EMTFBlockSP.cc: unpack"; // Why doesn't this work? - AWB 09.04.16
84 
85  // Get the payload for this block, made up of 16-bit words (0xffff)
86  // Format defined in MTF7Payload::getBlock() in src/Block.cc
87  // payload[0] = bits 0-15, payload[1] = 16-31, payload[3] = 32-47, etc.
88  auto payload = block.payload();
89 
90  // Check Format of Payload
91  l1t::emtf::SP SP_;
92  for (int err = 0; err < checkFormat(block); err++) SP_.add_format_error();
93 
94  // Assign payload to 16-bit words
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];
103 
104  // res is a pointer to a collection of EMTFDaqOut class objects
105  // There is one EMTFDaqOut for each MTF7 (60 deg. sector) in the event
107  res = static_cast<EMTFCollections*>(coll)->getEMTFDaqOuts();
108  int iOut = res->size() - 1;
109  std::vector<int> conv_vals_SP;
110  std::vector<int> conv_vals_pT_LUT;
111 
112  EMTFHitCollection* res_hit;
113  res_hit = static_cast<EMTFCollections*>(coll)->getEMTFHits();
114 
115  EMTFTrackCollection* res_track;
116  res_track = static_cast<EMTFCollections*>(coll)->getEMTFTracks();
117  EMTFTrack Track_;
118 
120  res_cand = static_cast<EMTFCollections*>(coll)->getRegionalMuonCands();
121  RegionalMuonCand mu_;
122 
123  // if (SP_.Format_Errors() > 0) goto write; // Temporarily disable for DQM operation - AWB 09.04.16
124 
126  // Unpack the SP Output Data Record
128 
129  SP_.set_phi_full ( GetHexBits(SP1a, 0, 12) );
130  SP_.set_c ( GetHexBits(SP1a, 13, 13) );
131  SP_.set_hl ( GetHexBits(SP1a, 14, 14) );
132 
133  SP_.set_phi_GMT ( TwosCompl(8, GetHexBits(SP1b, 0, 7)) );
134  SP_.set_quality_GMT ( GetHexBits(SP1b, 8, 11) );
135  SP_.set_bc0 ( GetHexBits(SP1b, 12, 12) );
136  SP_.set_se ( GetHexBits(SP1b, 13, 13) );
137  SP_.set_vc ( GetHexBits(SP1b, 14, 14) );
138 
139  SP_.set_eta_GMT ( TwosCompl(9, GetHexBits(SP1c, 0, 8)) );
140  SP_.set_mode ( GetHexBits(SP1c, 9, 12) );
141  SP_.set_bx ( GetHexBits(SP1c, 13, 14) );
142 
143  SP_.set_pt_GMT ( GetHexBits(SP1d, 0, 8) );
144  SP_.set_me1_stub_num ( GetHexBits(SP1d, 9, 9) );
145  SP_.set_me1_CSC_ID ( GetHexBits(SP1d, 10, 13) );
146  SP_.set_me1_subsector( GetHexBits(SP1d, 14, 14) );
147 
148  SP_.set_me2_stub_num ( GetHexBits(SP2a, 0, 0 ) );
149  SP_.set_me2_CSC_ID ( GetHexBits(SP2a, 1, 4 ) );
150  SP_.set_me3_stub_num ( GetHexBits(SP2a, 5, 5 ) );
151  SP_.set_me3_CSC_ID ( GetHexBits(SP2a, 6, 9 ) );
152  SP_.set_me4_stub_num ( GetHexBits(SP2a, 10, 10) );
153  SP_.set_me4_CSC_ID ( GetHexBits(SP2a, 11, 14) );
154 
155  SP_.set_me1_delay ( GetHexBits(SP2b, 0, 2) );
156  SP_.set_me2_delay ( GetHexBits(SP2b, 3, 5) );
157  SP_.set_me3_delay ( GetHexBits(SP2b, 6, 8) );
158  SP_.set_me4_delay ( GetHexBits(SP2b, 9, 11) );
159  SP_.set_tbin ( GetHexBits(SP2b, 12, 14) );
160 
161  SP_.set_pt_LUT_addr ( GetHexBits(SP2c, 0, 14, SP2d, 0, 14) );
162 
163  // SP_.set_dataword ( uint64_t dataword );
164 
165  Track_.ImportSP( SP_, (res->at(iOut)).PtrEventHeader()->Sector() );
166  Track_.ImportPtLUT( Track_.Mode(), Track_.Pt_LUT_addr() );
167  Track_.set_endcap ( ((res->at(iOut)).PtrEventHeader()->Endcap() == 1) ? 1 : -1 );
168  Track_.set_sector_index ( (Track_.Endcap() == 1) ? Track_.Sector() - 1 : Track_.Sector() + 5 );
169 
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() );
173  else Track_.set_track_num( 0 );
174  else Track_.set_track_num( 0 );
175 
176  mu_.setHwSign ( SP_.C() );
177  mu_.setHwSignValid ( SP_.VC() );
178  mu_.setHwQual ( SP_.Quality_GMT() );
179  mu_.setHwEta ( SP_.Eta_GMT() );
180  mu_.setHwPhi ( SP_.Phi_GMT() );
181  mu_.setHwPt ( SP_.Pt_GMT() );
182  mu_.setTFIdentifiers ( Track_.Sector_GMT(), (Track_.Endcap() == 1) ? emtf_pos : emtf_neg );
184  // mu_.set_dataword ( SP_.Dataword() );
185 
186  // set_type ( _SP.() );
187  // set_rank ( _SP.() );
188  // set_layer ( _SP.() );
189  // set_straightness ( _SP.() );
190  // set_strip ( _SP.() );
191  // set_second_bx ( _SP.() );
192  // set_pt_XML ( _SP.() );
193  // set_theta_int ( _SP.() );
194  // set_isGMT ( _SP.() );
195 
197  // Match hits to tracks
199 
200  int St_hits[4] = {0, 0, 0, 0}; // Number of matched hits in each station
201  // int dBX[3] = {0, 1, 2}; // Hit - track BX values for earliest LCT configuration
202  int dBX[5] = {0, -1, 1, -2, 2}; // Hit - track BX values for 2nd-earliest LCT configuration
203 
204  Track_.set_has_neighbor(false);
205  Track_.set_all_neighbor(true);
206 
207  conv_vals_SP = convert_SP_location( SP_.ME1_CSC_ID(), (res->at(iOut)).PtrEventHeader()->Sector(), SP_.ME1_subsector(), 1 );
208  if ( conv_vals_SP.at(3) == 1 and not Track_.Has_neighbor() ) Track_.set_has_neighbor(true);
209  if ( conv_vals_SP.at(3) == 0 and Track_.All_neighbor() ) Track_.set_all_neighbor(false);
210  // if (abs(SP_.TBIN() - 3) < 2)
211  // std::cout << "\nTrack: ID = " << conv_vals_SP.at(0) << ", sector = " << conv_vals_SP.at(1) << ", sub = " << conv_vals_SP.at(2)
212  // << ", neighbor = " << conv_vals_SP.at(3) << ", station = 1"
213  // << ", stub = " << SP_.ME1_stub_num() << ", BX = " << SP_.TBIN() - 3 << std::endl;
214  for (uint iBX = 0; iBX < 5; iBX++) { // Loop over BX values nearest to the track BX
215  for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
216  // if (abs(SP_.TBIN() - 3) < 2 && iBX == 0)
217  // std::cout << "Hit: ID = " << (res_hit->at(iHit)).CSC_ID() << ", sector = " << (res_hit->at(iHit)).Sector() << ", sub = " << (res_hit->at(iHit)).Subsector()
218  // << ", neighbor = " << (res_hit->at(iHit)).Neighbor() << ", station = " << (res_hit->at(iHit)).Station()
219  // << ", stub = " << (res_hit->at(iHit)).Stub_num() << ", BX = " << (res_hit->at(iHit)).BX() << std::endl;
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) );
225  St_hits[0] += 1; }
226  }
227  if (St_hits[0] > 0) break; // If you found a hit in a BX close to the track, not need to look in other BX
228  }
230  mu_.setTrackSubAddress( RegionalMuonCand::kME1Ch, calc_uGMT_chamber(conv_vals_SP.at(0), conv_vals_SP.at(2), conv_vals_SP.at(3), 1) );
231 
232  conv_vals_SP = convert_SP_location( SP_.ME2_CSC_ID(), (res->at(iOut)).PtrEventHeader()->Sector(), -99, 2 );
233  if ( conv_vals_SP.at(3) == 1 and not Track_.Has_neighbor() ) Track_.set_has_neighbor(true);
234  if ( conv_vals_SP.at(3) == 0 and Track_.All_neighbor() ) Track_.set_all_neighbor(false);
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) &&
238  // if ( ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) || (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) + 3 ) &&
239  // (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 &&
241  (res_hit->at(iHit)).Stub_num() == SP_.ME2_stub_num() && (res_hit->at(iHit)).Endcap() == Track_.Endcap() &&
242  (res_hit->at(iHit)).BX() - (SP_.TBIN() - 3) == dBX[iBX] ) {
243  if (St_hits[1] == 0 ) Track_.push_Hit( res_hit->at(iHit) );
244  St_hits[1] += 1; }
245  }
246  if (St_hits[1] > 0) break;
247  }
249  mu_.setTrackSubAddress( RegionalMuonCand::kME2Ch, calc_uGMT_chamber(conv_vals_SP.at(0), conv_vals_SP.at(2), conv_vals_SP.at(3), 2) );
250 
251  conv_vals_SP = convert_SP_location( SP_.ME3_CSC_ID(), (res->at(iOut)).PtrEventHeader()->Sector(), -99, 3 );
252  if ( conv_vals_SP.at(3) == 1 and not Track_.Has_neighbor() ) Track_.set_has_neighbor(true);
253  if ( conv_vals_SP.at(3) == 0 and Track_.All_neighbor() ) Track_.set_all_neighbor(false);
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) &&
257  // if ( ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) || (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) + 3 ) &&
258  // (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 &&
260  (res_hit->at(iHit)).Stub_num() == SP_.ME3_stub_num() && (res_hit->at(iHit)).Endcap() == Track_.Endcap() &&
261  (res_hit->at(iHit)).BX() - (SP_.TBIN() - 3) == dBX[iBX] ) {
262  if (St_hits[2] == 0 ) Track_.push_Hit( res_hit->at(iHit) );
263  St_hits[2] += 1; }
264  }
265  if (St_hits[2] > 0) break;
266  }
268  mu_.setTrackSubAddress( RegionalMuonCand::kME3Ch, calc_uGMT_chamber(conv_vals_SP.at(0), conv_vals_SP.at(2), conv_vals_SP.at(3), 3) );
269 
270  conv_vals_SP = convert_SP_location( SP_.ME4_CSC_ID(), (res->at(iOut)).PtrEventHeader()->Sector(), -99, 4 );
271  if ( conv_vals_SP.at(3) == 1 and not Track_.Has_neighbor() ) Track_.set_has_neighbor(true);
272  if ( conv_vals_SP.at(3) == 0 and Track_.All_neighbor() ) Track_.set_all_neighbor(false);
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) &&
276  // if ( ( (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) || (res_hit->at(iHit)).CSC_ID() == conv_vals_SP.at(0) + 3 ) &&
277  // (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 &&
279  (res_hit->at(iHit)).Stub_num() == SP_.ME4_stub_num() && (res_hit->at(iHit)).Endcap() == Track_.Endcap() &&
280  (res_hit->at(iHit)).BX() - (SP_.TBIN() - 3) == dBX[iBX] ) {
281  if (St_hits[3] == 0 ) Track_.push_Hit( res_hit->at(iHit) );
282  St_hits[3] += 1; }
283  }
284  if (St_hits[3] > 0) break;
285  }
287  mu_.setTrackSubAddress( RegionalMuonCand::kME4Ch, calc_uGMT_chamber(conv_vals_SP.at(0), conv_vals_SP.at(2), conv_vals_SP.at(3), 4) );
288 
289 
290  // if ( Track_.Mode() != St_hits[0]*8 + St_hits[1]*4 + St_hits[2]*2 + St_hits[3] && abs(Track_.BX()) < 2) {
291  // std::cout << "" << std::endl;
292  // std::cout << "***********************************************************" << std::endl;
293  // std::cout << "Bug in EMTF event! Mode " << Track_.Mode() << " track in sector " << Track_.Sector()*Track_.Endcap()
294  // << ", BX " << Track_.BX() << " with (" << St_hits[0] << ", " << St_hits[1]
295  // << ", " << St_hits[2] << ", " << St_hits[3] << ") hits in stations (1, 2, 3, 4)" << std::endl;
296  // std::cout << "Sector = " << (res->at(iOut)).PtrEventHeader()->Sector() << ", ME1_stub_num = " << SP_.ME1_stub_num()
297  // << ", ME1_delay = " << SP_.ME1_delay() << ", ME1_CSC_ID = " << SP_.ME1_CSC_ID() << ", ME1_subsector = " << SP_.ME1_subsector() << std::endl;
298  // std::cout << "Sector = " << (res->at(iOut)).PtrEventHeader()->Sector() << ", ME2_stub_num = " << SP_.ME2_stub_num()
299  // << ", ME2_delay = " << SP_.ME2_delay() << ", ME2_CSC_ID = " << SP_.ME2_CSC_ID() << std::endl;
300  // std::cout << "Sector = " << (res->at(iOut)).PtrEventHeader()->Sector() << ", ME3_stub_num = " << SP_.ME3_stub_num()
301  // << ", ME3_delay = " << SP_.ME3_delay() << ", ME3_CSC_ID = " << SP_.ME3_CSC_ID() << std::endl;
302  // std::cout << "Sector = " << (res->at(iOut)).PtrEventHeader()->Sector() << ", ME4_stub_num = " << SP_.ME4_stub_num()
303  // << ", ME4_delay = " << SP_.ME4_delay() << ", ME4_CSC_ID = " << SP_.ME4_CSC_ID() << std::endl;
304 
305  // for (uint iHit = 0; iHit < res_hit->size(); iHit++)
306  // std::cout << "ID = " << (res_hit->at(iHit)).CSC_ID() << ", sector = " << (res_hit->at(iHit)).Sector()
307  // << ", sub = " << (res_hit->at(iHit)).Subsector() << ", neighbor = " << (res_hit->at(iHit)).Neighbor()
308  // << ", station = " << (res_hit->at(iHit)).Station() << ", stub = " << (res_hit->at(iHit)).Stub_num()
309  // << ", BX = " << (res_hit->at(iHit)).BX() << ", ring = " << (res_hit->at(iHit)).Ring()
310  // << ", chamber = " << (res_hit->at(iHit)).Chamber() << std::endl;
311 
312  // for (uint iHit = 0; iHit < res_hit->size(); iHit++) {
313  // if (iHit == 0) (res_hit->at(iHit)).PrintSimulatorHeader();
314  // (res_hit->at(iHit)).PrintForSimulator();
315  // }
316  // std::cout << "***********************************************************" << std::endl;
317  // std::cout << "" << std::endl;
318  // }
319 
320  // write: // Temporarily disable for DQM operation - AWB 09.04.16
321 
322  (res->at(iOut)).push_SP(SP_);
323 
324  res_track->push_back( Track_ );
325 
326  // TBIN_num can range from 0 through 7, i.e. BX = -3 through +4. - AWB 04.04.16
327  res_cand->setBXRange(-3, 4);
328  res_cand->push_back(SP_.TBIN() - 3, mu_);
329 
330  // Finished with unpacking one SP Output Data Record
331  return true;
332 
333  } // End bool SPBlockUnpacker::unpack
334 
335  // bool SPBlockPacker::pack(const Block& block, UnpackerCollections *coll) {
336  // std::cout << "Inside SPBlockPacker::pack" << std::endl;
337  // return true;
338  // } // End bool SPBlockPacker::pack
339 
340  } // End namespace emtf
341  } // End namespace stage2
342 } // End namespace l1t
343 
345 // DEFINE_L1T_PACKER(l1t::stage2::SPBlockPacker);
int ME3_stub_num() const
Definition: SP.h:76
void set_me3_stub_num(int bits)
Definition: SP.h:45
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)
Definition: SP.h:43
int Endcap() const
Definition: EMTFTrack.h:96
void set_me3_CSC_ID(int bits)
Definition: SP.h:44
virtual int checkFormat(const Block &block)
Definition: EMTFBlockSP.cc:11
int Sector() const
Definition: EMTFTrack.h:97
int calc_uGMT_chamber(int _csc_ID, int _subsector, int _neighbor, int _station)
void set_bx(int bits)
Definition: SP.h:35
int TBIN() const
Definition: SP.h:79
void push_Hit(EMTFHit bits)
Definition: EMTFTrack.h:38
int All_neighbor() const
Definition: EMTFTrack.h:141
void ImportSP(const emtf::SP _SP, int _sector)
std::vector< uint32_t > payload() const
Definition: Block.h:57
int ME3_CSC_ID() const
Definition: SP.h:75
void set_se(int bits)
Definition: SP.h:31
void set_me2_CSC_ID(int bits)
Definition: SP.h:42
void set_me1_stub_num(int bits)
Definition: SP.h:41
void set_pt_GMT(int bits)
Definition: SP.h:38
int Sector_GMT() const
Definition: EMTFTrack.h:98
void set_me4_delay(int bits)
Definition: SP.h:52
void set_phi_GMT(int bits)
Definition: SP.h:34
int TwosCompl(int nBits, int bits)
void set_me1_delay(int bits)
Definition: SP.h:49
int Phi_GMT() const
Definition: SP.h:65
int ME1_subsector() const
Definition: SP.h:70
void ImportPtLUT(int _mode, unsigned long _address)
void set_me2_delay(int bits)
Definition: SP.h:50
void set_hl(int bits)
Definition: SP.h:26
int VC() const
Definition: SP.h:60
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
void set_tbin(int bits)
Definition: SP.h:48
int ME2_CSC_ID() const
Definition: SP.h:73
std::vector< EMTFHit > EMTFHitCollection
Definition: EMTFHit.h:158
int ME1_CSC_ID() const
Definition: SP.h:71
void set_sector_index(int bits)
Definition: EMTFTrack.h:51
void set_all_neighbor(int bits)
Definition: EMTFTrack.h:93
std::vector< EMTFDaqOut > EMTFDaqOutCollection
Definition: EMTFDaqOut.h:130
void setTrackSubAddress(bmtfAddress subAddress, int value)
Set a part of the muon candidates track address; specialised for BMTF.
void set_bc0(int bits)
Definition: SP.h:32
void set_track_num(int bits)
Definition: EMTFTrack.h:91
void set_eta_GMT(int bits)
Definition: SP.h:37
void set_c(int bits)
Definition: SP.h:27
void set_vc(int bits)
Definition: SP.h:29
int ME1_stub_num() const
Definition: SP.h:72
DEFINE_L1T_UNPACKER(l1t::stage2::MPUnpacker_0x10010033)
int Track_num() const
Definition: EMTFTrack.h:139
void setHwQual(int bits)
Set compressed quality code as transmitted by hardware (4 bits)
int ME4_CSC_ID() const
Definition: SP.h:77
void setHwPt(int bits)
Set compressed pT as transmitted by hardware LSB = 0.5 (9 bits)
void set_me4_CSC_ID(int bits)
Definition: SP.h:46
void setHwEta(int bits)
Set compressed eta as transmitted by hardware LSB = 0.010875 (9 bits)
void set_has_neighbor(int bits)
Definition: EMTFTrack.h:92
JetCorrectorParametersCollection coll
Definition: classes.h:10
unsigned long Pt_LUT_addr() const
Definition: EMTFTrack.h:106
void set_me4_stub_num(int bits)
Definition: SP.h:47
int Pt_GMT() const
Definition: SP.h:69
virtual bool unpack(const Block &block, UnpackerCollections *coll) override
Definition: EMTFBlockSP.cc:80
void set_me3_delay(int bits)
Definition: SP.h:51
int ME4_stub_num() const
Definition: SP.h:78
void setBXRange(int bxFirst, int bxLast)
void set_endcap(int bits)
Definition: EMTFTrack.h:48
int Eta_GMT() const
Definition: SP.h:68
void set_pt_LUT_addr(unsigned long bits)
Definition: SP.h:53
int Has_neighbor() const
Definition: EMTFTrack.h:140
int C() const
Definition: SP.h:58
void set_me1_CSC_ID(int bits)
Definition: SP.h:40
int Mode() const
Definition: EMTFTrack.h:100
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)
Definition: EMTFBlockSP.cc:54
std::vector< EMTFTrack > EMTFTrackCollection
Definition: EMTFTrack.h:201
uint16_t GetHexBits(uint16_t word, uint16_t lowBit, uint16_t highBit)
int ME2_stub_num() const
Definition: SP.h:74
void set_me1_subsector(int bits)
Definition: SP.h:39
int Quality_GMT() const
Definition: SP.h:64
void set_quality_GMT(int bits)
Definition: SP.h:33
void add_format_error()
Definition: SP.h:54
void push_back(int bx, T object)
void set_phi_full(int bits)
Definition: SP.h:28
void setHwSign(int bits)
Set charge sign bit (charge = (-1)^(sign))
void set_mode(int bits)
Definition: SP.h:36