Imports an SRP configuration file (stored in database "CLOB") into a Selective readout setting object.
- Parameters
-
sr | [in] ECAL selective readout setting object to set |
f | configuration file stream. A stringstream can be used if the configuration is available as an stl string of a c-string: stringstream buf; buf << s; |
debug | verbosity flag. If true, imported parameter are displayed on stdout. |
Definition at line 187 of file EcalSRCondTools.cc.
References EcalSRSettings::actions_, ecalcalib_dqm_sourceclient-live_cfg::algo, EcalSRSettings::automaticMasks_, EcalSRSettings::automaticSrpSelect_, EcalSRSettings::bxOffsets_, gather_cfg::cout, EcalSRSettings::dccMasks_, dccNum, EcalSRSettings::deltaEta_, EcalSRSettings::deltaPhi_, Exception, mps_splice::line, nChs, EcalSRSettings::nDccs_, EcalSRSettings::nSrps_, EcalSRSettings::nTccs_, EcalSRSettings::srfMasks_, EcalSRSettings::srpMasksFromConfig_, EcalSRSettings::substitutionSrfs_, EcalSRSettings::tccMasksFromConfig_, tccNum, EcalSRSettings::testerDccTestSrpIds_, EcalSRSettings::testerSrpEmuSrpIds_, EcalSRSettings::testerSrpTestSrpIds_, EcalSRSettings::testerTccEmuSrpIds_, tokenize(), trim(), and relativeConstraints::value.
Referenced by analyze(), and popcon::EcalSRPHandler::getNewObjects().
210 stringstream sErr(
"");
211 while (!
f.eof() && sErr.str().empty()) {
215 if (
line[0] ==
'#' ||
line.empty()) {
220 if (iValueSet >= nValueSets)
226 int nChs[nValueSets] = {
325 while (((sValue =
tokenize(
line,
" \t", pos)) !=
string(
"")) && (iCh < nChs[iValueSet]) && sErr.str().empty()) {
326 value = strtoul(sValue.c_str(),
nullptr, 0);
328 if (iValueSet < 12) {
329 assert((
unsigned)iSrp <
sizeof(
tccNum) /
sizeof(
tccNum[0]));
330 assert((
unsigned)iCh <
sizeof(
tccNum[0]) /
sizeof(
tccNum[0][0]));
331 int tcc =
tccNum[iSrp][iCh];
334 cout <<
"tccMasksFromConfig_[" << tcc <<
"] <- " << value <<
"\n";
337 }
else if (iValueSet < 24) {
339 cout <<
"srpMasks_[" << iSrp <<
"][" << iCh <<
"] <- " << value <<
"\n";
341 }
else if (iValueSet < 36) {
342 assert((
unsigned)iSrp <
sizeof(
dccNum) /
sizeof(
dccNum[0]));
343 assert((
unsigned)iCh <
sizeof(
dccNum[0]) /
sizeof(
dccNum[0][0]));
344 int dcc =
dccNum[iSrp][iCh];
346 assert((
unsigned)(dcc - 1) < sr.
dccMasks_.size());
348 cout <<
"dccMasks_[" << (dcc - 1) <<
"] <- " << value <<
"\n";
351 }
else if (iValueSet < 48) {
352 assert((
unsigned)iSrp <
sizeof(
dccNum) /
sizeof(
dccNum[0]));
353 assert((
unsigned)iCh <
sizeof(
dccNum[0]) /
sizeof(
dccNum[0][0]));
354 int dcc =
dccNum[iSrp][iCh];
357 cout <<
"srfMasks_[" << (dcc - 1) <<
"] <- " << value <<
"\n";
358 assert((
unsigned)(dcc - 1) < sr.
srfMasks_.size());
361 }
else if (iValueSet < 60) {
365 cout <<
"substitutionMasks_[" << iSrp <<
"][" << iCh <<
"] <- " << value <<
"\n";
367 }
else if (iValueSet < 72) {
372 cout <<
"testerTccEmuSrpIds_[" << iSrp <<
"] <- " << value <<
"\n";
378 cout <<
"testerSrpEmuSrpIds_[" << iSrp <<
"] <- " << value <<
"\n";
384 cout <<
"testerDccTestSrpIds_[" << iSrp <<
"] <- " << value <<
"\n";
390 cout <<
"testerSrpTestSrpIds_[" << iSrp <<
"] <- " << value <<
"\n";
394 sErr <<
"Syntax error in SRP system configuration " 395 <<
" line " << iLine <<
".";
397 }
else if (iValueSet < 73) {
400 cout <<
"bxOffset_[" << iCh <<
"] <- " << value <<
"\n";
402 }
else if (iValueSet < 74) {
413 <<
"Value of parameter algo ," << algo <<
", is invalid. Valid values are 0 and 1.";
417 <<
"deltaPhi_[0] <- " << sr.
deltaPhi_[0] <<
"\n";
418 }
else if (iValueSet < 75) {
419 assert((
unsigned)iCh < sr.
actions_.size());
421 cout <<
"actions_[" << iCh <<
"] <- " << value <<
"\n";
423 }
else if (iValueSet < 76) {
427 }
else if (iValueSet < 77) {
431 }
else if (iValueSet < 78) {
435 }
else if (iValueSet < 79) {
439 }
else if (iValueSet < 80) {
443 }
else if (iValueSet < 81) {
452 if (iCh != nChs[iValueSet]) {
453 sErr <<
"Syntax error in imported SRP system configuration file " 458 if (sErr.str().empty() && iValueSet != (nValueSets - 1)) {
459 sErr <<
"Syntax Error in imported SRP system configuration file " 463 if (!sErr.str().empty())
std::vector< short > srfMasks_
std::vector< int > testerSrpEmuSrpIds_
std::vector< int > actions_
std::vector< std::vector< short > > substitutionSrfs_
std::vector< int > testerDccTestSrpIds_
std::vector< short > tccMasksFromConfig_
std::vector< short > bxOffsets_
std::vector< short > dccMasks_
std::vector< int > deltaPhi_
std::vector< int > testerTccEmuSrpIds_
std::vector< int > deltaEta_
std::vector< int > testerSrpTestSrpIds_
std::vector< std::vector< short > > srpMasksFromConfig_