8 #include "L2DbConfig.h"
11 L2DbConfig::L2DbConfig(
const Char_t *fname )
14 ifstream inFile(fname, ifstream::in);
17 std::cout <<
"Problem reading in L2EmcDb configuration from " << fname << std::endl;
22 printf(
"L2DbConfig::L2DbConfig, opened =%s=\n", fname);
23 while ( !inFile.eof() )
26 double timeOld=c.getFullStartTime();
28 if ( c.comment() )
continue;
31 assert(c.getFullStartTime() < c.getFullFinishTime());
33 timeOld=c.getFullStartTime();
35 std::cout << Form(
"L2DbConfig::Read in %i records from=%s=, done",mConfig.size(),fname) << std::endl;
41 L2DbTime *L2DbConfig::getConfiguration( Int_t date, Int_t time,
const Char_t *tag )
43 std::cout <<
"L2DbConfig:: Get configuration for date=" << date <<
" time=" << time <<
" tag=" <<(tag? tag :
"")<<
"="<<std::endl;
44 for ( UInt_t ii=0;ii<mConfig.size();ii++ )
46 if ( mConfig[ii].valid(date,time) )
48 if ( !tag )
return &mConfig[ii];
49 if ( mConfig[ii].getTag().Contains(tag) )
return &mConfig[ii];