Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DbuDaqFileSummary.h

Go to the documentation of this file.
00001 // $Id: DbuDaqFileSummary.h,v 1.7 2005/08/26 19:20:59 rhatcher Exp $
00002 
00003 #ifndef DBUDAQFILESUMMARY_H
00004 #define DBUDAQFILESUMMARY_H
00005 
00007 // DbuDaqFileSummary
00008 //
00009 // Package: DatabaseUpdater
00010 //
00011 // Concept:
00012 //
00013 //
00014 // R. Hatcher 2002-04-19
00016 
00017 #include "DatabaseUpdater/DbuBits.h"
00018 
00019 #include "DatabaseInterface/DbiTableRow.h"
00020 #include "LeakChecker/Lea.h"
00021 
00022 #include "Validity/VldContext.h"
00023 #include <string>
00024 using std::string;
00025 #include <map>
00026 #include <iosfwd>
00027 
00028 class DbiValidityRec;
00029 class DbiStatement;
00030 
00031 class DbuDaqFileSummary;
00032 std::ostream& operator<<(std::ostream& os, const DbuDaqFileSummary& drs);
00033 
00034 class DbuDaqFileSummary : public DbiTableRow
00035 {
00036 
00037 public:
00038 
00039   enum { 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
00044 
00045   static const std::string kNoBaseName;  // = "<<No BaseName>>"
00046   static const std::string kNoDirName;   // = "<<No DirName>>"
00047 
00048 // Constructors and destructors.
00049 
00050    DbuDaqFileSummary() :
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; }
00065 
00066    virtual ~DbuDaqFileSummary()
00067      { LEA_DTOR; };
00068 
00069 // State testing member functions
00070 
00071    virtual Int_t GetAggregateNo() const
00072 #ifdef MULTIAGRREGATE
00073       { return CalcUniqueSeqNo(fDetector,fRun,fSubRun); }
00074 #else
00075       { return -1; }
00076 #endif
00077 
00078 //          UInt_t GetIndex(UInt_t defIndex) const;
00079 
00080    virtual DbiTableRow* CreateTableRow() const { return new DbuDaqFileSummary; }
00081 
00082 // I/O  member functions
00083 
00084    virtual void Fill(DbiResultSet& rs,
00085                      const DbiValidityRec* vrec);
00086    virtual void Store(DbiOutRowStream& ors,
00087                       const DbiValidityRec* vrec) const;
00088 
00089    Int_t              GetSeqNo() const
00090      { return CalcUniqueSeqNo(fDetector,fRun,fSubRun); }
00091 
00092    static Int_t       CalcUniqueSeqNo(Detector::Detector_t det,
00093                                       Int_t run, Short_t subrun);
00094 
00095    static const char* GetTableDescr();
00096 
00097    static void   SetFmtFlag(const UInt_t fmtflg) { fgFmtFlag = fmtflg; }
00098    static UInt_t GetFmtFlag() { return fgFmtFlag; }
00099    typedef enum EFtmFlagBits {
00100      fmt_BlockCount      = 0x0001
00101    } FmtFlagBits_t;
00102 
00103 private:
00104 
00105    friend class DbuRunSummary;     // allow this class to copy
00106    friend class DbuDaqFileModule;  // allow this class to Commit, copy
00107 
00108 // Constructors and destructors.
00109 
00110    DbuDaqFileSummary(const DbuDaqFileSummary& from)
00111      : DbiTableRow() { LEA_CTOR; *this = from; }
00112 
00113    Bool_t Commit(DbiStatement* stmt);
00114 
00115    void   FillMapFromString(const string& rstring);
00116    void   GetStringFromMap(string&  rstring) const;
00117 
00118 // Data members
00119 
00120 public: // !!!!!!! for now!
00121 
00122    Detector::Detector_t     fDetector;
00123    SimFlag::SimFlag_t       fSimFlag;
00124    Int_t                    fRun;
00125    Short_t                  fSubRun;
00126    Int_t                    fFirstTimeFrame;
00127    Int_t                    fLastTimeFrame;
00128    Int_t                    fRecSets;
00129    Int_t                    fRecSetsNotLIOnly;  // >0 DaqMonitor or DaqSnarl
00130    VldTimeStamp             fFirstSnarlTime;
00131    VldTimeStamp             fLastSnarlTime;
00132    Int_t                    fFirstSnarlNum;
00133    Int_t                    fLastSnarlNum;
00134    Int_t                    fSnarlRecs;
00135    UInt_t                   fTrigBitsSeen;
00136 
00137    Int_t                    fTotalDigitBlocks;
00138    Int_t                    fErrorDigitBlocks;
00139    Int_t                    fTotalDigits;
00140    Int_t                    fErrorDigits;
00141 
00142 
00143    VldTimeStamp             fFirstMonitorTime;
00144    VldTimeStamp             fLastMonitorTime;
00145    Int_t                    fMonitorRecs;    // monitor only (not LI streams)
00146    Int_t                    fLightInjRecs;
00147    Int_t                    fAdcLIBlocks;
00148    Int_t                    fTimingLIBlocks;
00149    std::map<string,int>     fBlockCount;     // # of each block type
00150    std::string              fBaseName;
00151    std::string              fDirName;
00152    Long64_t                 fSize;           // hope for nothing > 2GB ?
00153    Short_t                  fCompressLevel;
00154    Float_t                  fCompressFactor;
00155    Int_t                    fRootVersion;    // ROOT version when written
00156    VldTimeStamp             fModTime;        // when file was modified
00157    std::string              fProcHost;       // host machine when processed
00158 
00159    // global formatting flag
00160    static UInt_t fgFmtFlag;
00161 
00162 ClassDef(DbuDaqFileSummary,0)
00163 
00164 };
00165 
00166 #endif  // DBUDAQFILESUMMARY_H

Generated on Mon Feb 15 11:06:35 2010 for loon by  doxygen 1.3.9.1