33 typedef std::vector<edm::ParameterSet>
Parameters;
36 for ( Parameters::iterator itToPut=toPut.begin(); itToPut!=toPut.end(); itToPut++ ) {
39 since_.push_back(itToPut->getUntrackedParameter<
unsigned int>(
"since"));
50 std::cout <<
"PoolDBOutputService is unavailable" << std::endl;
73 std::cout <<
"Reading " <<
objectName_[
i] <<
" from file and writing to DB with newTime " << newTime << std::endl;
109 std::vector<EcalDQMStatusDictionary::codeDef> dictionary;
115 for (
int ic=1; ic<=1700; ic++ ) {
122 for (
int ix=1; ix<=100; ix++ ) {
123 for (
int iy=1; iy<=100; iy++ ) {
135 std::cout <<
"Reading channel status from file " << inputFile << std::endl;
136 FILE *
ifile = fopen( inputFile ,
"r" );
143 while ( fgets(line, 255, ifile) ) {
145 std::stringstream stream;
153 if ( key.size() == 0 || strcmp(key.c_str(),
" ") == 0 || strncmp(key.c_str(),
"#", 1) == 0 ) {
157 }
else if ( strcmp(key.c_str(),
"EB") == 0 ) {
161 stream >> index >> code;
167 if ( it != status->
end() ) code |= it->getStatusCode();
170 }
else if ( strcmp(key.c_str(),
"EE") == 0 ) {
174 stream >> ix >> iy >> iz >> code;
180 if ( it != status->
end() ) code |= it->getStatusCode();
183 }
else if ( strcmp(key.c_str(),
"Crystal") == 0 ) {
188 if ( strncmp(module.c_str(),
"EB+", 3) == 0 || strncmp(module.c_str(),
"EB-", 3) == 0 ) {
193 stream >> ie >> ip >> token;
195 int sm = atoi( module.substr(2, module.size()-2).c_str() );
197 int ism = (sm>=1&&sm<=18) ? sm+18 : -sm;
199 int ic = 20*(ie-1)+(ip-1)+1;
203 stream >> ic >> token;
205 int sm = atoi( module.substr(2, module.size()-2).c_str() );
207 int ism = (sm>=1&&sm<=18) ? sm+18 : -sm;
213 for (
unsigned int i=0;
i<dictionary.size();
i++ ) {
214 if ( strcmp(token.c_str(), dictionary[
i].desc) == 0 ) {
215 code = dictionary[
i].code;
219 std::cout <<
" --> not found in the dictionary: " << token << std::endl;
224 if ( it != status->
end() ) code |= it->getStatusCode();
227 }
else if ( strncmp(module.c_str(),
"EE+", 3) == 0 || strncmp(module.c_str(),
"EE-", 3) == 0 ) {
232 stream >> jx >> jy >> token;
236 stream >> index >> token;
241 int sm = atoi( module.substr(2, module.size()-2).c_str() );
244 if( sm == -99 ) sm = -1;
245 if( sm == +99 ) sm = +1;
247 case -7: ism = 1;
break;
248 case -8: ism = 2;
break;
249 case -9: ism = 3;
break;
250 case -1: ism = 4;
break;
251 case -2: ism = 5;
break;
252 case -3: ism = 6;
break;
253 case -4: ism = 7;
break;
254 case -5: ism = 8;
break;
255 case -6: ism = 9;
break;
256 case +7: ism = 10;
break;
257 case +8: ism = 11;
break;
258 case +9: ism = 12;
break;
259 case +1: ism = 13;
break;
260 case +2: ism = 14;
break;
261 case +3: ism = 15;
break;
262 case +4: ism = 16;
break;
263 case +5: ism = 17;
break;
264 case +6: ism = 18;
break;
267 EEDetId id(jx, jy, (ism>=1&&ism<=9)?-1:+1);
269 for (
unsigned int i=0;
i<dictionary.size();
i++ ) {
270 if ( strcmp(token.c_str(), dictionary[
i].desc) == 0 ) {
271 code = dictionary[
i].code;
275 std::cout <<
" --> not found in the dictionary: " << token << std::endl;
280 if ( it != status->
end() ) code |= it->getStatusCode();
285 std:: cout <<
"--> unknown token at line #" << ii <<
" : " <<
line;
289 }
else if ( strcmp(key.c_str(),
"TT") == 0 ) {
293 }
else if ( strcmp(key.c_str(),
"PN") == 0 || strcmp(key.c_str(),
"MemCh") == 0 || strcmp(key.c_str(),
"MemTT") == 0 ) {
295 std::cout <<
"--> unsupported key at line #" << ii <<
" : " <<
line;
315 std::vector<EcalDQMStatusDictionary::codeDef> dictionary;
319 for (
int ix=1; ix<=17; ix++ ) {
320 for (
int iy=1; iy<=72; iy++ ) {
333 for (
int ix=1; ix<=20; ix++ ) {
334 for (
int iy=1; iy<=20; iy++ ) {
346 std::cout <<
"Reading tower status from file " << inputFile << std::endl;
347 FILE *
ifile = fopen( inputFile ,
"r" );
354 while ( fgets(line, 255, ifile) ) {
356 std::stringstream stream;
364 if ( key.size() == 0 || strcmp(key.c_str(),
" ") == 0 || strncmp(key.c_str(),
"#", 1) == 0 ) {
368 }
else if ( strcmp(key.c_str(),
"EB") == 0 ) {
372 }
else if ( strcmp(key.c_str(),
"EE") == 0 ) {
376 }
else if ( strcmp(key.c_str(),
"Crystal") == 0 ) {
380 }
else if ( strcmp(key.c_str(),
"TT") == 0 ) {
385 if ( strncmp(module.c_str(),
"EB+", 3) == 0 || strncmp(module.c_str(),
"EB-", 3) == 0 ) {
389 stream >> itt >> token;
391 if ( itt >= 1 && itt <= 68 ) {
393 int sm = atoi( module.substr(2, module.size()-2).c_str() );
395 int iet = (itt-1)/4+1;
396 int ipt = (itt-1)%4+1;
400 if ( ipt < 1 ) ipt = ipt+72;
401 if ( ipt > 72 ) ipt = ipt-72;
404 if ( ipt < 1 ) ipt = ipt+72;
405 if ( ipt > 72 ) ipt = ipt-72;
410 for (
unsigned int i=0;
i<dictionary.size();
i++ ) {
411 if ( strcmp(token.c_str(), dictionary[
i].desc) == 0 ) {
412 code = dictionary[
i].code;
416 std::cout <<
" --> not found in the dictionary: " << token << std::endl;
421 if ( it != status->
end() ) code |= it->getStatusCode();
426 std::cout <<
"--> unsupported configuration at line #" << ii <<
" : " <<
line;
430 }
else if ( strncmp(module.c_str(),
"EE+", 3) == 0 || strncmp(module.c_str(),
"EE-", 3) == 0 ) {
434 stream >> isc >> token;
436 if ( isc >= 1 && isc <= 68 ) {
438 int sm = atoi( module.substr(2, module.size()-2).c_str() );
442 case -7: ism = 1;
break;
443 case -8: ism = 2;
break;
444 case -9: ism = 3;
break;
445 case -1: ism = 4;
break;
446 case -2: ism = 5;
break;
447 case -3: ism = 6;
break;
448 case -4: ism = 7;
break;
449 case -5: ism = 8;
break;
450 case -6: ism = 9;
break;
451 case +7: ism = 10;
break;
452 case +8: ism = 11;
break;
453 case +9: ism = 12;
break;
454 case +1: ism = 13;
break;
455 case +2: ism = 14;
break;
456 case +3: ism = 15;
break;
457 case +4: ism = 16;
break;
458 case +5: ism = 17;
break;
459 case +6: ism = 18;
break;
462 int idcc = (ism>=1&&ism<=9) ? ism : ism-9+45;
466 for (
unsigned int i=0;
i<crystals->size();
i++ ) {
470 for (
unsigned int i=0;
i<dictionary.size();
i++ ) {
471 if ( strcmp(token.c_str(), dictionary[
i].desc) == 0 ) {
472 code = dictionary[
i].code;
476 std::cout <<
" --> not found in the dictionary: " << token << std::endl;
481 if ( it != status->
end() ) code |= it->getStatusCode();
488 std::cout <<
"--> unsupported configuration at line #" << ii <<
" : " <<
line;
494 std:: cout <<
"--> unknown token at line #" << ii <<
" : " <<
line;
498 }
else if ( strcmp(key.c_str(),
"PN") == 0 || strcmp(key.c_str(),
"MemCh") == 0 || strcmp(key.c_str(),
"MemTT") == 0 ) {
500 std::cout <<
"--> unsupported key at line #" << ii <<
" : " <<
line;
518 if ( chStatus == 1 || (chStatus >= 8 && chStatus <= 12 )) {
544 }
else if ( chStatus == 2 ) {
556 }
else if ( chStatus == 3 ) {
569 }
else if ( chStatus == 4 ) {
581 }
else if ( chStatus == 13 || chStatus == 14 ) {
586 }
else if ( (chStatus&0x3f) == 13 || (chStatus&0x7f) == 13 ||
587 (chStatus&0x3f) == 14 || (chStatus&0x7f) == 14 ) {
static bool validDetId(int ix, int iy, int iz)
T getParameter(std::string const &) const
static const int LED_MEAN_ERROR
T getUntrackedParameter(std::string const &, T const &) const
static const int PEDESTAL_MIDDLE_GAIN_RMS_ERROR
static const int LASER_MEAN_ERROR
const_iterator end() const
static const int TESTPULSE_LOW_GAIN_RMS_ERROR
static const int PHYSICS_BAD_CHANNEL_WARNING
std::vector< unsigned long long > since_
Some "id" conversions.
static const int LASER_TIMING_RMS_ERROR
static const int PEDESTAL_HIGH_GAIN_MEAN_ERROR
static const int PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
static const int TESTPULSE_MIDDLE_GAIN_MEAN_ERROR
static const int PEDESTAL_LOW_GAIN_RMS_ERROR
EcalDQMTowerStatus * readEcalDQMTowerStatusFromFile(const char *)
void setValue(const uint32_t id, const Item &item)
const_iterator find(uint32_t rawId) const
static const int PEDESTAL_HIGH_GAIN_RMS_ERROR
static const int STATUS_FLAG_ERROR
void setValue(const uint32_t id, const Item &item)
static const int TESTPULSE_MIDDLE_GAIN_RMS_ERROR
static std::vector< DetId > * crystals(const EcalTrigTowerDetId &id)
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
EcalDQMChannelStatusMap EcalDQMChannelStatus
unsigned long long Time_t
vector< ParameterSet > Parameters
static void getDictionary(std::vector< codeDef > &dict)
bool isNewTagRequest(const std::string &recordName)
uint32_t convert(uint32_t c)
EcalDQMTowerStatusMap EcalDQMTowerStatus
cond::Time_t beginOfTime() const
EcalDQMChannelStatus * readEcalDQMChannelStatusFromFile(const char *)
Abs< T >::type abs(const T &t)
static const int TESTPULSE_HIGH_GAIN_RMS_ERROR
static const int LED_TIMING_MEAN_ERROR
void beginRun(const edm::Run &r, const edm::EventSetup &c)
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
static const int PEDESTAL_LOW_GAIN_MEAN_ERROR
std::vector< std::string > inpFileName_
static const int TESTPULSE_LOW_GAIN_MEAN_ERROR
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
std::vector< std::string > objectName_
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
static const int LED_TIMING_RMS_ERROR
std::vector< Item >::const_iterator const_iterator
static const int PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR
cond::Time_t endOfTime() const
static const int LASER_TIMING_MEAN_ERROR
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
static bool validDetId(int iz, EcalSubdetector sd, int i, int j)
check if a valid index combination
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
const_iterator find(uint32_t rawId) const
const_iterator end() const
static const int LED_RMS_ERROR
EcalDQMStatusWriter(const edm::ParameterSet &ps)
std::vector< Item >::const_iterator const_iterator
static const int PEDESTAL_MIDDLE_GAIN_MEAN_ERROR
static const int TESTPULSE_HIGH_GAIN_MEAN_ERROR
static const int LASER_RMS_ERROR
static const int SMCRYSTALMODE
int ism(int ieta, int iphi)