CMS 3D CMS Logo

SectorProcessorLUT.cc
Go to the documentation of this file.
2 
3 #include <iostream>
4 #include <fstream>
5 
9 
10 SectorProcessorLUT::SectorProcessorLUT() : version_(0xFFFFFFFF) {}
11 
13 
14 void SectorProcessorLUT::read(bool pc_lut_data, int pc_lut_version) {
15  if (version_ == pc_lut_version)
16  return;
17 
18  edm::LogInfo("L1T") << "EMTF using pc_lut_ver: " << pc_lut_version << ", configured for "
19  << (pc_lut_data ? "data" : "MC");
20 
21  std::string coord_lut_dir = "";
22  if (pc_lut_version == 0)
23  coord_lut_dir = "ph_lut_v1"; // All year 2016
24  else if (pc_lut_version == 1)
25  coord_lut_dir = "ph_lut_v2"; // Beginning of 2017, improved alignment from ideal CMS geometry (MC)
26  else if (pc_lut_version == 2 && pc_lut_data)
27  coord_lut_dir = "ph_lut_v3_data"; // Update in September 2017 from ReReco alignment, data only
28  else if (pc_lut_version == 3 && pc_lut_data)
29  coord_lut_dir = "ph_lut_Run3_2022_data"; // Update in October 2022 from Run 3 2022 alignment, data only
30  else if (pc_lut_version == 4 && pc_lut_data)
31  coord_lut_dir = "ph_lut_Run3_2023_data"; // Update in June 2023 from Run 3 2023 alignment, data only
32  else if (pc_lut_version == 5 && pc_lut_data)
33  coord_lut_dir = "ph_lut_Run3_2024_data"; // Update in May 2024 from Run 3 2024 alignment, data only
34  else if (pc_lut_version >= 2)
35  coord_lut_dir = "ph_lut_v2"; // MC still uses ideal CMS aligment
36  else if (pc_lut_version == -1 && pc_lut_data)
37  coord_lut_dir = "ph_lut_v3_data"; // September 2017 data LCT alignment, but use local CPPF LUTs for RPC
38  else if (pc_lut_version == -1)
39  coord_lut_dir = "ph_lut_v2"; // MC using ideal CMS LCT alignment, but use local CPPF LUTs for RPC
40  else
41  throw cms::Exception("L1TMuonEndCap")
42  << "Trying to use EMTF pc_lut_version = " << pc_lut_version << ", does not exist!";
43  // Will catch user trying to run with Global Tag settings on 2016 data, rather than fakeEmtfParams. - AWB 08.06.17
44 
45  std::string coord_lut_path = "L1Trigger/L1TMuon/data/emtf_luts/" + coord_lut_dir + "/";
46 
47  read_file(coord_lut_path + "ph_init_neighbor.txt", ph_init_neighbor_);
48  read_file(coord_lut_path + "ph_disp_neighbor.txt", ph_disp_neighbor_);
49  read_file(coord_lut_path + "th_init_neighbor.txt", th_init_neighbor_);
50  read_file(coord_lut_path + "th_disp_neighbor.txt", th_disp_neighbor_);
51  read_file(coord_lut_path + "th_lut_neighbor.txt", th_lut_neighbor_);
52  read_file(coord_lut_path + "th_corr_lut_neighbor.txt", th_corr_lut_neighbor_);
53 
54  std::string cppf_coord_lut_path = "L1Trigger/L1TMuon/data/cppf/"; // Coordinate LUTs actually used by CPPF
55  bool use_local_cppf_files = (pc_lut_version == -1);
56  if (use_local_cppf_files) { // More accurate coordinate transformation LUTs from Jia Fu
57  cppf_coord_lut_path = "L1Trigger/L1TMuon/data/cppf_luts/angleScale_v1/";
58  }
59 
60  read_cppf_file(cppf_coord_lut_path,
63  use_local_cppf_files); // cppf filenames are hardcoded in the function
64 
65  if (ph_init_neighbor_.size() != 2 * 6 * 61) { // [endcap_2][sector_6][chamber_61]
66  throw cms::Exception("L1TMuonEndCap") << "Expected ph_init_neighbor_ to get " << 2 * 6 * 61 << " values, "
67  << "got " << ph_init_neighbor_.size() << " values.";
68  }
69 
70  if (ph_disp_neighbor_.size() != 2 * 6 * 61) { // [endcap_2][sector_6][chamber_61]
71  throw cms::Exception("L1TMuonEndCap") << "Expected ph_disp_neighbor_ to get " << 2 * 6 * 61 << " values, "
72  << "got " << ph_disp_neighbor_.size() << " values.";
73  }
74 
75  if (th_init_neighbor_.size() != 2 * 6 * 61) { // [endcap_2][sector_6][chamber_61]
76  throw cms::Exception("L1TMuonEndCap") << "Expected th_init_neighbor_ to get " << 2 * 6 * 61 << " values, "
77  << "got " << th_init_neighbor_.size() << " values.";
78  }
79 
80  if (th_disp_neighbor_.size() != 2 * 6 * 61) { // [endcap_2][sector_6][chamber_61]
81  throw cms::Exception("L1TMuonEndCap") << "Expected th_disp_neighbor_ to get " << 2 * 6 * 61 << " values, "
82  << "got " << th_disp_neighbor_.size() << " values.";
83  }
84 
85  if (th_lut_neighbor_.size() != 2 * 6 * 61 * 128) { // [endcap_2][sector_6][chamber_61][wire_128]
86  throw cms::Exception("L1TMuonEndCap") << "Expected th_lut_neighbor_ to get " << 2 * 6 * 61 * 128 << " values, "
87  << "got " << th_lut_neighbor_.size() << " values.";
88  }
89 
90  if (th_corr_lut_neighbor_.size() != 2 * 6 * 7 * 128) { // [endcap_2][sector_6][chamber_61][strip_wire_128]
91  throw cms::Exception("L1TMuonEndCap") << "Expected th_corr_lut_neighbor_ to get " << 2 * 6 * 7 * 128 << " values, "
92  << "got " << th_corr_lut_neighbor_.size() << " values.";
93  }
94 
95  if (cppf_ph_lut_.size() !=
96  2 * 6 * 6 * 6 * 3 *
97  64) { // [endcap_2][rpc_sector_6][rpc_station_ring_6][rpc_subsector_6][rpc_roll_3][rpc_halfstrip_64]
98  throw cms::Exception("L1TMuonEndCap") << "Expected cppf_ph_lut_ to get " << 2 * 6 * 6 * 6 * 3 * 64 << " values, "
99  << "got " << cppf_ph_lut_.size() << " values.";
100  }
101 
102  if (cppf_th_lut_.size() !=
103  2 * 6 * 6 * 6 * 3) { // [endcap_2][rpc_sector_6][rpc_station_ring_6][rpc_subsector_6][rpc_roll_3]
104  throw cms::Exception("L1TMuonEndCap") << "Expected cppf_th_lut_ to get " << 2 * 6 * 6 * 6 * 3 << " values, "
105  << "got " << cppf_th_lut_.size() << " values.";
106  }
107 
108  // clct pattern convertion array from CMSSW
109  //{0.0, 0.0, -0.60, 0.60, -0.64, 0.64, -0.23, 0.23, -0.21, 0.21, 0.0}
110  // 0 0 -5 +5 -5 +5 -2 +2 -2 +2 0
111  ph_patt_corr_ = {0, 0, 5, 5, 5, 5, 2, 2, 2, 2, 0};
112  if (ph_patt_corr_.size() != 11) {
113  throw cms::Exception("L1TMuonEndCap") << "Expected ph_patt_corr_ to get " << 11 << " values, "
114  << "got " << ph_patt_corr_.size() << " values.";
115  }
116 
117  ph_patt_corr_sign_ = {0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0};
118  if (ph_patt_corr_sign_.size() != 11) {
119  throw cms::Exception("L1TMuonEndCap") << "Expected ph_patt_corr_sign_ to get " << 11 << " values, "
120  << "got " << ph_patt_corr_sign_.size() << " values.";
121  }
122 
123  ph_zone_offset_ = {39, 57, 76, 39, 58, 76, 41, 60, 79, 95, 114, 132, 95, 114, 133, 98, 116, 135,
124  38, 76, 113, 39, 58, 76, 95, 114, 132, 38, 76, 113, 39, 58, 76, 95, 114, 132,
125  38, 76, 113, 38, 57, 76, 95, 113, 132, 21, 21, 23, 1, 21, 1, 21, 1, 20};
126  if (ph_zone_offset_.size() != 6 * 9) {
127  throw cms::Exception("L1TMuonEndCap") << "Expected ph_zone_offset_ to get " << 6 * 9 << " values, "
128  << "got " << ph_zone_offset_.size() << " values.";
129  }
130 
131  // start phi of each chamber in reduced precision, for zone hits,
132  // with negative offset to allow for possible chamber movement
133  ph_init_hard_ = {39, 57, 76, 39, 58, 76, 41, 60, 79, 39, 57, 76, 21, 21, 23, 21, 95, 114, 132, 95,
134  114, 133, 98, 116, 135, 95, 114, 132, 0, 0, 0, 0, 38, 76, 113, 39, 58, 76, 95, 114,
135  132, 1, 21, 0, 0, 0, 0, 0, 38, 76, 113, 39, 58, 76, 95, 114, 132, 1, 21, 0,
136  0, 0, 0, 0, 38, 76, 113, 38, 57, 76, 95, 113, 132, 1, 20, 0, 0, 0, 0, 0};
137  if (ph_init_hard_.size() != 5 * 16) {
138  throw cms::Exception("L1TMuonEndCap") << "Expected ph_init_hard_ to get " << 5 * 16 << " values, "
139  << "got " << ph_init_hard_.size() << " values.";
140  }
141 
142  version_ = pc_lut_version;
143  return;
144 }
145 
146 uint32_t SectorProcessorLUT::get_ph_init(int fw_endcap, int fw_sector, int pc_lut_id) const {
147  const uint32_t index = (fw_endcap * 6 + fw_sector) * 61 + pc_lut_id;
148  uint32_t entry = 0;
149 
150  if (index < ph_init_neighbor_.size()) {
152  } else {
153  edm::LogError("L1T") << "Could not retrieve entry from LUT. fw_endcap: " << fw_endcap
154  << ", fw_sector: " << fw_sector << ", pc_lut_id: " << pc_lut_id;
155  }
156  return entry;
157 }
158 
159 uint32_t SectorProcessorLUT::get_ph_disp(int fw_endcap, int fw_sector, int pc_lut_id) const {
160  const uint32_t index = (fw_endcap * 6 + fw_sector) * 61 + pc_lut_id;
161  uint32_t entry = 0;
162 
163  if (index < ph_disp_neighbor_.size()) {
165  } else {
166  edm::LogError("L1T") << "Could not retrieve entry from LUT. fw_endcap: " << fw_endcap
167  << ", fw_sector: " << fw_sector << ", pc_lut_id: " << pc_lut_id;
168  }
169  return entry;
170 }
171 
172 uint32_t SectorProcessorLUT::get_th_init(int fw_endcap, int fw_sector, int pc_lut_id) const {
173  const uint32_t index = (fw_endcap * 6 + fw_sector) * 61 + pc_lut_id;
174  uint32_t entry = 0;
175 
176  if (index < th_init_neighbor_.size()) {
178  } else {
179  edm::LogError("L1T") << "Could not retrieve entry from LUT. fw_endcap: " << fw_endcap
180  << ", fw_sector: " << fw_sector << ", pc_lut_id: " << pc_lut_id;
181  }
182  return entry;
183 }
184 
185 uint32_t SectorProcessorLUT::get_th_disp(int fw_endcap, int fw_sector, int pc_lut_id) const {
186  const uint32_t index = (fw_endcap * 6 + fw_sector) * 61 + pc_lut_id;
187  uint32_t entry = 0;
188 
189  if (index < th_disp_neighbor_.size()) {
191  } else {
192  edm::LogError("L1T") << "Could not retrieve entry from LUT. fw_endcap: " << fw_endcap
193  << ", fw_sector: " << fw_sector << ", pc_lut_id: " << pc_lut_id;
194  }
195  return entry;
196 }
197 
198 uint32_t SectorProcessorLUT::get_th_lut(int fw_endcap, int fw_sector, int pc_lut_id, int pc_wire_id) const {
199  int pc_lut_id2 = pc_lut_id;
200 
201  // Make ME1/1a the same as ME1/1b
202  if ((9 <= pc_lut_id2 && pc_lut_id2 < 12) || (25 <= pc_lut_id2 && pc_lut_id2 < 28))
203  pc_lut_id2 -= 9;
204  // Make ME1/1a neighbor the same as ME1/1b
205  if (pc_lut_id2 == 15)
206  pc_lut_id2 -= 3;
207 
208  const uint32_t index = ((fw_endcap * 6 + fw_sector) * 61 + pc_lut_id2) * 128 + pc_wire_id;
209  uint32_t entry = 0;
210 
211  if (index < th_lut_neighbor_.size()) {
213  } else {
214  edm::LogError("L1T") << "Could not retrieve entry from LUT. fw_endcap: " << fw_endcap
215  << ", fw_sector: " << fw_sector << ", pc_lut_id: " << pc_lut_id
216  << ", pc_wire_id: " << pc_wire_id;
217  }
218  return entry;
219 }
220 
221 uint32_t SectorProcessorLUT::get_th_corr_lut(int fw_endcap, int fw_sector, int pc_lut_id, int pc_wire_strip_id) const {
222  int pc_lut_id2 = pc_lut_id;
223 
224  // Make ME1/1a the same as ME1/1b
225  if ((9 <= pc_lut_id2 && pc_lut_id2 < 12) || (25 <= pc_lut_id2 && pc_lut_id2 < 28))
226  pc_lut_id2 -= 9;
227  // Make ME1/1a neighbor the same as ME1/1b
228  if (pc_lut_id2 == 15)
229  pc_lut_id2 -= 3;
230 
231  if (pc_lut_id2 <= 3) {
232  pc_lut_id2 -= 0;
233  } else if (pc_lut_id2 == 12) {
234  pc_lut_id2 -= 9;
235  } else if (16 <= pc_lut_id2 && pc_lut_id2 < 19) {
236  pc_lut_id2 -= 12;
237  } else {
238  edm::LogError("L1T") << "get_th_corr_lut(): out of range pc_lut_id: " << pc_lut_id;
239  }
240 
241  const uint32_t index = ((fw_endcap * 6 + fw_sector) * 7 + pc_lut_id2) * 128 + pc_wire_strip_id;
242  uint32_t entry = 0;
243 
244  if (index < th_corr_lut_neighbor_.size()) {
246  } else {
247  edm::LogError("L1T") << "Could not retrieve entry from LUT. fw_endcap: " << fw_endcap
248  << ", fw_sector: " << fw_sector << ", pc_lut_id: " << pc_lut_id
249  << ", pc_wire_strip_id: " << pc_wire_strip_id;
250  }
251  return entry;
252 }
253 
255  const uint32_t index = pattern;
256  uint32_t entry = 0;
257 
258  if (index < ph_patt_corr_.size()) {
259  entry = ph_patt_corr_.at(index);
260  } else {
261  edm::LogError("L1T") << "Could not retrieve entry from LUT. pattern: " << pattern;
262  }
263  return entry;
264 }
265 
267  const uint32_t index = pattern;
268  uint32_t entry = 0;
269 
270  if (index < ph_patt_corr_sign_.size()) {
272  } else {
273  edm::LogError("L1T") << "Could not retrieve entry from LUT. pattern: " << pattern;
274  }
275  return entry;
276 }
277 
278 uint32_t SectorProcessorLUT::get_ph_zone_offset(int pc_station, int pc_chamber) const {
279  const uint32_t index = pc_station * 9 + pc_chamber;
280  uint32_t entry = 0;
281 
282  if (index < ph_zone_offset_.size()) {
284  } else {
285  edm::LogError("L1T") << "Could not retrieve entry from LUT. pc_station: " << pc_station
286  << ", pc_chamber: " << pc_chamber;
287  }
288  return entry;
289 }
290 
291 uint32_t SectorProcessorLUT::get_ph_init_hard(int fw_station, int fw_cscid) const {
292  const uint32_t index = fw_station * 16 + fw_cscid;
293  uint32_t entry = 0;
294 
295  if (index < ph_init_hard_.size()) {
296  entry = ph_init_hard_.at(index);
297  } else {
298  edm::LogError("L1T") << "Could not retrieve entry from LUT. fw_station: " << fw_station
299  << ", fw_cscid: " << fw_cscid;
300  }
301  return entry;
302 }
303 
305  int rpc_region, int rpc_sector, int rpc_station, int rpc_ring, int rpc_subsector, int rpc_roll) const {
306  uint32_t iendcap = (rpc_region == -1) ? 1 : 0;
307  uint32_t isector = (rpc_sector - 1);
308  uint32_t istationring = (rpc_station >= 3) ? ((rpc_station - 3) * 2 + (rpc_ring - 2) + 2) : (rpc_station - 1);
309  uint32_t isubsector = (rpc_subsector - 1);
310  uint32_t iroll = (rpc_roll - 1);
311  return ((((iendcap * 6 + isector) * 6 + istationring) * 6 + isubsector) * 3 + iroll);
312 }
313 
314 uint32_t SectorProcessorLUT::get_cppf_ph_lut(int rpc_region,
315  int rpc_sector,
316  int rpc_station,
317  int rpc_ring,
318  int rpc_subsector,
319  int rpc_roll,
320  int halfstrip,
321  bool is_neighbor) const {
322  const uint32_t th_index = get_cppf_lut_id(rpc_region, rpc_sector, rpc_station, rpc_ring, rpc_subsector, rpc_roll);
323  const uint32_t ph_index = (th_index * 64) + (halfstrip - 1);
324  uint32_t ph = 0;
325 
326  if (ph_index < cppf_ph_lut_.size()) {
327  ph = cppf_ph_lut_.at(ph_index);
328  } else {
329  edm::LogError("L1T") << "Could not retrieve entry from LUT. rpc_region: " << rpc_region
330  << ", rpc_sector: " << rpc_sector << ", rpc_station: " << rpc_station
331  << ", rpc_ring: " << rpc_ring << ", rpc_subsector: " << rpc_subsector
332  << ", rpc_roll: " << rpc_roll << ", halfstrip: " << halfstrip
333  << ", is_neighbor: " << is_neighbor;
334  }
335 
336  if (!is_neighbor && rpc_subsector == 2)
337  ph += 900;
338  return ph;
339 }
340 
342  int rpc_region, int rpc_sector, int rpc_station, int rpc_ring, int rpc_subsector, int rpc_roll) const {
343  const uint32_t th_index = get_cppf_lut_id(rpc_region, rpc_sector, rpc_station, rpc_ring, rpc_subsector, rpc_roll);
344  uint32_t th = 0;
345 
346  if (th_index < cppf_th_lut_.size()) {
347  th = cppf_th_lut_.at(th_index);
348  } else {
349  edm::LogError("L1T") << "Could not retrieve entry from LUT. rpc_region: " << rpc_region
350  << ", rpc_sector: " << rpc_sector << ", rpc_station: " << rpc_station
351  << ", rpc_ring: " << rpc_ring << ", rpc_subsector: " << rpc_subsector
352  << ", rpc_roll: " << rpc_roll;
353  }
354  return th;
355 }
356 
357 void SectorProcessorLUT::read_file(const std::string& filename, std::vector<uint32_t>& vec) {
358  vec.clear();
359 
360  std::ifstream infile;
361  infile.open(edm::FileInPath(filename).fullPath().c_str());
362 
363  int buf;
364  while (infile >> buf) {
365  buf = (buf == -999) ? 0 : buf;
366  vec.push_back(buf);
367  }
368  infile.close();
369 }
370 
372  std::vector<uint32_t>& vec1,
373  std::vector<uint32_t>& vec2,
374  bool local) {
375  auto get_rpc_region = [](uint32_t id) { return (static_cast<int>((id >> 0) & 0X3) + (-1)); };
376  auto get_rpc_sector = [](uint32_t id) { return (static_cast<int>((id >> 7) & 0XF) + (1)); };
377  auto get_rpc_ring = [](uint32_t id) { return (static_cast<int>((id >> 2) & 0X7) + (1)); };
378  auto get_rpc_station = [](uint32_t id) { return (static_cast<int>((id >> 5) & 0X3) + (1)); };
379  auto get_rpc_subsector = [](uint32_t id) { return (static_cast<int>((id >> 12) & 0X7) + (1)); };
380  auto get_rpc_roll = [](uint32_t id) { return (static_cast<int>((id >> 15) & 0X7) + (0)); };
381 
382  std::vector<std::string> cppf_filenames = {
383  "angleScale_RPC_CPPFp1.txt",
384  "angleScale_RPC_CPPFp2.txt",
385  "angleScale_RPC_CPPFp3.txt",
386  "angleScale_RPC_CPPFp4.txt",
387  "angleScale_RPC_CPPFn1.txt",
388  "angleScale_RPC_CPPFn2.txt",
389  "angleScale_RPC_CPPFn3.txt",
390  "angleScale_RPC_CPPFn4.txt",
391  };
392 
393  vec1.clear();
394  vec2.clear();
395  vec1.resize(2 * 6 * 6 * 6 * 3 * 64, 0);
396  vec2.resize(2 * 6 * 6 * 6 * 3, 0);
397 
398  for (size_t i = 0; i < cppf_filenames.size(); ++i) {
399  std::ifstream infile;
400  infile.open(edm::FileInPath(filename + cppf_filenames.at(i)).fullPath().c_str());
401 
402  // std::cout << "\n\nOpening CPPF LUT file " << cppf_filenames.at(i) << std::endl;
403 
404  int buf1, buf2, buf3, buf4, buf5, buf6;
405  // Special variables for transforming centrally-provided CPPF LUTs
406  int buf1_prev = 0, buf2_prev = 0, halfstrip_prev = 0; // Values from previous line in file
407  int line_num = 0; // Line number in file
408  int count_dir = -1; // Direction of half-strip counting: +1 is up, -1 is down
409  int dStrip = 0; // Offset for half-strip from full strip
410  while ((infile >> buf1) && (infile >> buf2) && (infile >> buf3) && (infile >> buf4) && (infile >> buf5) &&
411  (infile >> buf6)) {
412  if ((line_num % 192) == 191)
413  line_num += 1; // Gap in central files vs. Jia Fu's files
414  line_num += 1;
415  // On roughly every-other line, files in L1Trigger/L1TMuon/data/cppf have 0 in the first three columns
416  // Skips a "0 0 0" line once every 192 lines
417  if ((line_num % 2) == 1) {
418  buf1_prev = buf1;
419  buf2_prev = buf2;
420  }
421 
422  if (local && (buf1 == 0 || buf2 == 0)) {
423  throw cms::Exception("L1TMuonEndCap") << "Expected non-0 values, got buf1 = " << buf1 << ", buf2 = " << buf2;
424  }
425  if (!local && (buf1_prev == 0 || buf2_prev == 0)) {
426  throw cms::Exception("L1TMuonEndCap")
427  << "Expected non-0 values, got buf1_prev = " << buf1_prev << ", buf2_prev = " << buf2_prev;
428  }
429 
430  uint32_t id = (local ? buf1 : buf1_prev);
431  int32_t rpc_region = get_rpc_region(id);
432  int32_t rpc_sector = get_rpc_sector(id);
433  int32_t rpc_station = get_rpc_station(id);
434  int32_t rpc_ring = get_rpc_ring(id);
435  int32_t rpc_subsector = get_rpc_subsector(id);
436  int32_t rpc_roll = get_rpc_roll(id);
437 
438  // Offset into halfstrips from centrally-provided LUTs
439  if (buf2_prev * 2 > halfstrip_prev + 8 ||
440  buf2_prev * 2 < halfstrip_prev - 8) { // Starting a new series of strips
441  if (buf2_prev == 1)
442  count_dir = +1; // Starting from a low number, counting up
443  else
444  count_dir = -1; // Starting from a high number, counting down
445  }
446  if (count_dir == -1)
447  dStrip = (buf2_prev * 2 == halfstrip_prev ? 1 : 0);
448  if (count_dir == +1)
449  dStrip = (buf2_prev * 2 == halfstrip_prev + 2 ? 1 : 0);
450  if (buf2_prev * 2 < halfstrip_prev - 8 && buf2_prev == 1)
451  dStrip = 1;
452 
453  //uint32_t strip = buf2;
454  uint32_t halfstrip =
455  (local ? buf2
456  : buf2_prev * 2 -
457  dStrip); // I modified the local text files to use 'halfstrip' instead of 'strip' in column 2
458  halfstrip_prev = halfstrip;
459 
460  uint32_t ph = buf5;
461  uint32_t th = buf6;
462 
463  const uint32_t th_index = get_cppf_lut_id(rpc_region, rpc_sector, rpc_station, rpc_ring, rpc_subsector, rpc_roll);
464  const uint32_t ph_index = (th_index * 64) + (halfstrip - 1);
465 
466  // std::cout << id << " " << rpc_region << " " << rpc_sector << " " << rpc_station << " " << rpc_ring << " "
467  // << rpc_subsector << " " << rpc_roll << " " << halfstrip << " " << th_index << " " << ph_index << std::endl;
468 
469  vec1.at(ph_index) = ph;
470  if (halfstrip == 1)
471  vec2.at(th_index) = th;
472 
473  // Fill gap in centrally-provided LUTs once every 192 lines
474  if (!local && (line_num % 192) == 191)
475  vec1.at(ph_index + 1) = ph;
476 
477  } // End while ((infile >> buf1) && ... && (infile >> buf6))
478  infile.close();
479  } // End loop over CPPF LUT files
480 }
uint32_t get_ph_init_hard(int fw_station, int fw_cscid) const
uint32_t get_ph_patt_corr_sign(int pattern) const
uint32_t get_th_corr_lut(int fw_endcap, int fw_sector, int pc_lut_id, int pc_wire_strip_id) const
uint32_t get_th_lut(int fw_endcap, int fw_sector, int pc_lut_id, int pc_wire_id) const
std::vector< uint32_t > ph_zone_offset_
std::vector< uint32_t > cppf_ph_lut_
void read(bool pc_lut_data, int pc_lut_version)
std::vector< uint32_t > th_corr_lut_neighbor_
std::vector< uint32_t > cppf_th_lut_
Log< level::Error, false > LogError
std::vector< uint32_t > th_disp_neighbor_
uint32_t get_ph_patt_corr(int pattern) const
std::vector< uint32_t > ph_patt_corr_
std::vector< double > vec1
Definition: HCALResponse.h:15
std::vector< uint32_t > ph_init_hard_
uint32_t get_ph_zone_offset(int pc_station, int pc_chamber) const
uint32_t get_cppf_th_lut(int rpc_region, int rpc_sector, int rpc_station, int rpc_ring, int rpc_subsector, int rpc_roll) const
std::vector< uint32_t > ph_patt_corr_sign_
Log< level::Info, false > LogInfo
uint32_t get_cppf_lut_id(int rpc_region, int rpc_sector, int rpc_station, int rpc_ring, int rpc_subsector, int rpc_roll) const
void read_cppf_file(const std::string &filename, std::vector< uint32_t > &vec1, std::vector< uint32_t > &vec2, bool local)
std::vector< uint32_t > th_init_neighbor_
uint32_t get_cppf_ph_lut(int rpc_region, int rpc_sector, int rpc_station, int rpc_ring, int rpc_subsector, int rpc_roll, int halfstrip, bool is_neighbor) const
uint32_t get_ph_disp(int fw_endcap, int fw_sector, int pc_lut_id) const
uint32_t get_ph_init(int fw_endcap, int fw_sector, int pc_lut_id) const
std::vector< uint32_t > ph_disp_neighbor_
uint32_t get_th_init(int fw_endcap, int fw_sector, int pc_lut_id) const
std::vector< uint32_t > ph_init_neighbor_
void read_file(const std::string &filename, std::vector< uint32_t > &vec)
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
uint32_t get_th_disp(int fw_endcap, int fw_sector, int pc_lut_id) const
std::vector< uint32_t > th_lut_neighbor_