DbuRunSummary Class Reference

#include <DbuRunSummary.h>

Inheritance diagram for DbuRunSummary:

DbiTableRow List of all members.

Public Types

typedef enum DbuRunSummary::EFtmFlagBits FmtFlagBits_t
 fmt_RunComment = 0x0001
 fmt_RunPrepare = 0x0002
 fmt_AuxConfigText = 0x0004
 fmt_ConfigFilesText = 0x0008
 fmt_DaqFiles = 0x0010
enum  EFtmFlagBits {
  fmt_RunComment = 0x0001, fmt_RunPrepare = 0x0002, fmt_AuxConfigText = 0x0004, fmt_ConfigFilesText = 0x0008,
  fmt_DaqFiles = 0x0010
}

Public Member Functions

 DbuRunSummary ()
virtual ~DbuRunSummary ()
Int_t CalcSnarls () const
Int_t CalcNonSnarls () const
virtual Int_t GetAggregateNo () const
Bool_t IsSameRun (Detector::Detector_t det, Int_t run)
virtual DbiTableRowCreateTableRow () const
virtual void Fill (DbiResultSet &rs, const DbiValidityRec *vrec)
virtual void Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const
Int_t GetSeqNo () const
void ResetConsistencyBits (Int_t mask)
void SetConsistencyBits (Int_t mask)

Static Public Member Functions

static Int_t CalcUniqueSeqNo (Detector::Detector_t det, Int_t run)
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 fLastSubRun
Short_t fRunType
VldTimeStamp fStartTime
VldTimeStamp fEndTime
Int_t fTermCode
Int_t fRunEndSnarls
Int_t fRunEndNonSnarls
Int_t fNErrs
Int_t fTimeFrames
Int_t fDroppedFrames
Int_t fConsistency
std::string fRunComment
std::string fRunPrepare
std::string fAuxConfigText
DbuDaqConfigFilesTextfDbuDaqConfigFilesText
std::vector< DbuDaqFileSummary * > fDbuDaqFiles

Static Public Attributes

static const std::string kNoComment = "<<No Comment>>"
static const std::string kNoRunPrepare = "<<No RunPrepare>>"
static const std::string kNoAuxConfig = "<<No AuxConfig>>"
static const std::string kUnfilled = "<<Unfilled>>"
static UInt_t fgFmtFlag = 0xffff

Private Member Functions

 DbuRunSummary (const DbuRunSummary &from)
DbuRunSummaryoperator= (const DbuRunSummary &rhs)
void AddDaqFileEntry (const DbuDaqFileSummary &fs)
Bool_t Commit (DbiStatement *stmt, std::string cft_md5, int cft_seqno)

Friends

class DbuDaqFileModule

Detailed Description

Definition at line 36 of file DbuRunSummary.h.


Member Typedef Documentation

typedef enum DbuRunSummary::EFtmFlagBits DbuRunSummary::FmtFlagBits_t


Member Enumeration Documentation

enum DbuRunSummary::EFtmFlagBits

Enumerator:
fmt_RunComment 
fmt_RunPrepare 
fmt_AuxConfigText 
fmt_ConfigFilesText 
fmt_DaqFiles 

Definition at line 101 of file DbuRunSummary.h.

00101                              {
00102      fmt_RunComment          = 0x0001,
00103      fmt_RunPrepare          = 0x0002,
00104      fmt_AuxConfigText       = 0x0004,
00105      fmt_ConfigFilesText     = 0x0008,
00106      fmt_DaqFiles            = 0x0010
00107    } FmtFlagBits_t;


Constructor & Destructor Documentation

DbuRunSummary::DbuRunSummary (  )  [inline]

Definition at line 48 of file DbuRunSummary.h.

References LEA_CTOR.

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

Definition at line 61 of file DbuRunSummary.h.

References fDbuDaqConfigFilesText, and LEA_DTOR.

DbuRunSummary::DbuRunSummary ( const DbuRunSummary from  )  [private]

Definition at line 135 of file DbuRunSummary.cxx.

References LEA_CTOR.

00136   : DbiTableRow(from), 
00137     fDbuDaqConfigFilesText(0)  // make sure this pointer gets initialized
00138 {
00139   // deep copy using deep assignment
00140   LEA_CTOR;
00141   *this = from;
00142 }


Member Function Documentation

void DbuRunSummary::AddDaqFileEntry ( const DbuDaqFileSummary fs  )  [private]

Definition at line 399 of file DbuRunSummary.cxx.

References fDbuDaqFiles, DbuDaqFileSummary::fSubRun, Msg::kWarning, and MSG.

Referenced by Fill(), and operator=().

00400 {
00401   // copy DbuDaqFileSummary into DbuRunSummary's owned list
00402 
00403   Short_t subrun = fs.fSubRun;
00404   if (subrun < 0) {
00405     MSG("Dbu",Msg::kWarning) 
00406       << "DbuDaqFileSummary had SubRun=" << subrun << "?!"
00407       << endl;
00408     return;
00409   }
00410   if ( fDbuDaqFiles[subrun] ) {
00411     MSG("Dbu",Msg::kWarning) 
00412       << "DbuDaqFileSummary had previous entry for SubRun=" 
00413       << subrun << "?!"
00414       << endl;
00415     return;
00416   }
00417   if ( fDbuDaqFiles.size() < (size_t)subrun+1 ) {
00418     MSG("Dbu",Msg::kWarning) 
00419       << "DbuDaqFileSummary allocated " << fDbuDaqFiles.size()
00420       << ", saw " << subrun << "?!"
00421       << endl;
00422     fDbuDaqFiles.resize(subrun+1);  // expand if necessary
00423   }
00424   fDbuDaqFiles[subrun] = new DbuDaqFileSummary(fs);\
00425 }

Int_t DbuRunSummary::CalcNonSnarls (  )  const

Definition at line 209 of file DbuRunSummary.cxx.

References fDbuDaqFiles.

Referenced by operator<<().

00210 {
00211   // Calculate # of non-snarls from sum of those recorded in DbuDaqFileSummary's
00212   Int_t nonsnarls = 0;
00213   for (size_t k=0; k < fDbuDaqFiles.size(); ++k) {
00214     const DbuDaqFileSummary* fs = fDbuDaqFiles[k];
00215     if (fs) nonsnarls += ( fs->fMonitorRecs + fs->fLightInjRecs);
00216   }
00217   return nonsnarls;
00218 }

Int_t DbuRunSummary::CalcSnarls (  )  const

Definition at line 198 of file DbuRunSummary.cxx.

References fDbuDaqFiles.

Referenced by operator<<().

00199 {
00200   // Calculate # of snarls from sum of those recorded in DbuDaqFileSummary's
00201   Int_t snarls = 0;
00202   for (size_t k=0; k < fDbuDaqFiles.size(); ++k) {
00203     const DbuDaqFileSummary* fs = fDbuDaqFiles[k];
00204     if (fs) snarls += fs->fSnarlRecs;
00205   }
00206   return snarls;
00207 }

Int_t DbuRunSummary::CalcUniqueSeqNo ( Detector::Detector_t  det,
Int_t  run 
) [static]

Definition at line 474 of file DbuRunSummary.cxx.

Referenced by GetAggregateNo(), and GetSeqNo().

00475 {
00476 //
00477 //
00478 //  Purpose:  Calculate unique SeqNo
00479 //
00480 //  Return:   an integer
00481 //
00482 //  Contact:   R. Hatcher
00483 //
00484 //  Specification:-
00485 //  =============
00486 //
00487 
00488 //  Program Notes:-
00489 //  =============
00490 
00491 //  None.
00492 
00493 // similar to file naming convention
00494 //   Char_t detchar = Detector::AsString(det)[0];
00495 //   string fname = Form("%c%8.8d_%4.4d",detchar,run,subrun);
00496 // take care since can overflow int
00497 //  use two fewers places for sub and two fewer for run
00498 //  "drrrrrrss"
00499 
00500    return 99 + 100*(run + 1000000*det);
00501 }

Bool_t DbuRunSummary::Commit ( DbiStatement stmt,
std::string  cft_md5,
int  cft_seqno 
) [private]

Definition at line 580 of file DbuRunSummary.cxx.

References VldTimeStamp::AsString(), Detector::AsString(), DbiString::c_str(), DbuSignalHandler::Delay(), DbiStatement::ExecuteUpdate(), fAuxConfigText, fConsistency, fDetector, fDroppedFrames, fEndTime, fLastSubRun, fNErrs, fRun, fRunComment, fRunEndNonSnarls, fRunEndSnarls, fRunPrepare, fRunType, fSimFlag, fStartTime, fTermCode, fTimeFrames, GetAggregateNo(), GetSeqNo(), DbuSignalHandler::HandleDelayedSignal(), DbuSignalHandler::Instance(), Msg::kDebug, Msg::kVerbose, logDebug(), UtilString::MakePrintable(), MSG, DbiStatement::PrintExceptions(), and RunTypeName().

Referenced by DbuDaqFileModule::CommitDbuRunSummary().

00582 {
00583 //
00584 //
00585 //  Purpose:  
00586 //
00587 //  Arguments: 
00588 //    xxxxxxxxx    in    yyyyyy
00589 //
00590 //  Return:    
00591 //
00592 //  Contact:   R. Hatcher
00593 //
00594 //  Specification:-
00595 //  =============
00596 //
00597 //  o 
00598 
00599 //  Program Notes:-
00600 //  =============
00601 
00602 //  None.
00603 
00604   if (!stmt) return false; 
00605 
00606   // protect ODBC code against signals
00607   DbuSignalHandler::Instance().Delay();
00608   
00609   Int_t seqno = GetSeqNo();
00610   string tbl  = "DBURUNSUMMARY";
00611   string tblv = "DBURUNSUMMARYVLD";
00612   
00613   // just blast away any existing entry
00614 
00615   DbiString sqlrm, sqlrmv;
00616   
00617   sqlrm  << "delete from " << tbl  << " where SEQNO=" << seqno << ";\0";
00618   Int_t nrm  = stmt->ExecuteUpdate(sqlrm.c_str());
00619   stmt->PrintExceptions();
00620 
00621   sqlrmv << "delete from " << tblv << " where SEQNO=" << seqno << ";\0";
00622   Int_t nrmv = stmt->ExecuteUpdate(sqlrmv.c_str());
00623   stmt->PrintExceptions();
00624 
00625   // prepare to fill table
00626 
00627   string printableRunComment;
00628   UtilString::MakePrintable(fRunComment.c_str(),printableRunComment);
00629   string printableRunPrepare;
00630   UtilString::MakePrintable(fRunPrepare.c_str(),printableRunPrepare);
00631   string printableAuxConfigText;
00632   UtilString::MakePrintable(fAuxConfigText.c_str(),printableAuxConfigText);
00633 
00634   DbiString sqlcol, sqlval;
00635   sqlcol << " SEQNO ";
00636   sqlval << seqno;
00637   sqlcol << ", DETECTOR ";
00638   sqlval << ",'" << Detector::AsString(fDetector) << "'";
00639   sqlcol << ", RUN ";
00640   sqlval << "," << fRun;
00641   sqlcol << ", LAST_SUBRUN ";
00642   sqlval << "," << fLastSubRun;
00643   sqlcol << ", RUNTYPE ";
00644   sqlval << "," << fRunType;
00645   sqlcol << ", RUNTYPE_NAME ";
00646   sqlval << ",'" << RunTypeName(fRunType,fDetector,fRun) << "'";
00647   sqlcol << ", STARTTIME ";
00648   sqlval << ",'" << fStartTime.AsString("s") << "'";
00649   sqlcol << ", ENDTIME ";
00650   sqlval << ",'" << fEndTime.AsString("s") << "'";
00651   sqlcol << ", TERMCODE ";
00652   sqlval << "," << fTermCode;
00653   sqlcol << ", RUNEND_SNARLS ";
00654   sqlval << "," << fRunEndSnarls;
00655   sqlcol << ", RUNEND_NONSNARLS ";
00656   sqlval << "," << fRunEndNonSnarls;
00657   sqlcol << ", NERRS ";
00658   sqlval << "," << fNErrs;
00659   sqlcol << ", NTIMEFRAMES ";
00660   sqlval << "," << fTimeFrames;
00661   sqlcol << ", NDROPPEDFRAMES ";
00662   sqlval << "," << fDroppedFrames;
00663   sqlcol << ", CONSISTENCY_BITS ";
00664   sqlval << "," << fConsistency;
00665   sqlcol << ", RUN_COMMENT ";
00666   sqlval << ",'" << printableRunComment << "'";
00667   sqlcol << ", RUNPREPARE_STRING ";
00668   sqlval << ",'" << printableRunPrepare << "'";
00669   sqlcol << ", AUX_CONFIG_TEXT ";
00670   sqlval << ",'" << printableAuxConfigText << "'";
00671   sqlcol << ", CONFIGFILES_MD5 ";
00672   sqlval << ",'" << cft_md5 << "'";
00673   sqlcol << ", CONFIGFILES_SEQNO ";
00674   sqlval << "," << cft_seqno;
00675     
00676   DbiString sqlinsert;
00677   sqlinsert << "insert into " << tbl
00678             << " ( " << sqlcol.c_str() << " ) "
00679             << " values ( " << sqlval.c_str() << " ) ;\0";
00680   
00681   MSG("Dbu",Msg::kDebug) << sqlinsert.c_str() << endl;
00682   
00683   VldTimeStamp now;
00684   
00685   const Int_t task = 0;
00686   
00687   DbiString sqlcolv, sqlvalv;
00688   sqlcolv << " SEQNO";
00689   sqlvalv << seqno;
00690   sqlcolv << ", TIMESTART ";
00691   sqlvalv << ",'" << fStartTime.AsString("s") << "'";
00692   sqlcolv << ", TIMEEND ";
00693   sqlvalv << ",'" << fEndTime.AsString("s") << "'";
00694   sqlcolv << ", DETECTORMASK ";
00695   sqlvalv << "," << fDetector;
00696   sqlcolv << ", SIMMASK ";
00697   sqlvalv << "," << fSimFlag;
00698   sqlcolv << ", TASK ";
00699   sqlvalv << "," << task;
00700   sqlcolv << ", AGGREGATENO ";
00701   sqlvalv << "," << GetAggregateNo();
00702   sqlcolv << ", CREATIONDATE ";
00703   sqlvalv << ",'" << now.AsString("s") << "'" ;
00704   sqlcolv << ", INSERTDATE ";
00705   sqlvalv << ",'" << now.AsString("s") << "'";
00706   
00707   DbiString sqlinsertv;
00708   sqlinsertv << "insert into " << tblv
00709              << " ( " << sqlcolv.c_str() << " ) "
00710              << " VALUES ( " << sqlvalv.c_str() << " ) ;\0";
00711   
00712   MSG("Dbu",Msg::kDebug) 
00713     << "insert into " << tblv
00714     << " ( " << sqlcolv.c_str() << " ) "
00715     << " VALUES ( " << sqlvalv.c_str() << " ) ;"
00716     << endl;
00717   
00718   Int_t ninsert = stmt->ExecuteUpdate(sqlinsert.c_str());
00719   stmt->PrintExceptions();
00720   
00721   Int_t ninsertv = stmt->ExecuteUpdate(sqlinsertv.c_str());
00722   stmt->PrintExceptions();
00723   
00724   MSG("Dbu",Msg::kVerbose)
00725     << sqlinsert.c_str() << endl;
00726   MSG("Dbu",Msg::kVerbose)
00727     << sqlinsertv.c_str() << endl;
00728   
00729   char tmpbuf[1024];
00730   sprintf(tmpbuf,"Commit DbuRunSummary %c%8.8d",
00731           Detector::AsString(fDetector)[0],fRun);
00732 
00733   MSG("Dbu",Msg::kDebug) 
00734     << tmpbuf
00735     //<< " Cbits " << fCurrentSubRun->fConsistency 
00736     << " rm/in " 
00737     << nrm << "," << nrmv << "/"
00738     << ninsert << "," << ninsertv 
00739     << endl;
00740 
00741   logDebug(1,"%s rm=%d,%d in=%d,%d @ %s",
00742            tmpbuf,nrm,nrmv,ninsert,ninsertv,now.AsString("s"));
00743   
00744   bool success = (ninsert==1) && (ninsertv==1);
00745   
00746   // done protecting ODBC code against signals
00747   DbuSignalHandler::Instance().HandleDelayedSignal();
00748 
00749 
00750   return success;
00751 }

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

Implements DbiTableRow.

Definition at line 80 of file DbuRunSummary.h.

00080 { return new DbuRunSummary; }

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

Implements DbiTableRow.

Definition at line 222 of file DbuRunSummary.cxx.

References AddDaqFileEntry(), Detector::AsString(), Detector::CharToEnum(), det, fAuxConfigText, fConsistency, fDbuDaqConfigFilesText, fDbuDaqFiles, fDetector, fDroppedFrames, fEndTime, fLastSubRun, fNErrs, Form(), fRun, fRunComment, fRunEndNonSnarls, fRunEndSnarls, fRunPrepare, fRunType, fSimFlag, fStartTime, fTermCode, fTimeFrames, VldRange::GetDetectorMask(), Nav::GetName(), VldTimeStamp::GetSec(), VldRange::GetSimMask(), DbiValidityRec::GetVldRange(), DbiRowStream::HasRowCounter(), Dbi::kAnyTask, Msg::kDebug, Msg::kInfo, DbiSqlContext::kStarts, Msg::kWarning, MAXMSG, MSG, and DbiRowStream::NumCols().

00223                                                                   {
00224 //
00225 //
00226 //  Purpose:  Fill object from Result Set
00227 //
00228 //  Arguments:
00229 //    rs           in    Result Set used to fill object
00230 //    vrec         in    Associated validity record (or 0 if filling
00231 //                                                    DbiValidityRec)
00232 //
00233 //  Return:
00234 //
00235 //  Contact:   R. Hatcher
00236 //
00237 //  Specification:-
00238 //  =============
00239 //
00240 //  o Fill object from current row of Result Set.
00241 
00242 //  Program Notes:-
00243 //  =============
00244 
00245 //  None.
00246 
00247    Detector::Detector_t det =
00248       (Detector::Detector_t)
00249       ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00250 
00251    SimFlag::SimFlag_t simflag =
00252      (SimFlag::SimFlag_t)
00253      ((vrec) ? vrec->GetVldRange().GetSimMask() : 0);
00254 
00255    string detname, runtypename, config_md5;
00256    Int_t config_seqno;
00257 
00258    // count of data columns (not including SEQNO and ROW_COUNTER)
00259    Int_t numDataCol = rs.NumCols() - (rs.HasRowCounter() ? 1 : 0) - 1;
00260    if ( 19 == numDataCol ) {
00261        rs >> detname
00262           >> fRun
00263           >> fLastSubRun
00264           >> fRunType
00265           >> runtypename
00266           >> fStartTime
00267           >> fEndTime
00268           >> fTermCode
00269           >> fRunEndSnarls
00270           >> fRunEndNonSnarls
00271           >> fNErrs
00272           >> fTimeFrames
00273           >> fDroppedFrames
00274           >> fConsistency
00275           >> fRunComment
00276           >> fRunPrepare
00277           >> fAuxConfigText
00278           >> config_md5
00279           >> config_seqno;
00280    }
00281    else if ( 18 == numDataCol ) {  // before fAuxConfigText
00282        rs >> detname
00283           >> fRun
00284           >> fLastSubRun
00285           >> fRunType
00286           >> runtypename
00287           >> fStartTime
00288           >> fEndTime
00289           >> fTermCode
00290           >> fRunEndSnarls
00291           >> fRunEndNonSnarls
00292           >> fNErrs
00293           >> fTimeFrames
00294           >> fDroppedFrames
00295           >> fConsistency
00296           >> fRunComment
00297           >> fRunPrepare
00298           >> config_md5
00299           >> config_seqno;
00300    }
00301    else {
00302        MAXMSG("Dbu",Msg::kWarning,25)
00303            << "Table " << GetName() << " has " << numDataCol
00304            << ", but we only know how to handle 19 or 18."
00305            << endl;
00306    }
00307 
00308    fDetector = Detector::CharToEnum(detname.c_str()[0]);
00309    if (fDetector != det)
00310       MSG("Dbu",Msg::kWarning)
00311          << "Detector column '" << detname << "' (" << (int)fDetector
00312          << ") did not match DetectorMask (" << (int)det << ")" << endl;
00313    fSimFlag  = simflag;
00314 
00315    // make a extended query to get ConfigFileText
00316    VldTimeStamp tsStart(1970, 1, 1, 0, 0, 0);
00317    VldTimeStamp   tsEnd(2038, 1,18,19,14, 7);
00318 
00319    DbiSqlContext extContextConfig(DbiSqlContext::kStarts,tsStart,tsEnd,
00320                                   (Detector::Detector_t)127,   // any
00321                                   (SimFlag::SimFlag_t)127   ); // any
00322    //kUnknown,SimFlag::kUnknown);
00323    //fDetector,simflag);
00324                             
00325    string seqSelectConfig = Form("SEQNO=%d",config_seqno);
00326 
00327    DbiResultPtr<DbuDaqConfigFilesText> 
00328      rsConfig("DBUDAQCONFIGFILESTEXT",extContextConfig,Dbi::kAnyTask,
00329               seqSelectConfig.c_str());
00330 
00331    Int_t nConfig = rsConfig.GetNumRows();
00332    if (nConfig == 1) {
00333      *fDbuDaqConfigFilesText = *rsConfig.GetRow(0);
00334    }
00335    else
00336      MSG("Dbu",Msg::kWarning)
00337        << "Found " << nConfig << " matching DbuDaqConfigFilesText entries"
00338        << endl;
00339 
00340    VldTimeStamp tsLower(fStartTime.GetSec()-1,0);
00341    VldTimeStamp tsUpper(fEndTime.GetSec()+1,0);
00342    // make a extended query to get DaqFileSummary's
00343    DbiSqlContext extContextFile(DbiSqlContext::kStarts,
00344                                 tsLower,tsUpper, // was fStartTime,fEndTime,
00345                                 fDetector,simflag); // yes, these are important
00346                             
00347    string seqSelectFile = Form("RUN=%d",fRun);
00348 
00349    DbiResultPtr<DbuDaqFileSummary> 
00350      rsFiles("DBUDAQFILESUMMARY",extContextFile,Dbi::kAnyTask,
00351              seqSelectFile.c_str());
00352 
00353    // clear any existing DaqFileSummary's
00354    for (size_t j=0; j < fDbuDaqFiles.size(); ++j) 
00355      { delete fDbuDaqFiles[j]; fDbuDaqFiles[j] = 0; }
00356 
00357    // make sure vector has enough entries
00358    Int_t nFile = rsFiles.GetNumRows();
00359    Int_t lastSubRunSeen = -1;
00360    for (Int_t k=0; k < nFile; ++k) {
00361      const DbuDaqFileSummary* fs = rsFiles.GetRow(k);
00362      if ( fs->fSubRun > lastSubRunSeen ) lastSubRunSeen = fs->fSubRun;
00363    }
00364    size_t mxsize = TMath::Max( nFile, lastSubRunSeen+1 );
00365 
00366    MSG("Dbu",Msg::kDebug)
00367      << " " << Detector::AsString(fDetector) << " Run " << fRun 
00368      << " Found " << nFile << " matching DbuDaqFileSummary entries "
00369      << " LastSubRun " << fLastSubRun 
00370      << " lastSubRunSeen is " << lastSubRunSeen
00371      << endl;
00372 
00373    fDbuDaqFiles.resize(mxsize);
00374    if (mxsize > (size_t)(fLastSubRun+1)) {
00375      MSG("Dbu",Msg::kWarning)
00376        << "LastSubRun was " << fLastSubRun
00377        << " but there are " << nFile << " DbuDaqFileSummary entries "
00378        << " and lastSubRunSeen is " << lastSubRunSeen
00379        << endl;
00380      fLastSubRun = mxsize-1;
00381    }
00382 
00383    // make copies
00384    for (int iFile = 0; iFile < nFile; ++iFile) {
00385      const DbuDaqFileSummary* fs = rsFiles.GetRow(iFile);
00386      if (fs) AddDaqFileEntry(*fs);
00387    }
00388 
00389    if ( fLastSubRun != nFile-1 ) {
00390      MAXMSG("Dbu",Msg::kInfo,20)
00391        << "  ! fLastSubRun is " << fLastSubRun
00392        << " but there are " << nFile 
00393        << " DbuDaqFileSummary entries" << endl;
00394    }
00395 
00396 }

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

Reimplemented from DbiTableRow.

Definition at line 69 of file DbuRunSummary.h.

References CalcUniqueSeqNo(), fDetector, and fRun.

Referenced by Commit().

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

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

Definition at line 100 of file DbuRunSummary.h.

References fgFmtFlag.

Referenced by DbuDaqFileModule::CommitDbuRunSummary(), and DbuDaqFileModule::MyOwn_BeginRun().

00100 { return fgFmtFlag; }

Int_t DbuRunSummary::GetSeqNo (  )  const [inline]

Definition at line 89 of file DbuRunSummary.h.

References CalcUniqueSeqNo(), fDetector, and fRun.

Referenced by Commit().

00090      { return CalcUniqueSeqNo(fDetector,fRun); }

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

Definition at line 529 of file DbuRunSummary.cxx.

00530 {
00531 //
00532 //
00533 //  Purpose:  Return a string describing rows in the table
00534 //            Used in creating temporary tables
00535 //
00536 //  Return:   const char* to parenthesized comma separated list
00537 //            of column name and type pairs
00538 //
00539 //  Contact:   R. Hatcher
00540 //
00541 //  Specification:-
00542 //  =============
00543 //
00544 
00545 //  Program Notes:-
00546 //  =============
00547 
00548 //  None.
00549 
00550    const char* const_tabledescr = "(\
00551        SEQNO             int,        \
00552        ROW_COUNTER       int,        \
00553        DETECTOR          tinytext,   \
00554        RUN               int,        \
00555        LAST_SUBRUN       smallint,   \
00556        RUNTYPE           smallint,   \
00557        RUNTYPE_NAME      varchar(24),\
00558        STARTTIME         datetime,   \
00559        ENDTIME           datetime,   \
00560        TERMCODE          int,        \
00561        RUNEND_SNARLS     int,        \
00562        RUNEND_NONSNARLS  int,        \
00563        NERRS             int,        \
00564        NTIMEFRAMES       int,        \
00565        NDROPPEDFRAMES    int,        \
00566        CONSISTENCY_BITS  int,        \
00567        RUN_COMMENT       text,       \
00568        RUNPREPARE_STRING text,       \
00569        AUX_CONFIG_TEXT   text,       \
00570        CONFIGFILES_MD5   text,       \
00571        CONFIGFILES_SEQNO int,        \
00572        primary key (SEQNO,ROW_COUNTER), \
00573        index (RUN) )";
00574 
00575    return const_tabledescr;
00576 }

Bool_t DbuRunSummary::IsSameRun ( Detector::Detector_t  det,
Int_t  run 
)

Definition at line 505 of file DbuRunSummary.cxx.

References fDetector, and fRun.

00506 {
00507 //
00508 //
00509 //  Purpose:  Same characteristics?
00510 //
00511 //  Return:   a bool
00512 //
00513 //  Contact:   R. Hatcher
00514 //
00515 //  Specification:-
00516 //  =============
00517 //
00518 
00519 //  Program Notes:-
00520 //  =============
00521 
00522 //  None.
00523 
00524    return (fDetector == det) && (fRun == run);
00525 }

DbuRunSummary & DbuRunSummary::operator= ( const DbuRunSummary rhs  )  [private]

Definition at line 144 of file DbuRunSummary.cxx.

References AddDaqFileEntry(), fAuxConfigText, fConsistency, fDbuDaqConfigFilesText, fDbuDaqFiles, fDetector, fDroppedFrames, fEndTime, fLastSubRun, fNErrs, fRun, fRunComment, fRunEndNonSnarls, fRunEndSnarls, fRunPrepare, fRunType, fSimFlag, fStartTime, fTermCode, fTimeFrames, Msg::kError, MSG, and Registry::operator=().

00145 {
00146   // deep assignment
00147 
00148   if (this == &rhs) return *this;  // do nothing if asked to self-assign
00149 
00150   DbiTableRow::operator=(rhs);
00151   this->fDetector        = rhs.fDetector;
00152   this->fSimFlag         = rhs.fSimFlag;
00153   this->fRun             = rhs.fRun;
00154   this->fLastSubRun      = rhs.fLastSubRun;
00155   this->fRunType         = rhs.fRunType;
00156   this->fStartTime       = rhs.fStartTime;
00157   this->fEndTime         = rhs.fEndTime;
00158   this->fTermCode        = rhs.fTermCode;
00159   this->fRunEndSnarls    = rhs.fRunEndSnarls;
00160   this->fRunEndNonSnarls = rhs.fRunEndNonSnarls;
00161   this->fNErrs           = rhs.fNErrs;
00162   this->fTimeFrames      = rhs.fTimeFrames;
00163   this->fDroppedFrames   = rhs.fDroppedFrames;
00164   this->fConsistency     = rhs.fConsistency;
00165   this->fRunComment      = rhs.fRunComment;
00166   this->fRunPrepare      = rhs.fRunPrepare;
00167   this->fAuxConfigText  = rhs.fAuxConfigText;
00168 
00169   if (this->fDbuDaqConfigFilesText) delete this->fDbuDaqConfigFilesText;
00170   if ( ! rhs.fDbuDaqConfigFilesText ) {
00171     MSG("Dbu",Msg::kError)
00172       << "DbuRunSummary::operator= rhs has no fDbuDaqConfigFilesText"
00173       << endl;
00174   }
00175   this->fDbuDaqConfigFilesText = 
00176     new DbuDaqConfigFilesText(*(rhs.fDbuDaqConfigFilesText));
00177 
00178   // delete any DbuDaqFileSummary objects that we currently have
00179   for (size_t j=0; j < this->fDbuDaqFiles.size(); ++j) 
00180     { delete this->fDbuDaqFiles[j]; this->fDbuDaqFiles[j] = 0; }
00181 
00182   // make new copies of DbuDaqFileSummary objects
00183   if (rhs.fLastSubRun >= 0) {
00184     size_t mxsize = TMath::Max( rhs.fLastSubRun+1,
00185                                 (int)rhs.fDbuDaqFiles.size() );
00186     this->fDbuDaqFiles.resize(mxsize);
00187     for (size_t k=0; k < rhs.fDbuDaqFiles.size(); ++k) {
00188       const DbuDaqFileSummary* fs = rhs.fDbuDaqFiles[k];
00189       if (fs) AddDaqFileEntry(*fs);
00190     }
00191   }
00192 
00193   return *this;
00194 }

void DbuRunSummary::ResetConsistencyBits ( Int_t  mask  )  [inline]

Definition at line 155 of file DbuRunSummary.h.

References fConsistency.

Referenced by DbuDaqFileModule::MyOwn_EndFile(), DbuDaqFileModule::ProcessRawBlock(), and DbuDaqFileModule::ProcessRawRecord().

00156 { fConsistency &= ~mask; }

void DbuRunSummary::SetConsistencyBits ( Int_t  mask  )  [inline]

Definition at line 158 of file DbuRunSummary.h.

References fConsistency.

00159 { fConsistency |= mask; }

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

Definition at line 99 of file DbuRunSummary.h.

References fgFmtFlag.

Referenced by DbuDaqFileModule::CommitDbuRunSummary(), and DbuDaqFileModule::MyOwn_BeginRun().

00099 { fgFmtFlag = fmtflg; }

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

Reimplemented from DbiTableRow.

Definition at line 429 of file DbuRunSummary.cxx.

References Detector::AsString(), fConsistency, fDetector, fDroppedFrames, fEndTime, fLastSubRun, fNErrs, fRun, fRunComment, fRunEndNonSnarls, fRunEndSnarls, fRunType, fStartTime, fTermCode, fTimeFrames, and RunTypeName().

00430                                                                      {
00431 //
00432 //
00433 //  Purpose:  Stream object to output row stream
00434 //
00435 //  Arguments:
00436 //    ors          in     Output row stream.
00437 //    vrec         in     Associated validity record (or 0 if filling
00438 //                                                    DbiValidityRec)
00439 //
00440 //  Return:
00441 //
00442 //  Contact:   R. Hatcher
00443 //
00444 //  Specification:-
00445 //  =============
00446 //
00447 //  o  Stream object to output row stream.
00448 
00449 //  Program Notes:-
00450 //  =============
00451 
00452 //  None.
00453 
00454    ors << Detector::AsString(fDetector)
00455        << fRun
00456        << fLastSubRun
00457        << fRunType
00458        << RunTypeName(fRunType,fDetector,fRun)
00459        << fStartTime
00460        << fEndTime
00461        << fTermCode
00462        << fRunEndSnarls
00463        << fRunEndNonSnarls
00464        << fNErrs
00465        << fTimeFrames
00466        << fDroppedFrames
00467        << fConsistency
00468        << fRunComment;
00469 
00470 }


Friends And Related Function Documentation

friend class DbuDaqFileModule [friend]

Definition at line 111 of file DbuRunSummary.h.


Member Data Documentation

std::string DbuRunSummary::fAuxConfigText

Definition at line 143 of file DbuRunSummary.h.

Referenced by Commit(), Fill(), DbuDaqFileModule::HandleConfigFilesBlock(), operator<<(), and operator=().

Int_t DbuRunSummary::fConsistency

Definition at line 139 of file DbuRunSummary.h.

Referenced by Commit(), Fill(), operator<<(), operator=(), ResetConsistencyBits(), SetConsistencyBits(), and Store().

DbuDaqConfigFilesText* DbuRunSummary::fDbuDaqConfigFilesText

Definition at line 145 of file DbuRunSummary.h.

Referenced by Fill(), DbuDaqFileModule::MyOwn_BeginRun(), operator<<(), operator=(), and ~DbuRunSummary().

std::vector<DbuDaqFileSummary*> DbuRunSummary::fDbuDaqFiles

Definition at line 146 of file DbuRunSummary.h.

Referenced by AddDaqFileEntry(), CalcNonSnarls(), CalcSnarls(), Fill(), operator<<(), and operator=().

Detector::Detector_t DbuRunSummary::fDetector

Definition at line 126 of file DbuRunSummary.h.

Referenced by Commit(), Fill(), GetAggregateNo(), GetSeqNo(), IsSameRun(), DbuDaqFileModule::MyOwn_BeginRun(), operator<<(), operator=(), Store(), and DbuDaqFileModule::WritePythonFile().

Int_t DbuRunSummary::fDroppedFrames

Definition at line 138 of file DbuRunSummary.h.

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

VldTimeStamp DbuRunSummary::fEndTime

Definition at line 132 of file DbuRunSummary.h.

Referenced by Commit(), DbuDaqFileModule::CommitDbuRunSummary(), Fill(), operator<<(), operator=(), DbuDaqFileModule::ProcessRawRecord(), and Store().

UInt_t DbuRunSummary::fgFmtFlag = 0xffff [static]

Definition at line 149 of file DbuRunSummary.h.

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

Short_t DbuRunSummary::fLastSubRun

Definition at line 129 of file DbuRunSummary.h.

Referenced by Commit(), DbuDaqFileModule::CommitDbuRunSummary(), Fill(), operator<<(), operator=(), DbuDaqFileModule::ProcessRawRecord(), and Store().

Int_t DbuRunSummary::fNErrs

Definition at line 136 of file DbuRunSummary.h.

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

Int_t DbuRunSummary::fRun

Definition at line 128 of file DbuRunSummary.h.

Referenced by Commit(), Fill(), GetAggregateNo(), GetSeqNo(), IsSameRun(), DbuDaqFileModule::MyOwn_BeginRun(), operator<<(), operator=(), DbuDaqFileModule::ProcessRawRecord(), Store(), and DbuDaqFileModule::WritePythonFile().

std::string DbuRunSummary::fRunComment

Definition at line 141 of file DbuRunSummary.h.

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

Int_t DbuRunSummary::fRunEndNonSnarls

Definition at line 135 of file DbuRunSummary.h.

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

Int_t DbuRunSummary::fRunEndSnarls

Definition at line 134 of file DbuRunSummary.h.

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

std::string DbuRunSummary::fRunPrepare

Definition at line 142 of file DbuRunSummary.h.

Referenced by Commit(), Fill(), operator<<(), operator=(), and DbuDaqFileModule::ProcessRawBlock().

Short_t DbuRunSummary::fRunType

Definition at line 130 of file DbuRunSummary.h.

Referenced by Commit(), Fill(), DbuDaqFileModule::MyOwn_BeginRun(), operator<<(), operator=(), DbuDaqFileModule::ProcessRawRecord(), Store(), and DbuDaqFileModule::WritePythonFile().

SimFlag::SimFlag_t DbuRunSummary::fSimFlag

Definition at line 127 of file DbuRunSummary.h.

Referenced by Commit(), Fill(), DbuDaqFileModule::MyOwn_BeginRun(), and operator=().

VldTimeStamp DbuRunSummary::fStartTime

Definition at line 131 of file DbuRunSummary.h.

Referenced by Commit(), DbuDaqFileModule::CommitDbuRunSummary(), Fill(), operator<<(), operator=(), DbuDaqFileModule::ProcessRawRecord(), and Store().

Int_t DbuRunSummary::fTermCode

Definition at line 133 of file DbuRunSummary.h.

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

Int_t DbuRunSummary::fTimeFrames

Definition at line 137 of file DbuRunSummary.h.

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

const std::string DbuRunSummary::kNoAuxConfig = "<<No AuxConfig>>" [static]

Definition at line 43 of file DbuRunSummary.h.

Referenced by DbuDaqFileModule::HandleConfigFilesBlock().

const std::string DbuRunSummary::kNoComment = "<<No Comment>>" [static]

Definition at line 41 of file DbuRunSummary.h.

Referenced by DbuDaqFileModule::ProcessRawBlock().

const std::string DbuRunSummary::kNoRunPrepare = "<<No RunPrepare>>" [static]

Definition at line 42 of file DbuRunSummary.h.

Referenced by DbuDaqFileModule::ProcessRawBlock().

const std::string DbuRunSummary::kUnfilled = "<<Unfilled>>" [static]

Definition at line 44 of file DbuRunSummary.h.

Referenced by DbuDaqFileModule::HandleConfigFilesBlock().


The documentation for this class was generated from the following files:
Generated on Thu Apr 10 23:02:31 2014 for loon by  doxygen 1.4.7