14 #include "DipFactory.h" 15 #include "DipPublication.h" 16 #include "DipTimestamp.h" 21 const char*
qualities[3] = {
"Uncertain",
"Bad",
"Good"};
92 const string subjectPV =
"dip/CMS/Tracker/PrimaryVertices";
94 string sourceFile =
"/nfshome0/dqmpro/BeamMonitorDQM/BeamFitResultsForDIP.txt";
95 string sourceFile1 =
"/nfshome0/dqmpro/BeamMonitorDQM/BeamFitResultsOld_TkStatus.txt";
104 strftime(mbstr,
sizeof(mbstr),
"%Y.%m.%d %H:%M:%S %z", std::localtime(&
t));
110 time_t
t =
time(
nullptr);
122 cerr <<
"exception (create): " <<
e.what() << endl;
128 struct stat stat_buf;
130 return (rc == 0 ? stat_buf.st_size : -1);
135 struct stat stat_buf;
137 return (rc == 0 ? stat_buf.st_mtime : -1);
148 list.push_back(
token);
153 list.push_back(
line);
251 cerr <<
"exception (trueRcd): " <<
e.what() << endl;
273 cerr <<
"exception (fakeRcd): " <<
e.what() << endl;
283 cerr <<
"sending (" << qlty <<
" | " <<
err <<
")";
287 cerr <<
" to CCC and CMS";
289 cerr <<
" to CCC only";
299 zeit = DipTimestamp(epoch);
301 zeit = DipTimestamp();
322 }
else if (qlty ==
"UNINITIALIZED") {
329 cerr <<
"exception (publishRcd): " <<
e.what() << endl;
336 bool rcdQlty =
false;
345 switch (nthLnInRcd) {
347 if (
record.rfind(
"Run", 0) != 0) {
348 cerr <<
"Reading of results text file interrupted. " +
getDateTime() << endl;
462 cerr <<
"io exception (readRcd): " <<
e.what() << endl;
476 outstr =
"No CMS Tracker status available. No DAQ/DQM.";
488 switch (nthLnInRcd) {
490 if (
tmp[1].
find(
"Yes") == string::npos)
491 outstr =
"CMS Tracker OFF.";
493 outstr =
"CMS not taking data or no beam.";
503 cerr <<
"exception (tkStatus): " <<
e.what() << endl;
515 cerr <<
"no update | alive = " <<
alive << endl;
523 if (!
alive.test(2)) {
529 stringstream warnMsg;
530 warnMsg <<
"No new data for " <<
lsCount <<
" LS";
531 publishRcd(
"Uncertain", warnMsg.str(),
false,
false);
535 stringstream warnMsg;
537 publishRcd(
"Bad", warnMsg.str(),
false,
false);
544 stringstream warnMsg;
546 publishRcd(
"Bad", warnMsg.str(),
false,
false);
568 cerr <<
"New run starts. Run number: " <<
runnum << endl;
590 cerr <<
"got new record from file" << endl;
597 cerr <<
"problem with new record" << endl;
612 cerr <<
"io exception (end of lumi): " <<
e.what() << endl;
638 cerr <<
"exception (start up): " <<
e.what() << endl;
675 dip->setDNSNode(
"cmsdimns1.cern.ch,cmsdimns2.cern.ch");
677 cerr <<
"reading from file (NFS)" << endl;
682 cerr <<
"entering polling loop" << endl;
689 cerr <<
"[done]" << endl;
vector< string > parse(string line, const string &delimiter)
string getDateTime(time_t t)
def create(alignables, pedeDump, additionalData, outputFile, config)
DipPublication * publicationPV
void handleException(DipPublication *publication, DipException &e) override
void publishRcd(string qlty, string err, bool pubCMS, bool fitTime)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
long getFileSize(string filename)
int main(int narg, char *args[])
bool readRcd(ifstream &file)
DipPublication * publicationCMS
const bool publishStatErrors
time_t getLastTime(string filename)
const char * qualities[3]
DipPublication * publicationLHC
void CMS2LHCRF_POS(float x, float y, float z)