1 int read_trigger_definitions(
int runNumber = 13078009)
10 gROOT->Macro(
"loadMuDst.C");
11 gROOT->Macro(
"LoadLogger.C");
15 gSystem->Load(
"St_Tables");
16 gSystem->Load(
"StDbLib");
17 gSystem->Load(
"StDbBroker");
18 gSystem->Load(
"St_db_Maker");
20 gSystem->Load(
"StEmcRawMaker");
21 gSystem->Load(
"StEmcADCtoEMaker");
22 gSystem->Load(
"StEEmcUtil");
23 gSystem->Load(
"StEEmcDbMaker");
25 gSystem->Load(
"StTriggerUtilities");
27 ifstream in(Form(
"beginTimes/%d.beginTimes.txt", runNumber));
29 cout<<
"can't open input file\n";
36 cout<<
"beginTime:"<<date<<
" "<<time<<endl;
39 sscanf(date,
"%d-%d-%d", &yr, &mnth, &dy);
40 sscanf(time,
"%d:%d:%d", &hh, &mm, &ss);
42 int idate = yr*10000 + mnth*100 + dy;
43 int itime = hh*10000 + mm *100 + ss;
44 cout<<idate<<
" "<<itime<<endl;
48 dbMk->SetDateTime(idate, itime);
50 dbMk->SetFlavor(
"ofl");
56 DB = dbMk->GetDataBase(
"Calibrations/trg/triggerDefinition");
58 std::cout <<
"ERROR: no table found in db, or malformed local db config" << std::endl;
61 St_triggerDefinition *dataset = 0;
62 dataset = (St_triggerDefinition*) DB->
Find(
"triggerDefinition");
63 Int_t rows = dataset->GetNRows();
65 std::cout <<
"INFO: found INDEXED table with " << rows <<
" rows" << std::endl;
70 dbMk->GetValidity((
TTable*)dataset,val);
71 std::cout <<
"Dataset validity range: [ " << val[0].GetDate() <<
"." << val[0].GetTime() <<
" - "
72 << val[1].GetDate() <<
"." << val[1].GetTime() <<
" ] "
75 triggerDefinition_st *table = dataset->GetTable();
76 for (Int_t i = 0; i < rows; i++) {
78 std::cout << i <<
"th row : " << table[i].comments << std::endl;
79 TBufferFile buf(TBuffer::kRead);
80 buf.SetBuffer(table[i].trigdef,
sizeof(table[i].trigdef),
false);
85 cout <<
"Total entries: " << a->GetEntriesFast() << endl;
87 for (
int i = 0; i < a->GetEntriesFast(); ++i) {
94 std::cout <<
"ERROR: dataset does not contain requested table" << std::endl;
virtual TDataSet * Find(const char *path) const