DbuDaqFileModule.cxx File Reference

#include "DatabaseUpdater/DbuDaqFileModule.h"
#include "DatabaseUpdater/DbuSignalHandler.h"
#include "OnlineUtil/mdBlockDefinitions.h"
#include "DatabaseUpdater/DbuRunSummary.h"
#include "DatabaseUpdater/DbuDaqFileSummary.h"
#include "DatabaseUpdater/DbuDaqConfigFilesText.h"
#include "DatabaseUpdater/DbuBits.h"
#include "DatabaseUpdater/RunTypeName.h"
#include <cstdio>
#include <cassert>
#include "TObject.h"
#include "TCollection.h"
#include "TIterator.h"
#include "TObjectTable.h"
#include "TString.h"
#include "TSystem.h"
#include "TFile.h"
#include "TMath.h"
#include "TROOT.h"
#include "DatabaseInterface/Dbi.h"
#include "DatabaseInterface/DbiCascader.h"
#include "DatabaseInterface/DbiTableProxy.h"
#include "DatabaseInterface/DbiTableProxyRegistry.h"
#include "DatabaseInterface/DbiOutRowStream.h"
#include "DatabaseInterface/DbiWriter.h"
#include "DatabaseInterface/DbiCache.h"
#include "DatabaseInterface/DbiResultPtr.h"
#include "DatabaseInterface/DbiString.h"
#include "DatabaseInterface/DbiStatement.h"
#include "RawData/RawRecord.h"
#include "RawData/RawDaqSnarlHeader.h"
#include "RawData/RawLIAdcSummaryBlock.h"
#include "RawData/RawLITimingSummaryBlock.h"
#include "RawData/RawRunStartBlock.h"
#include "RawData/RawRunCommentBlock.h"
#include "RawData/RawRunEndBlock.h"
#include "RawData/RawSubRunEndBlock.h"
#include "RawData/RawRunConfigBlock.h"
#include "RawData/RawConfigFilesBlock.h"
#include "RawData/RawDigitDataBlock.h"
#include "JobControl/JobCommand.h"
#include "JobControl/JobCModuleRegistry.h"
#include "MinosObjectMap/MomNavigator.h"
#include "MessageService/MsgService.h"
#include "Util/UtilString.h"
#include <signal.h>
#include "OnlineUtil/msgLogLib/msgLog.h"
#include <fstream>

Go to the source code of this file.

Functions

 CVSID ("$Id: DbuDaqFileModule.cxx,v 1.12 2007/01/30 17:00:04 rhatcher Exp $")
 JOBMODULE (DbuDaqFileModule,"DbuDaqFileModule","Generate RunSummary entries in database.")
void updateMinTimeStamp (VldTimeStamp &ts, const VldTimeStamp &ts_new)
void updateMaxTimeStamp (VldTimeStamp &ts, const VldTimeStamp &ts_new)
void updateMinInt (Int_t &minInt, const Int_t curInt)
void updateMaxInt (Int_t &maxInt, const Int_t curInt)
const char * oracleTimeStamp (VldTimeStamp &ts)

Variables

const Int_t gkFakeRun = -1
const Int_t gkFakeSubRun = -1
const VldContext gkFakeVldContext = VldContext()
const std::string gkFakeFile = ""
const VldTimeStamp nullTime = VldTimeStamp((time_t)0,0)
const Int_t sec_fivemin = 5*60

Function Documentation

CVSID ( "$Id: DbuDaqFileModule.  cxx,
v 1.12 2007/01/30 17:00:04 rhatcher Exp $"   
)
JOBMODULE ( DbuDaqFileModule  ,
"DbuDaqFileModule"  ,
"Generate RunSummary entries in database."   
)
const char* oracleTimeStamp ( VldTimeStamp ts  ) 

Definition at line 113 of file DbuDaqFileModule.cxx.

References VldTimeStamp::GetSec().

Referenced by DbuDaqFileModule::WritePythonFile().

00114 {
00115   // return a string of the form "14-Oct-2004 00:14:10" (implied UTC)
00116   // use internal circular list of buffers to avoid problems
00117   // when multiple calls in a single iostream statment
00118 
00119   struct tm *ptm;
00120   time_t seconds = (time_t) ts.GetSec();
00121   ptm = gmtime(&seconds);  // returns ptr to static data
00122   const char *oracleFmt = "%d-%b-%Y %H:%M:%S";
00123 
00124   const  int nbuffers = 8;
00125   static int ibuffer  = nbuffers;
00126   ibuffer = (ibuffer+1)%nbuffers;  // each call move to next buffer
00127   static char timeString[nbuffers][64];
00128   strftime(timeString[ibuffer],sizeof(timeString[ibuffer]),oracleFmt,ptm);
00129   return timeString[ibuffer];
00130 }

void updateMaxInt ( Int_t &  maxInt,
const Int_t  curInt 
) [inline]

Definition at line 107 of file DbuDaqFileModule.cxx.

Referenced by DbuDaqFileModule::ProcessRawRecord().

00108 {
00109   if ( curInt < 0 ) return;  // bad data
00110   if ( maxInt < 0 || curInt > maxInt ) maxInt = curInt;
00111 }

void updateMaxTimeStamp ( VldTimeStamp ts,
const VldTimeStamp ts_new 
) [inline]

Definition at line 95 of file DbuDaqFileModule.cxx.

Referenced by DbuDaqFileModule::CommitDbuRunSummary(), DbuDaqFileModule::ProcessRawRecord(), and DbuDaqFileModule::WritePythonFile().

00096 {
00097   // update "ts" to the max of it's current value or the new value
00098   // (set it to the new value if it is the nullTime)
00099   if ( nullTime == ts_new ) return; // bad data
00100   if ( nullTime == ts || ts_new > ts ) ts = ts_new;
00101 }

void updateMinInt ( Int_t &  minInt,
const Int_t  curInt 
) [inline]

Definition at line 102 of file DbuDaqFileModule.cxx.

Referenced by DbuDaqFileModule::ProcessRawRecord().

00103 {
00104   if ( curInt < 0 ) return;  // bad data
00105   if ( minInt < 0 || curInt < minInt ) minInt = curInt;
00106 }

void updateMinTimeStamp ( VldTimeStamp ts,
const VldTimeStamp ts_new 
) [inline]

Definition at line 88 of file DbuDaqFileModule.cxx.

Referenced by DbuDaqFileModule::CommitDbuRunSummary(), DbuDaqFileModule::ProcessRawRecord(), and DbuDaqFileModule::WritePythonFile().

00089 {
00090   // update "ts" to the min of it's current value or the new value
00091   // (set it to the new value if it is the nullTime)
00092   if ( nullTime == ts_new ) return; // bad data
00093   if ( nullTime == ts || ts_new < ts ) ts = ts_new;
00094 }


Variable Documentation

const std::string gkFakeFile = ""
const Int_t gkFakeRun = -1
const Int_t gkFakeSubRun = -1

Definition at line 73 of file DbuDaqFileModule.cxx.

Referenced by DbuDaqFileModule::EndJob().

Definition at line 74 of file DbuDaqFileModule.cxx.

const VldTimeStamp nullTime = VldTimeStamp((time_t)0,0)
const Int_t sec_fivemin = 5*60

Definition at line 81 of file DbuDaqFileModule.cxx.

Referenced by DbuDaqMonitorModule::DefaultConfig().


Generated on 15 Jul 2018 for loon by  doxygen 1.6.1