27 {36, 19, 20, 21, 22, 23, 18, 1, 2, 3, 4, 5},
28 {24, 25, 26, 27, 28, 29, 6, 7, 8, 9, 10, 11},
29 {30, 31, 32, 33, 34, 35, 12, 13, 14, 15, 16, 17},
31 {54, 37, 38, 39, 40, 41, -1, -1, -1, -1, -1, -1},
32 {42, 43, 44, 45, 46, 47, -1, -1, -1, -1, -1, -1},
33 {48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1, -1},
35 {72, 55, 56, 57, 58, 59, -1, -1, -1, -1, -1, -1},
36 {60, 61, 62, 63, 64, 65, -1, -1, -1, -1, -1, -1},
37 {66, 67, 68, 69, 70, 71, -1, -1, -1, -1, -1, -1},
39 {90, 73, 74, 75, 76, 77, 108, 91, 92, 93, 94, 95},
40 {78, 79, 80, 81, 82, 83, 96, 97, 98, 99, 100, 101},
41 {84, 85, 86, 87, 88, 89, 102, 103, 104, 105, 106, 107}
45 {1, 2, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1},
46 {4, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1},
47 {7, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1},
48 {10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1},
49 {16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1},
50 {22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1},
51 {28, 29, 30, 31, 32, 33, -1, -1, -1, -1, -1, -1},
52 {34, 35, 36, 37, 38, 39, -1, -1, -1, -1, -1, -1},
53 {40, 41, 42, 43, 44, 45, -1, -1, -1, -1, -1, -1},
54 {46, 47, 48, -1, -1, -1, -1, -1, -1, -1, -1, -1},
55 {49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1},
56 {52, 53, 54, -1, -1, -1, -1, -1, -1, -1, -1, -1}
72 bool iomode_write =
true;
73 if (mode ==
"online_config" || mode ==
"combine_config") {
75 ifstream
f(fname.c_str());
82 if (mode ==
"python_config" || mode ==
"combine_config") {
90 if (!(mode ==
"python_config" || mode ==
"online_config" || mode ==
"combine_config" || (mode ==
"read"))) {
91 throw cms::Exception(
"Config") <<
"Invalid value," << mode <<
", for parameter mode. " 92 <<
"Valid values: online_config, python_config, combine_config, read";
101 if (!db.isAvailable()) {
102 throw cms::Exception(
"CondDBAccess") <<
"Failed to connect to PoolDBOutputService\n";
107 db->writeOne(sr, firstSinceTime,
"EcalSRSettingsRcd");
113 cout <<
"EcalSRSettings record not found. Check the Cond DB Global tag.\n";
116 cout <<
"ECAL Seletive readout settings:\n";
117 cout << *ssr <<
"\n" << endl;
124 cout <<
"EcalTPGPhysicsConst record not found. Check the Cond DB Global tag.\n";
128 if (mymap.size() != 2) {
129 cout <<
"Error: TPG physics record is of unexpected size: " << mymap.size()
130 <<
" elements instead of two (one for EB, one for EE)\n";
132 EcalTPGPhysicsConstMap::const_iterator it = mymap.begin();
133 cout <<
"----------------------------------------------------------------------\n" 134 "Trigger tower Et thresholds extracted from TPG configuration \n" 135 "(EcalSRCondTools modules supports only read mode for these parameters):\n\n";
137 <<
"LT = " << it->second.ttf_threshold_Low <<
" GeV " 138 <<
"HT = " << it->second.ttf_threshold_High <<
" GeV\n";
141 <<
"LT = " << it->second.ttf_threshold_Low <<
" GeV " 142 <<
"HT = " << it->second.ttf_threshold_High <<
" GeV\n";
159 const std::vector<double>&
w = ps.
getParameter<std::vector<double> >(
"dccNormalizedWeights");
208 const int nValueSets = 6 * EcalSRSettings::nSrps_ + 9;
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())
470 if (hwWeight & (1 << 11))
472 return hwWeight / 1024.;
481 while (pos0 < len &&
find(delim.begin(), delim.end(), s[pos0]) != delim.end()) {
486 pos = s.find_first_of(delim, pos0);
487 return s.substr(pos0, (pos > 0 ? pos : len) - pos0);
492 if (pos0 == string::npos) {
496 if (pos1 == string::npos) {
499 return s.substr(pos0, pos1 - pos0);
T getParameter(std::string const &) const
std::vector< short > srfMasks_
std::vector< std::vector< float > > dccNormalizedWeights_
std::vector< int > testerSrpEmuSrpIds_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< float > srpHighInterestChannelZS_
std::vector< int > actions_
unsigned long long Time_t
std::vector< std::vector< short > > substitutionSrfs_
std::vector< int > testerDccTestSrpIds_
std::vector< int > ecalDccZs1stSample_
std::vector< short > tccMasksFromConfig_
std::vector< short > bxOffsets_
std::vector< short > dccMasks_
std::vector< int > deltaPhi_
const std::map< uint32_t, Item > & getMap() const
std::vector< int > symetricZS_
float ebDccAdcToGeV_
ADC to GeV conversion factor used in ZS filter for EB.
std::vector< int > testerTccEmuSrpIds_
std::vector< float > srpLowInterestChannelZS_
std::vector< int > deltaEta_
std::vector< int > testerSrpTestSrpIds_
std::map< uint32_t, EcalTPGPhysicsConst::Item > EcalTPGPhysicsConstMap
float eeDccAdcToGeV_
ADC to GeV conversion factor used in ZS filter for EE.
T const * product() const
std::vector< std::vector< short > > srpMasksFromConfig_