Пример #1
0
void
QA::closeEntry(void)
{
   if( isCheckData )
   {
     // data: structure defined in hdhC.h
     for( size_t i=0 ; i < qaExp.varMeDa.size() ; ++i )
     {
       if( qaExp.varMeDa[i].var->isNoData() )
          continue;

       // skip time test for proceeding time steps when var is fixed
       if( isNotFirstRecord && qaExp.varMeDa[i].var->isFixed  )
         continue;

       hdhC::FieldData fA( qaExp.varMeDa[i].var->pDS->get() ) ;

       // test overflow of ranges specified in a table, or
       // plausibility of the extrema.
       qaExp.varMeDa[i].qaData.test(i, fA);

       storeData(qaExp.varMeDa[i], fA);
     }
   }

   // This here is only for the regular QA time series file
   if( qaTime.isTime && isCheckTimeValues )
     storeTime();

   ++currQARec;

   return;
}
Пример #2
0
/* Callback functions for GLUT */
void
display(void)
{
    glClear(GL_COLOR_BUFFER_BIT);
    glEnable(GL_TEXTURE_2D);

    glBegin(GL_QUADS);
    glTexCoord2f(1.0,1.0);
    glVertex3f(width, height, 0.0);
    glTexCoord2f(0.0,1.0);
    glVertex3f(0, height, 0.0);
    glTexCoord2f(0.0,0.0);
    glVertex3f(0, 0, 0.0);
    glTexCoord2f(1.0,0.0);
    glVertex3f(width, 0.0, 0.0);
    glEnd();
    glDisable(GL_TEXTURE_2D); // state machine!

    /* force drawing to start */
    glDeleteBuffers(1, &pixelBuffer);
    glFlush();
    if(pendingTimes.size() > 0)
    {
        storeTime(pendingTimes.front());
        pendingTimes.pop();
    }
// glutSwapBuffers();
}
Пример #3
0
void EventStorage::storeUserInput(vector<string> userInput, int doneFlag)
{
	storeTitle(userInput[0]);
	storeDate(userInput[1]);
	storeTime(userInput[2]);
	storePriority(userInput[3]);
	storeCode(userInput[4]);
	storeDoneFlag(doneFlag);
}
Пример #4
0
int write_trigger_thresholds(int runNumber = 13078009)
{

  // Load all required libraries
  gROOT->Macro("loadMuDst.C");
  gROOT->Macro("LoadLogger.C");
  gSystem->Load("St_base.so");
  gSystem->Load("libStDb_Tables.so");
  gSystem->Load("StDbLib.so");

  gSystem->Load("StEmcRawMaker");
  gSystem->Load("StEmcADCtoEMaker");
  gSystem->Load("StEEmcUtil");
  gSystem->Load("StEEmcDbMaker");
  gSystem->Load("StTriggerUtilities");
  //******//
  gSystem->Setenv("DB_ACCESS_MODE","write");
  //******//  
  // Initialize db manager
  ///*
  StDbManager* mgr = StDbManager::Instance();
  StDbConfigNode* node = mgr->initConfig("Calibrations_trg");
  StDbTable* dbtable = node->addDbTable("triggerThreshold");
  // beginTime timestamp in MySQL format: "YYYY-MM-DD HH:mm:ss"
  ifstream intime(Form("beginTimes/%d.beginTimes.txt", runNumber));
  if(!intime){
    cout<<"can't open beginTime file"<<endl;
    return 0;
  }
  char date[10];
  char time[8];
  intime >> date >> time;
  TString storeTime(Form("%s %s", date, time));
  //******//
  //time stamp 2012-07-30 00:00:0X for test purposes
  //TString storeTime("2012-07-30 00:00:02");
  //******//
  mgr->setStoreTime(storeTime.Data());
 // */
  // Create your c-struct
  triggerThreshold_st table;
  
  // Fill structure with data 
  // sample setup for a single channel, please add more channels!
  strcpy(table.comments, Form("run%d triggerThreshold uploaded by zchang", runNumber)); 
  cout<<"comments set to "<<table.comments<<endl;

  TObjArray objarr = readOnline(runNumber);
  TBufferFile buf(TBuffer::kWrite);
  buf << &objarr;
  objarr.Delete();

  cout<<"Buffer size: "<<buf.BufferSize()<<endl;

  memset(table.trigthr, 0, buf.BufferSize());
  memcpy(table.trigthr, buf.Buffer(), buf.BufferSize());
  table.size = buf.BufferSize();

  //******//
  // Store data to the StDbTable
  dbtable->SetTable((char*)&table, 1);
  
  // uncomment next line to set "sim" flavor. "ofl" flavor is set by default, no need to set it.
  // dbtable->setFlavor("sim");
  
  // Store table to database
  cout<<"Storing Db table: "<< mgr->storeDbTable(dbtable) << endl;
  //******//

  ofstream out(Form("buffer/%d.trigthr.buffer.out", runNumber));
  assert(out);
  out.write(buf.Buffer(),buf.BufferSize());
  out.close();

  return 1;
}