8 int old_chamber_id,old_strip,new_chamber_id,new_strip;
9 float old_elm33,old_elm34, old_elm44, old_elm35, old_elm45, old_elm55;
10 float old_elm46, old_elm56, old_elm66, old_elm57, old_elm67, old_elm77;
11 std::vector<int> old_cham_id;
12 std::vector<int> old_strips;
13 std::vector<float> old_elem33;
14 std::vector<float> old_elem34;
15 std::vector<float> old_elem44;
16 std::vector<float> old_elem45;
17 std::vector<float> old_elem35;
18 std::vector<float> old_elem55;
19 std::vector<float> old_elem46;
20 std::vector<float> old_elem56;
21 std::vector<float> old_elem66;
22 std::vector<float> old_elem57;
23 std::vector<float> old_elem67;
24 std::vector<float> old_elem77;
27 float new_elm33,new_elm34, new_elm44, new_elm35, new_elm45, new_elm55;
28 float new_elm46, new_elm56, new_elm66, new_elm57, new_elm67, new_elm77;
29 std::vector<int> new_cham_id;
30 std::vector<int> new_strips;
31 std::vector<float> new_elem33;
32 std::vector<float> new_elem34;
33 std::vector<float> new_elem44;
34 std::vector<float> new_elem45;
35 std::vector<float> new_elem35;
36 std::vector<float> new_elem55;
37 std::vector<float> new_elem46;
38 std::vector<float> new_elem56;
39 std::vector<float> new_elem66;
40 std::vector<float> new_elem57;
41 std::vector<float> new_elem67;
42 std::vector<float> new_elem77;
47 int max_istrip,id_layer,max_ring,max_cham;
48 unsigned int old_nrlines=0;
49 unsigned int new_nrlines=0;
51 std::ifstream olddata;
54 std::cerr <<
"Error: old_matrix.dat -> no such file!"<< std::endl;
58 while (!olddata.eof() ) {
59 olddata >> old_chamber_id >> old_strip >> old_elm33 >> old_elm34 >> old_elm44 >> old_elm35 >> old_elm45 >> old_elm55 >> old_elm46 >> old_elm56 >> old_elm66 >> old_elm57 >> old_elm67 >> old_elm77;
60 old_cham_id.push_back(old_chamber_id);
61 old_strips.push_back(old_strip);
62 old_elem33.push_back(old_elm33);
63 old_elem34.push_back(old_elm34);
64 old_elem44.push_back(old_elm44);
65 old_elem35.push_back(old_elm35);
66 old_elem45.push_back(old_elm45);
67 old_elem55.push_back(old_elm55);
68 old_elem46.push_back(old_elm46);
69 old_elem56.push_back(old_elm56);
70 old_elem66.push_back(old_elm66);
71 old_elem57.push_back(old_elm57);
72 old_elem67.push_back(old_elm67);
73 old_elem77.push_back(old_elm77);
79 std::ifstream newdata;
82 std::cerr <<
"Error: new_matrix.txt -> no such file!"<< std::endl;
86 while (!newdata.eof() ) {
87 newdata >> new_chamber_id >> new_strip >> new_elm33 >> new_elm34 >> new_elm44 >> new_elm35 >> new_elm45 >> new_elm55 >> new_elm46 >> new_elm56 >> new_elm66 >> new_elm57 >> new_elm67 >> new_elm77 ;
88 new_cham_id.push_back(new_chamber_id);
89 new_strips.push_back(new_strip);
90 new_elem33.push_back(new_elm33);
91 new_elem34.push_back(new_elm34);
92 new_elem44.push_back(new_elm44);
93 new_elem35.push_back(new_elm35);
94 new_elem45.push_back(new_elm45);
95 new_elem55.push_back(new_elm55);
96 new_elem46.push_back(new_elm46);
97 new_elem56.push_back(new_elm56);
98 new_elem66.push_back(new_elm66);
99 new_elem57.push_back(new_elm57);
100 new_elem67.push_back(new_elm67);
101 new_elem77.push_back(new_elm77);
115 if(istation==1) max_ring=3;
116 if(istation==2) max_ring=2;
117 if(istation==3) max_ring=2;
118 if(istation==4) max_ring=1;
120 for(
int iring=detId.
minRingId(); iring<=max_ring; iring++){
123 if(istation==1 && iring==1) max_cham=36;
124 if(istation==1 && iring==2) max_cham=36;
125 if(istation==1 && iring==3) max_cham=36;
126 if(istation==2 && iring==1) max_cham=18;
127 if(istation==2 && iring==2) max_cham=36;
128 if(istation==3 && iring==1) max_cham=18;
129 if(istation==3 && iring==2) max_cham=36;
130 if(istation==4 && iring==1) max_cham=18;
132 for(
int ichamber=detId.
minChamberId(); ichamber<=max_cham; ichamber++){
135 if(istation==1 && iring==3) max_istrip=64;
137 std::vector<CSCNoiseMatrix::Item> itemvector;
138 itemvector.resize(max_istrip);
139 id_layer = 100000*iendcap + 10000*istation + 1000*iring + 10*ichamber + ilayer;
141 for(
int istrip=0;istrip<max_istrip;istrip++){
143 if(istation==1 && iring==1){
144 itemvector[istrip].elem33 = 7.86675;
145 itemvector[istrip].elem34 = 2.07075;
146 itemvector[istrip].elem44 = 6.93875;
147 itemvector[istrip].elem35 = 1.42525;
148 itemvector[istrip].elem45 = 2.51025;
149 itemvector[istrip].elem55 = 7.93975;
150 itemvector[istrip].elem46 = 0.94725;
151 itemvector[istrip].elem56 = 2.39275;
152 itemvector[istrip].elem66 = 6.46475;
153 itemvector[istrip].elem57 = 1.86325;
154 itemvector[istrip].elem67 = 2.08025;
155 itemvector[istrip].elem77 = 6.67975;
156 cnmatrix->
matrix[id_layer]=itemvector;
159 if(istation==1 && iring==2){
160 itemvector[istrip].elem33 = 9.118;
161 itemvector[istrip].elem34 = 3.884;
162 itemvector[istrip].elem44 = 7.771;
163 itemvector[istrip].elem35 = 1.8225;
164 itemvector[istrip].elem45 = 3.7505;
165 itemvector[istrip].elem55 = 8.597;
166 itemvector[istrip].elem46 = 1.651;
167 itemvector[istrip].elem56 = 2.5225;
168 itemvector[istrip].elem66 = 6.583;
169 itemvector[istrip].elem57 = 1.5055;
170 itemvector[istrip].elem67 = 2.733;
171 itemvector[istrip].elem77 = 6.988;
172 cnmatrix->
matrix[id_layer]=itemvector;
175 if(istation==1 && iring==3){
176 itemvector[istrip].elem33 = 9.5245;
177 itemvector[istrip].elem34 = 3.2415;
178 itemvector[istrip].elem44 = 7.6265;
179 itemvector[istrip].elem35 = 1.7225;
180 itemvector[istrip].elem45 = 3.6075;
181 itemvector[istrip].elem55 = 8.7275;
182 itemvector[istrip].elem46 = 1.663;
183 itemvector[istrip].elem56 = 2.592;
184 itemvector[istrip].elem66 = 7.5685;
185 itemvector[istrip].elem57 = 1.7905;
186 itemvector[istrip].elem67 = 2.409;
187 itemvector[istrip].elem77 = 7.1495;
188 cnmatrix->
matrix[id_layer]=itemvector;
191 if(istation==2 && iring==1){
192 itemvector[istrip].elem33 = 9.06825;
193 itemvector[istrip].elem34 = 3.32025;
194 itemvector[istrip].elem44 = 7.52925;
195 itemvector[istrip].elem35 = 3.66125;
196 itemvector[istrip].elem45 = 3.39125;
197 itemvector[istrip].elem55 = 9.97625;
198 itemvector[istrip].elem46 = 1.32725;
199 itemvector[istrip].elem56 = 3.99025;
200 itemvector[istrip].elem66 = 8.10125;
201 itemvector[istrip].elem57 = 2.56456;
202 itemvector[istrip].elem67 = 2.96625;
203 itemvector[istrip].elem77 = 7.30925;
204 cnmatrix->
matrix[id_layer]=itemvector;
207 if(istation==2 &&iring==2){
208 itemvector[istrip].elem33 = 16.7442;
209 itemvector[istrip].elem34 = 7.96925;
210 itemvector[istrip].elem44 = 14.1643;
211 itemvector[istrip].elem35 = 4.67975;
212 itemvector[istrip].elem45 = 8.44075;
213 itemvector[istrip].elem55 = 17.2243;
214 itemvector[istrip].elem46 = 3.68575;
215 itemvector[istrip].elem56 = 7.48825;
216 itemvector[istrip].elem66 = 14.4902;
217 itemvector[istrip].elem57 = 4.4482;
218 itemvector[istrip].elem67 = 6.47875;
219 itemvector[istrip].elem77 = 14.6733;
220 cnmatrix->
matrix[id_layer]=itemvector;
223 if(istation==3 && iring==1){
224 itemvector[istrip].elem33 = 9.3495;
225 itemvector[istrip].elem34 = 3.529;
226 itemvector[istrip].elem44 = 7.8715;
227 itemvector[istrip].elem35 = 3.8155;
228 itemvector[istrip].elem45 = 3.858;
229 itemvector[istrip].elem55 = 10.8205;
230 itemvector[istrip].elem46 = 1.8585;
231 itemvector[istrip].elem56 = 4.445;
232 itemvector[istrip].elem66 = 8.0175;
233 itemvector[istrip].elem57 = 3.29479;
234 itemvector[istrip].elem67 = 3.625;
235 itemvector[istrip].elem77 = 8.3895;
236 cnmatrix->
matrix[id_layer]=itemvector;
239 if(istation==3 && iring==2){
240 itemvector[istrip].elem33 = 13.6193;
241 itemvector[istrip].elem34 = 5.91025;
242 itemvector[istrip].elem44 = 11.3842;
243 itemvector[istrip].elem35 = 3.31775;
244 itemvector[istrip].elem45 = 5.69775;
245 itemvector[istrip].elem55 = 11.6652;
246 itemvector[istrip].elem46 = 2.46175;
247 itemvector[istrip].elem56 = 4.48325;
248 itemvector[istrip].elem66 = 9.95725;
249 itemvector[istrip].elem57 = 2.10561;
250 itemvector[istrip].elem67 = 4.04625;
251 itemvector[istrip].elem77 = 9.51625;
252 cnmatrix->
matrix[id_layer]=itemvector;
255 if(istation==4 && iring==1){
256 itemvector[istrip].elem33 = 10.0;
257 itemvector[istrip].elem34 = 4.0;
258 itemvector[istrip].elem44 = 10.0;
259 itemvector[istrip].elem35 = 3.0;
260 itemvector[istrip].elem45 = 8.0;
261 itemvector[istrip].elem55 = 10.0;
262 itemvector[istrip].elem46 = 2.0;
263 itemvector[istrip].elem56 = 5.0;
264 itemvector[istrip].elem66 = 10.0;
265 itemvector[istrip].elem57 = 3.0;
266 itemvector[istrip].elem67 = 4.0;
267 itemvector[istrip].elem77 = 10.0;
268 cnmatrix->
matrix[id_layer]=itemvector;
279 std::vector<CSCNoiseMatrix::Item> itemvector;
280 itemvector.resize(80);
282 for(
unsigned int mystrip=0; mystrip<old_nrlines-1; mystrip++){
283 if(old_strips[mystrip]==0) istrip = 0;
284 itemvector[istrip].elem33 = old_elem33[mystrip];
285 itemvector[istrip].elem34 = old_elem34[mystrip];
286 itemvector[istrip].elem44 = old_elem44[mystrip];
287 itemvector[istrip].elem35 = old_elem35[mystrip];
288 itemvector[istrip].elem45 = old_elem45[mystrip];
289 itemvector[istrip].elem55 = old_elem55[mystrip];
290 itemvector[istrip].elem46 = old_elem46[mystrip];
291 itemvector[istrip].elem56 = old_elem56[mystrip];
292 itemvector[istrip].elem66 = old_elem66[mystrip];
293 itemvector[istrip].elem57 = old_elem57[mystrip];
294 itemvector[istrip].elem67 = old_elem67[mystrip];
295 itemvector[istrip].elem77 = old_elem77[mystrip];
296 cnmatrix->
matrix[old_cham_id[mystrip]]=itemvector;
301 itemvector.resize(64);
302 for(
unsigned int mystrip=0; mystrip<old_nrlines-1; mystrip++){
303 if(old_strips[mystrip]==0) istrip = 0;
304 if(old_cham_id[mystrip] >= 113000 && old_cham_id[mystrip] <= 113999){
305 itemvector[istrip].elem33 = old_elem33[mystrip];
306 itemvector[istrip].elem34 = old_elem34[mystrip];
307 itemvector[istrip].elem44 = old_elem44[mystrip];
308 itemvector[istrip].elem35 = old_elem35[mystrip];
309 itemvector[istrip].elem45 = old_elem45[mystrip];
310 itemvector[istrip].elem55 = old_elem55[mystrip];
311 itemvector[istrip].elem46 = old_elem46[mystrip];
312 itemvector[istrip].elem56 = old_elem56[mystrip];
313 itemvector[istrip].elem66 = old_elem66[mystrip];
314 itemvector[istrip].elem57 = old_elem57[mystrip];
315 itemvector[istrip].elem67 = old_elem67[mystrip];
316 itemvector[istrip].elem77 = old_elem77[mystrip];
317 cnmatrix->
matrix[old_cham_id[mystrip]]=itemvector;
322 itemvector.resize(64);
323 for(
unsigned int mystrip=0; mystrip<old_nrlines-1; mystrip++){
324 if(old_strips[mystrip]==0) istrip = 0;
325 if(old_cham_id[mystrip] >= 213000 && old_cham_id[mystrip] <= 213999){
326 itemvector[istrip].elem33 = old_elem33[mystrip];
327 itemvector[istrip].elem34 = old_elem34[mystrip];
328 itemvector[istrip].elem44 = old_elem44[mystrip];
329 itemvector[istrip].elem35 = old_elem35[mystrip];
330 itemvector[istrip].elem45 = old_elem45[mystrip];
331 itemvector[istrip].elem55 = old_elem55[mystrip];
332 itemvector[istrip].elem46 = old_elem46[mystrip];
333 itemvector[istrip].elem56 = old_elem56[mystrip];
334 itemvector[istrip].elem66 = old_elem66[mystrip];
335 itemvector[istrip].elem57 = old_elem57[mystrip];
336 itemvector[istrip].elem67 = old_elem67[mystrip];
337 itemvector[istrip].elem77 = old_elem77[mystrip];
338 cnmatrix->
matrix[old_cham_id[mystrip]]=itemvector;
344 itemvector.resize(80);
345 for(
unsigned int mystrip=0; mystrip<new_nrlines-1; mystrip++){
346 if(new_strips[mystrip]==0) istrip = 0;
347 itemvector[istrip].elem33 = new_elem33[mystrip];
348 itemvector[istrip].elem34 = new_elem34[mystrip];
349 itemvector[istrip].elem44 = new_elem44[mystrip];
350 itemvector[istrip].elem35 = new_elem35[mystrip];
351 itemvector[istrip].elem45 = new_elem45[mystrip];
352 itemvector[istrip].elem55 = new_elem55[mystrip];
353 itemvector[istrip].elem46 = new_elem46[mystrip];
354 itemvector[istrip].elem56 = new_elem56[mystrip];
355 itemvector[istrip].elem66 = new_elem66[mystrip];
356 itemvector[istrip].elem57 = new_elem57[mystrip];
357 itemvector[istrip].elem67 = new_elem67[mystrip];
358 itemvector[istrip].elem77 = new_elem77[mystrip];
359 cnmatrix->
matrix[new_cham_id[mystrip]]=itemvector;
363 itemvector.resize(64);
364 for(
unsigned int mystrip=0; mystrip<new_nrlines-1; mystrip++){
365 if(new_strips[mystrip]==0) istrip = 0;
366 if(new_cham_id[mystrip] >= 113000 && new_cham_id[mystrip] <= 113999){
367 itemvector[istrip].elem33 = new_elem33[mystrip];
368 itemvector[istrip].elem34 = new_elem34[mystrip];
369 itemvector[istrip].elem44 = new_elem44[mystrip];
370 itemvector[istrip].elem35 = new_elem35[mystrip];
371 itemvector[istrip].elem45 = new_elem45[mystrip];
372 itemvector[istrip].elem55 = new_elem55[mystrip];
373 itemvector[istrip].elem46 = new_elem46[mystrip];
374 itemvector[istrip].elem56 = new_elem56[mystrip];
375 itemvector[istrip].elem66 = new_elem66[mystrip];
376 itemvector[istrip].elem57 = new_elem57[mystrip];
377 itemvector[istrip].elem67 = new_elem67[mystrip];
378 itemvector[istrip].elem77 = new_elem77[mystrip];
379 cnmatrix->
matrix[new_cham_id[mystrip]]=itemvector;
384 itemvector.resize(64);
385 for(
unsigned int mystrip=0; mystrip<new_nrlines-1; mystrip++){
386 if(new_strips[mystrip]==0) istrip = 0;
387 if(new_cham_id[mystrip] >= 213000 && new_cham_id[mystrip] <= 213999){
388 itemvector[istrip].elem33 = new_elem33[mystrip];
389 itemvector[istrip].elem34 = new_elem34[mystrip];
390 itemvector[istrip].elem44 = new_elem44[mystrip];
391 itemvector[istrip].elem35 = new_elem35[mystrip];
392 itemvector[istrip].elem45 = new_elem45[mystrip];
393 itemvector[istrip].elem55 = new_elem55[mystrip];
394 itemvector[istrip].elem46 = new_elem46[mystrip];
395 itemvector[istrip].elem56 = new_elem56[mystrip];
396 itemvector[istrip].elem66 = new_elem66[mystrip];
397 itemvector[istrip].elem57 = new_elem57[mystrip];
398 itemvector[istrip].elem67 = new_elem67[mystrip];
399 itemvector[istrip].elem77 = new_elem77[mystrip];
400 cnmatrix->
matrix[new_cham_id[mystrip]]=itemvector;
415 findingRecord<CSCNoiseMatrixRcd>();
static CSCNoiseMatrix * prefillNoiseMatrix()
CSCNoiseMatrix * cnMatrix
~CSCNoiseMatrixConditions() override
static const IOVSyncValue & endOfTime()
std::pair< Time_t, Time_t > ValidityInterval
static int maxStationId()
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
static int minChamberId()
static const IOVSyncValue & beginOfTime()
static int minStationId()
static int maxChamberId()
ReturnType produceNoiseMatrix(const CSCNoiseMatrixRcd &)
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
CSCNoiseMatrixConditions(const edm::ParameterSet &)