/////////////////////////////////////////////////////////////////////////////// // Andrea Castro November 28, 2005 // stores plots and HTML files into $OFFLINE_MON_DIR /////////////////////////////////////////////////////////////////////////////// #include "TSystem.h" #include "TFile.h" #include "TTree.h" #include "TH1.h" #include "TProfile.h" #include "TLine.h" #include "TCanvas.h" #include "TPaveText.h" #include "TText.h" #include /* Directory information. */ #include #include using namespace std; #include "OfflineMon/TCalibrationsMonitor.hh" ClassImp(TCalibrationsMonitor) ClassImp(TCalibrationsMonitor::Data_t) //_____________________________________________________________________________ TCalibrationsMonitor::TCalibrationsMonitor(const char* Name): TOfflineMonitor(Name) { fData = new TCalibrationsMonitor::Data_t(); } //_____________________________________________________________________________ TCalibrationsMonitor::~TCalibrationsMonitor() { delete fData; } //_____________________________________________________________________________ int TCalibrationsMonitor::Init() { printf(" inside TCalibrationsMonitor::Init()\n"); // AC // first checks if the files are there bool exist; struct stat buffer; exist=false; sprintf(fPass10A.fFileName,"%sprod_physics_cdf_10A.html", fInputDirName.Data()); if (!stat(fPass10A.fFileName, &buffer)) { // the file exists exist = true; fPass10A.fStatus=0; } fPass10A.fExist = exist; exist=false; sprintf(fPass17A.fFileName,"%sprod_physics_cdf_17A.html", fInputDirName.Data()); if (!stat(fPass17A.fFileName, &buffer)) { // the file exists exist = true; fPass17A.fStatus=0; } fPass17A.fExist = exist; exist=false; sprintf(fCotBeam.fFileName,"%spad_physics_cotbeam.html", fInputDirName.Data()); if (!stat(fCotBeam.fFileName, &buffer)) { // the file exists exist = true; fCotBeam.fStatus=0; } fCotBeam.fExist = exist; exist=false; sprintf(fSvxBeam.fFileName,"%spad_physics_svxbeam.html", fInputDirName.Data()); if (!stat(fSvxBeam.fFileName, &buffer)) { // the file exists exist = true; fSvxBeam.fStatus=0; } fSvxBeam.fExist = exist; exist=false; sprintf(fCotSet.fFileName,"%sprod_physics_cot.html", fInputDirName.Data()); if (!stat(fCotSet.fFileName, &buffer)) { // the file exists exist = true; fCotSet.fStatus=0; } fCotSet.fExist = exist; exist=false; sprintf(fSvxSet.fFileName,"%sprod_physics_svx.html", fInputDirName.Data()); if (!stat(fSvxSet.fFileName, &buffer)) { // the file exists exist = true; fSvxSet.fStatus=0; } fSvxSet.fExist = exist; // now read the paramenters TString parsFile; char dummy[300]; parsFile = fHtmlDirectory + "/Params.dat"; printf("++%s\n", parsFile.Data()); FILE* fIn = fopen(parsFile,"r"); fgets(dummy, sizeof(dummy)-1, fIn); fscanf(fIn,"%f %f", &fPars.maxDaysMissWPass10A, &fPars.maxDaysMissEPass10A); fgets(dummy, sizeof(dummy)-1, fIn); // rest of line fgets(dummy, sizeof(dummy)-1, fIn); fscanf(fIn,"%f %f", &fPars.maxDaysMissWPass17A, &fPars.maxDaysMissEPass17A); fgets(dummy, sizeof(dummy)-1, fIn); // rest of line fgets(dummy, sizeof(dummy)-1, fIn); fscanf(fIn,"%f %f", &fPars.maxDaysMissWCotBeam, &fPars.maxDaysMissECotBeam); fgets(dummy, sizeof(dummy)-1, fIn); // rest of line fgets(dummy, sizeof(dummy)-1, fIn); fscanf(fIn,"%f %f", &fPars.maxDaysMissWSvxBeam, &fPars.maxDaysMissESvxBeam); fgets(dummy, sizeof(dummy)-1, fIn); // rest of line fgets(dummy, sizeof(dummy)-1, fIn); fscanf(fIn,"%d %d", &fPars.maxHoursMissWCotSet, &fPars.maxHoursMissECotSet); fgets(dummy, sizeof(dummy)-1, fIn); // rest of line fgets(dummy, sizeof(dummy)-1, fIn); fscanf(fIn,"%d %d", &fPars.maxHoursMissWSvxSet, &fPars.maxHoursMissESvxSet); fgets(dummy, sizeof(dummy)-1, fIn); // rest of line fgets(dummy, sizeof(dummy)-1, fIn); fscanf(fIn,"%s", &fPars.fExpertPass); fgets(dummy, sizeof(dummy)-1, fIn); fscanf(fIn,"%s", &fPars.fExpertBeam); fgets(dummy, sizeof(dummy)-1, fIn); fscanf(fIn,"%s", &fPars.fExpertCot); fgets(dummy, sizeof(dummy)-1, fIn); fscanf(fIn,"%s", &fPars.fExpertSvx); fgets(dummy, sizeof(dummy)-1, fIn); fscanf(fIn,"%s", &fPars.fExpertCron); // fscanf(fIn,"%f %f", &fPars.minDaysOld, &fPars.minDaysXOld); fclose(fIn); // fPars.minDaysOld=2; fPars.minDaysXOld=3; // initialize fCotBeam.fNumRunsNotinPass=fSvxBeam.fNumRunsNotinPass=fCotSet.fNumRunsNotinPass=fSvxSet.fNumRunsNotinPass=0; for(int i=0; iQuery("select lorun from passcalibs where pass_index=123 and lorun>207000") // 1) prod10A if(fPass10A.fExist) { fPass10A.fMissingRunsMaxTime = 0; f = fopen(fPass10A.fFileName,"r"); // let's skip all comments fscanf(f,"%s", dummy); //
    fscanf(f,"%s %s %d %d:%d:%d %s %d", dummy, mon, &day, &hour, &min, &sec, dummy, &year);

    for(int i=0; i<12; i++) if(strncmp(mon, Month[i],3)==0) month=i+1;
    (fData->fFileTime).Set(year-1900, month, day, hour, min, sec);  // watch out: year must be 95fFileTime;
    fgets(dummy, 300, f);  //
    fgets(dummy, 300, f);  // --- 
    fgets(dummy, 300, f);  // --- 
    fgets(dummy, 300, f);  // // RunNum  Trigger Table ...
    
    while(fscanf(f,"%s", dummy) != -1){
      if(strncmp(dummy,"
",6)!=0) { fData->fRun=atoi(dummy); if(nPass10aRunsfRun; nPass10aRuns++; if(fPass10A.fFirstRun==0) fPass10A.fFirstRun=fData->fRun; fscanf(f,"%s %d %d.%d.%d", fData->fTable, &fData->fVersion, &year, &month, &day); fscanf(f,"%d:%d:%d %s %s %s", &hour, &min, &sec, fData->fProcess, fData->fPass, dummy); (fData->fRunTime).Set(year-1900, month, day, hour, min, sec); // watch out: year must be 95fNameTag=fData->fProdVersion=fData->fJobset=0; strcpy(fData->fStatus,"MISSING"); strcpy(fData->fUser," "); if(strstr(fData->fTable,"TEST")==NULL) { // skip test runs if(fData->fRun < fPass10A.fFirstMissingRun) { fPass10A.fFirstMissingRun=fData->fRun; fPass10A.fFirstMissingTime=fData->fRunTime; } if(fData->fRun > fPass10A.fLastMissingRun) { fPass10A.fLastMissingRun=fData->fRun; fPass10A.fLastMissingTime=fData->fRunTime; } if(fPass10A.fNumMissingRunsfRun; fPass10A.fMissingRunsTime[fPass10A.fNumMissingRuns]=fData->fRunTime; tDiff = now.Convert()- fData->fRunTime.Convert(); if(tDiff>(fPars.maxDaysMissWPass10A*ONEDAY) && tDiff<=(fPars.maxDaysMissEPass10A*ONEDAY)) fPass10A.fMissingRunsCode[fPass10A.fNumMissingRuns]=1; if(tDiff>(fPars.maxDaysMissEPass10A*ONEDAY)) fPass10A.fMissingRunsCode[fPass10A.fNumMissingRuns]=2; fPass10A.fMissingRunsMaxTime = MAX(fPass10A.fMissingRunsMaxTime, tDiff); fPass10A.fNumMissingRuns++; } } } else { // calibration available fData->fNameTag=atoi(dummy); fscanf(f,"%d %s %d", &fData->fProdVersion, fData->fStatus, &fData->fJobset); fscanf(f,"%s %s %d %d:%d:%d %d %s", dummy, mon, &day, &hour, &min, &sec, &year, fData->fUser); for(int i=0; i<12; i++) if(strncmp(mon, Month[i],3)==0) month=i+1; (fData->fCalTime).Set(year-1900, month, day, hour, min, sec); // watch out: year must be 95fTable,"TEST")==NULL) { // skip test runs if(fData->fRun > fPass10A.fLastAvailRun) { fPass10A.fLastAvailRun=fData->fRun; fPass10A.fLastAvailTime=fData->fRunTime; } } } } // endif no } // end while loop fclose(f); } // if exists // 2) prod17A if(fPass17A.fExist) { fPass17A.fMissingRunsMaxTime = 0; f = fopen(fPass17A.fFileName,"r"); // let's skip all comments fscanf(f,"%s", dummy); //
    fscanf(f,"%s %s %d %d:%d:%d %s %d", dummy, mon, &day, &hour, &min, &sec, dummy, &year);
    for(int i=0; i<12; i++) if(strncmp(mon, Month[i],3)==0) month=i+1;
    (fData->fFileTime).Set(year-1900, month, day, hour, min, sec); // watch out: year must be 95fFileTime;
    fgets(dummy, 300, f);  // 
    fgets(dummy, 300, f);  // --- 
    fgets(dummy, 300, f);  // --- 
    fgets(dummy, 300, f);  //  RunNum  Trigger Table ...
    
    
    while(fscanf(f,"%s", dummy) != -1){
      if(strncmp(dummy,"
",6)!=0) { fData->fRun=atoi(dummy); if(nPass17aRunsfRun; nPass17aRuns++; if(fPass17A.fFirstRun==0) fPass17A.fFirstRun=fData->fRun; fscanf(f,"%s %d %d.%d.%d", fData->fTable, &fData->fVersion, &year, &month, &day); fscanf(f,"%d:%d:%d %s %s %s", &hour, &min, &sec, fData->fProcess, fData->fPass, dummy); (fData->fRunTime).Set(year-1900, month, day, hour, min, sec); // watch out: year must be 95fNameTag=fData->fProdVersion=fData->fJobset=0; strcpy(fData->fStatus,"MISSING"); strcpy(fData->fUser," "); if(strstr(fData->fTable,"TEST")==NULL) { // skip test runs if(fData->fRun < fPass17A.fFirstMissingRun) { fPass17A.fFirstMissingRun=fData->fRun; fPass17A.fFirstMissingTime=fData->fRunTime; } if(fData->fRun > fPass17A.fLastMissingRun) { fPass17A.fLastMissingRun=fData->fRun; fPass17A.fLastMissingTime=fData->fRunTime; } if(fPass17A.fNumMissingRunsfRun; fPass17A.fMissingRunsTime[fPass17A.fNumMissingRuns]=fData->fRunTime; tDiff = now.Convert()- fData->fRunTime.Convert(); if(tDiff>(fPars.maxDaysMissWPass17A*ONEDAY) && tDiff<=(fPars.maxDaysMissEPass17A*ONEDAY)) fPass17A.fMissingRunsCode[fPass17A.fNumMissingRuns]=1; if(tDiff>(fPars.maxDaysMissEPass17A*ONEDAY)) fPass17A.fMissingRunsCode[fPass17A.fNumMissingRuns]=2; fPass17A.fMissingRunsMaxTime = MAX(fPass17A.fMissingRunsMaxTime, tDiff); fPass17A.fNumMissingRuns++; } } } else { // calibration available fData->fNameTag=atoi(dummy); fscanf(f,"%d %s %d", &fData->fProdVersion, fData->fStatus, &fData->fJobset); fscanf(f,"%s %s %d %d:%d:%d %d %s", dummy, mon, &day, &hour, &min, &sec, &year, fData->fUser); for(int i=0; i<12; i++) if(strncmp(mon, Month[i],3)==0) month=i+1; (fData->fCalTime).Set(year-1900, month, day, hour, min, sec); // watch out: year must be 95fTable,"TEST")==NULL) { // skip test runs if(fData->fRun > fPass17A.fLastAvailRun) { fPass17A.fLastAvailRun=fData->fRun; fPass17A.fLastAvailTime=fData->fRunTime; } } } } // endif no } // end while loop fclose(f); } // if exists // 3) CotBeam if(fCotBeam.fExist) { fCotBeam.fMissingRunsMaxTime = 0; f = fopen(fCotBeam.fFileName,"r"); // let's skip all comments fscanf(f,"%s", dummy); //
    fscanf(f,"%s %s %d %d:%d:%d %s %d", dummy, mon, &day, &hour, &min, &sec, dummy, &year);
    
    for(int i=0; i<12; i++) if(strncmp(mon, Month[i],3)==0) month=i+1;
    (fData->fFileTime).Set(year-1900, month, day, hour, min, sec);  // watch out: year must be 95fFileTime;    
    fscanf(f,"%s", dummy); // 
    fgets(dummy, 300, f);  //
    fgets(dummy, 300, f);  // --- 
    fgets(dummy, 300, f);  // --- 
    fgets(dummy, 300, f);  // // RunNum  Trigger Table ...

    while(fscanf(f,"%s", dummy) != -1){
      if(strncmp(dummy,"
",6)!=0) { fData->fRun=atoi(dummy); if(fCotBeam.fFirstRun==0) fCotBeam.fFirstRun=fData->fRun; fscanf(f,"%s %d %d.%d.%d", fData->fTable, &fData->fVersion, &year, &month, &day); fscanf(f,"%d:%d:%d %s %s", &hour, &min, &sec, fData->fProcess, fData->fPass); (fData->fRunTime).Set(year-1900, month, day, hour, min, sec); // watch out: year must be 95fPass,"is",2)==0) { // missing calibration fscanf(f,"%s %s", dummy, dummy); fData->fNameTag=fData->fProdVersion=fData->fJobset=0; strcpy(fData->fStatus,"MISSING"); strcpy(fData->fUser," "); if(strstr(fData->fTable,"TEST")==NULL) { // skip test runs if(fData->fRun < fCotBeam.fFirstMissingRun) { fCotBeam.fFirstMissingRun=fData->fRun; fCotBeam.fFirstMissingTime=fData->fRunTime; } if(fData->fRun > fCotBeam.fLastMissingRun) { fCotBeam.fLastMissingRun=fData->fRun; fCotBeam.fLastMissingTime=fData->fRunTime; } if(fCotBeam.fNumMissingRunsfRun; fCotBeam.fMissingRunsTime[fCotBeam.fNumMissingRuns]=fData->fRunTime; tDiff = now.Convert()- fData->fRunTime.Convert(); if(tDiff>(fPars.maxDaysMissWCotBeam*ONEDAY) && tDiff<=(fPars.maxDaysMissECotBeam*ONEDAY)) fCotBeam.fMissingRunsCode[fCotBeam.fNumMissingRuns]=1; if(tDiff>(fPars.maxDaysMissECotBeam*ONEDAY)) fCotBeam.fMissingRunsCode[fCotBeam.fNumMissingRuns]=2; fCotBeam.fMissingRunsMaxTime = MAX(fCotBeam.fMissingRunsMaxTime, tDiff); fCotBeam.fNumMissingRuns++; } } } else { // calibration available fData->fNameTag = atoi(fData->fPass); strcpy(fData->fPass," "); fscanf(f,"%d %s %d", &fData->fProdVersion, fData->fStatus, &fData->fJobset); fscanf(f,"%s %s %d %d:%d:%d %d %s", dummy, mon, &day, &hour, &min, &sec, &year, fData->fUser); for(int i=0; i<12; i++) if(strncmp(mon, Month[i],3)==0) month=i+1; (fData->fCalTime).Set(year-1900, month, day, hour, min, sec); // watch out: year must be 95fTable,"TEST")==NULL) { // skip test runs if(fData->fRun > fCotBeam.fLastAvailRun) { fCotBeam.fLastAvailRun=fData->fRun; fCotBeam.fLastAvailTime=fData->fRunTime; } notInPass=true; for(int i=0; ifRun==pass17aRuns[i]) notInPass=false; } if(notInPass) { fCotBeam.fRunsNotinPass[fCotBeam.fNumRunsNotinPass]=fData->fRun; fCotBeam.fNumRunsNotinPass++; } } } } // endif no } // end while loop fclose(f); } // if exists // 4) SvxBeam if(fSvxBeam.fExist) { fSvxBeam.fMissingRunsMaxTime = 0; f = fopen(fSvxBeam.fFileName,"r"); // let's skip all comments fscanf(f,"%s", dummy); //
    fscanf(f,"%s %s %d %d:%d:%d %s %d", dummy, mon, &day, &hour, &min, &sec, dummy, &year);
    for(int i=0; i<12; i++) if(strncmp(mon, Month[i],3)==0) month=i+1;
    (fData->fFileTime).Set(year-1900, month, day, hour, min, sec);  // watch out: year must be 95fFileTime;     
    fscanf(f,"%s", dummy); // 
    fgets(dummy, 300, f);  //
    fgets(dummy, 300, f);  // --- 
    fgets(dummy, 300, f);  // --- 
    fgets(dummy, 300, f);  // // RunNum  Trigger Table ...
 
    
    while(fscanf(f,"%s", dummy) != -1){
      if(strncmp(dummy,"
",6)!=0) { fData->fRun=atoi(dummy); if(fSvxBeam.fFirstRun==0) fSvxBeam.fFirstRun=fData->fRun; fscanf(f,"%s %d %d.%d.%d", fData->fTable, &fData->fVersion, &year, &month, &day); fscanf(f,"%d:%d:%d %s %s", &hour, &min, &sec, fData->fProcess, fData->fPass); (fData->fRunTime).Set(year-1900, month, day, hour, min, sec); // watch out: year must be 95fPass,"is",2)==0) { // missing calibration fscanf(f,"%s %s", dummy, dummy); fData->fNameTag=fData->fProdVersion=fData->fJobset=0; strcpy(fData->fStatus,"MISSING"); strcpy(fData->fUser," "); if(strstr(fData->fTable,"TEST")==NULL) { // skip test runs if(fData->fRun < fSvxBeam.fFirstMissingRun) { fSvxBeam.fFirstMissingRun=fData->fRun; fSvxBeam.fFirstMissingTime=fData->fRunTime; } if(fData->fRun > fSvxBeam.fLastMissingRun) { fSvxBeam.fLastMissingRun=fData->fRun; fSvxBeam.fLastMissingTime=fData->fRunTime; } if(fSvxBeam.fNumMissingRunsfRun; fSvxBeam.fMissingRunsTime[fSvxBeam.fNumMissingRuns]=fData->fRunTime; tDiff = now.Convert()- fData->fRunTime.Convert(); if(tDiff>(fPars.maxDaysMissWSvxBeam*ONEDAY) && tDiff<=(fPars.maxDaysMissESvxBeam*ONEDAY)) fSvxBeam.fMissingRunsCode[fSvxBeam.fNumMissingRuns]=1; if(tDiff>(fPars.maxDaysMissESvxBeam*ONEDAY)) fSvxBeam.fMissingRunsCode[fSvxBeam.fNumMissingRuns]=2; fSvxBeam.fMissingRunsMaxTime = MAX(fSvxBeam.fMissingRunsMaxTime, tDiff); fSvxBeam.fNumMissingRuns++; } } } else { // calibration available fData->fNameTag = atoi(fData->fPass); strcpy(fData->fPass," "); fscanf(f,"%d %s %d", &fData->fProdVersion, fData->fStatus, &fData->fJobset); fscanf(f,"%s %s %d %d:%d:%d %d %s", dummy, mon, &day, &hour, &min, &sec, &year, fData->fUser); for(int i=0; i<12; i++) if(strncmp(mon, Month[i],3)==0) month=i+1; (fData->fCalTime).Set(year-1900, month, day, hour, min, sec); // watch out: year must be 95fTable,"TEST")==NULL) { // skip test runs if(fData->fRun > fSvxBeam.fLastAvailRun) { fSvxBeam.fLastAvailRun=fData->fRun; fSvxBeam.fLastAvailTime=fData->fRunTime; } notInPass=true; for(int i=0; ifRun==pass17aRuns[i]) notInPass=false; } if(notInPass) { fSvxBeam.fRunsNotinPass[fSvxBeam.fNumRunsNotinPass]=fData->fRun; fSvxBeam.fNumRunsNotinPass++; } } } } // endif no } // end while loop fclose(f); } // if exists // 5) CotSet if(fCotSet.fExist) { fCotSet.fMissingRunsMaxTime = 0; f = fopen(fCotSet.fFileName,"r"); // let's skip all comments fscanf(f,"%s", dummy); //
    fscanf(f,"%s %s %d %d:%d:%d %s %d", dummy, mon, &day, &hour, &min, &sec, dummy, &year);
    for(int i=0; i<12; i++) if(strncmp(mon, Month[i],3)==0) month=i+1;
    (fData->fFileTime).Set(year-1900, month, day, hour, min, sec);  // watch out: year must be 95fFileTime;     
    fscanf(f,"%s", dummy); // 
    fgets(dummy, 300, f);  //
    fgets(dummy, 300, f);  // --- 
    fgets(dummy, 300, f);  // --- 
    fgets(dummy, 300, f);  // // RunNum  Trigger Table ...
    
    while(fscanf(f,"%s", dummy) != -1){
      if(strncmp(dummy,"
",6)!=0) { fData->fRun=atoi(dummy); if(fCotSet.fFirstRun==0) fCotSet.fFirstRun=fData->fRun; fscanf(f,"%s %d %d.%d.%d", fData->fTable, &fData->fVersion, &year, &month, &day); fscanf(f,"%d:%d:%d %s %s", &hour, &min, &sec, fData->fProcess, fData->fPass); (fData->fRunTime).Set(year-1900, month, day, hour, min, sec); // watch out: year must be 95fPass,"is",2)==0) { // missing calibration fscanf(f,"%s %s", dummy, dummy); fData->fNameTag=fData->fProdVersion=fData->fJobset=0; strcpy(fData->fStatus,"MISSING"); strcpy(fData->fUser," "); if(strstr(fData->fTable,"TEST")==NULL) { // skip test runs if(fData->fRun < fCotSet.fFirstMissingRun) { fCotSet.fFirstMissingRun=fData->fRun; fCotSet.fFirstMissingTime=fData->fRunTime; } if(fData->fRun > fCotSet.fLastMissingRun) { fCotSet.fLastMissingRun=fData->fRun; fCotSet.fLastMissingTime=fData->fRunTime; } if(fCotSet.fNumMissingRunsfRun; fCotSet.fMissingRunsTime[fCotSet.fNumMissingRuns]=fData->fRunTime; tDiff = now.Convert()- fData->fRunTime.Convert(); if(tDiff>(fPars.maxHoursMissWCotSet*ONEHOUR) && tDiff<=(fPars.maxHoursMissECotSet*ONEHOUR)) fCotSet.fMissingRunsCode[fCotSet.fNumMissingRuns]=1; if(tDiff>(fPars.maxHoursMissECotSet*ONEHOUR)) fCotSet.fMissingRunsCode[fCotSet.fNumMissingRuns]=2; fCotSet.fMissingRunsMaxTime = MAX(fCotSet.fMissingRunsMaxTime, tDiff); fCotSet.fNumMissingRuns++; } } } else { // calibration available fData->fNameTag = atoi(fData->fPass); strcpy(fData->fPass," "); fscanf(f,"%d %s %d", &fData->fProdVersion, fData->fStatus, &fData->fJobset); fscanf(f,"%s %s %d %d:%d:%d %d %s", dummy, mon, &day, &hour, &min, &sec, &year, fData->fUser); for(int i=0; i<12; i++) if(strncmp(mon, Month[i],3)==0) month=i+1; (fData->fCalTime).Set(year-1900, month, day, hour, min, sec); // watch out: year must be 95fTable,"TEST")==NULL) { // skip test runs if(fData->fRun > fCotSet.fLastAvailRun) { fCotSet.fLastAvailRun=fData->fRun; fCotSet.fLastAvailTime=fData->fRunTime; } notInPass=true; for(int i=0; ifRun==pass10aRuns[i]) notInPass=false; } if(notInPass) { fCotSet.fRunsNotinPass[fCotSet.fNumRunsNotinPass]=fData->fRun; fCotSet.fNumRunsNotinPass++; } } } } // endif no } // end while loop fclose(f); } // if exists // 6) SvxSet f = fopen(fSvxSet.fFileName,"r"); // let's skip all comments if(fSvxSet.fExist) { fSvxSet.fMissingRunsMaxTime = 0; fscanf(f,"%s", dummy); //
 
    fscanf(f,"%s %s %d %d:%d:%d %s %d", dummy, mon, &day, &hour, &min, &sec, dummy, &year);
    for(int i=0; i<12; i++) if(strncmp(mon, Month[i],3)==0) month=i+1;
    (fData->fFileTime).Set(year-1900, month, day, hour, min, sec);  // watch out: year must be 95fFileTime;     
    fscanf(f,"%s", dummy); // 
    fgets(dummy, 300, f);  //
    fgets(dummy, 300, f);  // --- 
    fgets(dummy, 300, f);  // --- 
    fgets(dummy, 300, f);  // // RunNum  Trigger Table ...
    
    while(fscanf(f,"%s", dummy) != -1){
      if(strncmp(dummy,"
",6)!=0) { fData->fRun=atoi(dummy); if(fSvxSet.fFirstRun==0) fSvxSet.fFirstRun=fData->fRun; fscanf(f,"%s %d %d.%d.%d", fData->fTable, &fData->fVersion, &year, &month, &day); fscanf(f,"%d:%d:%d %s %s", &hour, &min, &sec, fData->fProcess, fData->fPass); (fData->fRunTime).Set(year-1900, month, day, hour, min, sec); // watch out: year must be 95fPass,"is",2)==0) { // missing calibration fscanf(f,"%s %s", dummy, dummy); fData->fNameTag=fData->fProdVersion=fData->fJobset=0; strcpy(fData->fStatus,"MISSING"); strcpy(fData->fUser," "); if(strstr(fData->fTable,"TEST")==NULL) { // skip test runs if(fData->fRun < fSvxSet.fFirstMissingRun) { fSvxSet.fFirstMissingRun=fData->fRun; fSvxSet.fFirstMissingTime=fData->fRunTime; } if(fData->fRun > fSvxSet.fLastMissingRun) { fSvxSet.fLastMissingRun=fData->fRun; fSvxSet.fLastMissingTime=fData->fRunTime; } if(fSvxSet.fNumMissingRunsfRun; fSvxSet.fMissingRunsTime[fSvxSet.fNumMissingRuns]=fData->fRunTime; tDiff = now.Convert()- fData->fRunTime.Convert(); if(tDiff>(fPars.maxHoursMissWSvxSet*ONEHOUR) && tDiff<=(fPars.maxHoursMissESvxSet*ONEHOUR)) fSvxSet.fMissingRunsCode[fSvxSet.fNumMissingRuns]=1; if(tDiff>(fPars.maxHoursMissESvxSet*ONEHOUR)) fSvxSet.fMissingRunsCode[fSvxSet.fNumMissingRuns]=2; fSvxSet.fMissingRunsMaxTime = MAX(fSvxSet.fMissingRunsMaxTime, tDiff); fSvxSet.fNumMissingRuns++; } } } else { // calibration available fData->fNameTag = atoi(fData->fPass); strcpy(fData->fPass," "); fscanf(f,"%d %s %d", &fData->fProdVersion, fData->fStatus, &fData->fJobset); fscanf(f,"%s %s %d %d:%d:%d %d %s", dummy, mon, &day, &hour, &min, &sec, &year, fData->fUser); for(int i=0; i<12; i++) if(strncmp(mon, Month[i],3)==0) month=i+1; (fData->fCalTime).Set(year-1900, month, day, hour, min, sec); // watch out: year must be 95fTable,"TEST")==NULL) { // skip test runs if(fData->fRun > fSvxSet.fLastAvailRun) { fSvxSet.fLastAvailRun=fData->fRun; fSvxSet.fLastAvailTime=fData->fRunTime; } notInPass=true; for(int i=0; ifRun==pass10aRuns[i]) notInPass=false; } if(notInPass) { fSvxSet.fRunsNotinPass[fSvxSet.fNumRunsNotinPass]=fData->fRun; fSvxSet.fNumRunsNotinPass++; } } } } // endif no } // end while loop fclose(f); } // if exist return 0; } //_____________________________________________________________________________ int TCalibrationsMonitor::MakePlots(const char* HtmlFile) { #define max(A,B) ((A)>(B)?(A):(B)) printf(" inside TCalibrationsMonitor::MakePlots()\n"); // AC TDatime now; int tDiff; // just fills the Status int code; // if(fPass10A.fNumOldRuns>0) fPass10A.fStatus=1; // if(fPass10A.fNumXOldRuns>0) fPass10A.fStatus=2; code=0; if(fPass10A.fNumMissingRuns>0) { for(int i=0; i 2.*ONEHOUR) fPass10A.fStatus=4; // if(fPass17A.fNumOldRuns>0) fPass17A.fStatus=1; // if(fPass17A.fNumXOldRuns>0) fPass17A.fStatus=2; code=0; if(fPass17A.fNumMissingRuns>0) { for(int i=0; i 2.*ONEHOUR) fPass17A.fStatus=4; // if(fCotBeam.fNumOldRuns>0) fCotBeam.fStatus=1; // if(fCotBeam.fNumXOldRuns>0) fCotBeam.fStatus=2; code=0; if(fCotBeam.fNumMissingRuns>0) { for(int i=0; i 2.*ONEHOUR) fCotBeam.fStatus=4; // if(fSvxBeam.fNumOldRuns>0) fSvxBeam.fStatus=1; // if(fSvxBeam.fNumXOldRuns>0) fSvxBeam.fStatus=2; code=0; if(fSvxBeam.fNumMissingRuns>0) { for(int i=0; i 2.*ONEHOUR) fSvxBeam.fStatus=4; // if(fCotSet.fNumOldRuns>0) fCotSet.fStatus=1; // if(fCotSet.fNumXOldRuns>0) fCotSet.fStatus=2; code=0; if(fCotSet.fNumMissingRuns>0) { for(int i=0; i 2.*ONEHOUR) fCotSet.fStatus=4; // if(fSvxSet.fNumOldRuns>0) fSvxSet.fStatus=1; // if(fSvxSet.fNumXOldRuns>0) fSvxSet.fStatus=2; code=0; if(fSvxSet.fNumMissingRuns>0) { for(int i=0; i 2.*ONEHOUR) fSvxSet.fStatus=4; TString statusFile; statusFile = fHtmlDirectory + "/Status.dat"; FILE* fOut = fopen(statusFile,"w"); fprintf(fOut,"%d %d %d %d %d %d\n", fPass10A.fStatus, fPass17A.fStatus, fCotBeam.fStatus, fSvxBeam.fStatus, fCotSet.fStatus, fSvxSet.fStatus); fprintf(fOut,"%s", now.AsSQLString()); fclose(fOut); return 0; } //_____________________________________________________________________________ int TCalibrationsMonitor::MakeHtml(const char* HtmlFile) { // input file is always a raw data file... printf(" inside TCalibrationsMonitor::MakeHtml()\n"); // AC char * wwwBase={"http://www-cdf.fnal.gov/offline/monitoring/"}; TDatime now; FILE* page; const char* mon_dir = gSystem->Getenv("OFFLINE_MON_DIR"); TString inFile, outFile; // first the time-stamp file TString psFile, gifFile; char command[400]; char cFileName[200]; int calibStatus=0; if(fPass10A.fStatus==1 || fPass17A.fStatus==1 || fCotBeam.fStatus==1 || fSvxBeam.fStatus==1 || fCotSet.fStatus==1 || fSvxSet.fStatus==1) calibStatus=1; if(fPass10A.fStatus==2 || fPass17A.fStatus==2 || fCotBeam.fStatus==2 || fSvxBeam.fStatus==2 || fCotSet.fStatus==2 || fSvxSet.fStatus==2) calibStatus=2; if(fPass10A.fStatus==4 || fPass17A.fStatus==4 || fCotBeam.fStatus==4 || fSvxBeam.fStatus==4 || fCotSet.fStatus==4 || fSvxSet.fStatus==4) calibStatus=4; TCanvas * ctime = new TCanvas("ctime","ctime",250,80); TPaveText * ptime = new TPaveText(0.,0.,1.,1.); char timeLabel[100]; sprintf(timeLabel, "%s", now.AsString()); TText *txt = ptime->AddText(timeLabel); if(calibStatus==0) txt->SetTextColor(kGreen); if(calibStatus==1) txt->SetTextColor(kYellow); if(calibStatus==2) txt->SetTextColor(kRed); ptime->Draw(); psFile = fHtmlDirectory + "/Time.eps"; gifFile = fHtmlDirectory + "/Time.gif"; ctime->Print(psFile); sprintf(command,"pstopnm -ppm -xborder 0 -yborder 0 -portrait %s", psFile.Data()); gSystem->Exec(command); sprintf(command,"ppmtogif %s001.ppm > %s", psFile.Data(), gifFile.Data()); gSystem->Exec(command); sprintf(command,"rm -f %s001.ppm", psFile.Data()); gSystem->Exec(command); // all passes // Pass10A if(fPass10A.fStatus==0) inFile = TString(mon_dir) + "/greenball.gif"; if(fPass10A.fStatus==1) inFile = TString(mon_dir) + "/yelball.gif"; if(fPass10A.fStatus==2) inFile = TString(mon_dir) + "/redball.gif"; if(fPass10A.fStatus==4) inFile = TString(mon_dir) + "/down.gif"; outFile = fHtmlDirectory + "/Pass10A.gif"; gSystem->CopyFile(inFile.Data(), outFile.Data(), kTRUE); // Pass17A if(fPass17A.fStatus==0) inFile = TString(mon_dir) + "/greenball.gif"; if(fPass17A.fStatus==1) inFile = TString(mon_dir) + "/yelball.gif"; if(fPass17A.fStatus==2) inFile = TString(mon_dir) + "/redball.gif"; if(fPass17A.fStatus==4) inFile = TString(mon_dir) + "/down.gif"; outFile = fHtmlDirectory + "/Pass17A.gif"; gSystem->CopyFile(inFile.Data(), outFile.Data(), kTRUE); // CotBeam if(fCotBeam.fStatus==0) inFile = TString(mon_dir) + "/greenball.gif"; if(fCotBeam.fStatus==1) inFile = TString(mon_dir) + "/yelball.gif"; if(fCotBeam.fStatus==2) inFile = TString(mon_dir) + "/redball.gif"; if(fCotBeam.fStatus==4) inFile = TString(mon_dir) + "/down.gif"; outFile = fHtmlDirectory + "/CotBeam.gif"; gSystem->CopyFile(inFile.Data(), outFile.Data(), kTRUE); // SvxBeam if(fSvxBeam.fStatus==0) inFile = TString(mon_dir) + "/greenball.gif"; if(fSvxBeam.fStatus==1) inFile = TString(mon_dir) + "/yelball.gif"; if(fSvxBeam.fStatus==2) inFile = TString(mon_dir) + "/redball.gif"; if(fSvxBeam.fStatus==4) inFile = TString(mon_dir) + "/down.gif"; outFile = fHtmlDirectory + "/SvxBeam.gif"; gSystem->CopyFile(inFile.Data(), outFile.Data(), kTRUE); // CotSet if(fCotSet.fStatus==0) inFile = TString(mon_dir) + "/greenball.gif"; if(fCotSet.fStatus==1) inFile = TString(mon_dir) + "/yelball.gif"; if(fCotSet.fStatus==2) inFile = TString(mon_dir) + "/redball.gif"; if(fCotSet.fStatus==4) inFile = TString(mon_dir) + "/down.gif"; outFile = fHtmlDirectory + "/CotSet.gif"; gSystem->CopyFile(inFile.Data(), outFile.Data(), kTRUE); // SvxSet if(fSvxSet.fStatus==0) inFile = TString(mon_dir) + "/greenball.gif"; if(fSvxSet.fStatus==1) inFile = TString(mon_dir) + "/yelball.gif"; if(fSvxSet.fStatus==2) inFile = TString(mon_dir) + "/redball.gif"; if(fSvxSet.fStatus==4) inFile = TString(mon_dir) + "/down.gif"; outFile = fHtmlDirectory + "/SvxSet.gif"; gSystem->CopyFile(inFile.Data(), outFile.Data(), kTRUE); // now global if(calibStatus==0) inFile = TString(mon_dir) + "/greenball.gif"; if(calibStatus==1) inFile = TString(mon_dir) + "/yelball.gif"; if(calibStatus==2) inFile = TString(mon_dir) + "/redball.gif"; if(calibStatus==4) inFile = TString(mon_dir) + "/down.gif"; outFile = fHtmlDirectory + "/All.gif"; gSystem->CopyFile(inFile.Data(), outFile.Data(), kTRUE); char date1[20],date2[20]; int code; int tDiff; int diffHours, hoursW, hoursE; TString htmlFile; // first we fill each single HTML page // Pass10A status htmlFile = fHtmlDirectory + "/Pass10A.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
Calibrations monitorPass10A monitorPass10A Help
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); if(fPass10A.fStatus==0) fprintf(page,"\n"); if(fPass10A.fStatus==1) fprintf(page,"\n"); if(fPass10A.fStatus==2 || fPass10A.fStatus==4) fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 
greenball.gif Pass10A Statusyelball.gif Pass10A Statusredball.gif Pass10A Status
 
\n"); fprintf(page,"
\n"); if(fPass10A.fExist) { code=0; if(fPass10A.fNumMissingRuns>0) { for(int i=0; i greenball.gif Runs with missing calibration "); fprintf(page," \n"); } if(code==1) { fprintf(page," yelball.gif Runs with missing calibration ==> KEEP AN EYE ON THIS "); fprintf(page," \n"); } if(code==2) { fprintf(page," redball.gif Runs with missing calibration "); fprintf(page," ==> TAKE ACTION! (click on siren) ==> siren.gif \n"); } fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); if(fPass10A.fNumMissingRuns==0) fprintf(page," No Run missing calibration
\n"); for(int i=0; i Run %d is missing (run is %d hours old)
\n", fPass10A.fMissingRuns[i], diffHours); if(fPass10A.fMissingRunsCode[i]==1) fprintf(page," Run %d is missing (run is %d hours old)
\n", fPass10A.fMissingRuns[i], diffHours); if(fPass10A.fMissingRunsCode[i]==2) fprintf(page," Run %d is missing (run is %d hours old)
\n", fPass10A.fMissingRuns[i], diffHours); } fprintf(page,"

\n"); fprintf(page,"
\n"); } else { fprintf(page," The calibration file for Pass10A is missing !"); } fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 

\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
greenball.gif Recent runsyelball.gif Not-so-recent runsredball.gif Old runs
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"

\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n", now.AsSQLString()); fprintf(page,"
Legal Notices
Brought To You By: Calibrations Monitoring
Last updated: %s
\n"); fprintf(page,"\n"); fclose(page); // Pass10A popup hoursW = static_cast ( fPars.maxDaysMissWPass10A*24 ); hoursE = static_cast ( fPars.maxDaysMissEPass10A*24 ); htmlFile = fHtmlDirectory + "/Pass10APop.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Pass10As status\n"); fprintf(page,"

\n"); fprintf(page,"The status of the Pass10A calibration depends on how old is the first run for which calibrations are not available. If it is more than %d hours old then the situation is declared 'bad' (red ball) . If the first non-calibrated run is between %d and %d hours old, then the situation is flagged 'abnormal' (yellow ball). Otherwise (<%d hours)the situation is flagged as 'normal' (green ball)\n", hoursE, hoursW, hoursE, hoursW); fprintf(page,"
\n"); fprintf(page,"The downward arrow indicates that the calibration files are missing or not up-to-date then there might be problems with the cron job and the expert should be contacted.\n"); fprintf(page,"

\n"); fclose(page); // Pass10A Help htmlFile = fHtmlDirectory + "/Pass10AHelp.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"Pass10A Help\n"); fprintf(page,"

\n"); fprintf(page," \n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 
Pass10A Help
 
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"This monitor shows the status of calibrations for Pass10A. The things which are monitored are essentially:\n"); fprintf(page,"
    \n"); fprintf(page,"
  • the existence of the corresponding web page (created by a cron job)\n"); fprintf(page,"
  • the latest occurence of calibration\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"For the latest runs, if there are runs missing calibration which are no more than %d hours old, the situation is flagged as 'normal' (green ball).\n", hoursW); fprintf(page,"If there are runs missing calibration which are between %d and %d hours old, this needs attention and the status is labeled as 'abnormal' (yellow). \n", hoursW, hoursE); fprintf(page,"If there are runs missing calibration which are more than %d hours old, then there is need for immediate action and the situation is flagged as 'bad' (red).\n", hoursE); fprintf(page,"
\n"); fprintf(page,"If the calibration files are missing or not up-to-date then there might be problems with the cron job and the expert should be contacted.\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n", now.AsSQLString()); fprintf(page,"
Legal Notices
Brought To You By: Calibrations Monitoring
Last updated: %s
\n"); fprintf(page,"\n"); fclose(page); // Pass17A status htmlFile = fHtmlDirectory + "/Pass17A.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
Calibrations monitorPass17A monitorPass17A Help
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); if(fPass17A.fStatus==0) fprintf(page,"\n"); if(fPass17A.fStatus==1) fprintf(page,"\n"); if(fPass17A.fStatus==2||fPass17A.fStatus==4) fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 
greenball.gif Pass17A Statusyelball.gif Pass17A Statusredball.gif Pass17A Status
 
\n"); fprintf(page,"
\n"); if(fPass17A.fExist) { code=0; if(fPass17A.fNumMissingRuns>0) { for(int i=0; i greenball.gif Runs with missing calibration "); fprintf(page," \n"); } if(code==1) { fprintf(page," yelball.gif Runs with missing calibration ==> KEEP AN EYE ON THIS "); fprintf(page," \n"); } if(code==2) { fprintf(page," redball.gif Runs with missing calibration "); fprintf(page," ==> TAKE ACTION! (click on siren) ==> siren.gif \n"); } fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); if(fPass17A.fNumMissingRuns==0) fprintf(page," No Run missing calibration
\n"); for(int i=0; i Run %d is missing (run is %d hours old)

\n", fPass17A.fMissingRuns[i], diffHours); if(fPass17A.fMissingRunsCode[i]==1) fprintf(page," Run %d is missing (run is %d hours old)
\n", fPass17A.fMissingRuns[i],diffHours ); if(fPass17A.fMissingRunsCode[i]==2) fprintf(page," Run %d is missing (run is %d hours old)
\n", fPass17A.fMissingRuns[i], diffHours); } fprintf(page,"

\n"); fprintf(page,"
\n"); } else { fprintf(page," The calibration file for Pass17A is missing !"); } fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 

\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
greenball.gif Recent runsyelball.gif Not-so-recent runsredball.gif Old runs
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"

\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n", now.AsSQLString()); fprintf(page,"
Legal Notices
Brought To You By: Calibrations Monitoring
Last updated: %s
\n"); fprintf(page,"\n"); fclose(page); // Pass17A popup hoursW = static_cast ( fPars.maxDaysMissWPass17A*24 ); hoursE = static_cast ( fPars.maxDaysMissEPass17A*24 ); htmlFile = fHtmlDirectory + "/Pass17APop.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Pass17As status\n"); fprintf(page,"

\n"); fprintf(page,"The status of the Pass17A calibration depends on how old is the first run for which calibrations are not available. If it is more than %d hours old then the situation is declared 'bad' (red ball). If the first non-calibrated run is between %d and %d hours old, then the situation is flagged 'abnormal' (yellow ball). Otherwise (<%d hours) the situation is flagged as 'normal' (green ball)\n", hoursE, hoursW, hoursE, hoursW); fprintf(page,"
\n"); fprintf(page,"The downward arrow indicates that the calibration files are missing or not up-to-date then there might be problems with the cron job and the expert should be contacted.\n"); fprintf(page,"

\n"); fclose(page); // Pass17A Help htmlFile = fHtmlDirectory + "/Pass17AHelp.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Pass10A Help\n"); fprintf(page,"

\n"); fprintf(page," \n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 
Pass17A Help
 
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"This monitor shows the status of calibrations for Pass17A. The things which are monitored are essentially:\n"); fprintf(page,"
    \n"); fprintf(page,"
  • the existence of the corresponding web page (created by a cron job)\n"); fprintf(page,"
  • the latest occurence of calibration\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"For the latest runs, if there are runs missing calibration which are no more than %d hours old, the situation is flagged as 'normal' (green ball).\n", hoursW); fprintf(page,"If there are runs missing calibration which are between %d and %d hours old, this needs attention and the status is labeled as 'abnormal' (yellow). \n", hoursW, hoursE); fprintf(page,"If there are runs missing calibration which are more than %d hours old, then there is need for immediate action and the situation is flagged as 'bad' (red).\n", hoursE); fprintf(page,"
\n"); fprintf(page,"If the calibration files are missing or not up-to-date then there might be problems with the cron job and the expert should be contacted.\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n", now.AsSQLString()); fprintf(page,"
Legal Notices
Brought To You By: Calibrations Monitoring
Last updated: %s
\n"); fprintf(page,"\n"); fclose(page); // CotBeam status htmlFile = fHtmlDirectory + "/CotBeam.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
Calibrations monitorPad_Physics_Cot monitorPad_Physics_CotBeam Help
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); if(fCotBeam.fStatus==0) fprintf(page,"\n"); if(fCotBeam.fStatus==1) fprintf(page,"\n"); if(fCotBeam.fStatus==2||fCotBeam.fStatus==4) fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 
greenball.gif Pad_Physics_CotBeam Statusyelball.gif Pad_Physics_CotBeam Statusredball.gif Pad_Physics_CotBeam Status
 
\n"); fprintf(page,"
\n"); if(fCotBeam.fExist) { code=0; if(fCotBeam.fNumMissingRuns>0) { for(int i=0; i greenball.gif Runs with missing calibration "); fprintf(page," \n"); } if(code==1) { fprintf(page," yelball.gif Runs with missing calibration ==> KEEP AN EYE ON THIS "); fprintf(page," \n"); } if(code==2) { fprintf(page," redball.gif Runs with missing calibration "); fprintf(page," ==> TAKE ACTION! (click on siren) ==> siren.gif \n"); } fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); if(fCotBeam.fNumMissingRuns==0) fprintf(page," No Run missing calibration
\n"); for(int i=0; i Run %d is missing (run is %d hours old)

\n", fCotBeam.fMissingRuns[i], diffHours); if(fCotBeam.fMissingRunsCode[i]==1) fprintf(page," Run %d is missing (run is %d hours old)
\n", fCotBeam.fMissingRuns[i], diffHours); if(fCotBeam.fMissingRunsCode[i]==2) fprintf(page," Run %d is missing (run is %d hours old)
\n", fCotBeam.fMissingRuns[i], diffHours); } fprintf(page,"

\n"); fprintf(page,"
\n"); if(fCotBeam.fNumRunsNotinPass>0) { fprintf(page,"
\n"); fprintf(page," greenball.gif Runs with calibration but not in PASS17A \n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); for(int i=0; i Run %d is not in PASS17A
\n", fCotBeam.fRunsNotinPass[i]); } fprintf(page,"

\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); } } else { fprintf(page," The calibration file for Pad_Physics_CotBeam is missing !"); } fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 

\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
greenball.gif Recent runsyelball.gif Not-so-recent runsredball.gif Old runs
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"

\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n", now.AsSQLString()); fprintf(page,"
Legal Notices
Brought To You By: Calibrations Monitoring
Last updated: %s
\n"); fprintf(page,"\n"); fclose(page); // CotBeam popup htmlFile = fHtmlDirectory + "/CotBeamPop.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Pad_Physics_CotBeam status\n"); fprintf(page,"

\n"); fprintf(page,"The status of the Pad_Physics_CotBeam calibration depends on how old is the last available calibration. If it is more than %3.1f days old then the situation is declared 'bad' (red ball) . If the last available calibration is between %3.1f and %3.1f days old , then the situation is flagged 'abnormal' (yellow ball) . Otherwise (<%3.1f days) the situation is flagged as 'normal' (green ball) \n", fPars.maxDaysMissESvxBeam, fPars.maxDaysMissWSvxBeam, fPars.maxDaysMissESvxBeam, fPars.maxDaysMissWSvxBeam); fprintf(page,"
\n"); fprintf(page,"The downward arrow indicates that the calibration files are missing or not up-to-date then there might be problems with the cron job and the expert should be contacted.\n"); fprintf(page,"

\n"); fclose(page); // CotBeam Help htmlFile = fHtmlDirectory + "/CotBeamHelp.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Pad_Physics_CotBeam Help\n"); fprintf(page,"

\n"); fprintf(page," \n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 
Pad_Physics_CotBeam Help
 
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"This monitor shows the status of calibrations for Pad_Physics_CotBeam. The things which are monitored are essentially:\n"); fprintf(page,"
    \n"); fprintf(page,"
  • the existence of the corresponding web page (created by a cron job)\n"); fprintf(page,"
  • the latest occurence of calibration\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"For the latest runs, if all runs have a calibration performed no later than %3.1f days. before current time, the situation is flagged as 'normal' (green ball).\n", fPars.maxDaysMissWCotBeam); fprintf(page,"If there are runs whose calibration is between %3.1f and %3.1f days old., this needs attention and the status is labeled as 'abnormal' (yellow). \n", fPars.maxDaysMissWCotBeam, fPars.maxDaysMissECotBeam); fprintf(page,"If there are runs whose calibration occurred more than %3.1f days ago., then there is need for immediate action and the situation is flagged as 'bad' (red).\n", fPars.maxDaysMissECotBeam); fprintf(page,"
\n"); fprintf(page,"If the calibration files are missing or not up-to-date then there might be problems with the cron job and the expert should be contacted.\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n", now.AsSQLString()); fprintf(page,"
Legal Notices
Brought To You By: Calibrations Monitoring
Last updated: %s
\n"); fprintf(page,"\n"); fclose(page); // SvxBeam status htmlFile = fHtmlDirectory + "/SvxBeam.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
Calibrations monitorPad_Physics_SvxBeam monitorPad_Physics_SvxBeam Help
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); if(fSvxBeam.fStatus==0) fprintf(page,"\n"); if(fSvxBeam.fStatus==1) fprintf(page,"\n"); if(fSvxBeam.fStatus==2||fSvxBeam.fStatus==4) fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 
greenball.gif Pad_Physics_SvxBeam Statusyelball.gif Pad_Physics_SvxBeam Statusredball.gif Pad_Physics_SvxBeam Status
 
\n"); fprintf(page,"
\n"); if(fSvxBeam.fExist) { code=0; if(fSvxBeam.fNumMissingRuns>0) { for(int i=0; i greenball.gif Runs with missing calibration "); fprintf(page," \n"); } if(code==1) { fprintf(page," yelball.gif Runs with missing calibration ==> KEEP AN EYE ON THIS "); fprintf(page," \n"); } if(code==2) { fprintf(page," redball.gif Runs with missing calibration "); fprintf(page," ==> TAKE ACTION! (click on siren) ==> siren.gif \n"); } fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); if(fSvxBeam.fNumMissingRuns==0) fprintf(page," No Run missing calibration
\n"); for(int i=0; i Run %d is missing (run is %d hours old)

\n", fSvxBeam.fMissingRuns[i], diffHours); if(fSvxBeam.fMissingRunsCode[i]==1) fprintf(page," Run %d is missing (run is %d hours old)
\n", fSvxBeam.fMissingRuns[i], diffHours); if(fSvxBeam.fMissingRunsCode[i]==2) fprintf(page," Run %d is missing (run is %d hours old)
\n", fSvxBeam.fMissingRuns[i], diffHours); } fprintf(page,"

\n"); fprintf(page,"
\n"); if(fSvxBeam.fNumRunsNotinPass>0) { fprintf(page,"
\n"); fprintf(page," greenball.gif Runs with calibration but not in PASS17A \n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); for(int i=0; i Run %d is not in PASS17A
\n", fSvxBeam.fRunsNotinPass[i]); } fprintf(page,"

\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); } } else { fprintf(page," The calibration file for Pad_Physics_SvxBeam is missing !"); } fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 

\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
greenball.gif Recent runsyelball.gif Not-so-recent runsredball.gif Old runs
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"

\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n", now.AsSQLString()); fprintf(page,"
Legal Notices
Brought To You By: Calibrations Monitoring
Last updated: %s
\n"); fprintf(page,"\n"); fclose(page); // SvxBeam popup htmlFile = fHtmlDirectory + "/SvxBeamPop.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Pad_Physics_SvxBeam status\n"); fprintf(page,"

\n"); fprintf(page,"The status of the Pad_Physics_SvxBeam calibration depends on how old is the last available calibration. If it is more than %3.1f days old then the situation is declared 'bad' (red ball). If the last available calibration is between %3.1f and %3.1f days old, then the situation is flagged 'abnormal' (yellow ball). Otherwise (<%3.1f days) the situation is flagged as 'normal' (green ball)\n", fPars.maxDaysMissESvxBeam, fPars.maxDaysMissWSvxBeam, fPars.maxDaysMissESvxBeam, fPars.maxDaysMissWSvxBeam); fprintf(page,"
\n"); fprintf(page,"The downward arrow indicates that the calibration files are missing or not up-to-date then there might be problems with the cron job and the expert should be contacted.\n"); fprintf(page,"

\n"); fclose(page); // SvxBeam Help htmlFile = fHtmlDirectory + "/SvxBeamHelp.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"Pad_Physics_SvxBeam Help\n"); fprintf(page,"

\n"); fprintf(page," \n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 
Pad_Physics_SvxBeam Help
 
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"This monitor shows the status of calibrations for Pad_Physics_SvxBeam. The things which are monitored are essentially:\n"); fprintf(page,"
    \n"); fprintf(page,"
  • the existence of the corresponding web page (created by a cron job)\n"); fprintf(page,"
  • the latest occurence of calibration\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"For the latest runs, if there are runs missing calibration which are no more than %3.1f days old , the situation is flagged as 'normal' (green ball).\n", fPars.maxDaysMissWSvxBeam); fprintf(page,"If there are runs missing calibration which are between %3.1f and %3.1f days old, this needs attention and the status is labeled as 'abnormal' (yellow). \n", fPars.maxDaysMissWSvxBeam, fPars.maxDaysMissESvxBeam); fprintf(page,"If there are runs missing calibration which are more than %3.1f days old, then there is need for immediate action and the situation is flagged as 'bad' (red).\n", fPars.maxDaysMissESvxBeam); fprintf(page,"
\n"); fprintf(page,"If the calibration files are missing or not up-to-date then there might be problems with the cron job and the expert should be contacted.\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n", now.AsSQLString()); fprintf(page,"
Legal Notices
Brought To You By: Calibrations Monitoring
Last updated: %s
\n"); fprintf(page,"\n"); fclose(page); // CotSet status htmlFile = fHtmlDirectory + "/CotSet.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
Calibrations monitorProd_Physics_Cot monitorProd_Physics_Cot Help
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); if(fCotSet.fStatus==0) fprintf(page,"\n"); if(fCotSet.fStatus==1) fprintf(page,"\n"); if(fCotSet.fStatus==2||fCotSet.fStatus==4) fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 
greenball.gif Prod_Physics_Cot Statusyelball.gif Prod_Physics_Cot Statusredball.gif Prod_Physics_Cot Status
 
\n"); fprintf(page,"
\n"); if(fCotSet.fExist) { code=0; if(fCotSet.fNumMissingRuns>0) { for(int i=0; i greenball.gif Runs with missing calibration "); fprintf(page," \n"); } if(code==1) { fprintf(page," yelball.gif Runs with missing calibration ==> KEEP AN EYE ON THIS "); fprintf(page," \n"); } if(code==2) { fprintf(page," redball.gif Runs with missing calibration "); fprintf(page," ==> TAKE ACTION! (click on siren) ==> siren.gif \n"); } fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); if(fCotSet.fNumMissingRuns==0) fprintf(page," No Run missing calibration
\n"); for(int i=0; i Run %d is missing (run is %d hours old)

\n", fCotSet.fMissingRuns[i], diffHours); if(fCotSet.fMissingRunsCode[i]==1) fprintf(page," Run %d is missing (run is %d hours old)
\n", fCotSet.fMissingRuns[i], diffHours); if(fCotSet.fMissingRunsCode[i]==2) fprintf(page," Run %d is missing (run is %d hours old)
\n", fCotSet.fMissingRuns[i], diffHours); } fprintf(page,"

\n"); fprintf(page,"
\n"); if(fCotSet.fNumRunsNotinPass>0) { fprintf(page,"
\n"); fprintf(page," greenball.gif Runs with calibration but not in PASS10A \n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); for(int i=0; i Run %d is not in PASS10A
\n", fCotSet.fRunsNotinPass[i]); } fprintf(page,"

\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); } } else { fprintf(page," The calibration file for Prod_Physics_Cot is missing !"); } fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 

\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
greenball.gif Recent runsyelball.gif Not-so-recent runsredball.gif Old runs
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"

\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n", now.AsSQLString()); fprintf(page,"
Legal Notices
Brought To You By: Calibrations Monitoring
Last updated: %s
\n"); fprintf(page,"\n"); fclose(page); // CotSet popup htmlFile = fHtmlDirectory + "/CotSetPop.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Prod_Physics_Cot status\n"); fprintf(page,"

\n"); fprintf(page,"The status of the Prod_Physics_Cot calibration depends on how old is the last available calibration. If it is more than %d hours old .then the situation is declared 'bad' (red ball). If the last available calibration is no more than %d hours old., then the situation is flagged 'abnormal' (yellow ball).\n", fPars.maxHoursMissWCotSet, fPars.maxHoursMissECotSet); fprintf(page,"In this case there is no 'normal' (green ball). condition, since the calibrations should be there by the end of the run.\n"); fprintf(page,"
\n"); fprintf(page,"The downward arrow indicates that the calibration files are missing or not up-to-date then there might be problems with the cron job and the expert should be contacted.\n"); fprintf(page,"

\n"); fclose(page); // CotSet Help htmlFile = fHtmlDirectory + "/CotSetHelp.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Prod_Physics_Cot Help\n"); fprintf(page,"

\n"); fprintf(page," \n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 
Prod_Physics_Cot Help
 
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"This monitor shows the status of calibrations for Prod_Physics_Cot. The things which are monitored are essentially:\n"); fprintf(page,"
    \n"); fprintf(page,"
  • the existence of the corresponding web page (created by a cron job)\n"); fprintf(page,"
  • the latest occurence of calibration\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"For the latest runs, if all runs have a calibration , the situation is flagged as 'normal' (green ball).\n", fPars.maxHoursMissWCotSet); fprintf(page,"If there are runs missing calibration which are less than %d hours old, this needs attention and the status is labeled as 'abnormal' (yellow). \n", fPars.maxHoursMissWCotSet); fprintf(page,"If there are runs missing calibration which are more than %d hours old, then there is need for immediate action and the situation is flagged as 'bad' (red).\n", fPars.maxHoursMissECotSet); fprintf(page,"
\n"); fprintf(page,"If the calibration files are missing or not up-to-date then there might be problems with the cron job and the expert should be contacted.\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n", now.AsSQLString()); fprintf(page,"
Legal Notices
Brought To You By: Calibrations Monitoring
Last updated: %s
\n"); fprintf(page,"\n"); fclose(page); // SvxSet status htmlFile = fHtmlDirectory + "/SvxSet.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
Calibrations monitorProd_Physics_Svx monitorProd_Physics_SvxS Help
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); if(fSvxSet.fStatus==0) fprintf(page,"\n"); if(fSvxSet.fStatus==1) fprintf(page,"\n"); if(fSvxSet.fStatus==2||fSvxSet.fStatus==4) fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 
greenball.gif Prod_Physics_Svx Statusyelball.gif Prod_Physics_Svx Statusredball.gif Prod_Physics_Svx Status
 
\n"); fprintf(page,"
\n"); if(fSvxSet.fExist) { code=0; if(fSvxSet.fNumMissingRuns>0) { for(int i=0; i greenball.gif Runs with missing calibration "); fprintf(page," \n"); } if(code==1) { fprintf(page," yelball.gif Runs with missing calibration ==> KEEP AN EYE ON THIS "); fprintf(page," \n"); } if(code==2) { fprintf(page," redball.gif Runs with missing calibration "); fprintf(page," ==> TAKE ACTION! (click on siren) ==> siren.gif \n"); } fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); if(fSvxSet.fNumMissingRuns==0) fprintf(page," No Run missing calibration
\n"); for(int i=0; i Run %d is missing (run is %d hours old)

\n", fSvxSet.fMissingRuns[i], diffHours); if(fSvxSet.fMissingRunsCode[i]==1) fprintf(page," Run %d is missing (run is %d hours old)
\n", fSvxSet.fMissingRuns[i],diffHours ); if(fSvxSet.fMissingRunsCode[i]==2) fprintf(page," Run %d is missing (run is %d hours old)
\n", fSvxSet.fMissingRuns[i], diffHours); } fprintf(page,"

\n"); fprintf(page,"
\n"); if(fSvxSet.fNumRunsNotinPass>0) { fprintf(page,"
\n"); fprintf(page," greenball.gif Runs with calibration but not in PASS10A \n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); for(int i=0; i Run %d is not in PASS10A
\n", fSvxSet.fRunsNotinPass[i]); } fprintf(page,"

\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); } } else { fprintf(page," The calibration file for Prod_Physics_Svx is missing !"); } fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 

\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
greenball.gif Recent runsyelball.gif Not-so-recent runsredball.gif Old runs
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"

\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n", now.AsSQLString()); fprintf(page,"
Legal Notices
Brought To You By: Calibrations Monitoring
Last updated: %s
\n"); fprintf(page,"\n"); fclose(page); // SvxSet popup htmlFile = fHtmlDirectory + "/SvxSetPop.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Prod_Physics_Svx status\n"); fprintf(page,"

\n"); fprintf(page,"The status of the Prod_Physics_Svx calibration depends on how old is the last available calibration. If it is more than %d hours old then the situation is declared 'bad' (red ball). If the last available calibration is between %d and %d hours old, then the situation is flagged 'abnormal' (yellow ball). Otherwise (<%d hours)the situation is flagged as 'normal' (green ball)\n", fPars.maxHoursMissESvxSet, fPars.maxHoursMissWSvxSet, fPars.maxHoursMissESvxSet, fPars.maxHoursMissWSvxSet); fprintf(page,"
\n"); fprintf(page,"The downward arrow indicates that the calibration files are missing or not up-to-date then there might be problems with the cron job and the expert should be contacted.\n"); fprintf(page,"

\n"); fclose(page); // SvxSet Help htmlFile = fHtmlDirectory + "/SvxSetHelp.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"Prod_Physics_Svx Help\n"); fprintf(page,"

\n"); fprintf(page," \n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 
Prod_Physics_Svx Help
 
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"This monitor shows the status of calibrations for Prod_Physics_Svx. The things which are monitored are essentially:\n"); fprintf(page,"
    \n"); fprintf(page,"
  • the existence of the corresponding web page (created by a cron job)\n"); fprintf(page,"
  • the latest occurence of calibration\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"For the latest runs, if there are runs missing calibration which are no more than %d hours old , the situation is flagged as 'normal' (green ball).\n", fPars.maxHoursMissWSvxSet); fprintf(page,"If there are runs missing calibration which are between %d and %d hours old, this needs attention and the status is labeled as 'abnormal' (yellow). \n", fPars.maxHoursMissWSvxSet, fPars.maxHoursMissESvxSet); fprintf(page,"If there are runs missing calibration which are more than %d hours old, then there is need for immediate action and the situation is flagged as 'bad' (red).\n", fPars.maxHoursMissESvxSet); fprintf(page,"
\n"); fprintf(page,"If the calibration files are missing or not up-to-date then there might be problems with the cron job and the expert should be contacted.\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n", now.AsSQLString()); fprintf(page,"
Legal Notices
Brought To You By: Calibrations Monitoring
Last updated: %s
\n"); fprintf(page,"\n"); fclose(page); // Action (missing run popup) Pass10A htmlFile = fHtmlDirectory + "/ActionMissingPass10A.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Calibrations missing!\n"); fprintf(page,"

\n"); fprintf(page,"If there are runs older than %3.1f days missing calibration, the CO should notify the Calibration experts: %s \n", fPars.maxDaysMissEPass10A, fPars.fExpertPass); fprintf(page,"

\n"); fclose(page); // Action (missing run popup) Pass17A htmlFile = fHtmlDirectory + "/ActionMissingPass17A.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Calibrations missing!\n"); fprintf(page,"

\n"); fprintf(page,"If there are runs older than %3.1f days missing calibration, the CO should notify the Calibration expert: %s \n", fPars.maxDaysMissEPass17A, fPars.fExpertPass); fprintf(page,"

\n"); fclose(page); // Action (missing run popup) CotBeam htmlFile = fHtmlDirectory + "/ActionMissingCotBeam.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Calibrations missing!\n"); fprintf(page,"

\n"); fprintf(page,"If there are runs older than %3.1f days missing calibration, the CO should notify the Calibration expert: %s \n", fPars.maxDaysMissECotBeam, fPars.fExpertBeam); fprintf(page,"

\n"); fclose(page); // Action (missing run popup) SvxBeam htmlFile = fHtmlDirectory + "/ActionMissingSvxBeam.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Calibrations missing!\n"); fprintf(page,"

\n"); fprintf(page,"If there are runs older than %3.1f days missing calibration, the CO should notify the Calibration expert: %s \n", fPars.maxDaysMissESvxBeam, fPars.fExpertBeam); fprintf(page,"

\n"); fclose(page); // Action (missing run popup) CotSet htmlFile = fHtmlDirectory + "/ActionMissingCotSet.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Calibrations missing!\n"); fprintf(page,"

\n"); fprintf(page,"If there are runs older than %d hours missing calibration, the CO should notify the Calibration expert: %s \n", fPars.maxHoursMissECotSet, fPars.fExpertCot); fprintf(page,"

\n"); fclose(page); // Action (missing run popup) SvxSet htmlFile = fHtmlDirectory + "/ActionMissingSvxSet.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Calibrations missing!\n"); fprintf(page,"

\n"); fprintf(page,"If there are runs older than %d hours missing calibration, the CO should notify the Calibration expert: %s \n", fPars.maxHoursMissESvxSet, fPars.fExpertSvx); fprintf(page,"

\n"); fclose(page); // now Calibrations Status page htmlFile = fHtmlDirectory + "/Status.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); // 1 fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
Global monitorCalibrations tikiPageCalibrations Help
\n"); fprintf(page,"
\n"); // 2 fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 
Calibrations Monitor
 
\n"); fprintf(page,"
\n"); // 3 fprintf(page,"\n"); // fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 

\n"); fprintf(page,"
\n"); // 3 if(calibStatus==0) fprintf(page,"\n"); if(calibStatus==1) fprintf(page,"
greenball.gif Calibrations status
\n"); if(calibStatus==2) { fprintf(page,"
yelball.gif Calibrations status
\n"); } if(calibStatus==3) fprintf(page,"
redball.gif Calibrations Status
\n"); fprintf(page," ==> TAKE ACTION! (click on siren) ==> siren.gif
\n"); if(calibStatus==4) { fprintf(page,"
checkmark.gif Calibrations status
\n"); } fprintf(page,"\n"); // CotSet status if(fCotSet.fStatus==0) fprintf(page,"\n"); if(fCotSet.fStatus==1) fprintf(page,"\n"); if(fCotSet.fStatus==2) fprintf(page,"\n"); if(fCotSet.fStatus==3) fprintf(page,"\n"); if(fCotSet.fStatus==4) fprintf(page,"\n"); // SvxSet status if(fSvxSet.fStatus==0) fprintf(page,"\n"); if(fSvxSet.fStatus==1) fprintf(page,"\n"); if(fSvxSet.fStatus==2) fprintf(page,"\n"); if(fSvxSet.fStatus==3) fprintf(page,"\n"); if(fSvxSet.fStatus==4) fprintf(page,"\n"); // CotBeam status if(fCotBeam.fStatus==0) fprintf(page,"\n"); if(fCotBeam.fStatus==1) fprintf(page,"\n"); if(fCotBeam.fStatus==2) fprintf(page,"\n"); if(fCotBeam.fStatus==3) fprintf(page,"\n"); if(fCotBeam.fStatus==4) fprintf(page,"\n"); fprintf(page,"
down.gif Calibrations Status
\n"); fprintf(page," ==> TAKE ACTION! (click on siren) ==> siren.gif
 
greenball.gif Prod_Physics_Cot yelball.gif Prod_Physics_Cot redball.gif Prod_Physics_Cot checkmark.gif Prod_Physics_Cot down.gif Prod_Physics_Cot greenball.gif Prod_Physics_Svx yelball.gif Prod_Physics_Svx redball.gif Prod_Physics_Svx checkmark.gif Prod_Physics_Svx down.gif Prod_Physics_Svx greenball.gif Pad_Physics_CotBeam yelball.gif Pad_Physics_CotBeam redball.gif Pad_Physics_CotBeam checkmark.gif Pad_Physics_CotBeam down.gif Pad_Physics_CotBeam
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); if(fCotSet.fStatus==4) fprintf(page,"\n", fCotSet.fFileTime.AsSQLString()); if(fSvxSet.fStatus==4) fprintf(page,"\n", fSvxSet.fFileTime.AsSQLString()); if(fCotBeam.fStatus==4) fprintf(page,"\n", fCotBeam.fFileTime.AsSQLString()); if(fCotSet.fStatus!=4) fprintf(page,"\n", fCotSet.fFileTime.AsSQLString()); if(fSvxSet.fStatus!=4) fprintf(page,"\n", fSvxSet.fFileTime.AsSQLString()); if(fCotBeam.fStatus!=4) fprintf(page,"\n", fCotBeam.fFileTime.AsSQLString()); fprintf(page,"\n"); fprintf(page,"
%s %s %s %s %s %s
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); fprintf(page," \n"); // SvxBeam status if(fSvxBeam.fStatus==0) fprintf(page,"\n"); if(fSvxBeam.fStatus==1) fprintf(page,"\n"); if(fSvxBeam.fStatus==2) fprintf(page,"\n"); if(fSvxBeam.fStatus==3) fprintf(page,"\n"); if(fSvxBeam.fStatus==4) fprintf(page,"\n"); // Pass10A status if(fPass10A.fStatus==0) fprintf(page,"\n"); if(fPass10A.fStatus==1) fprintf(page,"\n"); if(fPass10A.fStatus==2) fprintf(page,"\n"); if(fPass10A.fStatus==3) fprintf(page,"\n"); if(fPass10A.fStatus==4) fprintf(page,"\n"); // Pass17A status if(fPass17A.fStatus==0) fprintf(page,"\n"); if(fPass17A.fStatus==1) fprintf(page,"\n"); if(fPass17A.fStatus==2) fprintf(page,"\n"); if(fPass17A.fStatus==3) fprintf(page,"\n"); if(fPass17A.fStatus==4) fprintf(page,"\n"); fprintf(page,"
 
greenball.gif Pad_Physics_SvxBeam yelball.gif Pad_Physics_SvxBeam redball.gif Pad_Physics_SvxBeam checkmark.gif Pad_Physics_SvxBeam down.gif Pad_Physics_SvxBeam greenball.gif Pass10A yelball.gif Pass10A redball.gif Pass10A checkmark.gif Pass10A down.gifPass10A greenball.gif Pass17A yelball.gif Pass17A redball.gif Pass17A checkmark.gif Pass17A down.gif Pass17A
\n"); fprintf(page,"
\n"); fprintf(page,"\n"); if(fSvxBeam.fStatus!=4) fprintf(page,"\n", fSvxBeam.fFileTime.AsSQLString()); if(fPass10A.fStatus!=4) fprintf(page,"\n", fPass10A.fFileTime.AsSQLString()); if(fPass17A.fStatus!=4) fprintf(page,"\n", fPass17A.fFileTime.AsSQLString()); if(fSvxBeam.fStatus==4) fprintf(page,"\n", fSvxBeam.fFileTime.AsSQLString()); if(fPass10A.fStatus==4) fprintf(page,"\n", fPass10A.fFileTime.AsSQLString()); if(fPass17A.fStatus==4) fprintf(page,"\n", fPass17A.fFileTime.AsSQLString()); fprintf(page,"\n"); fprintf(page,"
%s %s %s %s %s %s
\n"); fprintf(page,"
\n"); // 4 fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 

\n"); fprintf(page,"
\n"); // 5 fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); // fprintf(page,"\n"); // fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
greenball.gif All systems are operationalyelball.gif Minor Problemredball.gif Major Problem
star.gif Situation under investigation
checkmark.gif Scheduled outage
down.gif Masked offdown.gif Calibration Files missing/not-recent
\n"); fprintf(page,"
\n"); // 6 fprintf(page,"\n"); // fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"
 

\n"); fprintf(page,"
\n"); // 7 fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n"); fprintf(page,"\n", now.AsSQLString()); fprintf(page,"
Legal Notices
Brought To You By: Calibrations Monitoring
Last updated: %s
\n"); fprintf(page,"\n"); fclose(page); // Status popup htmlFile = fHtmlDirectory + "/StatusPop.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Calibrations\n"); fprintf(page,"

\n"); fprintf(page,"The status of the calibrations depends is the 'OR' of the status of the various subsystems: if for any of them the last available calibration is too old (status 'bad'), the situation is is flagged as 'bad' (red ball); if any one has a not so old calibration, the situation is flagged 'abnormal' (yellow ball). Otherwise the situation is flagged as 'normal' (green ball)\n"); fprintf(page,"

\n"); fclose(page); // delete page; // Action (calibrations popup) htmlFile = fHtmlDirectory + "/Action.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page,"Calibrations are too old!\n"); fprintf(page,"

\n"); fprintf(page,"Some of the subsections have problems: please access the subsection in abnormal state (red ball) and investigate more\n"); fprintf(page,"

\n"); fclose(page); // Action No files(calibrations popup) htmlFile = fHtmlDirectory + "/ActionNoFiles.html"; page = fopen(htmlFile,"w"); fprintf(page,"\n"); fprintf(page,"\n", wwwBase); fprintf(page,"\n"); fprintf(page," Calibration files are missing or not-recent\n"); fprintf(page,"

\n"); fprintf(page,"Please check which section is missing/not-recent (down arrow) and send email to experts: %s \n", fPars.fExpertCron); fprintf(page,"

\n"); fclose(page); // finally some TXT files for SNARF // Pass10A status htmlFile = fHtmlDirectory + "/Pass10A.txt"; page = fopen(htmlFile,"w"); if(fPass10A.fExist) { code=0; if(fPass10A.fNumMissingRuns>0) { for(int i=0; i Runs with missing calibration "); fprintf(page," \n"); } if(code==1) { fprintf(page," Runs with missing calibration ==> KEEP AN EYE ON THIS "); fprintf(page," \n"); } if(code==2) { fprintf(page," Runs with missing calibration "); fprintf(page," ==> TAKE ACTION! ==> \n"); } fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); if(fPass10A.fNumMissingRuns==0) fprintf(page," No Run missing calibration
\n"); for(int i=0; i Run %d is missing (run is %d hours old)

\n", fPass10A.fMissingRuns[i], diffHours); if(fPass10A.fMissingRunsCode[i]==1) fprintf(page," Run %d is missing (run is %d hours old)
\n", fPass10A.fMissingRuns[i], diffHours); if(fPass10A.fMissingRunsCode[i]==2) fprintf(page," Run %d is missing (run is %d hours old)
\n", fPass10A.fMissingRuns[i], diffHours); } fprintf(page,"

\n"); fprintf(page,"
\n"); } else { fprintf(page," The calibration file for Pass10A is missing !"); } fclose(page); // Pass17A status htmlFile = fHtmlDirectory + "/Pass17A.txt"; page = fopen(htmlFile,"w"); if(fPass17A.fExist) { code=0; if(fPass17A.fNumMissingRuns>0) { for(int i=0; i Runs with missing calibration "); fprintf(page," \n"); } if(code==1) { fprintf(page," Runs with missing calibration ==> KEEP AN EYE ON THIS "); fprintf(page," \n"); } if(code==2) { fprintf(page," Runs with missing calibration "); fprintf(page," ==> TAKE ACTION! ==> \n"); } fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); if(fPass17A.fNumMissingRuns==0) fprintf(page," No Run missing calibration
\n"); for(int i=0; i Run %d is missing (run is %d hours old)

\n", fPass17A.fMissingRuns[i], diffHours); if(fPass17A.fMissingRunsCode[i]==1) fprintf(page," Run %d is missing (run is %d hours old)
\n", fPass17A.fMissingRuns[i], diffHours); if(fPass17A.fMissingRunsCode[i]==2) fprintf(page," Run %d is missing (run is %d hours old)
\n", fPass17A.fMissingRuns[i], diffHours); } fprintf(page,"

\n"); fprintf(page,"
\n"); } else { fprintf(page," The calibration file for Pass17A is missing !"); } fclose(page); // CotBeam status htmlFile = fHtmlDirectory + "/CotBeam.txt"; page = fopen(htmlFile,"w"); if(fCotBeam.fExist) { code=0; if(fCotBeam.fNumMissingRuns>0) { for(int i=0; i Runs with missing calibration "); fprintf(page," \n"); } if(code==1) { fprintf(page," Runs with missing calibration ==> KEEP AN EYE ON THIS "); fprintf(page," \n"); } if(code==2) { fprintf(page," Runs with missing calibration "); fprintf(page," ==> TAKE ACTION! ==> \n"); } fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); if(fCotBeam.fNumMissingRuns==0) fprintf(page," No Run missing calibration
\n"); for(int i=0; i Run %d is missing (run is %d hours old)

\n", fCotBeam.fMissingRuns[i], diffHours); if(fCotBeam.fMissingRunsCode[i]==1) fprintf(page," Run %d is missing (run is %d hours old)
\n", fCotBeam.fMissingRuns[i], diffHours); if(fCotBeam.fMissingRunsCode[i]==2) fprintf(page," Run %d is missing (run is %d hours old)
\n", fCotBeam.fMissingRuns[i], diffHours); } fprintf(page,"

\n"); fprintf(page,"
\n"); if(fCotBeam.fNumRunsNotinPass>0) { fprintf(page,"
\n"); fprintf(page," Runs with calibration but not in PASS17A \n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); for(int i=0; i Run %d is not in PASS17A
\n", fCotBeam.fRunsNotinPass[i]); } fprintf(page,"

\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); } } else { fprintf(page," The calibration file for Pad_Physics_CotBeam is missing !"); } fclose(page); // SvxBeam status htmlFile = fHtmlDirectory + "/SvxBeam.txt"; page = fopen(htmlFile,"w"); if(fSvxBeam.fExist) { code=0; if(fSvxBeam.fNumMissingRuns>0) { for(int i=0; i Runs with missing calibration "); fprintf(page," \n"); } if(code==1) { fprintf(page," Runs with missing calibration ==> KEEP AN EYE ON THIS "); fprintf(page," \n"); } if(code==2) { fprintf(page," Runs with missing calibration "); fprintf(page," ==> TAKE ACTION! ==> \n"); } fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); if(fSvxBeam.fNumMissingRuns==0) fprintf(page," No Run missing calibration
\n"); for(int i=0; i Run %d is missing (run is %d hours old)

\n", fSvxBeam.fMissingRuns[i], diffHours); if(fSvxBeam.fMissingRunsCode[i]==1) fprintf(page," Run %d is missing (run is %d hours old)
\n", fSvxBeam.fMissingRuns[i], diffHours); if(fSvxBeam.fMissingRunsCode[i]==2) fprintf(page," Run %d is missing (run is %d hours old)
\n", fSvxBeam.fMissingRuns[i], diffHours); } fprintf(page,"

\n"); fprintf(page,"
\n"); if(fSvxBeam.fNumRunsNotinPass>0) { fprintf(page,"
\n"); fprintf(page," Runs with calibration but not in PASS17A \n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); for(int i=0; i Run %d is not in PASS17A
\n", fSvxBeam.fRunsNotinPass[i]); } fprintf(page,"

\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); } } else { fprintf(page," The calibration file for Pad_Physics_SvxBeam is missing !"); } fclose(page); // CotSet status htmlFile = fHtmlDirectory + "/CotSet.txt"; page = fopen(htmlFile,"w"); if(fCotSet.fExist) { code=0; if(fCotSet.fNumMissingRuns>0) { for(int i=0; i Runs with missing calibration "); fprintf(page," \n"); } if(code==1) { fprintf(page," Runs with missing calibration ==> KEEP AN EYE ON THIS "); fprintf(page," \n"); } if(code==2) { fprintf(page," Runs with missing calibration "); fprintf(page," ==> TAKE ACTION! ==> \n"); } fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); if(fCotSet.fNumMissingRuns==0) fprintf(page," No Run missing calibration
\n"); for(int i=0; i Run %d is missing (run is %d hours old)

\n", fCotSet.fMissingRuns[i], diffHours); if(fCotSet.fMissingRunsCode[i]==1) fprintf(page," Run %d is missing (run is %d hours old)
\n", fCotSet.fMissingRuns[i], diffHours); if(fCotSet.fMissingRunsCode[i]==2) fprintf(page," Run %d is missing (run is %d hours old)
\n", fCotSet.fMissingRuns[i], diffHours); } fprintf(page,"

\n"); fprintf(page,"
\n"); if(fCotSet.fNumRunsNotinPass>0) { fprintf(page,"
\n"); fprintf(page," Runs with calibration but not in PASS10A \n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); for(int i=0; i Run %d is not in PASS10A
\n", fCotSet.fRunsNotinPass[i]); } fprintf(page,"

\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); } } else { fprintf(page," The calibration file for Prod_Physics_Cot is missing !"); } fclose(page); // SvxSet status htmlFile = fHtmlDirectory + "/SvxSet.txt"; page = fopen(htmlFile,"w"); if(fSvxSet.fExist) { code=0; if(fSvxSet.fNumMissingRuns>0) { for(int i=0; i Runs with missing calibration "); fprintf(page," \n"); } if(code==1) { fprintf(page," Runs with missing calibration ==> KEEP AN EYE ON THIS "); fprintf(page," \n"); } if(code==2) { fprintf(page," Runs with missing calibration "); fprintf(page," ==> TAKE ACTION! ==> \n"); } fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); if(fSvxSet.fNumMissingRuns==0) fprintf(page," No Run missing calibration
\n"); for(int i=0; i Run %d is missing (run is %d hours old)

\n", fSvxSet.fMissingRuns[i], diffHours); if(fSvxSet.fMissingRunsCode[i]==1) fprintf(page," Run %d is missing (run is %d hours old)
\n", fSvxSet.fMissingRuns[i],diffHours ); if(fSvxSet.fMissingRunsCode[i]==2) fprintf(page," Run %d is missing (run is %d hours old)
\n", fSvxSet.fMissingRuns[i], diffHours); } fprintf(page,"

\n"); fprintf(page,"
\n"); if(fSvxSet.fNumRunsNotinPass>0) { fprintf(page,"
\n"); fprintf(page," Runs with calibration but not in PASS10A \n"); fprintf(page,"
\n"); fprintf(page,"
\n"); fprintf(page,"

\n"); for(int i=0; i Run %d is not in PASS10A
\n", fSvxSet.fRunsNotinPass[i]); } fprintf(page,"

\n"); fprintf(page,"
\n"); fprintf(page,"
\n"); } } else { fprintf(page," The calibration file for Prod_Physics_Svx is missing !"); } fclose(page); return 0; } int TCalibrationsMonitor::MakeXml() { // XXX use actutal values monInfo.name = "Calibrations"; monInfo.filename = "calibrations.xml"; monInfo.contactname = "Calibration experts"; monInfo.contacturl = "mailto:tvine@fnal.gov,smalik@fnal.gov,cdfoom@fnal.gov"; monInfo.timestamp = TDatime().Convert(); if(fPass10A.fStatus==1 || fPass17A.fStatus==1 || fCotBeam.fStatus==1 || fSvxBeam.fStatus==1 || fCotSet.fStatus==1 || fSvxSet.fStatus==1) monInfo.status=ABNORMAL; if(fPass10A.fStatus==2 || fPass17A.fStatus==2 || fCotBeam.fStatus==2 || fSvxBeam.fStatus==2 || fCotSet.fStatus==2 || fSvxSet.fStatus==2) monInfo.status=BAD; if(fPass10A.fStatus==4 || fPass17A.fStatus==4 || fCotBeam.fStatus==4 || fSvxBeam.fStatus==4 || fCotSet.fStatus==4 || fSvxSet.fStatus==4) monInfo.status=BAD; monSubInfo.reserve(6); monSubInfo.resize(6); monSubInfo[0].name = "Prod_Physics_Cot"; monSubInfo[0].url = "http://www-cdf.fnal.gov/tiki/tiki-index.php?page=ProdPhysicsCot"; monSubInfo[0].status = static_cast(fCotSet.fStatus) < BAD ? static_cast(fCotSet.fStatus) : BAD; monSubInfo[0].values.reserve(1); monSubInfo[0].values.resize(1); monSubInfo[0].values[0].grouping = "none"; monSubInfo[0].values[0].group = "Missing runs / Oldest run"; ostringstream oss; oss << fCotSet.fNumMissingRuns << " / " << fCotSet.fMissingRunsMaxTime/ONEHOUR << "h"; monSubInfo[0].values[0].val = oss.str(); monSubInfo[1].name = "Prod_Physics_Svx"; monSubInfo[1].url = "http://www-cdf.fnal.gov/tiki/tiki-index.php?page=ProdPhysicsSvx"; monSubInfo[1].status = static_cast(fSvxSet.fStatus) < BAD ? static_cast(fSvxSet.fStatus) : BAD; monSubInfo[1].values.reserve(1); monSubInfo[1].values.resize(1); monSubInfo[1].values[0].grouping = "none"; monSubInfo[1].values[0].group = "Missing runs / Oldest run"; oss.str(""); oss << fSvxSet.fNumMissingRuns << " / " << fSvxSet.fMissingRunsMaxTime/ONEHOUR << "h"; monSubInfo[1].values[0].val = oss.str(); monSubInfo[2].name = "Pad_Physics_CotBeam"; monSubInfo[2].url = "http://www-cdf.fnal.gov/tiki/tiki-index.php?page=PadPhysicsCot"; monSubInfo[2].status = static_cast(fCotBeam.fStatus) < BAD ? static_cast(fCotBeam.fStatus) : BAD; monSubInfo[2].values.reserve(1); monSubInfo[2].values.resize(1); monSubInfo[2].values[0].grouping = "none"; monSubInfo[2].values[0].group = "Missing runs / Oldest run"; oss.str(""); oss << fCotBeam.fNumMissingRuns << " / " << fCotBeam.fMissingRunsMaxTime/ONEHOUR << "h"; monSubInfo[2].values[0].val = oss.str(); monSubInfo[3].name = "Pad_Physics_SvxBeam"; monSubInfo[3].url = "http://www-cdf.fnal.gov/tiki/tiki-index.php?page=PadPhysicsSvx"; monSubInfo[3].status = static_cast(fSvxBeam.fStatus) < BAD ? static_cast(fSvxBeam.fStatus) : BAD; monSubInfo[3].values.reserve(1); monSubInfo[3].values.resize(1); monSubInfo[3].values[0].grouping = "none"; monSubInfo[3].values[0].group = "Missing runs / Oldest run"; oss.str(""); oss << fSvxBeam.fNumMissingRuns << " / " << fSvxBeam.fMissingRunsMaxTime/ONEHOUR << "h"; monSubInfo[3].values[0].val = oss.str(); monSubInfo[4].name = "Pass10A"; monSubInfo[4].url = "http://www-cdf.fnal.gov/tiki/tiki-index.php?page=Pass10A"; monSubInfo[4].status = static_cast(fPass10A.fStatus) < BAD ? static_cast(fPass10A.fStatus) : BAD; monSubInfo[4].values.reserve(1); monSubInfo[4].values.resize(1); monSubInfo[4].values[0].grouping = "none"; monSubInfo[4].values[0].group = "Missing runs / Oldest run"; oss.str(""); oss << fPass10A.fNumMissingRuns << " / " << fPass10A.fMissingRunsMaxTime/ONEHOUR << "h"; monSubInfo[4].values[0].val = oss.str(); monSubInfo[5].name = "Pass17A"; monSubInfo[5].url = "http://www-cdf.fnal.gov/tiki/tiki-index.php?page=Pass17A"; monSubInfo[5].status = static_cast(fPass17A.fStatus) < BAD ? static_cast(fPass17A.fStatus) : BAD; monSubInfo[5].values.reserve(1); monSubInfo[5].values.resize(1); monSubInfo[5].values[0].grouping = "none"; monSubInfo[5].values[0].group = "Missing runs / Oldest run"; oss.str(""); oss << fPass17A.fNumMissingRuns << " / " << fPass17A.fMissingRunsMaxTime/ONEHOUR << "h"; monSubInfo[5].values[0].val = oss.str(); TOfflineMonitor::MakeXml(); return 0; }