21 #include <unordered_map> 46 findingRecord<CSCL1TPLookupTableCCLUTRcd>();
47 findingRecord<CSCL1TPLookupTableME11ILTRcd>();
48 findingRecord<CSCL1TPLookupTableME21ILTRcd>();
60 std::unique_ptr<CSCL1TPLookupTableCCLUT> lut = std::make_unique<CSCL1TPLookupTableCCLUT>();
63 std::vector<std::string> positionLUTFiles_ =
pset_.
getParameter<std::vector<std::string>>(
"positionLUTFiles");
64 std::vector<std::string> slopeLUTFiles_ =
pset_.
getParameter<std::vector<std::string>>(
"slopeLUTFiles");
66 std::unordered_map<unsigned, std::vector<unsigned>> cclutPosition;
67 std::unordered_map<unsigned, std::vector<unsigned>> cclutSlope;
70 for (
int i = 0;
i < 5; ++
i) {
71 cclutPosition[
i] =
load(positionLUTFiles_[
i]);
72 cclutSlope[
i] =
load(slopeLUTFiles_[
i]);
76 lut->set_cclutPosition(
std::move(cclutPosition));
77 lut->set_cclutSlope(
std::move(cclutSlope));
84 std::unique_ptr<CSCL1TPLookupTableME11ILT> lut = std::make_unique<CSCL1TPLookupTableME11ILT>();
87 std::vector<std::string> padToEsME11aFiles_ =
pset_.
getParameter<std::vector<std::string>>(
"padToEsME11aFiles");
88 std::vector<std::string> padToEsME11bFiles_ =
pset_.
getParameter<std::vector<std::string>>(
"padToEsME11bFiles");
90 std::vector<std::string> rollToMaxWgME11Files_ =
pset_.
getParameter<std::vector<std::string>>(
"rollToMaxWgME11Files");
91 std::vector<std::string> rollToMinWgME11Files_ =
pset_.
getParameter<std::vector<std::string>>(
"rollToMinWgME11Files");
93 std::vector<std::string> gemCscSlopeCosiFiles_ =
pset_.
getParameter<std::vector<std::string>>(
"gemCscSlopeCosiFiles");
94 std::vector<std::string> gemCscSlopeCosiCorrectionFiles_ =
96 std::vector<std::string> gemCscSlopeCorrectionFiles_ =
99 std::vector<std::string> esDiffToSlopeME11aFiles_ =
101 std::vector<std::string> esDiffToSlopeME11bFiles_ =
105 auto GEM_pad_CSC_es_ME11a_even_ =
load(padToEsME11aFiles_[0]);
106 auto GEM_pad_CSC_es_ME11a_odd_ =
load(padToEsME11aFiles_[1]);
107 auto GEM_pad_CSC_es_ME11b_even_ =
load(padToEsME11bFiles_[0]);
108 auto GEM_pad_CSC_es_ME11b_odd_ =
load(padToEsME11bFiles_[1]);
110 auto GEM_roll_CSC_min_wg_ME11_even_ =
load(rollToMinWgME11Files_[0]);
111 auto GEM_roll_CSC_min_wg_ME11_odd_ =
load(rollToMinWgME11Files_[1]);
112 auto GEM_roll_CSC_max_wg_ME11_even_ =
load(rollToMaxWgME11Files_[0]);
113 auto GEM_roll_CSC_max_wg_ME11_odd_ =
load(rollToMaxWgME11Files_[1]);
115 auto CSC_slope_cosi_2to1_L1_ME11a_even_ =
load(gemCscSlopeCosiFiles_[0]);
116 auto CSC_slope_cosi_2to1_L1_ME11a_odd_ =
load(gemCscSlopeCosiFiles_[1]);
117 auto CSC_slope_cosi_3to1_L1_ME11a_even_ =
load(gemCscSlopeCosiFiles_[2]);
118 auto CSC_slope_cosi_3to1_L1_ME11a_odd_ =
load(gemCscSlopeCosiFiles_[3]);
120 auto CSC_slope_cosi_2to1_L1_ME11b_even_ =
load(gemCscSlopeCosiFiles_[4]);
121 auto CSC_slope_cosi_2to1_L1_ME11b_odd_ =
load(gemCscSlopeCosiFiles_[5]);
122 auto CSC_slope_cosi_3to1_L1_ME11b_even_ =
load(gemCscSlopeCosiFiles_[6]);
123 auto CSC_slope_cosi_3to1_L1_ME11b_odd_ =
load(gemCscSlopeCosiFiles_[7]);
125 auto CSC_slope_cosi_corr_L1_ME11a_even_ =
load(gemCscSlopeCosiCorrectionFiles_[0]);
126 auto CSC_slope_cosi_corr_L1_ME11b_even_ =
load(gemCscSlopeCosiCorrectionFiles_[1]);
127 auto CSC_slope_cosi_corr_L1_ME11a_odd_ =
load(gemCscSlopeCosiCorrectionFiles_[3]);
128 auto CSC_slope_cosi_corr_L1_ME11b_odd_ =
load(gemCscSlopeCosiCorrectionFiles_[4]);
130 auto CSC_slope_corr_L1_ME11a_even_ =
load(gemCscSlopeCorrectionFiles_[0]);
131 auto CSC_slope_corr_L1_ME11b_even_ =
load(gemCscSlopeCorrectionFiles_[1]);
132 auto CSC_slope_corr_L1_ME11a_odd_ =
load(gemCscSlopeCorrectionFiles_[3]);
133 auto CSC_slope_corr_L1_ME11b_odd_ =
load(gemCscSlopeCorrectionFiles_[4]);
134 auto CSC_slope_corr_L2_ME11a_even_ =
load(gemCscSlopeCorrectionFiles_[6]);
135 auto CSC_slope_corr_L2_ME11b_even_ =
load(gemCscSlopeCorrectionFiles_[7]);
136 auto CSC_slope_corr_L2_ME11a_odd_ =
load(gemCscSlopeCorrectionFiles_[9]);
137 auto CSC_slope_corr_L2_ME11b_odd_ =
load(gemCscSlopeCorrectionFiles_[10]);
139 auto es_diff_slope_L1_ME11a_even_ =
load(esDiffToSlopeME11aFiles_[0]);
140 auto es_diff_slope_L1_ME11a_odd_ =
load(esDiffToSlopeME11aFiles_[1]);
141 auto es_diff_slope_L2_ME11a_even_ =
load(esDiffToSlopeME11aFiles_[2]);
142 auto es_diff_slope_L2_ME11a_odd_ =
load(esDiffToSlopeME11aFiles_[3]);
144 auto es_diff_slope_L1_ME11b_even_ =
load(esDiffToSlopeME11bFiles_[0]);
145 auto es_diff_slope_L1_ME11b_odd_ =
load(esDiffToSlopeME11bFiles_[1]);
146 auto es_diff_slope_L2_ME11b_even_ =
load(esDiffToSlopeME11bFiles_[2]);
147 auto es_diff_slope_L2_ME11b_odd_ =
load(esDiffToSlopeME11bFiles_[3]);
150 lut->set_GEM_pad_CSC_es_ME11b_even(
std::move(GEM_pad_CSC_es_ME11b_even_));
151 lut->set_GEM_pad_CSC_es_ME11a_even(
std::move(GEM_pad_CSC_es_ME11a_even_));
152 lut->set_GEM_pad_CSC_es_ME11b_odd(
std::move(GEM_pad_CSC_es_ME11b_odd_));
153 lut->set_GEM_pad_CSC_es_ME11a_odd(
std::move(GEM_pad_CSC_es_ME11a_odd_));
155 lut->set_GEM_roll_CSC_min_wg_ME11_even(
std::move(GEM_roll_CSC_min_wg_ME11_even_));
156 lut->set_GEM_roll_CSC_min_wg_ME11_odd(
std::move(GEM_roll_CSC_min_wg_ME11_odd_));
157 lut->set_GEM_roll_CSC_max_wg_ME11_even(
std::move(GEM_roll_CSC_max_wg_ME11_even_));
158 lut->set_GEM_roll_CSC_max_wg_ME11_odd(
std::move(GEM_roll_CSC_max_wg_ME11_odd_));
161 lut->set_CSC_slope_cosi_2to1_L1_ME11a_even(
std::move(CSC_slope_cosi_2to1_L1_ME11a_even_));
162 lut->set_CSC_slope_cosi_2to1_L1_ME11a_odd(
std::move(CSC_slope_cosi_2to1_L1_ME11a_odd_));
163 lut->set_CSC_slope_cosi_3to1_L1_ME11a_even(
std::move(CSC_slope_cosi_3to1_L1_ME11a_even_));
164 lut->set_CSC_slope_cosi_3to1_L1_ME11a_odd(
std::move(CSC_slope_cosi_3to1_L1_ME11a_odd_));
166 lut->set_CSC_slope_cosi_2to1_L1_ME11b_even(
std::move(CSC_slope_cosi_2to1_L1_ME11b_even_));
167 lut->set_CSC_slope_cosi_2to1_L1_ME11b_odd(
std::move(CSC_slope_cosi_2to1_L1_ME11b_odd_));
168 lut->set_CSC_slope_cosi_3to1_L1_ME11b_even(
std::move(CSC_slope_cosi_3to1_L1_ME11b_even_));
169 lut->set_CSC_slope_cosi_3to1_L1_ME11b_odd(
std::move(CSC_slope_cosi_3to1_L1_ME11b_odd_));
171 lut->set_CSC_slope_corr_L1_ME11a_even(
std::move(CSC_slope_corr_L1_ME11a_even_));
172 lut->set_CSC_slope_corr_L1_ME11a_odd(
std::move(CSC_slope_corr_L1_ME11a_odd_));
173 lut->set_CSC_slope_corr_L1_ME11b_even(
std::move(CSC_slope_corr_L1_ME11b_even_));
174 lut->set_CSC_slope_corr_L1_ME11b_odd(
std::move(CSC_slope_corr_L1_ME11b_odd_));
175 lut->set_CSC_slope_corr_L2_ME11a_even(
std::move(CSC_slope_corr_L2_ME11a_even_));
176 lut->set_CSC_slope_corr_L2_ME11a_odd(
std::move(CSC_slope_corr_L2_ME11a_odd_));
177 lut->set_CSC_slope_corr_L2_ME11b_even(
std::move(CSC_slope_corr_L2_ME11b_even_));
178 lut->set_CSC_slope_corr_L2_ME11b_odd(
std::move(CSC_slope_corr_L2_ME11b_odd_));
181 lut->set_es_diff_slope_L1_ME11a_even(
std::move(es_diff_slope_L1_ME11a_even_));
182 lut->set_es_diff_slope_L1_ME11a_odd(
std::move(es_diff_slope_L1_ME11a_odd_));
183 lut->set_es_diff_slope_L2_ME11a_even(
std::move(es_diff_slope_L2_ME11a_even_));
184 lut->set_es_diff_slope_L2_ME11a_odd(
std::move(es_diff_slope_L2_ME11a_odd_));
186 lut->set_es_diff_slope_L1_ME11b_even(
std::move(es_diff_slope_L1_ME11b_even_));
187 lut->set_es_diff_slope_L1_ME11b_odd(
std::move(es_diff_slope_L1_ME11b_odd_));
188 lut->set_es_diff_slope_L2_ME11b_even(
std::move(es_diff_slope_L2_ME11b_even_));
189 lut->set_es_diff_slope_L2_ME11b_odd(
std::move(es_diff_slope_L2_ME11b_odd_));
196 std::unique_ptr<CSCL1TPLookupTableME21ILT> lut = std::make_unique<CSCL1TPLookupTableME21ILT>();
199 std::vector<std::string> padToEsME21Files_ =
pset_.
getParameter<std::vector<std::string>>(
"padToEsME21Files");
201 std::vector<std::string> rollToMaxWgME21Files_ =
pset_.
getParameter<std::vector<std::string>>(
"rollToMaxWgME21Files");
202 std::vector<std::string> rollToMinWgME21Files_ =
pset_.
getParameter<std::vector<std::string>>(
"rollToMinWgME21Files");
204 std::vector<std::string> gemCscSlopeCosiFiles_ =
pset_.
getParameter<std::vector<std::string>>(
"gemCscSlopeCosiFiles");
205 std::vector<std::string> gemCscSlopeCosiCorrectionFiles_ =
207 std::vector<std::string> gemCscSlopeCorrectionFiles_ =
210 std::vector<std::string> esDiffToSlopeME21Files_ =
214 auto GEM_pad_CSC_es_ME21_even_ =
load(padToEsME21Files_[0]);
215 auto GEM_pad_CSC_es_ME21_odd_ =
load(padToEsME21Files_[1]);
217 auto GEM_roll_L1_CSC_min_wg_ME21_even_ =
load(rollToMinWgME21Files_[0]);
218 auto GEM_roll_L1_CSC_min_wg_ME21_odd_ =
load(rollToMinWgME21Files_[1]);
219 auto GEM_roll_L2_CSC_min_wg_ME21_even_ =
load(rollToMinWgME21Files_[2]);
220 auto GEM_roll_L2_CSC_min_wg_ME21_odd_ =
load(rollToMinWgME21Files_[3]);
222 auto GEM_roll_L1_CSC_max_wg_ME21_even_ =
load(rollToMaxWgME21Files_[0]);
223 auto GEM_roll_L1_CSC_max_wg_ME21_odd_ =
load(rollToMaxWgME21Files_[1]);
224 auto GEM_roll_L2_CSC_max_wg_ME21_even_ =
load(rollToMaxWgME21Files_[2]);
225 auto GEM_roll_L2_CSC_max_wg_ME21_odd_ =
load(rollToMaxWgME21Files_[3]);
227 auto es_diff_slope_L1_ME21_even_ =
load(esDiffToSlopeME21Files_[0]);
228 auto es_diff_slope_L1_ME21_odd_ =
load(esDiffToSlopeME21Files_[1]);
229 auto es_diff_slope_L2_ME21_even_ =
load(esDiffToSlopeME21Files_[2]);
230 auto es_diff_slope_L2_ME21_odd_ =
load(esDiffToSlopeME21Files_[3]);
232 auto CSC_slope_cosi_2to1_L1_ME21_even_ =
load(gemCscSlopeCosiFiles_[8]);
233 auto CSC_slope_cosi_2to1_L1_ME21_odd_ =
load(gemCscSlopeCosiFiles_[9]);
234 auto CSC_slope_cosi_3to1_L1_ME21_even_ =
load(gemCscSlopeCosiFiles_[10]);
235 auto CSC_slope_cosi_3to1_L1_ME21_odd_ =
load(gemCscSlopeCosiFiles_[11]);
237 auto CSC_slope_cosi_corr_L1_ME21_even_ =
load(gemCscSlopeCosiCorrectionFiles_[2]);
238 auto CSC_slope_cosi_corr_L1_ME21_odd_ =
load(gemCscSlopeCosiCorrectionFiles_[5]);
240 auto CSC_slope_corr_L1_ME21_even_ =
load(gemCscSlopeCorrectionFiles_[2]);
241 auto CSC_slope_corr_L1_ME21_odd_ =
load(gemCscSlopeCorrectionFiles_[5]);
242 auto CSC_slope_corr_L2_ME21_even_ =
load(gemCscSlopeCorrectionFiles_[8]);
243 auto CSC_slope_corr_L2_ME21_odd_ =
load(gemCscSlopeCorrectionFiles_[11]);
246 lut->set_GEM_pad_CSC_es_ME21_even(
std::move(GEM_pad_CSC_es_ME21_even_));
247 lut->set_GEM_pad_CSC_es_ME21_odd(
std::move(GEM_pad_CSC_es_ME21_odd_));
249 lut->set_GEM_roll_L1_CSC_min_wg_ME21_even(
std::move(GEM_roll_L1_CSC_min_wg_ME21_even_));
250 lut->set_GEM_roll_L1_CSC_max_wg_ME21_even(
std::move(GEM_roll_L1_CSC_max_wg_ME21_even_));
251 lut->set_GEM_roll_L1_CSC_min_wg_ME21_odd(
std::move(GEM_roll_L1_CSC_min_wg_ME21_odd_));
252 lut->set_GEM_roll_L1_CSC_max_wg_ME21_odd(
std::move(GEM_roll_L1_CSC_max_wg_ME21_odd_));
254 lut->set_GEM_roll_L2_CSC_min_wg_ME21_even(
std::move(GEM_roll_L2_CSC_min_wg_ME21_even_));
255 lut->set_GEM_roll_L2_CSC_max_wg_ME21_even(
std::move(GEM_roll_L2_CSC_max_wg_ME21_even_));
256 lut->set_GEM_roll_L2_CSC_min_wg_ME21_odd(
std::move(GEM_roll_L2_CSC_min_wg_ME21_odd_));
257 lut->set_GEM_roll_L2_CSC_max_wg_ME21_odd(
std::move(GEM_roll_L2_CSC_max_wg_ME21_odd_));
259 lut->set_es_diff_slope_L1_ME21_even(
std::move(es_diff_slope_L1_ME21_even_));
260 lut->set_es_diff_slope_L1_ME21_odd(
std::move(es_diff_slope_L1_ME21_odd_));
261 lut->set_es_diff_slope_L2_ME21_even(
std::move(es_diff_slope_L2_ME21_even_));
262 lut->set_es_diff_slope_L2_ME21_odd(
std::move(es_diff_slope_L2_ME21_odd_));
264 lut->set_CSC_slope_cosi_2to1_L1_ME21_even(
std::move(CSC_slope_cosi_2to1_L1_ME21_even_));
265 lut->set_CSC_slope_cosi_2to1_L1_ME21_odd(
std::move(CSC_slope_cosi_2to1_L1_ME21_odd_));
266 lut->set_CSC_slope_cosi_3to1_L1_ME21_even(
std::move(CSC_slope_cosi_3to1_L1_ME21_even_));
267 lut->set_CSC_slope_cosi_3to1_L1_ME21_odd(
std::move(CSC_slope_cosi_3to1_L1_ME21_odd_));
269 lut->set_CSC_slope_corr_L1_ME21_even(
std::move(CSC_slope_corr_L1_ME21_even_));
270 lut->set_CSC_slope_corr_L1_ME21_odd(
std::move(CSC_slope_corr_L1_ME21_odd_));
271 lut->set_CSC_slope_corr_L2_ME21_even(
std::move(CSC_slope_corr_L2_ME21_even_));
272 lut->set_CSC_slope_corr_L2_ME21_odd(
std::move(CSC_slope_corr_L2_ME21_odd_));
278 std::vector<unsigned> returnV;
279 std::ifstream fstream;
282 if (!fstream.good()) {
289 while (std::getline(fstream,
line)) {
292 std::istringstream lineStream(
line);
293 std::pair<unsigned, unsigned>
entry;
294 while (lineStream >>
entry.first >>
entry.second) {
295 returnV.push_back(
entry.second);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
T getParameter(std::string const &) const
static const IOVSyncValue & endOfTime()
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const edm::ParameterSet pset_
std::unique_ptr< CSCL1TPLookupTableCCLUT > produceCCLUT(const CSCL1TPLookupTableCCLUTRcd &)
static const IOVSyncValue & beginOfTime()
std::unique_ptr< CSCL1TPLookupTableME21ILT > produceME21ILT(const CSCL1TPLookupTableME21ILTRcd &)
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
~CSCL1TPLookupTableEP() override
CSCL1TPLookupTableEP(const edm::ParameterSet &)
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
std::vector< unsigned > load(std::string fileName) const
std::unique_ptr< CSCL1TPLookupTableME11ILT > produceME11ILT(const CSCL1TPLookupTableME11ILTRcd &)