CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SectorProcessorLUT Class Reference

#include <SectorProcessorLUT.h>

Public Member Functions

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
 
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_cppf_th_lut (int rpc_region, int rpc_sector, int rpc_station, int rpc_ring, int rpc_subsector, int rpc_roll) 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
 
uint32_t get_ph_init_hard (int fw_station, int fw_cscid) const
 
uint32_t get_ph_patt_corr (int pattern) const
 
uint32_t get_ph_patt_corr_sign (int pattern) const
 
uint32_t get_ph_zone_offset (int pc_station, int pc_chamber) 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_disp (int fw_endcap, int fw_sector, int pc_lut_id) const
 
uint32_t get_th_init (int fw_endcap, int fw_sector, int pc_lut_id) const
 
uint32_t get_th_lut (int fw_endcap, int fw_sector, int pc_lut_id, int pc_wire_id) const
 
void read (bool pc_lut_data, int pc_lut_version)
 
 SectorProcessorLUT ()
 
 ~SectorProcessorLUT ()
 

Private Member Functions

void read_cppf_file (const std::string &filename, std::vector< uint32_t > &vec1, std::vector< uint32_t > &vec2, bool local)
 
void read_file (const std::string &filename, std::vector< uint32_t > &vec)
 

Private Attributes

std::vector< uint32_t > cppf_ph_lut_
 
std::vector< uint32_t > cppf_th_lut_
 
std::vector< uint32_t > ph_disp_neighbor_
 
std::vector< uint32_t > ph_init_hard_
 
std::vector< uint32_t > ph_init_neighbor_
 
std::vector< uint32_t > ph_patt_corr_
 
std::vector< uint32_t > ph_patt_corr_sign_
 
std::vector< uint32_t > ph_zone_offset_
 
std::vector< uint32_t > th_corr_lut_neighbor_
 
std::vector< uint32_t > th_disp_neighbor_
 
std::vector< uint32_t > th_init_neighbor_
 
std::vector< uint32_t > th_lut_neighbor_
 
int version_
 

Detailed Description

Definition at line 8 of file SectorProcessorLUT.h.

Constructor & Destructor Documentation

◆ SectorProcessorLUT()

SectorProcessorLUT::SectorProcessorLUT ( )
explicit

Definition at line 10 of file SectorProcessorLUT.cc.

10 : version_(0xFFFFFFFF) {}

◆ ~SectorProcessorLUT()

SectorProcessorLUT::~SectorProcessorLUT ( )

Definition at line 12 of file SectorProcessorLUT.cc.

12 {}

Member Function Documentation

◆ get_cppf_lut_id()

uint32_t SectorProcessorLUT::get_cppf_lut_id ( int  rpc_region,
int  rpc_sector,
int  rpc_station,
int  rpc_ring,
int  rpc_subsector,
int  rpc_roll 
) const

Definition at line 212 of file SectorProcessorLUT.cc.

213  {
214  uint32_t iendcap = (rpc_region == -1) ? 1 : 0;
215  uint32_t isector = (rpc_sector - 1);
216  uint32_t istationring = (rpc_station >= 3) ? ((rpc_station - 3) * 2 + (rpc_ring - 2) + 2) : (rpc_station - 1);
217  uint32_t isubsector = (rpc_subsector - 1);
218  uint32_t iroll = (rpc_roll - 1);
219  return ((((iendcap * 6 + isector) * 6 + istationring) * 6 + isubsector) * 3 + iroll);
220 }

Referenced by get_cppf_ph_lut(), get_cppf_th_lut(), and read_cppf_file().

◆ get_cppf_ph_lut()

uint32_t SectorProcessorLUT::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

Definition at line 222 of file SectorProcessorLUT.cc.

229  {
230  size_t th_index = get_cppf_lut_id(rpc_region, rpc_sector, rpc_station, rpc_ring, rpc_subsector, rpc_roll);
231  size_t ph_index = (th_index * 64) + (halfstrip - 1);
232  uint32_t ph = cppf_ph_lut_.at(ph_index);
233  if (!is_neighbor && rpc_subsector == 2)
234  ph += 900;
235  return ph;
236 }

References cppf_ph_lut_, and get_cppf_lut_id().

Referenced by PrimitiveConversion::convert_rpc_details().

◆ get_cppf_th_lut()

uint32_t SectorProcessorLUT::get_cppf_th_lut ( int  rpc_region,
int  rpc_sector,
int  rpc_station,
int  rpc_ring,
int  rpc_subsector,
int  rpc_roll 
) const

Definition at line 238 of file SectorProcessorLUT.cc.

239  {
240  size_t th_index = get_cppf_lut_id(rpc_region, rpc_sector, rpc_station, rpc_ring, rpc_subsector, rpc_roll);
241  uint32_t th = cppf_th_lut_.at(th_index);
242  return th;
243 }

References cppf_th_lut_, and get_cppf_lut_id().

Referenced by PrimitiveConversion::convert_rpc_details().

◆ get_ph_disp()

uint32_t SectorProcessorLUT::get_ph_disp ( int  fw_endcap,
int  fw_sector,
int  pc_lut_id 
) const

Definition at line 145 of file SectorProcessorLUT.cc.

145  {
146  size_t index = (fw_endcap * 6 + fw_sector) * 61 + pc_lut_id;
147  return ph_disp_neighbor_.at(index);
148 }

References ph_disp_neighbor_.

Referenced by PrimitiveConversion::convert_csc_details().

◆ get_ph_init()

uint32_t SectorProcessorLUT::get_ph_init ( int  fw_endcap,
int  fw_sector,
int  pc_lut_id 
) const

Definition at line 140 of file SectorProcessorLUT.cc.

140  {
141  size_t index = (fw_endcap * 6 + fw_sector) * 61 + pc_lut_id;
142  return ph_init_neighbor_.at(index);
143 }

References ph_init_neighbor_.

Referenced by PrimitiveConversion::convert_csc_details().

◆ get_ph_init_hard()

uint32_t SectorProcessorLUT::get_ph_init_hard ( int  fw_station,
int  fw_cscid 
) const

Definition at line 207 of file SectorProcessorLUT.cc.

207  {
208  size_t index = fw_station * 16 + fw_cscid;
209  return ph_init_hard_.at(index);
210 }

References ph_init_hard_.

Referenced by PrimitiveConversion::convert_csc_details().

◆ get_ph_patt_corr()

uint32_t SectorProcessorLUT::get_ph_patt_corr ( int  pattern) const

Definition at line 198 of file SectorProcessorLUT.cc.

198 { return ph_patt_corr_.at(pattern); }

References topSingleLeptonDQM_PU_cfi::pattern, and ph_patt_corr_.

Referenced by PrimitiveConversion::convert_csc_details().

◆ get_ph_patt_corr_sign()

uint32_t SectorProcessorLUT::get_ph_patt_corr_sign ( int  pattern) const

◆ get_ph_zone_offset()

uint32_t SectorProcessorLUT::get_ph_zone_offset ( int  pc_station,
int  pc_chamber 
) const

Definition at line 202 of file SectorProcessorLUT.cc.

202  {
203  size_t index = pc_station * 9 + pc_chamber;
204  return ph_zone_offset_.at(index);
205 }

References ph_zone_offset_.

Referenced by PrimitiveConversion::convert_csc_details().

◆ get_th_corr_lut()

uint32_t SectorProcessorLUT::get_th_corr_lut ( int  fw_endcap,
int  fw_sector,
int  pc_lut_id,
int  pc_wire_strip_id 
) const

Definition at line 174 of file SectorProcessorLUT.cc.

174  {
175  int pc_lut_id2 = pc_lut_id;
176 
177  // Make ME1/1a the same as ME1/1b
178  if ((9 <= pc_lut_id2 && pc_lut_id2 < 12) || (25 <= pc_lut_id2 && pc_lut_id2 < 28))
179  pc_lut_id2 -= 9;
180  // Make ME1/1a neighbor the same as ME1/1b
181  if (pc_lut_id2 == 15)
182  pc_lut_id2 -= 3;
183 
184  if (pc_lut_id2 <= 3) {
185  pc_lut_id2 -= 0;
186  } else if (pc_lut_id2 == 12) {
187  pc_lut_id2 -= 9;
188  } else if (16 <= pc_lut_id2 && pc_lut_id2 < 19) {
189  pc_lut_id2 -= 12;
190  } else {
191  throw cms::Exception("L1TMuonEndCap") << "get_th_corr_lut(): out of range pc_lut_id: " << pc_lut_id;
192  }
193 
194  size_t index = ((fw_endcap * 6 + fw_sector) * 7 + pc_lut_id2) * 128 + pc_wire_strip_id;
195  return th_corr_lut_neighbor_.at(index);
196 }

References Exception, and th_corr_lut_neighbor_.

Referenced by PrimitiveConversion::convert_csc_details().

◆ get_th_disp()

uint32_t SectorProcessorLUT::get_th_disp ( int  fw_endcap,
int  fw_sector,
int  pc_lut_id 
) const

Definition at line 155 of file SectorProcessorLUT.cc.

155  {
156  size_t index = (fw_endcap * 6 + fw_sector) * 61 + pc_lut_id;
157  return th_disp_neighbor_.at(index);
158 }

References th_disp_neighbor_.

Referenced by PrimitiveConversion::convert_csc_details().

◆ get_th_init()

uint32_t SectorProcessorLUT::get_th_init ( int  fw_endcap,
int  fw_sector,
int  pc_lut_id 
) const

Definition at line 150 of file SectorProcessorLUT.cc.

150  {
151  size_t index = (fw_endcap * 6 + fw_sector) * 61 + pc_lut_id;
152  return th_init_neighbor_.at(index);
153 }

References th_init_neighbor_.

Referenced by PrimitiveConversion::convert_csc_details().

◆ get_th_lut()

uint32_t SectorProcessorLUT::get_th_lut ( int  fw_endcap,
int  fw_sector,
int  pc_lut_id,
int  pc_wire_id 
) const

Definition at line 160 of file SectorProcessorLUT.cc.

160  {
161  int pc_lut_id2 = pc_lut_id;
162 
163  // Make ME1/1a the same as ME1/1b
164  if ((9 <= pc_lut_id2 && pc_lut_id2 < 12) || (25 <= pc_lut_id2 && pc_lut_id2 < 28))
165  pc_lut_id2 -= 9;
166  // Make ME1/1a neighbor the same as ME1/1b
167  if (pc_lut_id2 == 15)
168  pc_lut_id2 -= 3;
169 
170  size_t index = ((fw_endcap * 6 + fw_sector) * 61 + pc_lut_id2) * 128 + pc_wire_id;
171  return th_lut_neighbor_.at(index);
172 }

References th_lut_neighbor_.

Referenced by PrimitiveConversion::convert_csc_details().

◆ read()

void SectorProcessorLUT::read ( bool  pc_lut_data,
int  pc_lut_version 
)

Definition at line 14 of file SectorProcessorLUT.cc.

14  {
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 == 2)
29  coord_lut_dir = "ph_lut_v2"; // MC still uses ideal CMS aligment
30  else if (pc_lut_version == -1 && pc_lut_data)
31  coord_lut_dir = "ph_lut_v3_data"; // September 2017 data LCT alignment, but use local CPPF LUTs for RPC
32  else if (pc_lut_version == -1)
33  coord_lut_dir = "ph_lut_v2"; // MC using ideal CMS LCT alignment, but use local CPPF LUTs for RPC
34  else
35  throw cms::Exception("L1TMuonEndCap")
36  << "Trying to use EMTF pc_lut_version = " << pc_lut_version << ", does not exist!";
37  // Will catch user trying to run with Global Tag settings on 2016 data, rather than fakeEmtfParams. - AWB 08.06.17
38 
39  std::string coord_lut_path = "L1Trigger/L1TMuon/data/emtf_luts/" + coord_lut_dir + "/";
40 
41  read_file(coord_lut_path + "ph_init_neighbor.txt", ph_init_neighbor_);
42  read_file(coord_lut_path + "ph_disp_neighbor.txt", ph_disp_neighbor_);
43  read_file(coord_lut_path + "th_init_neighbor.txt", th_init_neighbor_);
44  read_file(coord_lut_path + "th_disp_neighbor.txt", th_disp_neighbor_);
45  read_file(coord_lut_path + "th_lut_neighbor.txt", th_lut_neighbor_);
46  read_file(coord_lut_path + "th_corr_lut_neighbor.txt", th_corr_lut_neighbor_);
47 
48  std::string cppf_coord_lut_path = "L1Trigger/L1TMuon/data/cppf/"; // Coordinate LUTs actually used by CPPF
49  bool use_local_cppf_files = (pc_lut_version == -1);
50  if (use_local_cppf_files) { // More accurate coordinate transformation LUTs from Jia Fu
51  cppf_coord_lut_path = "L1Trigger/L1TMuon/data/cppf_luts/angleScale_v1/";
52  }
53 
54  read_cppf_file(cppf_coord_lut_path,
57  use_local_cppf_files); // cppf filenames are hardcoded in the function
58 
59  if (ph_init_neighbor_.size() != 2 * 6 * 61) { // [endcap_2][sector_6][chamber_61]
60  throw cms::Exception("L1TMuonEndCap") << "Expected ph_init_neighbor_ to get " << 2 * 6 * 61 << " values, "
61  << "got " << ph_init_neighbor_.size() << " values.";
62  }
63 
64  if (ph_disp_neighbor_.size() != 2 * 6 * 61) { // [endcap_2][sector_6][chamber_61]
65  throw cms::Exception("L1TMuonEndCap") << "Expected ph_disp_neighbor_ to get " << 2 * 6 * 61 << " values, "
66  << "got " << ph_disp_neighbor_.size() << " values.";
67  }
68 
69  if (th_init_neighbor_.size() != 2 * 6 * 61) { // [endcap_2][sector_6][chamber_61]
70  throw cms::Exception("L1TMuonEndCap") << "Expected th_init_neighbor_ to get " << 2 * 6 * 61 << " values, "
71  << "got " << th_init_neighbor_.size() << " values.";
72  }
73 
74  if (th_disp_neighbor_.size() != 2 * 6 * 61) { // [endcap_2][sector_6][chamber_61]
75  throw cms::Exception("L1TMuonEndCap") << "Expected th_disp_neighbor_ to get " << 2 * 6 * 61 << " values, "
76  << "got " << th_disp_neighbor_.size() << " values.";
77  }
78 
79  if (th_lut_neighbor_.size() != 2 * 6 * 61 * 128) { // [endcap_2][sector_6][chamber_61][wire_128]
80  throw cms::Exception("L1TMuonEndCap") << "Expected th_lut_neighbor_ to get " << 2 * 6 * 61 * 128 << " values, "
81  << "got " << th_lut_neighbor_.size() << " values.";
82  }
83 
84  if (th_corr_lut_neighbor_.size() != 2 * 6 * 7 * 128) { // [endcap_2][sector_6][chamber_61][strip_wire_128]
85  throw cms::Exception("L1TMuonEndCap") << "Expected th_corr_lut_neighbor_ to get " << 2 * 6 * 7 * 128 << " values, "
86  << "got " << th_corr_lut_neighbor_.size() << " values.";
87  }
88 
89  if (cppf_ph_lut_.size() !=
90  2 * 6 * 6 * 6 * 3 *
91  64) { // [endcap_2][rpc_sector_6][rpc_station_ring_6][rpc_subsector_6][rpc_roll_3][rpc_halfstrip_64]
92  throw cms::Exception("L1TMuonEndCap") << "Expected cppf_ph_lut_ to get " << 2 * 6 * 6 * 6 * 3 * 64 << " values, "
93  << "got " << cppf_ph_lut_.size() << " values.";
94  }
95 
96  if (cppf_th_lut_.size() !=
97  2 * 6 * 6 * 6 * 3) { // [endcap_2][rpc_sector_6][rpc_station_ring_6][rpc_subsector_6][rpc_roll_3]
98  throw cms::Exception("L1TMuonEndCap") << "Expected cppf_th_lut_ to get " << 2 * 6 * 6 * 6 * 3 << " values, "
99  << "got " << cppf_th_lut_.size() << " values.";
100  }
101 
102  // clct pattern convertion array from CMSSW
103  //{0.0, 0.0, -0.60, 0.60, -0.64, 0.64, -0.23, 0.23, -0.21, 0.21, 0.0}
104  // 0 0 -5 +5 -5 +5 -2 +2 -2 +2 0
105  ph_patt_corr_ = {0, 0, 5, 5, 5, 5, 2, 2, 2, 2, 0};
106  if (ph_patt_corr_.size() != 11) {
107  throw cms::Exception("L1TMuonEndCap") << "Expected ph_patt_corr_ to get " << 11 << " values, "
108  << "got " << ph_patt_corr_.size() << " values.";
109  }
110 
111  ph_patt_corr_sign_ = {0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0};
112  if (ph_patt_corr_sign_.size() != 11) {
113  throw cms::Exception("L1TMuonEndCap") << "Expected ph_patt_corr_sign_ to get " << 11 << " values, "
114  << "got " << ph_patt_corr_sign_.size() << " values.";
115  }
116 
117  ph_zone_offset_ = {39, 57, 76, 39, 58, 76, 41, 60, 79, 95, 114, 132, 95, 114, 133, 98, 116, 135,
118  38, 76, 113, 39, 58, 76, 95, 114, 132, 38, 76, 113, 39, 58, 76, 95, 114, 132,
119  38, 76, 113, 38, 57, 76, 95, 113, 132, 21, 21, 23, 1, 21, 1, 21, 1, 20};
120  if (ph_zone_offset_.size() != 6 * 9) {
121  throw cms::Exception("L1TMuonEndCap") << "Expected ph_zone_offset_ to get " << 6 * 9 << " values, "
122  << "got " << ph_zone_offset_.size() << " values.";
123  }
124 
125  // start phi of each chamber in reduced precision, for zone hits,
126  // with negative offset to allow for possible chamber movement
127  ph_init_hard_ = {39, 57, 76, 39, 58, 76, 41, 60, 79, 39, 57, 76, 21, 21, 23, 21, 95, 114, 132, 95,
128  114, 133, 98, 116, 135, 95, 114, 132, 0, 0, 0, 0, 38, 76, 113, 39, 58, 76, 95, 114,
129  132, 1, 21, 0, 0, 0, 0, 0, 38, 76, 113, 39, 58, 76, 95, 114, 132, 1, 21, 0,
130  0, 0, 0, 0, 38, 76, 113, 38, 57, 76, 95, 113, 132, 1, 20, 0, 0, 0, 0, 0};
131  if (ph_init_hard_.size() != 5 * 16) {
132  throw cms::Exception("L1TMuonEndCap") << "Expected ph_init_hard_ to get " << 5 * 16 << " values, "
133  << "got " << ph_init_hard_.size() << " values.";
134  }
135 
136  version_ = pc_lut_version;
137  return;
138 }

References cppf_ph_lut_, cppf_th_lut_, Exception, ph_disp_neighbor_, ph_init_hard_, ph_init_neighbor_, ph_patt_corr_, ph_patt_corr_sign_, ph_zone_offset_, read_cppf_file(), read_file(), AlCaHLTBitMon_QueryRunRegistry::string, th_corr_lut_neighbor_, th_disp_neighbor_, th_init_neighbor_, th_lut_neighbor_, and version_.

Referenced by edmIntegrityCheck.PublishToFileSystem::get(), and EMTFSetup::reload().

◆ read_cppf_file()

void SectorProcessorLUT::read_cppf_file ( const std::string &  filename,
std::vector< uint32_t > &  vec1,
std::vector< uint32_t > &  vec2,
bool  local 
)
private

Definition at line 259 of file SectorProcessorLUT.cc.

262  {
263  auto get_rpc_region = [](uint32_t id) { return (static_cast<int>((id >> 0) & 0X3) + (-1)); };
264  auto get_rpc_sector = [](uint32_t id) { return (static_cast<int>((id >> 7) & 0XF) + (1)); };
265  auto get_rpc_ring = [](uint32_t id) { return (static_cast<int>((id >> 2) & 0X7) + (1)); };
266  auto get_rpc_station = [](uint32_t id) { return (static_cast<int>((id >> 5) & 0X3) + (1)); };
267  auto get_rpc_subsector = [](uint32_t id) { return (static_cast<int>((id >> 12) & 0X7) + (1)); };
268  auto get_rpc_roll = [](uint32_t id) { return (static_cast<int>((id >> 15) & 0X7) + (0)); };
269 
270  std::vector<std::string> cppf_filenames = {
271  "angleScale_RPC_CPPFp1.txt",
272  "angleScale_RPC_CPPFp2.txt",
273  "angleScale_RPC_CPPFp3.txt",
274  "angleScale_RPC_CPPFp4.txt",
275  "angleScale_RPC_CPPFn1.txt",
276  "angleScale_RPC_CPPFn2.txt",
277  "angleScale_RPC_CPPFn3.txt",
278  "angleScale_RPC_CPPFn4.txt",
279  };
280 
281  vec1.clear();
282  vec2.clear();
283  vec1.resize(2 * 6 * 6 * 6 * 3 * 64, 0);
284  vec2.resize(2 * 6 * 6 * 6 * 3, 0);
285 
286  for (size_t i = 0; i < cppf_filenames.size(); ++i) {
287  std::ifstream infile;
288  infile.open(edm::FileInPath(filename + cppf_filenames.at(i)).fullPath().c_str());
289 
290  // std::cout << "\n\nOpening CPPF LUT file " << cppf_filenames.at(i) << std::endl;
291 
292  int buf1, buf2, buf3, buf4, buf5, buf6;
293  // Special variables for transforming centrally-provided CPPF LUTs
294  int buf1_prev = 0, buf2_prev = 0, halfstrip_prev = 0; // Values from previous line in file
295  int line_num = 0; // Line number in file
296  int count_dir = -1; // Direction of half-strip counting: +1 is up, -1 is down
297  int dStrip = 0; // Offset for half-strip from full strip
298  while ((infile >> buf1) && (infile >> buf2) && (infile >> buf3) && (infile >> buf4) && (infile >> buf5) &&
299  (infile >> buf6)) {
300  if ((line_num % 192) == 191)
301  line_num += 1; // Gap in central files vs. Jia Fu's files
302  line_num += 1;
303  // On roughly every-other line, files in L1Trigger/L1TMuon/data/cppf have 0 in the first three columns
304  // Skips a "0 0 0" line once every 192 lines
305  if ((line_num % 2) == 1) {
306  buf1_prev = buf1;
307  buf2_prev = buf2;
308  }
309 
310  if (local && (buf1 == 0 || buf2 == 0)) {
311  throw cms::Exception("L1TMuonEndCap") << "Expected non-0 values, got buf1 = " << buf1 << ", buf2 = " << buf2;
312  }
313  if (!local && (buf1_prev == 0 || buf2_prev == 0)) {
314  throw cms::Exception("L1TMuonEndCap")
315  << "Expected non-0 values, got buf1_prev = " << buf1_prev << ", buf2_prev = " << buf2_prev;
316  }
317 
318  uint32_t id = (local ? buf1 : buf1_prev);
319  int32_t rpc_region = get_rpc_region(id);
320  int32_t rpc_sector = get_rpc_sector(id);
321  int32_t rpc_station = get_rpc_station(id);
322  int32_t rpc_ring = get_rpc_ring(id);
323  int32_t rpc_subsector = get_rpc_subsector(id);
324  int32_t rpc_roll = get_rpc_roll(id);
325 
326  // Offset into halfstrips from centrally-provided LUTs
327  if (buf2_prev * 2 > halfstrip_prev + 8 ||
328  buf2_prev * 2 < halfstrip_prev - 8) { // Starting a new series of strips
329  if (buf2_prev == 1)
330  count_dir = +1; // Starting from a low number, counting up
331  else
332  count_dir = -1; // Starting from a high number, counting down
333  }
334  if (count_dir == -1)
335  dStrip = (buf2_prev * 2 == halfstrip_prev ? 1 : 0);
336  if (count_dir == +1)
337  dStrip = (buf2_prev * 2 == halfstrip_prev + 2 ? 1 : 0);
338  if (buf2_prev * 2 < halfstrip_prev - 8 && buf2_prev == 1)
339  dStrip = 1;
340 
341  //uint32_t strip = buf2;
342  uint32_t halfstrip =
343  (local ? buf2
344  : buf2_prev * 2 -
345  dStrip); // I modified the local text files to use 'halfstrip' instead of 'strip' in column 2
346  halfstrip_prev = halfstrip;
347 
348  uint32_t ph = buf5;
349  uint32_t th = buf6;
350 
351  size_t th_index = get_cppf_lut_id(rpc_region, rpc_sector, rpc_station, rpc_ring, rpc_subsector, rpc_roll);
352  size_t ph_index = (th_index * 64) + (halfstrip - 1);
353 
354  // std::cout << id << " " << rpc_region << " " << rpc_sector << " " << rpc_station << " " << rpc_ring << " "
355  // << rpc_subsector << " " << rpc_roll << " " << halfstrip << " " << th_index << " " << ph_index << std::endl;
356 
357  vec1.at(ph_index) = ph;
358  if (halfstrip == 1)
359  vec2.at(th_index) = th;
360 
361  // Fill gap in centrally-provided LUTs once every 192 lines
362  if (!local && (line_num % 192) == 191)
363  vec1.at(ph_index + 1) = ph;
364 
365  } // End while ((infile >> buf1) && ... && (infile >> buf6))
366  infile.close();
367  } // End loop over CPPF LUT files
368 }

References Exception, corrVsCorr::filename, contentValuesFiles::fullPath, get_cppf_lut_id(), mps_fire::i, triggerObjects_cff::id, timingPdfMaker::infile, and DTRecHitClients_cfi::local.

Referenced by read().

◆ read_file()

void SectorProcessorLUT::read_file ( const std::string &  filename,
std::vector< uint32_t > &  vec 
)
private

Definition at line 245 of file SectorProcessorLUT.cc.

245  {
246  vec.clear();
247 
248  std::ifstream infile;
249  infile.open(edm::FileInPath(filename).fullPath().c_str());
250 
251  int buf;
252  while (infile >> buf) {
253  buf = (buf == -999) ? 0 : buf;
254  vec.push_back(buf);
255  }
256  infile.close();
257 }

References visDQMUpload::buf, corrVsCorr::filename, contentValuesFiles::fullPath, and timingPdfMaker::infile.

Referenced by read().

Member Data Documentation

◆ cppf_ph_lut_

std::vector<uint32_t> SectorProcessorLUT::cppf_ph_lut_
private

Definition at line 67 of file SectorProcessorLUT.h.

Referenced by get_cppf_ph_lut(), and read().

◆ cppf_th_lut_

std::vector<uint32_t> SectorProcessorLUT::cppf_th_lut_
private

Definition at line 68 of file SectorProcessorLUT.h.

Referenced by get_cppf_th_lut(), and read().

◆ ph_disp_neighbor_

std::vector<uint32_t> SectorProcessorLUT::ph_disp_neighbor_
private

Definition at line 56 of file SectorProcessorLUT.h.

Referenced by get_ph_disp(), and read().

◆ ph_init_hard_

std::vector<uint32_t> SectorProcessorLUT::ph_init_hard_
private

Definition at line 65 of file SectorProcessorLUT.h.

Referenced by get_ph_init_hard(), and read().

◆ ph_init_neighbor_

std::vector<uint32_t> SectorProcessorLUT::ph_init_neighbor_
private

Definition at line 55 of file SectorProcessorLUT.h.

Referenced by get_ph_init(), and read().

◆ ph_patt_corr_

std::vector<uint32_t> SectorProcessorLUT::ph_patt_corr_
private

Definition at line 62 of file SectorProcessorLUT.h.

Referenced by get_ph_patt_corr(), and read().

◆ ph_patt_corr_sign_

std::vector<uint32_t> SectorProcessorLUT::ph_patt_corr_sign_
private

Definition at line 63 of file SectorProcessorLUT.h.

Referenced by get_ph_patt_corr_sign(), and read().

◆ ph_zone_offset_

std::vector<uint32_t> SectorProcessorLUT::ph_zone_offset_
private

Definition at line 64 of file SectorProcessorLUT.h.

Referenced by get_ph_zone_offset(), and read().

◆ th_corr_lut_neighbor_

std::vector<uint32_t> SectorProcessorLUT::th_corr_lut_neighbor_
private

Definition at line 60 of file SectorProcessorLUT.h.

Referenced by get_th_corr_lut(), and read().

◆ th_disp_neighbor_

std::vector<uint32_t> SectorProcessorLUT::th_disp_neighbor_
private

Definition at line 58 of file SectorProcessorLUT.h.

Referenced by get_th_disp(), and read().

◆ th_init_neighbor_

std::vector<uint32_t> SectorProcessorLUT::th_init_neighbor_
private

Definition at line 57 of file SectorProcessorLUT.h.

Referenced by get_th_init(), and read().

◆ th_lut_neighbor_

std::vector<uint32_t> SectorProcessorLUT::th_lut_neighbor_
private

Definition at line 59 of file SectorProcessorLUT.h.

Referenced by get_th_lut(), and read().

◆ version_

int SectorProcessorLUT::version_
private

Definition at line 70 of file SectorProcessorLUT.h.

Referenced by read().

SectorProcessorLUT::cppf_ph_lut_
std::vector< uint32_t > cppf_ph_lut_
Definition: SectorProcessorLUT.h:67
SectorProcessorLUT::th_corr_lut_neighbor_
std::vector< uint32_t > th_corr_lut_neighbor_
Definition: SectorProcessorLUT.h:60
mps_fire.i
i
Definition: mps_fire.py:355
SectorProcessorLUT::ph_init_hard_
std::vector< uint32_t > ph_init_hard_
Definition: SectorProcessorLUT.h:65
SectorProcessorLUT::read_file
void read_file(const std::string &filename, std::vector< uint32_t > &vec)
Definition: SectorProcessorLUT.cc:245
SectorProcessorLUT::th_init_neighbor_
std::vector< uint32_t > th_init_neighbor_
Definition: SectorProcessorLUT.h:57
vec1
std::vector< double > vec1
Definition: HCALResponse.h:15
SectorProcessorLUT::ph_patt_corr_
std::vector< uint32_t > ph_patt_corr_
Definition: SectorProcessorLUT.h:62
SectorProcessorLUT::read_cppf_file
void read_cppf_file(const std::string &filename, std::vector< uint32_t > &vec1, std::vector< uint32_t > &vec2, bool local)
Definition: SectorProcessorLUT.cc:259
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
edm::LogInfo
Definition: MessageLogger.h:254
vec2
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
SectorProcessorLUT::get_cppf_lut_id
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
Definition: SectorProcessorLUT.cc:212
edm::FileInPath
Definition: FileInPath.h:64
SectorProcessorLUT::ph_patt_corr_sign_
std::vector< uint32_t > ph_patt_corr_sign_
Definition: SectorProcessorLUT.h:63
SectorProcessorLUT::ph_disp_neighbor_
std::vector< uint32_t > ph_disp_neighbor_
Definition: SectorProcessorLUT.h:56
SectorProcessorLUT::cppf_th_lut_
std::vector< uint32_t > cppf_th_lut_
Definition: SectorProcessorLUT.h:68
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SectorProcessorLUT::th_disp_neighbor_
std::vector< uint32_t > th_disp_neighbor_
Definition: SectorProcessorLUT.h:58
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
Exception
Definition: hltDiff.cc:246
SectorProcessorLUT::version_
int version_
Definition: SectorProcessorLUT.h:70
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
timingPdfMaker.infile
infile
Definition: timingPdfMaker.py:350
SectorProcessorLUT::th_lut_neighbor_
std::vector< uint32_t > th_lut_neighbor_
Definition: SectorProcessorLUT.h:59
DTRecHitClients_cfi.local
local
Definition: DTRecHitClients_cfi.py:10
SectorProcessorLUT::ph_zone_offset_
std::vector< uint32_t > ph_zone_offset_
Definition: SectorProcessorLUT.h:64
SectorProcessorLUT::ph_init_neighbor_
std::vector< uint32_t > ph_init_neighbor_
Definition: SectorProcessorLUT.h:55