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

static void SetDebugFlags (const UInt_t dbgflgs)
static UInt_t GetDebugFlags ()

Static Private Attributes

static UInt_t fgDebugFlags = 0

Detailed Description

Definition at line 22 of file RawDaqHeaderBlock.h.


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 RawDataBlock::fRawBlock, RawDataBlock::fSize, VldContext::GetDetector(), RawBlockProxy::GetMajorId(), VldTimeStamp::GetNanoSec(), VldTimeStamp::GetSec(), VldContext::GetSimFlag(), VldContext::GetTimeStamp(), indx_end_nsec, indx_end_sec, indx_run, indx_start_nsec, indx_start_sec, indx_subrun, indx_tf, RawBlockRegistry::Instance(), RawBlockProxy::IsDCS(), RawBlockRegistry::LookUp(), rdxsum_fill(), and zzzz_last.

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((int32_t*)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

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

Reimplemented from RawDataBlock.

static UInt_t RawDaqHeaderBlock::GetDebugFlags (  )  [inline, static]

Definition at line 49 of file RawDaqHeaderBlock.h.

References fgDebugFlags.

00049 { return fgDebugFlags; }

VldTimeStamp RawDaqHeaderBlock::GetFrameEndTime (  )  const

Definition at line 122 of file RawDaqHeaderBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, indx_end_nsec, indx_end_sec, indx_start_nsec, and indx_start_sec.

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 RawDataBlock::fRawBlock, RawDataBlock::fSize, indx_start_nsec, and indx_start_sec.

Referenced by 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 ( void   )  const
Short_t RawDaqHeaderBlock::GetRunType (  )  const

Definition at line 155 of file RawDaqHeaderBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, and indx_runtype.

Referenced by FarDetRawDigitDump::Ana(), RotoObjectifier::BuildRecord(), 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
Int_t RawDaqHeaderBlock::GetTimeFrameNo (  )  const [inline]

Definition at line 43 of file RawDaqHeaderBlock.h.

References GetTimeFrameNum().

00043 { return GetTimeFrameNum(); }

Int_t RawDaqHeaderBlock::GetTimeFrameNum (  )  const
VldTimeStamp RawDaqHeaderBlock::GetTimeStamp (  )  const [inline]
VldContext RawDaqHeaderBlock::GetVldContext (  )  const
static 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 60 of file RawDaqHeaderBlock.h.

Referenced by GetDebugFlags(), and SetDebugFlags().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1