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}
76 bool iomode_write =
true;
77 if(mode ==
"online_config" || mode ==
"combine_config"){
80 ifstream
f(fname.c_str());
87 if(mode==
"python_config" || mode==
"combine_config"){
95 if(!(mode==
"python_config" || mode ==
"online_config" || mode ==
"combine_config" || (mode==
"read"))){
96 throw cms::Exception(
"Config") <<
"Invalid value," << mode <<
", for parameter mode. " 97 <<
"Valid values: online_config, python_config, combine_config, read";
106 if( !db.isAvailable() ){
107 throw cms::Exception(
"CondDBAccess") <<
"Failed to connect to PoolDBOutputService\n";
112 db->writeOne(sr,firstSinceTime,
"EcalSRSettingsRcd");
118 cout <<
"EcalSRSettings record not found. Check the Cond DB Global tag.\n";
121 cout <<
"ECAL Seletive readout settings:\n";
122 cout << *ssr <<
"\n" << endl;
129 cout <<
"EcalTPGPhysicsConst record not found. Check the Cond DB Global tag.\n";
134 cout <<
"Error: TPG physics record is of unexpected size: " 135 << mymap.size() <<
" elements instead of two (one for EB, one for EE)\n";
137 EcalTPGPhysicsConstMap::const_iterator it=mymap.begin();
138 cout <<
"----------------------------------------------------------------------\n" 139 "Trigger tower Et thresholds extracted from TPG configuration \n" 140 "(EcalSRCondTools modules supports only read mode for these parameters):\n\n";
141 cout<<
"EB: " <<
"LT = " << it->second.ttf_threshold_Low <<
" GeV " 142 <<
"HT = "<< it->second.ttf_threshold_High <<
" GeV\n";
144 cout<<
"EE: " <<
"LT = " << it->second.ttf_threshold_Low <<
" GeV " 145 <<
"HT = "<< it->second.ttf_threshold_High <<
" GeV\n";
163 const std::vector<double>&
w = ps.
getParameter<std::vector<double> >(
"dccNormalizedWeights");
212 const int nValueSets = 6*EcalSRSettings::nSrps_+9;
214 stringstream sErr(
"");
215 while(!f.eof() && sErr.str().empty()){
219 if(line[0] ==
'#' || line.empty()){
224 if(iValueSet>=nValueSets)
break;
229 int nChs[nValueSets] = {
231 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
233 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
235 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
237 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
239 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
241 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
262 while(((sValue =
tokenize(line,
" \t", pos))!=
string(
""))
263 && (iCh<nChs[iValueSet]) && sErr.str().empty()){
264 value = strtoul(sValue.c_str(),
nullptr, 0);
267 assert((
unsigned)iSrp <
sizeof(
tccNum) /
sizeof(
tccNum[0]));
268 assert((
unsigned)iCh <
sizeof(
tccNum[0]) /
sizeof(
tccNum[0][0]));
269 int tcc =
tccNum[iSrp][iCh];
271 if(d)
cout <<
"tccMasksFromConfig_[" << tcc <<
"] <- " 275 }
else if(iValueSet<24){
276 if(d)
cout <<
"srpMasks_[" << iSrp <<
"][" << iCh <<
"] <- " 279 }
else if(iValueSet<36) {
280 assert((
unsigned)iSrp <
sizeof(
dccNum) /
sizeof(
dccNum[0]));
281 assert((
unsigned)iCh <
sizeof(
dccNum[0]) /
sizeof(
dccNum[0][0]));
282 int dcc =
dccNum[iSrp][iCh];
284 assert((
unsigned)(dcc-1) < sr.
dccMasks_.size());
285 if(d)
cout <<
"dccMasks_[" << (dcc-1) <<
"] <- " 289 }
else if(iValueSet<48){
290 assert((
unsigned)iSrp <
sizeof(
dccNum) /
sizeof(
dccNum[0]));
291 assert((
unsigned)iCh <
sizeof(
dccNum[0]) /
sizeof(
dccNum[0][0]));
292 int dcc =
dccNum[iSrp][iCh];
294 if(d)
cout <<
"srfMasks_[" << (dcc-1) <<
"] <- " 296 assert((
unsigned)(dcc-1) < sr.
srfMasks_.size());
299 }
else if(iValueSet<60){
302 if(d)
cout <<
"substitutionMasks_[" << iSrp <<
"][" << iCh <<
"] <- " 305 }
else if(iValueSet<72){
309 if(d)
cout <<
"testerTccEmuSrpIds_[" << iSrp <<
"] <- " 315 if(d)
cout <<
"testerSrpEmuSrpIds_[" << iSrp <<
"] <- " 321 if(d)
cout <<
"testerDccTestSrpIds_[" << iSrp <<
"] <- " 327 if(d)
cout <<
"testerSrpTestSrpIds_[" << iSrp <<
"] <- " 332 sErr <<
"Syntax error in SRP system configuration " 333 <<
" line " << iLine <<
".";
335 }
else if(iValueSet<73){
337 if(d)
cout <<
"bxOffset_[" << iCh <<
"] <- " 340 }
else if(iValueSet<74){
350 throw cms::Exception(
"OutOfRange") <<
"Value of parameter algo ," << algo
351 <<
", is invalid. Valid values are 0 and 1.";
354 <<
"deltaPhi_[0] <- " << sr.
deltaPhi_[0] <<
"\n";
355 }
else if(iValueSet<75){
356 assert((
unsigned)iCh < sr.
actions_.size());
357 if(d)
cout <<
"actions_[" << iCh <<
"] <- " 360 }
else if(iValueSet<76){
364 }
else if(iValueSet<77){
368 }
else if(iValueSet<78){
372 }
else if (iValueSet<79){
376 }
else if (iValueSet<80){
380 }
else if (iValueSet<81){
389 if(iCh!=nChs[iValueSet]){
390 sErr <<
"Syntax error in imported SRP system configuration file " 391 " line " << iLine <<
".";
394 if(sErr.str().empty() && iValueSet!=(nValueSets-1)){
395 sErr <<
"Syntax Error in imported SRP system configuration file " 396 " line " << iLine <<
".";
398 if(!sErr.str().empty())
throw cms::Exception(
"SyntaxError") << sErr.str();
404 if(hwWeight & (1<<11)) hwWeight |= ~0xEFF;
405 return hwWeight/1024.;
413 while(pos0<len &&
find(delim.begin(), delim.end(), s[pos0])!=delim.end()){
416 if(pos0==len)
return "";
417 pos = s.find_first_of(delim, pos0);
418 return s.substr(pos0, (pos>0?pos:len)-pos0);
423 if(pos0==string::npos){
427 if(pos1==string::npos){
430 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_