24 LogDebug(
"L1MuCSCTFConfiguration") <<
"SP:" << int(sp) << std::endl;
34 bool run_core =
false;
35 bool trigger_on_ME1a =
false;
36 bool trigger_on_ME1b =
false;
37 bool trigger_on_ME2 =
false;
38 bool trigger_on_ME3 =
false;
39 bool trigger_on_ME4 =
false;
40 bool trigger_on_MB1a =
false;
41 bool trigger_on_MB1d =
false;
43 unsigned int BXAdepth = 0;
44 unsigned int useDT = 0;
45 unsigned int widePhi = 0;
46 unsigned int PreTrigger = 0;
52 unsigned int CoreLatency = 7;
53 bool rescaleSinglesPhi =
true;
56 bool AllowALCTonly =
false;
57 bool AllowCLCTonly =
false;
60 unsigned int QualityEnableME1a = 0xFFFF;
61 unsigned int QualityEnableME1b = 0xFFFF;
62 unsigned int QualityEnableME1c = 0xFFFF;
63 unsigned int QualityEnableME1d = 0xFFFF;
64 unsigned int QualityEnableME1e = 0xFFFF;
65 unsigned int QualityEnableME1f = 0xFFFF;
66 unsigned int QualityEnableME2a = 0xFFFF;
67 unsigned int QualityEnableME2b = 0xFFFF;
68 unsigned int QualityEnableME2c = 0xFFFF;
69 unsigned int QualityEnableME3a = 0xFFFF;
70 unsigned int QualityEnableME3b = 0xFFFF;
71 unsigned int QualityEnableME3c = 0xFFFF;
72 unsigned int QualityEnableME4a = 0xFFFF;
73 unsigned int QualityEnableME4b = 0xFFFF;
74 unsigned int QualityEnableME4c = 0xFFFF;
76 unsigned int kill_fiber = 0;
77 unsigned int singlesTrackOutput = 1;
83 std::vector<unsigned int> etamin(8), etamax(8), etawin(7);
85 unsigned int mindetap = 8;
86 unsigned int mindetap_halo = 8;
97 unsigned int mindeta12_accp = 8;
98 unsigned int mindeta13_accp = 19;
99 unsigned int mindeta112_accp = 19;
100 unsigned int mindeta113_accp = 30;
111 unsigned int maxdeta12_accp = 14;
112 unsigned int maxdeta13_accp = 25;
113 unsigned int maxdeta112_accp = 25;
114 unsigned int maxdeta113_accp = 36;
124 unsigned int maxdphi12_accp = 64;
125 unsigned int maxdphi13_accp = 64;
126 unsigned int maxdphi112_accp = 64;
127 unsigned int maxdphi113_accp = 64;
129 unsigned int mindphip = 128;
130 unsigned int mindphip_halo = 128;
132 unsigned int straightp = 60;
133 unsigned int curvedp = 200;
135 unsigned int mbaPhiOff = 0;
141 unsigned int mbbPhiOff = 0;
146 unsigned int firmwareSP = 20100210;
147 unsigned int firmwareFA = 20090521;
148 unsigned int firmwareDD = 20090521;
149 unsigned int firmwareVM = 20090521;
153 <<
"\nCORE CONFIGURATION DEFAULT VALUES"
154 <<
"\nrun_core=" << run_core <<
"\ntrigger_on_ME1a=" << trigger_on_ME1a <<
"\ntrigger_on_ME1b=" << trigger_on_ME1b
155 <<
"\ntrigger_on_ME2=" << trigger_on_ME2 <<
"\ntrigger_on_ME3=" << trigger_on_ME3
156 <<
"\ntrigger_on_ME4=" << trigger_on_ME4 <<
"\ntrigger_on_MB1a=" << trigger_on_MB1a
157 <<
"\ntrigger_on_MB1d=" << trigger_on_MB1d
159 <<
"\nBXAdepth=" << BXAdepth <<
"\nuseDT=" << useDT <<
"\nwidePhi=" << widePhi <<
"\nPreTrigger=" << PreTrigger
161 <<
"\nCoreLatency=" << CoreLatency <<
"\nrescaleSinglesPhi=" << rescaleSinglesPhi
163 <<
"\n\nVARIOUS CONFIGURATION PARAMETERS DEFAULT VALUES"
164 <<
"\nAllowALCTonly=" << AllowALCTonly <<
"\nAllowCLCTonly=" << AllowCLCTonly
166 <<
"\nQualityEnableME1a=" << QualityEnableME1a <<
"\nQualityEnableME1b=" << QualityEnableME1b
167 <<
"\nQualityEnableME1c=" << QualityEnableME1c <<
"\nQualityEnableME1d=" << QualityEnableME1d
168 <<
"\nQualityEnableME1e=" << QualityEnableME1e <<
"\nQualityEnableME1f=" << QualityEnableME1f
169 <<
"\nQualityEnableME2a=" << QualityEnableME2a <<
"\nQualityEnableME2b=" << QualityEnableME2b
170 <<
"\nQualityEnableME2c=" << QualityEnableME2c <<
"\nQualityEnableME3a=" << QualityEnableME3a
171 <<
"\nQualityEnableME3b=" << QualityEnableME3b <<
"\nQualityEnableME3c=" << QualityEnableME3c
172 <<
"\nQualityEnableME4a=" << QualityEnableME4a <<
"\nQualityEnableME4b=" << QualityEnableME4b
173 <<
"\nQualityEnableME4c=" << QualityEnableME4c
175 <<
"\nkill_fiber=" << kill_fiber <<
"\nsinglesTrackOutput=" << singlesTrackOutput
177 <<
"\n\nDEFAULT VALUES FOR DAT_ETA"
178 <<
"\nmindetap =" << mindetap <<
"\nmindetap_halo=" << mindetap_halo
180 <<
"\netamin[0]=" << etamin[0] <<
"\netamin[1]=" << etamin[1] <<
"\netamin[2]=" << etamin[2]
181 <<
"\netamin[3]=" << etamin[3] <<
"\netamin[4]=" << etamin[4] <<
"\netamin[5]=" << etamin[5]
182 <<
"\netamin[6]=" << etamin[6] <<
"\netamin[7]=" << etamin[7]
184 <<
"\nmindeta12_accp =" << mindeta12_accp <<
"\nmindeta13_accp =" << mindeta13_accp
185 <<
"\nmindeta112_accp=" << mindeta112_accp <<
"\nmindeta113_accp=" << mindeta113_accp
187 <<
"\netamax[0]=" << etamax[0] <<
"\netamax[1]=" << etamax[1] <<
"\netamax[2]=" << etamax[2]
188 <<
"\netamax[3]=" << etamax[3] <<
"\netamax[4]=" << etamax[4] <<
"\netamax[5]=" << etamax[5]
189 <<
"\netamax[6]=" << etamax[6] <<
"\netamax[7]=" << etamax[7]
191 <<
"\nmaxdeta12_accp =" << maxdeta12_accp <<
"\nmaxdeta13_accp =" << maxdeta13_accp
192 <<
"\nmaxdeta112_accp=" << maxdeta112_accp <<
"\nmaxdeta113_accp=" << maxdeta113_accp
194 <<
"\netawin[0]=" << etawin[0] <<
"\netawin[1]=" << etawin[1] <<
"\netawin[2]=" << etawin[2]
195 <<
"\netawin[3]=" << etawin[3] <<
"\netawin[4]=" << etawin[4] <<
"\netawin[5]=" << etawin[5]
196 <<
"\netawin[6]=" << etawin[6]
198 <<
"\nmaxdphi12_accp =" << maxdphi12_accp <<
"\nmaxdphi13_accp =" << maxdphi13_accp
199 <<
"\nmaxdphi112_accp=" << maxdphi112_accp <<
"\nmaxdphi113_accp=" << maxdphi113_accp
201 <<
"\nmindphip =" << mindphip <<
"\nmindphip_halo=" << mindphip_halo
203 <<
"\nstraightp=" << straightp <<
"\ncurvedp =" << curvedp <<
"\nmbaPhiOff=" << mbaPhiOff
204 <<
"\nmbbPhiOff=" << mbbPhiOff
206 <<
"\n\nFIRMWARE VERSIONS"
207 <<
"\nSP: " << firmwareSP <<
"\nFA: " << firmwareFA <<
"\nDD: " << firmwareDD <<
"\nVM: " << firmwareVM;
210 std::stringstream conf(iConfig[sp]);
211 while (!conf.eof()) {
213 conf.getline(buff, 1024);
214 std::stringstream
line(buff);
225 std::getline(line, comments_);
227 if (register_ ==
"CSR_REQ" && chip_ ==
"SP") {
228 unsigned int value = ::strtol(writeValue_.c_str(),
nullptr, 16);
229 run_core = (value & 0x8000);
230 trigger_on_ME1a = (value & 0x0001);
231 trigger_on_ME1b = (value & 0x0002);
232 trigger_on_ME2 = (value & 0x0004);
233 trigger_on_ME3 = (value & 0x0008);
234 trigger_on_ME4 = (value & 0x0010);
235 trigger_on_MB1a = (value & 0x0100);
236 trigger_on_MB1d = (value & 0x0200);
239 if (register_ ==
"CSR_SCC" && chip_ ==
"SP") {
240 unsigned int value = ::strtol(writeValue_.c_str(),
nullptr, 16);
242 BXAdepth = (value & 0x3);
243 useDT = ((value & 0x80) >> 7);
244 widePhi = ((value & 0x40) >> 6);
245 PreTrigger = ((value & 0x300) >> 8);
248 if (register_ ==
"CSR_LQE" && chip_ ==
"F1" && muon_ ==
"M1")
249 QualityEnableME1a = ::strtol(writeValue_.c_str(),
nullptr, 16);
250 if (register_ ==
"CSR_LQE" && chip_ ==
"F1" && muon_ ==
"M2")
251 QualityEnableME1b = ::strtol(writeValue_.c_str(),
nullptr, 16);
252 if (register_ ==
"CSR_LQE" && chip_ ==
"F1" && muon_ ==
"M3")
253 QualityEnableME1c = ::strtol(writeValue_.c_str(),
nullptr, 16);
254 if (register_ ==
"CSR_LQE" && chip_ ==
"F2" && muon_ ==
"M1")
255 QualityEnableME1d = ::strtol(writeValue_.c_str(),
nullptr, 16);
256 if (register_ ==
"CSR_LQE" && chip_ ==
"F2" && muon_ ==
"M2")
257 QualityEnableME1e = ::strtol(writeValue_.c_str(),
nullptr, 16);
258 if (register_ ==
"CSR_LQE" && chip_ ==
"F2" && muon_ ==
"M3")
259 QualityEnableME1f = ::strtol(writeValue_.c_str(),
nullptr, 16);
260 if (register_ ==
"CSR_LQE" && chip_ ==
"F3" && muon_ ==
"M1")
261 QualityEnableME2a = ::strtol(writeValue_.c_str(),
nullptr, 16);
262 if (register_ ==
"CSR_LQE" && chip_ ==
"F3" && muon_ ==
"M2")
263 QualityEnableME2b = ::strtol(writeValue_.c_str(),
nullptr, 16);
264 if (register_ ==
"CSR_LQE" && chip_ ==
"F3" && muon_ ==
"M3")
265 QualityEnableME2c = ::strtol(writeValue_.c_str(),
nullptr, 16);
266 if (register_ ==
"CSR_LQE" && chip_ ==
"F4" && muon_ ==
"M1")
267 QualityEnableME3a = ::strtol(writeValue_.c_str(),
nullptr, 16);
268 if (register_ ==
"CSR_LQE" && chip_ ==
"F4" && muon_ ==
"M2")
269 QualityEnableME3b = ::strtol(writeValue_.c_str(),
nullptr, 16);
270 if (register_ ==
"CSR_LQE" && chip_ ==
"F4" && muon_ ==
"M3")
271 QualityEnableME3c = ::strtol(writeValue_.c_str(),
nullptr, 16);
272 if (register_ ==
"CSR_LQE" && chip_ ==
"F5" && muon_ ==
"M1")
273 QualityEnableME4a = ::strtol(writeValue_.c_str(),
nullptr, 16);
274 if (register_ ==
"CSR_LQE" && chip_ ==
"F5" && muon_ ==
"M2")
275 QualityEnableME4b = ::strtol(writeValue_.c_str(),
nullptr, 16);
276 if (register_ ==
"CSR_LQE" && chip_ ==
"F5" && muon_ ==
"M3")
277 QualityEnableME4c = ::strtol(writeValue_.c_str(),
nullptr, 16);
279 if (register_ ==
"CSR_KFL")
280 kill_fiber = ::strtol(writeValue_.c_str(),
nullptr, 16);
282 if (register_ ==
"CSR_SFC" && chip_ ==
"SP") {
283 unsigned int value = ::strtol(writeValue_.c_str(),
nullptr, 16);
284 singlesTrackOutput = ((value & 0x3000) >> 12);
287 if (register_ ==
"CNT_ETA" && chip_ ==
"SP") {
288 unsigned int value = ::strtol(writeValue_.c_str(),
nullptr, 16);
293 if (register_ ==
"DAT_ETA" && chip_ ==
"SP") {
294 unsigned int value = ::strtol(writeValue_.c_str(),
nullptr, 16);
301 mindetap_halo =
value;
303 if (eta_cnt >= 2 && eta_cnt < 10)
304 etamin[eta_cnt - 2] =
value;
307 mindeta12_accp =
value;
309 mindeta13_accp =
value;
311 mindeta112_accp =
value;
313 mindeta113_accp =
value;
315 if (eta_cnt >= 14 && eta_cnt < 22)
316 etamax[eta_cnt - 14] =
value;
319 maxdeta12_accp =
value;
321 maxdeta13_accp =
value;
323 maxdeta112_accp =
value;
325 maxdeta113_accp =
value;
327 if (eta_cnt >= 26 && eta_cnt < 33)
328 etawin[eta_cnt - 26] =
value;
331 maxdphi12_accp =
value;
333 maxdphi13_accp =
value;
335 maxdphi112_accp =
value;
337 maxdphi113_accp =
value;
342 mindphip_halo =
value;
357 if (register_ ==
"FIRMWARE" && muon_ ==
"SP") {
358 unsigned int value = atoi(writeValue_.c_str());
363 if (register_ ==
"FIRMWARE" && muon_ ==
"FA") {
364 unsigned int value = atoi(writeValue_.c_str());
369 if (register_ ==
"FIRMWARE" && muon_ ==
"DD") {
370 unsigned int value = atoi(writeValue_.c_str());
375 if (register_ ==
"FIRMWARE" && muon_ ==
"VM") {
376 unsigned int value = atoi(writeValue_.c_str());
382 pset.
addParameter<
bool>(
"trigger_on_ME1a", trigger_on_ME1a);
383 pset.
addParameter<
bool>(
"trigger_on_ME1b", trigger_on_ME1b);
384 pset.
addParameter<
bool>(
"trigger_on_ME2", trigger_on_ME2);
385 pset.
addParameter<
bool>(
"trigger_on_ME3", trigger_on_ME3);
386 pset.
addParameter<
bool>(
"trigger_on_ME4", trigger_on_ME4);
387 pset.
addParameter<
bool>(
"trigger_on_MB1a", trigger_on_MB1a);
388 pset.
addParameter<
bool>(
"trigger_on_MB1d", trigger_on_MB1d);
393 pset.
addParameter<
unsigned int>(
"PreTrigger", PreTrigger);
397 pset.
addParameter<
bool>(
"AllowALCTonly", AllowALCTonly);
398 pset.
addParameter<
bool>(
"AllowCLCTonly", AllowCLCTonly);
401 pset.
addParameter<
bool>(
"rescaleSinglesPhi", rescaleSinglesPhi);
403 pset.
addParameter<
unsigned int>(
"QualityEnableME1a", QualityEnableME1a);
404 pset.
addParameter<
unsigned int>(
"QualityEnableME1b", QualityEnableME1b);
405 pset.
addParameter<
unsigned int>(
"QualityEnableME1c", QualityEnableME1c);
406 pset.
addParameter<
unsigned int>(
"QualityEnableME1d", QualityEnableME1d);
407 pset.
addParameter<
unsigned int>(
"QualityEnableME1e", QualityEnableME1e);
408 pset.
addParameter<
unsigned int>(
"QualityEnableME1f", QualityEnableME1f);
409 pset.
addParameter<
unsigned int>(
"QualityEnableME2a", QualityEnableME2a);
410 pset.
addParameter<
unsigned int>(
"QualityEnableME2b", QualityEnableME2b);
411 pset.
addParameter<
unsigned int>(
"QualityEnableME2c", QualityEnableME2c);
412 pset.
addParameter<
unsigned int>(
"QualityEnableME3a", QualityEnableME3a);
413 pset.
addParameter<
unsigned int>(
"QualityEnableME3b", QualityEnableME3b);
414 pset.
addParameter<
unsigned int>(
"QualityEnableME3c", QualityEnableME3c);
415 pset.
addParameter<
unsigned int>(
"QualityEnableME4a", QualityEnableME4a);
416 pset.
addParameter<
unsigned int>(
"QualityEnableME4b", QualityEnableME4b);
417 pset.
addParameter<
unsigned int>(
"QualityEnableME4c", QualityEnableME4c);
419 pset.
addParameter<
unsigned int>(
"kill_fiber", kill_fiber);
420 pset.
addParameter<
unsigned int>(
"singlesTrackOutput", singlesTrackOutput);
424 pset.
addParameter<
unsigned int>(
"mindetap_halo", mindetap_halo);
426 pset.
addParameter<std::vector<unsigned int> >(
"EtaMin", etamin);
428 pset.
addParameter<
unsigned int>(
"mindeta12_accp", mindeta12_accp);
429 pset.
addParameter<
unsigned int>(
"mindeta13_accp", mindeta13_accp);
430 pset.
addParameter<
unsigned int>(
"mindeta112_accp", mindeta112_accp);
431 pset.
addParameter<
unsigned int>(
"mindeta113_accp", mindeta113_accp);
433 pset.
addParameter<std::vector<unsigned int> >(
"EtaMax", etamax);
435 pset.
addParameter<
unsigned int>(
"maxdeta12_accp", maxdeta12_accp);
436 pset.
addParameter<
unsigned int>(
"maxdeta13_accp", maxdeta13_accp);
437 pset.
addParameter<
unsigned int>(
"maxdeta112_accp", maxdeta112_accp);
438 pset.
addParameter<
unsigned int>(
"maxdeta113_accp", maxdeta113_accp);
440 pset.
addParameter<std::vector<unsigned int> >(
"EtaWindows", etawin);
442 pset.
addParameter<
unsigned int>(
"maxdphi12_accp", maxdphi12_accp);
443 pset.
addParameter<
unsigned int>(
"maxdphi13_accp", maxdphi13_accp);
444 pset.
addParameter<
unsigned int>(
"maxdphi112_accp", maxdphi112_accp);
445 pset.
addParameter<
unsigned int>(
"maxdphi113_accp", maxdphi113_accp);
448 pset.
addParameter<
unsigned int>(
"mindphip_halo", mindphip_halo);
450 pset.
addParameter<
unsigned int>(
"straightp", straightp);
452 pset.
addParameter<
unsigned int>(
"mbaPhiOff", mbaPhiOff);
453 pset.
addParameter<
unsigned int>(
"mbbPhiOff", mbbPhiOff);
455 pset.
addParameter<
unsigned int>(
"firmwareSP", firmwareSP);
456 pset.
addParameter<
unsigned int>(
"firmwareFA", firmwareFA);
457 pset.
addParameter<
unsigned int>(
"firmwareDD", firmwareDD);
458 pset.
addParameter<
unsigned int>(
"firmwareVM", firmwareVM);
462 <<
"\nCORE CONFIGURATION AFTER READING THE DBS VALUES"
463 <<
"\nrun_core=" << run_core <<
"\ntrigger_on_ME1a=" << trigger_on_ME1a <<
"\ntrigger_on_ME1b=" << trigger_on_ME1b
464 <<
"\ntrigger_on_ME2=" << trigger_on_ME2 <<
"\ntrigger_on_ME3=" << trigger_on_ME3
465 <<
"\ntrigger_on_ME4=" << trigger_on_ME4 <<
"\ntrigger_on_MB1a=" << trigger_on_MB1a
466 <<
"\ntrigger_on_MB1d=" << trigger_on_MB1d
468 <<
"\nBXAdepth=" << BXAdepth <<
"\nuseDT=" << useDT <<
"\nwidePhi=" << widePhi <<
"\nPreTrigger=" << PreTrigger
470 <<
"\nCoreLatency=" << CoreLatency <<
"\nrescaleSinglesPhi=" << rescaleSinglesPhi
472 <<
"\n\nVARIOUS CONFIGURATION PARAMETERS AFTER READING THE DBS VALUES"
473 <<
"\nAllowALCTonly=" << AllowALCTonly <<
"\nAllowCLCTonly=" << AllowCLCTonly
475 <<
"\nQualityEnableME1a=" << QualityEnableME1a <<
"\nQualityEnableME1b=" << QualityEnableME1b
476 <<
"\nQualityEnableME1c=" << QualityEnableME1c <<
"\nQualityEnableME1d=" << QualityEnableME1d
477 <<
"\nQualityEnableME1e=" << QualityEnableME1e <<
"\nQualityEnableME1f=" << QualityEnableME1f
478 <<
"\nQualityEnableME2a=" << QualityEnableME2a <<
"\nQualityEnableME2b=" << QualityEnableME2b
479 <<
"\nQualityEnableME2c=" << QualityEnableME2c <<
"\nQualityEnableME3a=" << QualityEnableME3a
480 <<
"\nQualityEnableME3b=" << QualityEnableME3b <<
"\nQualityEnableME3c=" << QualityEnableME3c
481 <<
"\nQualityEnableME4a=" << QualityEnableME4a <<
"\nQualityEnableME4b=" << QualityEnableME4b
482 <<
"\nQualityEnableME4c=" << QualityEnableME4c
484 <<
"\nkill_fiber=" << kill_fiber <<
"\nsinglesTrackOutput=" << singlesTrackOutput
486 <<
"\n\nDAT_ETA AFTER READING THE DBS VALUES"
487 <<
"\nmindetap =" << mindetap <<
"\nmindetap_halo=" << mindetap_halo
489 <<
"\netamin[0]=" << etamin[0] <<
"\netamin[1]=" << etamin[1] <<
"\netamin[2]=" << etamin[2]
490 <<
"\netamin[3]=" << etamin[3] <<
"\netamin[4]=" << etamin[4] <<
"\netamin[5]=" << etamin[5]
491 <<
"\netamin[6]=" << etamin[6] <<
"\netamin[7]=" << etamin[7]
493 <<
"\nmindeta12_accp =" << mindeta12_accp <<
"\nmindeta13_accp =" << mindeta13_accp
494 <<
"\nmindeta112_accp=" << mindeta112_accp <<
"\nmindeta113_accp=" << mindeta113_accp
496 <<
"\netamax[0]=" << etamax[0] <<
"\netamax[1]=" << etamax[1] <<
"\netamax[2]=" << etamax[2]
497 <<
"\netamax[3]=" << etamax[3] <<
"\netamax[4]=" << etamax[4] <<
"\netamax[5]=" << etamax[5]
498 <<
"\netamax[6]=" << etamax[6] <<
"\netamax[7]=" << etamax[7]
500 <<
"\nmaxdeta12_accp =" << maxdeta12_accp <<
"\nmaxdeta13_accp =" << maxdeta13_accp
501 <<
"\nmaxdeta112_accp=" << maxdeta112_accp <<
"\nmaxdeta113_accp=" << maxdeta113_accp
503 <<
"\netawin[0]=" << etawin[0] <<
"\netawin[1]=" << etawin[1] <<
"\netawin[2]=" << etawin[2]
504 <<
"\netawin[3]=" << etawin[3] <<
"\netawin[4]=" << etawin[4] <<
"\netawin[5]=" << etawin[5]
505 <<
"\netawin[6]=" << etawin[6]
507 <<
"\nmaxdphi12_accp =" << maxdphi12_accp <<
"\nmaxdphi13_accp =" << maxdphi13_accp
508 <<
"\nmaxdphi112_accp=" << maxdphi112_accp <<
"\nmaxdphi113_accp=" << maxdphi113_accp
510 <<
"\nmindphip =" << mindphip <<
"\nmindphip_halo=" << mindphip_halo
512 <<
"\nstraightp=" << straightp <<
"\ncurvedp =" << curvedp <<
"\nmbaPhiOff=" << mbaPhiOff
513 <<
"\nmbbPhiOff=" << mbbPhiOff
515 <<
"\n\nFIRMWARE VERSIONS AFTER READING THE DBS VALUES"
516 <<
"\nSP: " << firmwareSP <<
"\nFA: " << firmwareFA <<
"\nDD: " << firmwareDD <<
"\nVM: " << firmwareVM;
void addParameter(std::string const &name, T const &value)