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> padToHsME1aFiles_ =
pset_.
getParameter<std::vector<std::string>>(
"padToHsME1aFiles");
88 std::vector<std::string> padToHsME1bFiles_ =
pset_.
getParameter<std::vector<std::string>>(
"padToHsME1bFiles");
90 std::vector<std::string> padToEsME1aFiles_ =
pset_.
getParameter<std::vector<std::string>>(
"padToEsME1aFiles");
91 std::vector<std::string> padToEsME1bFiles_ =
pset_.
getParameter<std::vector<std::string>>(
"padToEsME1bFiles");
93 std::vector<std::string> rollToMaxWgME11Files_ =
pset_.
getParameter<std::vector<std::string>>(
"rollToMaxWgME11Files");
94 std::vector<std::string> rollToMinWgME11Files_ =
pset_.
getParameter<std::vector<std::string>>(
"rollToMinWgME11Files");
96 std::vector<std::string> gemCscSlopeCosiFiles_ =
pset_.
getParameter<std::vector<std::string>>(
"gemCscSlopeCosiFiles");
97 std::vector<std::string> gemCscSlopeCosiCorrectionFiles_ =
99 std::vector<std::string> gemCscSlopeCorrectionFiles_ =
102 std::vector<std::string> esDiffToSlopeME1aFiles_ =
104 std::vector<std::string> esDiffToSlopeME1bFiles_ =
108 auto GEM_pad_CSC_hs_ME1a_even_ =
load(padToHsME1aFiles_[0]);
109 auto GEM_pad_CSC_hs_ME1a_odd_ =
load(padToHsME1aFiles_[1]);
110 auto GEM_pad_CSC_hs_ME1b_even_ =
load(padToHsME1bFiles_[0]);
111 auto GEM_pad_CSC_hs_ME1b_odd_ =
load(padToHsME1bFiles_[1]);
113 auto GEM_pad_CSC_es_ME1a_even_ =
load(padToEsME1aFiles_[0]);
114 auto GEM_pad_CSC_es_ME1a_odd_ =
load(padToEsME1aFiles_[1]);
115 auto GEM_pad_CSC_es_ME1b_even_ =
load(padToEsME1bFiles_[0]);
116 auto GEM_pad_CSC_es_ME1b_odd_ =
load(padToEsME1bFiles_[1]);
118 auto GEM_roll_L1_CSC_min_wg_ME11_even_ =
load(rollToMinWgME11Files_[0]);
119 auto GEM_roll_L1_CSC_min_wg_ME11_odd_ =
load(rollToMinWgME11Files_[1]);
120 auto GEM_roll_L2_CSC_min_wg_ME11_even_ =
load(rollToMinWgME11Files_[2]);
121 auto GEM_roll_L2_CSC_min_wg_ME11_odd_ =
load(rollToMinWgME11Files_[3]);
123 auto GEM_roll_L1_CSC_max_wg_ME11_even_ =
load(rollToMaxWgME11Files_[0]);
124 auto GEM_roll_L1_CSC_max_wg_ME11_odd_ =
load(rollToMaxWgME11Files_[1]);
125 auto GEM_roll_L2_CSC_max_wg_ME11_even_ =
load(rollToMaxWgME11Files_[2]);
126 auto GEM_roll_L2_CSC_max_wg_ME11_odd_ =
load(rollToMaxWgME11Files_[3]);
128 auto CSC_slope_cosi_2to1_L1_ME11_even_ =
load(gemCscSlopeCosiFiles_[0]);
129 auto CSC_slope_cosi_2to1_L1_ME11_odd_ =
load(gemCscSlopeCosiFiles_[1]);
130 auto CSC_slope_cosi_3to1_L1_ME11_even_ =
load(gemCscSlopeCosiFiles_[2]);
131 auto CSC_slope_cosi_3to1_L1_ME11_odd_ =
load(gemCscSlopeCosiFiles_[3]);
133 auto CSC_slope_cosi_corr_L1_ME11_even_ =
load(gemCscSlopeCosiCorrectionFiles_[0]);
134 auto CSC_slope_cosi_corr_L2_ME11_even_ =
load(gemCscSlopeCosiCorrectionFiles_[1]);
135 auto CSC_slope_cosi_corr_L1_ME11_odd_ =
load(gemCscSlopeCosiCorrectionFiles_[2]);
136 auto CSC_slope_cosi_corr_L2_ME11_odd_ =
load(gemCscSlopeCosiCorrectionFiles_[3]);
138 auto CSC_slope_corr_L1_ME11_even_ =
load(gemCscSlopeCorrectionFiles_[0]);
139 auto CSC_slope_corr_L2_ME11_even_ =
load(gemCscSlopeCorrectionFiles_[1]);
140 auto CSC_slope_corr_L1_ME11_odd_ =
load(gemCscSlopeCorrectionFiles_[2]);
141 auto CSC_slope_corr_L2_ME11_odd_ =
load(gemCscSlopeCorrectionFiles_[3]);
143 auto es_diff_slope_L1_ME1a_even_ =
load(esDiffToSlopeME1aFiles_[0]);
144 auto es_diff_slope_L1_ME1a_odd_ =
load(esDiffToSlopeME1aFiles_[1]);
145 auto es_diff_slope_L2_ME1a_even_ =
load(esDiffToSlopeME1aFiles_[2]);
146 auto es_diff_slope_L2_ME1a_odd_ =
load(esDiffToSlopeME1aFiles_[3]);
148 auto es_diff_slope_L1_ME1b_even_ =
load(esDiffToSlopeME1bFiles_[0]);
149 auto es_diff_slope_L1_ME1b_odd_ =
load(esDiffToSlopeME1bFiles_[1]);
150 auto es_diff_slope_L2_ME1b_even_ =
load(esDiffToSlopeME1bFiles_[2]);
151 auto es_diff_slope_L2_ME1b_odd_ =
load(esDiffToSlopeME1bFiles_[3]);
154 lut->set_GEM_pad_CSC_hs_ME1b_even(
std::move(GEM_pad_CSC_hs_ME1b_even_));
155 lut->set_GEM_pad_CSC_hs_ME1a_even(
std::move(GEM_pad_CSC_hs_ME1a_even_));
156 lut->set_GEM_pad_CSC_hs_ME1b_odd(
std::move(GEM_pad_CSC_hs_ME1b_odd_));
157 lut->set_GEM_pad_CSC_hs_ME1a_odd(
std::move(GEM_pad_CSC_hs_ME1a_odd_));
159 lut->set_GEM_pad_CSC_es_ME1b_even(
std::move(GEM_pad_CSC_es_ME1b_even_));
160 lut->set_GEM_pad_CSC_es_ME1a_even(
std::move(GEM_pad_CSC_es_ME1a_even_));
161 lut->set_GEM_pad_CSC_es_ME1b_odd(
std::move(GEM_pad_CSC_es_ME1b_odd_));
162 lut->set_GEM_pad_CSC_es_ME1a_odd(
std::move(GEM_pad_CSC_es_ME1a_odd_));
164 lut->set_GEM_roll_L1_CSC_min_wg_ME11_even(
std::move(GEM_roll_L1_CSC_min_wg_ME11_even_));
165 lut->set_GEM_roll_L1_CSC_max_wg_ME11_even(
std::move(GEM_roll_L1_CSC_max_wg_ME11_even_));
166 lut->set_GEM_roll_L1_CSC_min_wg_ME11_odd(
std::move(GEM_roll_L1_CSC_min_wg_ME11_odd_));
167 lut->set_GEM_roll_L1_CSC_max_wg_ME11_odd(
std::move(GEM_roll_L1_CSC_max_wg_ME11_odd_));
169 lut->set_GEM_roll_L2_CSC_min_wg_ME11_even(
std::move(GEM_roll_L2_CSC_min_wg_ME11_even_));
170 lut->set_GEM_roll_L2_CSC_max_wg_ME11_even(
std::move(GEM_roll_L2_CSC_max_wg_ME11_even_));
171 lut->set_GEM_roll_L2_CSC_min_wg_ME11_odd(
std::move(GEM_roll_L2_CSC_min_wg_ME11_odd_));
172 lut->set_GEM_roll_L2_CSC_max_wg_ME11_odd(
std::move(GEM_roll_L2_CSC_max_wg_ME11_odd_));
175 lut->set_CSC_slope_cosi_2to1_L1_ME11_even(
std::move(CSC_slope_cosi_2to1_L1_ME11_even_));
176 lut->set_CSC_slope_cosi_2to1_L1_ME11_odd(
std::move(CSC_slope_cosi_2to1_L1_ME11_odd_));
177 lut->set_CSC_slope_cosi_3to1_L1_ME11_even(
std::move(CSC_slope_cosi_3to1_L1_ME11_even_));
178 lut->set_CSC_slope_cosi_3to1_L1_ME11_odd(
std::move(CSC_slope_cosi_3to1_L1_ME11_odd_));
180 lut->set_CSC_slope_cosi_corr_L1_ME11_even(
std::move(CSC_slope_cosi_corr_L1_ME11_even_));
181 lut->set_CSC_slope_cosi_corr_L1_ME11_odd(
std::move(CSC_slope_cosi_corr_L1_ME11_odd_));
182 lut->set_CSC_slope_cosi_corr_L2_ME11_even(
std::move(CSC_slope_cosi_corr_L2_ME11_even_));
183 lut->set_CSC_slope_cosi_corr_L2_ME11_odd(
std::move(CSC_slope_cosi_corr_L2_ME11_odd_));
185 lut->set_CSC_slope_corr_L1_ME11_even(
std::move(CSC_slope_corr_L1_ME11_even_));
186 lut->set_CSC_slope_corr_L1_ME11_odd(
std::move(CSC_slope_corr_L1_ME11_odd_));
187 lut->set_CSC_slope_corr_L2_ME11_even(
std::move(CSC_slope_corr_L2_ME11_even_));
188 lut->set_CSC_slope_corr_L2_ME11_odd(
std::move(CSC_slope_corr_L2_ME11_odd_));
191 lut->set_es_diff_slope_L1_ME1a_even(
std::move(es_diff_slope_L1_ME1a_even_));
192 lut->set_es_diff_slope_L2_ME1a_even(
std::move(es_diff_slope_L2_ME1a_even_));
193 lut->set_es_diff_slope_L1_ME1a_odd(
std::move(es_diff_slope_L1_ME1a_odd_));
194 lut->set_es_diff_slope_L2_ME1a_odd(
std::move(es_diff_slope_L2_ME1a_odd_));
196 lut->set_es_diff_slope_L1_ME1b_even(
std::move(es_diff_slope_L1_ME1b_even_));
197 lut->set_es_diff_slope_L2_ME1b_even(
std::move(es_diff_slope_L2_ME1b_even_));
198 lut->set_es_diff_slope_L1_ME1b_odd(
std::move(es_diff_slope_L1_ME1b_odd_));
199 lut->set_es_diff_slope_L2_ME1b_odd(
std::move(es_diff_slope_L2_ME1b_odd_));
206 std::unique_ptr<CSCL1TPLookupTableME21ILT> lut = std::make_unique<CSCL1TPLookupTableME21ILT>();
209 std::vector<std::string> padToHsME21Files_ =
pset_.
getParameter<std::vector<std::string>>(
"padToHsME21Files");
210 std::vector<std::string> padToEsME21Files_ =
pset_.
getParameter<std::vector<std::string>>(
"padToEsME21Files");
212 std::vector<std::string> rollToMaxWgME21Files_ =
pset_.
getParameter<std::vector<std::string>>(
"rollToMaxWgME21Files");
213 std::vector<std::string> rollToMinWgME21Files_ =
pset_.
getParameter<std::vector<std::string>>(
"rollToMinWgME21Files");
215 std::vector<std::string> esDiffToSlopeME21Files_ =
219 auto GEM_pad_CSC_hs_ME21_even_ =
load(padToHsME21Files_[0]);
220 auto GEM_pad_CSC_hs_ME21_odd_ =
load(padToHsME21Files_[1]);
222 auto GEM_pad_CSC_es_ME21_even_ =
load(padToEsME21Files_[0]);
223 auto GEM_pad_CSC_es_ME21_odd_ =
load(padToEsME21Files_[1]);
225 auto GEM_roll_L1_CSC_min_wg_ME21_even_ =
load(rollToMinWgME21Files_[0]);
226 auto GEM_roll_L1_CSC_min_wg_ME21_odd_ =
load(rollToMinWgME21Files_[1]);
227 auto GEM_roll_L2_CSC_min_wg_ME21_even_ =
load(rollToMinWgME21Files_[2]);
228 auto GEM_roll_L2_CSC_min_wg_ME21_odd_ =
load(rollToMinWgME21Files_[3]);
230 auto GEM_roll_L1_CSC_max_wg_ME21_even_ =
load(rollToMaxWgME21Files_[0]);
231 auto GEM_roll_L1_CSC_max_wg_ME21_odd_ =
load(rollToMaxWgME21Files_[1]);
232 auto GEM_roll_L2_CSC_max_wg_ME21_even_ =
load(rollToMaxWgME21Files_[2]);
233 auto GEM_roll_L2_CSC_max_wg_ME21_odd_ =
load(rollToMaxWgME21Files_[3]);
235 auto es_diff_slope_L1_ME21_even_ =
load(esDiffToSlopeME21Files_[0]);
236 auto es_diff_slope_L1_ME21_odd_ =
load(esDiffToSlopeME21Files_[1]);
237 auto es_diff_slope_L2_ME21_even_ =
load(esDiffToSlopeME21Files_[2]);
238 auto es_diff_slope_L2_ME21_odd_ =
load(esDiffToSlopeME21Files_[3]);
241 lut->set_GEM_pad_CSC_hs_ME21_even(
std::move(GEM_pad_CSC_hs_ME21_even_));
242 lut->set_GEM_pad_CSC_hs_ME21_odd(
std::move(GEM_pad_CSC_hs_ME21_odd_));
244 lut->set_GEM_pad_CSC_es_ME21_even(
std::move(GEM_pad_CSC_es_ME21_even_));
245 lut->set_GEM_pad_CSC_es_ME21_odd(
std::move(GEM_pad_CSC_es_ME21_odd_));
247 lut->set_GEM_roll_L1_CSC_min_wg_ME21_even(
std::move(GEM_roll_L1_CSC_min_wg_ME21_even_));
248 lut->set_GEM_roll_L1_CSC_max_wg_ME21_even(
std::move(GEM_roll_L1_CSC_max_wg_ME21_even_));
249 lut->set_GEM_roll_L1_CSC_min_wg_ME21_odd(
std::move(GEM_roll_L1_CSC_min_wg_ME21_odd_));
250 lut->set_GEM_roll_L1_CSC_max_wg_ME21_odd(
std::move(GEM_roll_L1_CSC_max_wg_ME21_odd_));
252 lut->set_GEM_roll_L2_CSC_min_wg_ME21_even(
std::move(GEM_roll_L2_CSC_min_wg_ME21_even_));
253 lut->set_GEM_roll_L2_CSC_max_wg_ME21_even(
std::move(GEM_roll_L2_CSC_max_wg_ME21_even_));
254 lut->set_GEM_roll_L2_CSC_min_wg_ME21_odd(
std::move(GEM_roll_L2_CSC_min_wg_ME21_odd_));
255 lut->set_GEM_roll_L2_CSC_max_wg_ME21_odd(
std::move(GEM_roll_L2_CSC_max_wg_ME21_odd_));
257 lut->set_es_diff_slope_L1_ME21_even(
std::move(es_diff_slope_L1_ME21_even_));
258 lut->set_es_diff_slope_L2_ME21_even(
std::move(es_diff_slope_L2_ME21_even_));
259 lut->set_es_diff_slope_L1_ME21_odd(
std::move(es_diff_slope_L1_ME21_odd_));
260 lut->set_es_diff_slope_L2_ME21_odd(
std::move(es_diff_slope_L2_ME21_odd_));
266 std::vector<unsigned> returnV;
267 std::ifstream fstream;
270 if (!fstream.good()) {
277 while (std::getline(fstream, line)) {
279 line.erase(
std::find(line.begin(), line.end(),
'#'), line.end());
280 std::istringstream lineStream(line);
281 std::pair<unsigned, unsigned>
entry;
282 while (lineStream >> entry.first >> entry.second) {
283 returnV.push_back(entry.second);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
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)
T getParameter(std::string const &) const
std::unique_ptr< CSCL1TPLookupTableME11ILT > produceME11ILT(const CSCL1TPLookupTableME11ILTRcd &)
std::vector< unsigned > load(std::string fileName) const