DbuDaqFileSummary Class Reference

#include <DbuDaqFileSummary.h>

Inheritance diagram for DbuDaqFileSummary:
DbiTableRow

List of all members.

Public Types

enum  {
  kMinSubRun = 0, kMaxSubRun = 99, kModSubRun = 100, kMaxRun = 999999,
  kModRun = 1000000
}
enum  EFtmFlagBits { fmt_BlockCount = 0x0001 }
typedef enum
DbuDaqFileSummary::EFtmFlagBits 
FmtFlagBits_t

Public Member Functions

 DbuDaqFileSummary ()
virtual ~DbuDaqFileSummary ()
virtual Int_t GetAggregateNo () const
virtual DbiTableRowCreateTableRow () const
virtual void Fill (DbiResultSet &rs, const DbiValidityRec *vrec)
virtual void Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const
Int_t GetSeqNo () const

Static Public Member Functions

static Int_t CalcUniqueSeqNo (Detector::Detector_t det, Int_t run, Short_t subrun)
static const char * GetTableDescr ()
static void SetFmtFlag (const UInt_t fmtflg)
static UInt_t GetFmtFlag ()

Public Attributes

Detector::Detector_t fDetector
SimFlag::SimFlag_t fSimFlag
Int_t fRun
Short_t fSubRun
Int_t fFirstTimeFrame
Int_t fLastTimeFrame
Int_t fRecSets
Int_t fRecSetsNotLIOnly
VldTimeStamp fFirstSnarlTime
VldTimeStamp fLastSnarlTime
Int_t fFirstSnarlNum
Int_t fLastSnarlNum
Int_t fSnarlRecs
UInt_t fTrigBitsSeen
Int_t fTotalDigitBlocks
Int_t fErrorDigitBlocks
Int_t fTotalDigits
Int_t fErrorDigits
VldTimeStamp fFirstMonitorTime
VldTimeStamp fLastMonitorTime
Int_t fMonitorRecs
Int_t fLightInjRecs
Int_t fAdcLIBlocks
Int_t fTimingLIBlocks
std::map< string, int > fBlockCount
std::string fBaseName
std::string fDirName
Long64_t fSize
Short_t fCompressLevel
Float_t fCompressFactor
Int_t fRootVersion
VldTimeStamp fModTime
std::string fProcHost

Static Public Attributes

static const std::string kNoBaseName = "<<No BaseName>>"
static const std::string kNoDirName = "<<No DirName>>"
static UInt_t fgFmtFlag = 0xffff

Private Member Functions

 DbuDaqFileSummary (const DbuDaqFileSummary &from)
Bool_t Commit (DbiStatement *stmt)
void FillMapFromString (const string &rstring)
void GetStringFromMap (string &rstring) const

Friends

class DbuRunSummary
class DbuDaqFileModule

Detailed Description

Definition at line 34 of file DbuDaqFileSummary.h.


Member Typedef Documentation


Member Enumeration Documentation

anonymous enum
Enumerator:
kMinSubRun 
kMaxSubRun 
kModSubRun 
kMaxRun 
kModRun 

Definition at line 39 of file DbuDaqFileSummary.h.

00039        { kMinSubRun =       0,    // min SubRun
00040          kMaxSubRun =      99,    // max SubRun
00041          kModSubRun =     100,    // used in packing
00042          kMaxRun    =  999999,    // max Run
00043          kModRun    = 1000000 };  // used in packing

Enumerator:
fmt_BlockCount 

Definition at line 99 of file DbuDaqFileSummary.h.

00099                              {
00100      fmt_BlockCount      = 0x0001
00101    } FmtFlagBits_t;


Constructor & Destructor Documentation

DbuDaqFileSummary::DbuDaqFileSummary (  )  [inline]

Definition at line 50 of file DbuDaqFileSummary.h.

References LEA_CTOR.

00050                        :
00051      fDetector(Detector::kUnknown), fSimFlag(SimFlag::kUnknown),
00052      fRun(0), fSubRun(0), fFirstTimeFrame(-1), fLastTimeFrame(-1), 
00053      fRecSets(0), fRecSetsNotLIOnly(0),
00054      fFirstSnarlTime((time_t)0,0), fLastSnarlTime((time_t)0,0), 
00055      fFirstSnarlNum(-1), fLastSnarlNum(-1), fSnarlRecs(0), fTrigBitsSeen(0),
00056      fTotalDigitBlocks(0), fErrorDigitBlocks(0), 
00057      fTotalDigits(0), fErrorDigits(0),
00058      fFirstMonitorTime((time_t)0,0), fLastMonitorTime((time_t)0,0),
00059      fMonitorRecs(0), fLightInjRecs(0), 
00060      fAdcLIBlocks(0), fTimingLIBlocks(0),
00061      fBaseName(kNoBaseName), fDirName(kNoDirName), fSize(0),
00062      fCompressLevel(-1), fCompressFactor(0), fRootVersion(-1),
00063      fModTime((time_t)0,0), fProcHost("")
00064      { LEA_CTOR; }

virtual DbuDaqFileSummary::~DbuDaqFileSummary (  )  [inline, virtual]

Definition at line 66 of file DbuDaqFileSummary.h.

References LEA_DTOR.

00067      { LEA_DTOR; };

DbuDaqFileSummary::DbuDaqFileSummary ( const DbuDaqFileSummary from  )  [inline, private]

Definition at line 110 of file DbuDaqFileSummary.h.

References LEA_CTOR.

00111      : DbiTableRow() { LEA_CTOR; *this = from; }


Member Function Documentation

Int_t DbuDaqFileSummary::CalcUniqueSeqNo ( Detector::Detector_t  det,
Int_t  run,
Short_t  subrun 
) [static]

Definition at line 333 of file DbuDaqFileSummary.cxx.

References kModRun, and kModSubRun.

Referenced by DbuDaqFileModule::BuildExtContextAndSelect(), GetAggregateNo(), and GetSeqNo().

00335 {
00336 //
00337 //
00338 //  Purpose:  Calculate unique SeqNo
00339 //
00340 //  Return:   an integer
00341 //
00342 //  Contact:   R. Hatcher
00343 //
00344 //  Specification:-
00345 //  =============
00346 //
00347 
00348 //  Program Notes:-
00349 //  =============
00350 
00351 //  None.
00352 
00353 // similar to file naming convention
00354 //   Char_t detchar = Detector::AsString(det)[0];
00355 //   string fname = Form("%c%8.8d_%4.4d",detchar,run,subrun);
00356 // take care since can overflow int
00357 //  use two fewers places for sub and two fewer for run
00358 //  "drrrrrrss"
00359 
00360    return subrun%kModSubRun + kModSubRun*(run%kModRun + kModRun*det);
00361 }

Bool_t DbuDaqFileSummary::Commit ( DbiStatement stmt  )  [private]

Definition at line 429 of file DbuDaqFileSummary.cxx.

References bfld::AsString(), VldTimeStamp::AsString(), Detector::AsString(), DbiString::c_str(), DbuSignalHandler::Delay(), DbiStatement::ExecuteUpdate(), fAdcLIBlocks, fBaseName, fCompressFactor, fCompressLevel, fDetector, fDirName, fErrorDigitBlocks, fErrorDigits, fFirstMonitorTime, fFirstSnarlNum, fFirstSnarlTime, fFirstTimeFrame, fLastMonitorTime, fLastSnarlNum, fLastSnarlTime, fLastTimeFrame, fLightInjRecs, fModTime, fMonitorRecs, fProcHost, fRecSets, fRecSetsNotLIOnly, fRootVersion, fRun, fSimFlag, fSize, fSnarlRecs, fSubRun, fTimingLIBlocks, fTotalDigitBlocks, fTotalDigits, fTrigBitsSeen, GetSeqNo(), GetStringFromMap(), DbuSignalHandler::HandleDelayedSignal(), DbuSignalHandler::Instance(), Msg::kDebug, Msg::kVerbose, logDebug(), UtilString::MakePrintable(), MSG, nullTime, and DbiStatement::PrintExceptions().

Referenced by DbuDaqFileModule::CommitDbuDaqFileSummary().

00430 {
00431 //
00432 //
00433 //  Purpose:  
00434 //
00435 //  Arguments: 
00436 //    xxxxxxxxx    in    yyyyyy
00437 //
00438 //  Return:    
00439 //
00440 //  Contact:   R. Hatcher
00441 //
00442 //  Specification:-
00443 //  =============
00444 //
00445 //  o 
00446 
00447 //  Program Notes:-
00448 //  =============
00449 
00450 //  None.
00451 
00452   if (!stmt) return false; 
00453 
00454   // protect ODBC code against signals
00455   DbuSignalHandler::Instance().Delay();
00456   
00457   Int_t seqno = GetSeqNo();
00458   string tbl  = "DBUDAQFILESUMMARY";
00459   string tblv = "DBUDAQFILESUMMARYVLD";
00460   
00461   // just blast away any existing entry
00462 
00463   DbiString sqlrm, sqlrmv;
00464   
00465   sqlrm  << "delete from " << tbl  << " where SEQNO=" << seqno << ";\0";
00466   Int_t nrm  = stmt->ExecuteUpdate(sqlrm.c_str());
00467   stmt->PrintExceptions();
00468 
00469   sqlrmv << "delete from " << tblv << " where SEQNO=" << seqno << ";\0";
00470   Int_t nrmv = stmt->ExecuteUpdate(sqlrmv.c_str());
00471   stmt->PrintExceptions();
00472 
00473   // prepare to fill table
00474 
00475   string mapstring;
00476   GetStringFromMap(mapstring);
00477   string printableMapString;
00478   UtilString::MakePrintable(mapstring.c_str(),printableMapString);
00479 
00480   DbiString sqlcol, sqlval;
00481   sqlcol << " SEQNO ";
00482   sqlval << seqno;
00483   sqlcol << ", DETECTOR ";
00484   sqlval << ",'" << Detector::AsString(fDetector) << "'";
00485   sqlcol << ", RUN ";
00486   sqlval << "," << fRun;
00487   sqlcol << ", SUBRUN ";
00488   sqlval << "," << fSubRun;
00489   sqlcol << ", FIRST_TIMEFRAME ";
00490   sqlval << "," << fFirstTimeFrame;
00491   sqlcol << ", LAST_TIMEFRAME ";
00492   sqlval << "," << fLastTimeFrame;
00493   sqlcol << ", REC_SETS ";
00494   sqlval << "," << fRecSets;
00495   sqlcol << ", REC_SETS_NOTLIONLY ";
00496   sqlval << "," << fRecSetsNotLIOnly;
00497   sqlcol << ", FIRST_SNARL_TIME ";
00498   sqlval << ",'" << fFirstSnarlTime.AsString("s") << "'";
00499   sqlcol << ", LAST_SNARL_TIME ";
00500   sqlval << ",'" << fLastSnarlTime.AsString("s") << "'";
00501   sqlcol << ", FIRST_SNARL_NUM ";
00502   sqlval << "," << fFirstSnarlNum;
00503   sqlcol << ", LAST_SNARL_NUM ";
00504   sqlval << "," << fLastSnarlNum;
00505   sqlcol << ", SNARL_RECS ";
00506   sqlval << "," << fSnarlRecs;
00507   sqlcol << ", TRIGBITS_SEEN ";
00508   sqlval << "," << fTrigBitsSeen;
00509 
00510   sqlcol << ", DIGITBLOCKS_TOTAL ";
00511   sqlval << "," << fTotalDigitBlocks;
00512   sqlcol << ", DIGITBLOCKS_ERROR ";
00513   sqlval << "," << fErrorDigitBlocks;
00514   sqlcol << ", DIGITS_TOTAL ";
00515   sqlval << "," << fTotalDigits;
00516   sqlcol << ", DIGITS_ERROR ";
00517   sqlval << "," << fErrorDigits;
00518 
00519   sqlcol << ", FIRST_MONITOR_TIME ";
00520   sqlval << ",'" << fFirstMonitorTime.AsString("s") << "'";
00521   sqlcol << ", LAST_MONITOR_TIME ";
00522   sqlval << ",'" << fLastMonitorTime.AsString("s") << "'";
00523   sqlcol << ", MONITOR_RECS ";
00524   sqlval << "," << fMonitorRecs;
00525   sqlcol << ", LIGHTINJ_RECS ";
00526   sqlval << "," << fLightInjRecs;
00527   sqlcol << ", ADC_LI_BLKS ";
00528   sqlval << "," << fAdcLIBlocks;
00529   sqlcol << ", TIMING_LI_BLKS ";
00530   sqlval << "," << fTimingLIBlocks;
00531 
00532   sqlcol << ", BLOCK_COUNT ";
00533   sqlval << ",'" << printableMapString << "'";
00534   
00535   sqlcol << ", BASENAME ";
00536   sqlval << ",'" << fBaseName << "'";
00537   sqlcol << ", DIRNAME ";
00538   sqlval << ",'" << fDirName << "'";
00539   sqlcol << ", FILESIZE ";
00540   Int_t size_32 = fSize;  // hope it doesn't overflow
00541   sqlval << "," << size_32;
00542   sqlcol << ", COMPRESSLEVEL ";
00543   sqlval << "," << fCompressLevel;
00544   sqlcol << ", COMPRESSFACTOR ";
00545   sqlval << "," << fCompressFactor;
00546   sqlcol << ", ROOTVERSION ";
00547   sqlval << "," << fRootVersion;
00548   sqlcol << ", MODTIME ";
00549   sqlval << ",'" << fModTime.AsString("s") << "'";
00550   sqlcol << ", PROC_HOST ";
00551   sqlval << ",'" << fProcHost << "'";
00552 
00553   DbiString sqlinsert;
00554   sqlinsert << "insert into " << tbl
00555             << " ( " << sqlcol.c_str() << " ) "
00556             << " values ( " << sqlval.c_str() << " ) ;\0";
00557   
00558   MSG("Dbu",Msg::kDebug) << sqlinsert.c_str() << endl;
00559 
00560   VldTimeStamp now;
00561   VldTimeStamp startTime = fFirstMonitorTime;
00562   VldTimeStamp endTime   = fLastMonitorTime;
00563   // the above _should_ do in general ... but sometimes things are weird
00564   const VldTimeStamp nullTime = VldTimeStamp((time_t)0,0);  
00565   if ( nullTime != fFirstSnarlTime ) {
00566     if ( nullTime        == startTime || 
00567          fFirstSnarlTime  < startTime    ) startTime = fFirstSnarlTime;
00568   }
00569   if ( nullTime != fLastSnarlTime ) {
00570     if ( nullTime        == endTime || 
00571          fFirstSnarlTime  > endTime    ) endTime = fLastSnarlTime;
00572   }
00573 
00574   const Int_t task = 0;
00575 
00576   DbiString sqlcolv, sqlvalv;
00577   sqlcolv << " SEQNO";
00578   sqlvalv << seqno;
00579   sqlcolv << ", TIMESTART ";
00580   sqlvalv << ",'" << startTime.AsString("s") << "'";
00581   sqlcolv << ", TIMEEND ";
00582   sqlvalv << ",'" << endTime.AsString("s") << "'";
00583   sqlcolv << ", DETECTORMASK ";
00584   sqlvalv << "," << fDetector;
00585   sqlcolv << ", SIMMASK ";
00586   sqlvalv << "," << fSimFlag;
00587   sqlcolv << ", TASK ";
00588   sqlvalv << "," << task;
00589   sqlcolv << ", AGGREGATENO ";
00590   sqlvalv << "," << fSubRun;
00591   sqlcolv << ", CREATIONDATE ";
00592   sqlvalv << ",'" << now.AsString("s") << "'" ;
00593   sqlcolv << ", INSERTDATE ";
00594   sqlvalv << ",'" << now.AsString("s") << "'";
00595   
00596   DbiString sqlinsertv;
00597   sqlinsertv << "insert into " << tblv
00598              << " ( " << sqlcolv.c_str() << " ) "
00599              << " VALUES ( " << sqlvalv.c_str() << " ) ;\0";
00600   
00601   MSG("Dbu",Msg::kDebug) 
00602     << "insert into " << tblv
00603     << " ( " << sqlcolv.c_str() << " ) "
00604     << " VALUES ( " << sqlvalv.c_str() << " ) ;"
00605     << endl;
00606   
00607   Int_t ninsert = stmt->ExecuteUpdate(sqlinsert.c_str());
00608   stmt->PrintExceptions();
00609   
00610   Int_t ninsertv = stmt->ExecuteUpdate(sqlinsertv.c_str());
00611   stmt->PrintExceptions();
00612   
00613   MSG("Dbu",Msg::kVerbose)
00614     << sqlinsert.c_str() << endl;
00615   MSG("Dbu",Msg::kVerbose)
00616     << sqlinsertv.c_str() << endl;
00617   
00618   char tmpbuf[1024];
00619   sprintf(tmpbuf,"Commit DbuDaqFileSummary %c%8.8d_%4.4d",
00620           Detector::AsString(fDetector)[0],fRun,fSubRun);
00621 
00622   MSG("Dbu",Msg::kDebug) 
00623     << tmpbuf
00624     //<< " Cbits " << fCurrentSubRun->fConsistency 
00625     << " rm/in " 
00626     << nrm << "," << nrmv << "/"
00627     << ninsert << "," << ninsertv 
00628     << endl;
00629 
00630   logDebug(1,"%s rm=%d,%d in=%d,%d @ %s",
00631            tmpbuf,nrm,nrmv,ninsert,ninsertv,now.AsString("s"));
00632   
00633   bool success = (ninsert==1) && (ninsertv==1);
00634   
00635   // done protecting ODBC code against signals
00636   DbuSignalHandler::Instance().HandleDelayedSignal();
00637 
00638 
00639   //rwh!
00640   MSG("Dbu",Msg::kVerbose)
00641     << "DbuDaqFileSummary::Commit " << endl << *this << endl;
00642 
00643   return success;
00644 }

virtual DbiTableRow* DbuDaqFileSummary::CreateTableRow (  )  const [inline, virtual]

Implements DbiTableRow.

Definition at line 80 of file DbuDaqFileSummary.h.

00080 { return new DbuDaqFileSummary; }

void DbuDaqFileSummary::Fill ( DbiResultSet rs,
const DbiValidityRec vrec 
) [virtual]

Implements DbiTableRow.

Definition at line 144 of file DbuDaqFileSummary.cxx.

References ClusterType::CharToEnum(), det, fAdcLIBlocks, fBaseName, fCompressFactor, fCompressLevel, fDetector, fDirName, fErrorDigitBlocks, fErrorDigits, fFirstMonitorTime, fFirstSnarlNum, fFirstSnarlTime, fFirstTimeFrame, FillMapFromString(), fLastMonitorTime, fLastSnarlNum, fLastSnarlTime, fLastTimeFrame, fLightInjRecs, fModTime, fMonitorRecs, fProcHost, fRecSets, fRecSetsNotLIOnly, fRootVersion, fRun, fSize, fSnarlRecs, fSubRun, fTimingLIBlocks, fTotalDigitBlocks, fTotalDigits, fTrigBitsSeen, VldRange::GetDetectorMask(), Nav::GetName(), DbiValidityRec::GetVldRange(), DbiRowStream::HasRowCounter(), Msg::kWarning, MAXMSG, MSG, and DbiRowStream::NumCols().

00145                                                                   {
00146 //
00147 //
00148 //  Purpose:  Fill object from Result Set
00149 //
00150 //  Arguments: 
00151 //    rs           in    Result Set used to fill object
00152 //    vrec         in    Associated validity record (or 0 if filling
00153 //                                                    DbiValidityRec)
00154 //
00155 //  Return:    
00156 //
00157 //  Contact:   R. Hatcher
00158 //
00159 //  Specification:-
00160 //  =============
00161 //
00162 //  o Fill object from current row of Result Set.
00163 
00164 //  Program Notes:-
00165 //  =============
00166 
00167 //  None.
00168 
00169    Detector::Detector_t det =
00170       (Detector::Detector_t) 
00171       ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00172 
00173    string detname, runtypename, mapstring;   
00174    Int_t size_32;
00175 
00176    // count of data columns (not including SEQNO and ROW_COUNTER)
00177    Int_t numDataCol = rs.NumCols() - (rs.HasRowCounter() ? 1 : 0) - 1;
00178    if ( 32 == numDataCol ) {  
00179        rs >> detname
00180           >> fRun
00181           >> fSubRun
00182           >> fFirstTimeFrame
00183           >> fLastTimeFrame
00184           >> fRecSets
00185           >> fRecSetsNotLIOnly
00186           >> fFirstSnarlTime
00187           >> fLastSnarlTime
00188           >> fFirstSnarlNum
00189           >> fLastSnarlNum
00190           >> fSnarlRecs
00191           >> fTrigBitsSeen
00192           >> fTotalDigitBlocks
00193           >> fErrorDigitBlocks
00194           >> fTotalDigits
00195           >> fErrorDigits
00196           >> fFirstMonitorTime
00197           >> fLastMonitorTime
00198           >> fMonitorRecs
00199           >> fLightInjRecs
00200           >> fAdcLIBlocks
00201           >> fTimingLIBlocks
00202           >> mapstring
00203           >> fBaseName
00204           >> fDirName
00205           >> size_32
00206           >> fCompressLevel
00207           >> fCompressFactor
00208           >> fRootVersion
00209           >> fModTime
00210           >> fProcHost;
00211    }
00212    else if ( 31 == numDataCol ) {    // before fRecSetsNotLIOnly
00213        rs >> detname
00214           >> fRun
00215           >> fSubRun
00216           >> fFirstTimeFrame
00217           >> fLastTimeFrame
00218           >> fRecSets
00219           >> fFirstSnarlTime
00220           >> fLastSnarlTime
00221           >> fFirstSnarlNum
00222           >> fLastSnarlNum
00223           >> fSnarlRecs
00224           >> fTrigBitsSeen
00225           >> fTotalDigitBlocks
00226           >> fErrorDigitBlocks
00227           >> fTotalDigits
00228           >> fErrorDigits
00229           >> fFirstMonitorTime
00230           >> fLastMonitorTime
00231           >> fMonitorRecs
00232           >> fLightInjRecs
00233           >> fAdcLIBlocks
00234           >> fTimingLIBlocks
00235           >> mapstring
00236           >> fBaseName
00237           >> fDirName
00238           >> size_32
00239           >> fCompressLevel
00240           >> fCompressFactor
00241           >> fRootVersion
00242           >> fModTime
00243           >> fProcHost;
00244    }
00245    else {
00246        MAXMSG("Dbu",Msg::kWarning,25)
00247            << "Table " << GetName() << " has " << numDataCol
00248            << ", but we only know how to handle 19 or 18."
00249            << endl;
00250    }
00251 
00252    
00253    fSize = size_32;
00254 
00255    fDetector = Detector::CharToEnum(detname.c_str()[0]);
00256    if (fDetector != det) 
00257       MSG("Dbu",Msg::kWarning)
00258          << "Detector column '" << detname << "' (" << (int)fDetector
00259          << ") did not match DetectorMask (" << (int)det << ")" << endl;
00260 
00261    FillMapFromString(mapstring);
00262 
00263 }

void DbuDaqFileSummary::FillMapFromString ( const string &  rstring  )  [private]

Definition at line 648 of file DbuDaqFileSummary.cxx.

References Registry::Clear(), fBlockCount, Registry::GetInt(), Registry::GetType(), Registry::Key(), Msg::kWarning, Registry::LockKeys(), Registry::LockValues(), MSG, Registry::ReadStream(), reg, Registry::UnLockKeys(), and Registry::UnLockValues().

Referenced by Fill().

00648                                                                {
00649 //
00650 //
00651 //  Purpose:  
00652 //
00653 //  Arguments: 
00654 //    xxxxxxxxx    in    yyyyyy
00655 //
00656 //  Return:    
00657 //
00658 //  Contact:   R. Hatcher
00659 //
00660 //  Specification:-
00661 //  =============
00662 //
00663 //  o 
00664 
00665 //  Program Notes:-
00666 //  =============
00667 
00668 //  Two step dance:
00669 //    2) fill Registry from string
00670 //    1) fill map from Registry
00671 
00672   fBlockCount.clear();  // clear it out first
00673 
00674   Registry reg;
00675   reg.UnLockKeys();
00676   reg.UnLockValues();
00677   reg.Clear();
00678   istringstream is(rstring);
00679   reg.ReadStream(is);
00680   reg.LockKeys();
00681   reg.LockValues();
00682 
00683   // unsigned int n = reg.Size();
00684 
00685   Registry::RegistryKey rk = reg.Key();
00686   const char* keyname;
00687   while ( ( keyname = rk() ) ) {
00688     string blkName = keyname;
00689     string valType = reg.GetType(keyname).name();
00690     if ( "i" != valType ) {  // this may be platform dependent!
00691       MSG("Dbu",Msg::kWarning)
00692         << "BlockCount string had non-int entry: key='"
00693         << blkName << "' value-type='" << valType << "'" << endl;
00694       continue;  // skip on
00695     }
00696     fBlockCount[blkName] = reg.GetInt(keyname);
00697   }
00698 
00699 }

virtual Int_t DbuDaqFileSummary::GetAggregateNo (  )  const [inline, virtual]

Reimplemented from DbiTableRow.

Definition at line 71 of file DbuDaqFileSummary.h.

References CalcUniqueSeqNo(), fDetector, fRun, and fSubRun.

00073       { return CalcUniqueSeqNo(fDetector,fRun,fSubRun); }
00074 #else
00075       { return -1; }

static UInt_t DbuDaqFileSummary::GetFmtFlag (  )  [inline, static]

Definition at line 98 of file DbuDaqFileSummary.h.

References fgFmtFlag.

00098 { return fgFmtFlag; }

Int_t DbuDaqFileSummary::GetSeqNo (  )  const [inline]

Definition at line 89 of file DbuDaqFileSummary.h.

References CalcUniqueSeqNo(), fDetector, fRun, and fSubRun.

Referenced by Commit().

void DbuDaqFileSummary::GetStringFromMap ( string &  rstring  )  const [private]

Definition at line 703 of file DbuDaqFileSummary.cxx.

References fBlockCount, Registry::LockKeys(), Registry::LockValues(), Registry::PrintStream(), reg, and Registry::Set().

Referenced by Commit(), and Store().

00703                                                               {
00704 //
00705 //
00706 //  Purpose:  
00707 //
00708 //  Arguments: 
00709 //    xxxxxxxxx    in    yyyyyy
00710 //
00711 //  Return:    
00712 //
00713 //  Contact:   R. Hatcher
00714 //
00715 //  Specification:-
00716 //  =============
00717 //
00718 //  o 
00719 
00720 //  Program Notes:-
00721 //  =============
00722 
00723 //  Two step dance:
00724 //    1) fill Registry from map
00725 //    2) fill string from Registry
00726 
00727   Registry reg;
00728   reg.SetName("BlockCount");
00729   std::map<string,int>::const_iterator mapItr = fBlockCount.begin();
00730   while (mapItr != fBlockCount.end()) {
00731     string blkName = mapItr->first;
00732     int    blkCnt  = mapItr->second;
00733     reg.Set(blkName.c_str(),blkCnt);
00734     mapItr++;  // move on
00735   }
00736   reg.LockKeys();
00737   reg.LockValues();
00738 
00739   ostringstream os;
00740   reg.PrintStream(os);
00741 
00742   rstring = os.str();
00743 
00744 }

const char * DbuDaqFileSummary::GetTableDescr (  )  [static]

Definition at line 365 of file DbuDaqFileSummary.cxx.

00366 {
00367 //
00368 //
00369 //  Purpose:  Return a string describing rows in the table
00370 //            Used in creating temporary tables
00371 //
00372 //  Return:   const char* to parenthesized comma separated list
00373 //            of column name and type pairs
00374 //
00375 //  Contact:   R. Hatcher
00376 //
00377 //  Specification:-
00378 //  =============
00379 //
00380 
00381 //  Program Notes:-
00382 //  =============
00383 
00384 //  None.
00385 
00386    const char* const_tabledescr = "(\
00387        SEQNO              int,          \
00388        ROW_COUNTER        int,          \
00389        DETECTOR           varchar(10),  \
00390        RUN                int,          \
00391        SUBRUN             smallint,     \
00392        FIRST_TIMEFRAME    int,          \
00393        LAST_TIMEFRAME     int,          \
00394        REC_SETS           int,          \
00395        REC_SETS_NOTLIONLY int,          \
00396        FIRST_SNARL_TIME   datetime,     \
00397        LAST_SNARL_TIME    datetime,     \
00398        FIRST_SNARL_NUM    int,          \
00399        LAST_SNARL_NUM     int,          \
00400        SNARL_RECS         int,          \
00401        TRIGBITS_SEEN      int,          \
00402        DIGITBLOCKS_TOTAL  int,          \
00403        DIGITBLOCKS_ERROR  int,          \
00404        DIGITS_TOTAL       int,          \
00405        DIGITS_ERROR       int,          \
00406        FIRST_MONITOR_TIME datetime,     \
00407        LAST_MONITOR_TIME  datetime,     \
00408        MONITOR_RECS       int,          \
00409        LIGHTINJ_RECS      int,          \
00410        ADC_LI_BLKS        int,          \
00411        TIMING_LI_BLKS     int,          \
00412        BLOCK_COUNT        text,         \
00413        BASENAME           varchar(24),  \
00414        DIRNAME            varchar(255), \
00415        FILESIZE           int,          \
00416        COMPRESSLEVEL      smallint,     \
00417        COMPRESSFACTOR     float,        \
00418        ROOTVERSION        int,          \
00419        MODTIME            datetime,     \
00420        PROC_HOST          varchar(80),  \
00421        primary key (SEQNO,ROW_COUNTER), \
00422        index (RUN) )";
00423 
00424    return const_tabledescr;
00425 }

static void DbuDaqFileSummary::SetFmtFlag ( const UInt_t  fmtflg  )  [inline, static]

Definition at line 97 of file DbuDaqFileSummary.h.

References fgFmtFlag.

00097 { fgFmtFlag = fmtflg; }

void DbuDaqFileSummary::Store ( DbiOutRowStream ors,
const DbiValidityRec vrec 
) const [virtual]

Reimplemented from DbiTableRow.

Definition at line 267 of file DbuDaqFileSummary.cxx.

References bfld::AsString(), fAdcLIBlocks, fBaseName, fCompressFactor, fCompressLevel, fDetector, fDirName, fErrorDigitBlocks, fErrorDigits, fFirstMonitorTime, fFirstSnarlNum, fFirstSnarlTime, fFirstTimeFrame, fLastMonitorTime, fLastSnarlNum, fLastSnarlTime, fLastTimeFrame, fLightInjRecs, fModTime, fMonitorRecs, fProcHost, fRecSets, fRecSetsNotLIOnly, fRootVersion, fRun, fSize, fSnarlRecs, fSubRun, fTimingLIBlocks, fTotalDigitBlocks, fTotalDigits, fTrigBitsSeen, and GetStringFromMap().

00268                                                                      {
00269 //
00270 //
00271 //  Purpose:  Stream object to output row stream
00272 //
00273 //  Arguments: 
00274 //    ors          in     Output row stream.
00275 //    vrec         in     Associated validity record (or 0 if filling
00276 //                                                    DbiValidityRec)
00277 //
00278 //  Return:    
00279 //
00280 //  Contact:   R. Hatcher
00281 //
00282 //  Specification:-
00283 //  =============
00284 //
00285 //  o  Stream object to output row stream.
00286 
00287 //  Program Notes:-
00288 //  =============
00289 
00290 //  None.
00291 
00292    Int_t size_32 = fSize;  // hope it doesn't overflow
00293    string mapstring;
00294    GetStringFromMap(mapstring);
00295 
00296    ors << Detector::AsString(fDetector)
00297        << fRun
00298        << fSubRun
00299        << fFirstTimeFrame
00300        << fLastTimeFrame
00301        << fRecSets
00302        << fRecSetsNotLIOnly
00303        << fFirstSnarlTime
00304        << fLastSnarlTime
00305        << fFirstSnarlNum
00306        << fLastSnarlNum
00307        << fSnarlRecs
00308        << fTrigBitsSeen
00309        << fTotalDigitBlocks
00310        << fErrorDigitBlocks
00311        << fTotalDigits
00312        << fErrorDigits
00313        << fFirstMonitorTime
00314        << fLastMonitorTime
00315        << fMonitorRecs
00316        << fLightInjRecs
00317        << fAdcLIBlocks
00318        << fTimingLIBlocks
00319        << mapstring
00320        << fBaseName
00321        << fDirName
00322        << size_32
00323        << fCompressLevel
00324        << fCompressFactor
00325        << fRootVersion
00326        << fModTime
00327        << fProcHost;
00328    
00329 }


Friends And Related Function Documentation

friend class DbuDaqFileModule [friend]

Definition at line 106 of file DbuDaqFileSummary.h.

friend class DbuRunSummary [friend]

Definition at line 105 of file DbuDaqFileSummary.h.


Member Data Documentation

std::map<string,int> DbuDaqFileSummary::fBlockCount
UInt_t DbuDaqFileSummary::fgFmtFlag = 0xffff [static]

Definition at line 160 of file DbuDaqFileSummary.h.

Referenced by GetFmtFlag(), operator<<(), and SetFmtFlag().

Definition at line 129 of file DbuDaqFileSummary.h.

Referenced by DbuDaqFileModule::Ana(), Commit(), Fill(), operator<<(), and Store().

Definition at line 123 of file DbuDaqFileSummary.h.

Referenced by Commit(), and DbuDaqFileModule::MyOwn_BeginFile().

const std::string DbuDaqFileSummary::kNoBaseName = "<<No BaseName>>" [static]

Definition at line 45 of file DbuDaqFileSummary.h.

const std::string DbuDaqFileSummary::kNoDirName = "<<No DirName>>" [static]

Definition at line 46 of file DbuDaqFileSummary.h.


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1