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

RawDaqHeaderBlock Class Reference

#include <RawDaqHeaderBlock.h>

Inheritance diagram for RawDaqHeaderBlock:

RawDataBlock List of all members.

Public Member Functions

 RawDaqHeaderBlock ()
 RawDaqHeaderBlock (const Int_t *block)
 RawDaqHeaderBlock (const VldContext &vldc, Int_t run, Short_t subrun, Short_t runtype, Int_t timeframe)
virtual ~RawDaqHeaderBlock ()
VldTimeStamp GetTimeStamp () const
VldTimeStamp GetFrameStartTime () const
VldTimeStamp GetFrameEndTime () const
Int_t GetRun () const
Short_t GetSubRun () const
Short_t GetRunType () const
Int_t GetTimeFrameNum () const
VldContext GetVldContext () const
Int_t GetTimeFrameNo () const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const
 RawDaqHeaderBlock (const RawDaqHeaderBlock &rhs)

Static Public Member Functions

void SetDebugFlags (const UInt_t dbgflgs)
UInt_t GetDebugFlags ()

Static Private Attributes

UInt_t fgDebugFlags = 0

Constructor & Destructor Documentation

RawDaqHeaderBlock::RawDaqHeaderBlock  ) 
 

Definition at line 43 of file RawDaqHeaderBlock.cxx.

00043                                      : RawDataBlock()
00044 {
00045    // Default constructor
00046 }

RawDaqHeaderBlock::RawDaqHeaderBlock const Int_t *  block  ) 
 

Definition at line 49 of file RawDaqHeaderBlock.cxx.

00050    : RawDataBlock(block)
00051 {
00052    //  stored block format is:
00053    //---------------------
00054    //  0   # words in block
00055    //  1   checksum
00056    //  2   Block Id
00057    //-----
00058    //  3   run #
00059    //  4   {subrun #| run type}
00060    //  5   start timestamp (sec)
00061    //  6   start timestamp (nsec)
00062    //  7   timeframe #   [version 1+]
00063    //  8   end timestamp (sec)  [version 2+]
00064    //  9   end timestamp (nsec) [version 2+]
00065 }

RawDaqHeaderBlock::RawDaqHeaderBlock const VldContext vldc,
Int_t  run,
Short_t  subrun,
Short_t  runtype,
Int_t  timeframe
 

Definition at line 67 of file RawDaqHeaderBlock.cxx.

References VldContext::GetDetector(), RawBlockProxy::GetMajorId(), VldTimeStamp::GetNanoSec(), VldTimeStamp::GetSec(), VldContext::GetSimFlag(), VldContext::GetTimeStamp(), RawBlockRegistry::Instance(), RawBlockProxy::IsDCS(), RawBlockRegistry::LookUp(), and rdxsum_fill().

00070    : RawDataBlock()
00071 {
00072    // Component ctor
00073 
00074    fSize = zzzz_last;
00075    if (fRawBlock) delete [] fRawBlock;
00076    fRawBlock = new Int_t [fSize];
00077 
00078    fRawBlock[0] = fSize;
00079 // fRawBlock[1] = checksum... see below
00080 
00081    RawBlockRegistry& rbr = RawBlockRegistry::Instance();
00082    RawBlockProxy*    rbp = rbr.LookUp("RawDaqHeaderBlock");
00083 
00084    Bool_t isDCS   = rbp->IsDCS();
00085    Int_t  majorId = rbp->GetMajorId();
00086    Int_t  minorId = 2;  // latest and greatest minor version #
00087    RawBlockId rbid(majorId,minorId,isDCS,
00088                    vldc.GetDetector(),vldc.GetSimFlag());
00089    fRawBlock[2] = rbid.GetEncoded();
00090 
00091    fRawBlock[indx_run]         = run;
00092    fRawBlock[indx_subrun]      = (subrun&0xffff)<<16 | (runtype&0xffff);
00093    fRawBlock[indx_start_sec]   = vldc.GetTimeStamp().GetSec();
00094    fRawBlock[indx_start_nsec]  = vldc.GetTimeStamp().GetNanoSec();
00095    fRawBlock[indx_tf]          = timeframe;
00096    fRawBlock[indx_end_sec]     = fRawBlock[indx_start_sec] + 1;
00097    fRawBlock[indx_end_nsec]    = fRawBlock[indx_start_nsec];
00098 
00099    // fill checksum
00100    rdxsum_fill((long*)fRawBlock,0); 
00101 
00102 }

RawDaqHeaderBlock::~RawDaqHeaderBlock  )  [virtual]
 

Definition at line 105 of file RawDaqHeaderBlock.cxx.

00106 {
00107    // dtor
00108 }

RawDaqHeaderBlock::RawDaqHeaderBlock const RawDaqHeaderBlock rhs  )  [inline]
 

Definition at line 52 of file RawDaqHeaderBlock.h.

00053      : RawDataBlock(rhs) { ; }


Member Function Documentation

std::ostream & RawDaqHeaderBlock::FormatToOStream std::ostream &  os,
Option_t *  option = ""
const [virtual]
 

Reimplemented from RawDataBlock.

Definition at line 179 of file RawDaqHeaderBlock.cxx.

References VldTimeStamp::AsString(), RawDataBlock::FormatToOStream(), GetFrameEndTime(), GetFrameStartTime(), RawDataBlock::GetMinorId(), GetRun(), GetRunType(), GetSubRun(), GetTimeFrameNum(), GetTimeStamp(), and option.

00181 {
00182    RawDataBlock::FormatToOStream(os,option);
00183    if (option[0] == 'X') return os;
00184 
00185    Int_t minor = GetMinorId();
00186 
00187    if (minor > 1) {
00188      os << " [ " 
00189         << GetFrameStartTime().AsString("c") 
00190         << " : "
00191         << GetFrameEndTime().AsString("c") 
00192         << " ]"
00193         << endl;
00194    }
00195    else {
00196      // prior to v2 there was only one timestamp
00197      // current code with give something (time stamp + 1sec)
00198      // so we could actually just go with the above code
00199      os << " TimeStamp " 
00200         << GetTimeStamp().AsString("c") 
00201         << endl;
00202    }
00203    os << " Run " << GetRun()
00204       << " SubRun " << GetSubRun() 
00205       << " RunType " << GetRunType();
00206    if (minor > 0) {
00207       os << " TimeFrame " << GetTimeFrameNum();
00208    }
00209    os << endl; 
00210 
00211    return os;
00212 }

UInt_t RawDaqHeaderBlock::GetDebugFlags  )  [inline, static]
 

Definition at line 49 of file RawDaqHeaderBlock.h.

00049 { return fgDebugFlags; }

VldTimeStamp RawDaqHeaderBlock::GetFrameEndTime  )  const
 

Definition at line 122 of file RawDaqHeaderBlock.cxx.

References indx_end_nsec, indx_end_sec, indx_start_nsec, and indx_start_sec.

Referenced by FormatToOStream().

00123 {
00124    // get the timestamp for the end of the timeframe
00125 
00126    if (fSize > indx_end_nsec) 
00127       return VldTimeStamp(fRawBlock[indx_end_sec],
00128                           fRawBlock[indx_end_nsec]);
00129 
00130    // prior to v2 this didn't exist, so fake it w/ the assumption of 1sec
00131    if (fSize > indx_start_nsec) 
00132       return VldTimeStamp(fRawBlock[indx_start_sec]+1,
00133                           fRawBlock[indx_start_nsec]);
00134 
00135    return VldTimeStamp((time_t)0,(Int_t)0);
00136 }

VldTimeStamp RawDaqHeaderBlock::GetFrameStartTime  )  const
 

Definition at line 111 of file RawDaqHeaderBlock.cxx.

References indx_start_nsec, and indx_start_sec.

Referenced by FormatToOStream(), and GetTimeStamp().

00112 {
00113    // get the timestamp for the start of the timeframe
00114    if (fSize > indx_start_nsec) 
00115       return VldTimeStamp(fRawBlock[indx_start_sec],
00116                           fRawBlock[indx_start_nsec]);
00117 
00118    return VldTimeStamp((time_t)0,(Int_t)0);
00119 }

Int_t RawDaqHeaderBlock::GetRun  )  const
 

Definition at line 139 of file RawDaqHeaderBlock.cxx.

Referenced by PreFilter::Ana(), FarDetVarcErrorsDump::Ana(), FarDetTpSinglesDump::Ana(), FarDetRawRateDump::Ana(), FarDetRawDigitDump::Ana(), RotoObjectifier::BuildRecord(), FormatToOStream(), DQHeader::Process(), FarDetDataQualityModule::ProcessBlock(), OltNewModule::Reco(), and OltBlockScan::Reco().

00140 {
00141    // get the run number
00142    if (fSize > indx_run) return fRawBlock[indx_run];
00143    return -1;
00144 }

Short_t RawDaqHeaderBlock::GetRunType  )  const
 

Definition at line 155 of file RawDaqHeaderBlock.cxx.

Referenced by FarDetRawDigitDump::Ana(), RotoObjectifier::BuildRecord(), FormatToOStream(), DQHeader::Process(), and OltNewModule::Reco().

00156 {
00157    // get the run type
00158    if (fSize > indx_runtype) return fRawBlock[indx_runtype]&0xffff;
00159    return -1;
00160 }

Short_t RawDaqHeaderBlock::GetSubRun  )  const
 

Definition at line 147 of file RawDaqHeaderBlock.cxx.

Referenced by PreFilter::Ana(), FarDetRawDigitDump::Ana(), RotoObjectifier::BuildRecord(), FormatToOStream(), DQHeader::Process(), FarDetDataQualityModule::ProcessBlock(), OltNewModule::Reco(), and OltBlockScan::Reco().

00148 {
00149    // get the subrun number
00150    if (fSize > indx_subrun) return (fRawBlock[indx_subrun]>>16)&0xffff;
00151    return -1;
00152 }

Int_t RawDaqHeaderBlock::GetTimeFrameNo  )  const [inline]
 

Definition at line 43 of file RawDaqHeaderBlock.h.

References GetTimeFrameNum().

Referenced by FarPlaneCheckout::Ana().

00043 { return GetTimeFrameNum(); }

Int_t RawDaqHeaderBlock::GetTimeFrameNum  )  const
 

Definition at line 163 of file RawDaqHeaderBlock.cxx.

Referenced by FarDetVarcErrorsDump::Ana(), FarDetTpSinglesDump::Ana(), FarDetRawRateDump::Ana(), FarDetRawDigitDump::Ana(), RotoObjectifier::BuildRecord(), FormatToOStream(), GetTimeFrameNo(), DQHeader::Process(), and FarDetDataQualityModule::ProcessBlock().

00164 {
00165    // get the timeframe number
00166    if (fSize > indx_tf) return fRawBlock[indx_tf];
00167    return -1;
00168 }

VldTimeStamp RawDaqHeaderBlock::GetTimeStamp  )  const [inline]
 

Definition at line 32 of file RawDaqHeaderBlock.h.

References GetFrameStartTime().

Referenced by FarDetVarcErrorsDump::Ana(), FarDetTpSinglesDump::Ana(), FarDetRawRateDump::Ana(), FarDetRawDigitDump::Ana(), FormatToOStream(), GetVldContext(), DQHeader::Process(), FarDetDataQualityModule::ProcessBlock(), and OltBlockScan::Reco().

00032 { return GetFrameStartTime(); }

VldContext RawDaqHeaderBlock::GetVldContext  )  const
 

Definition at line 171 of file RawDaqHeaderBlock.cxx.

References RawDataBlock::GetBlockId(), RawBlockId::GetDetector(), RawBlockId::GetSimFlag(), and GetTimeStamp().

Referenced by RotoObjectifier::BuildRecord(), DQRawDigits::Process(), DQHeader::Process(), FillNearRunQuality::ProcessBlock(), and OltNewModule::Reco().

00172 {
00173    // build validity context
00174    RawBlockId rbid = GetBlockId();
00175    return VldContext(rbid.GetDetector(),rbid.GetSimFlag(),GetTimeStamp());
00176 }

void RawDaqHeaderBlock::SetDebugFlags const UInt_t  dbgflgs  )  [inline, static]
 

Definition at line 48 of file RawDaqHeaderBlock.h.

References fgDebugFlags.

00048 {fgDebugFlags=dbgflgs;}


Member Data Documentation

UInt_t RawDaqHeaderBlock::fgDebugFlags = 0 [static, private]
 

Definition at line 16 of file RawDaqHeaderBlock.cxx.

Referenced by SetDebugFlags().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:09 2010 for loon by  doxygen 1.3.9.1