RawDcsHeaderBlock Class Reference

#include <RawDcsHeaderBlock.h>

Inheritance diagram for RawDcsHeaderBlock:
RawDataBlock

List of all members.

Public Member Functions

 RawDcsHeaderBlock ()
 RawDcsHeaderBlock (const Int_t *block)
 RawDcsHeaderBlock (const VldContext &vldc)
virtual ~RawDcsHeaderBlock ()
VldTimeStamp GetTimeStamp () const
VldContext GetVldContext () const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const
 RawDcsHeaderBlock (const RawDcsHeaderBlock &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 20 of file RawDcsHeaderBlock.h.


Constructor & Destructor Documentation

RawDcsHeaderBlock::RawDcsHeaderBlock (  ) 

Definition at line 35 of file RawDcsHeaderBlock.cxx.

00035                                      : RawDataBlock()
00036 {
00037    // Default constructor
00038 }

RawDcsHeaderBlock::RawDcsHeaderBlock ( const Int_t *  block  ) 

Definition at line 41 of file RawDcsHeaderBlock.cxx.

00042    : RawDataBlock(block)
00043 {
00044    //  stored block format is:
00045    //---------------------
00046    //  0   # words in block
00047    //  1   checksum
00048    //  2   Block Id
00049    //-----
00050    //  3   timestamp (sec)
00051    //  4   timestamp (nsec)
00052 }

RawDcsHeaderBlock::RawDcsHeaderBlock ( const VldContext vldc  ) 

Definition at line 54 of file RawDcsHeaderBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, VldContext::GetDetector(), RawBlockProxy::GetMajorId(), VldTimeStamp::GetNanoSec(), VldTimeStamp::GetSec(), VldContext::GetSimFlag(), VldContext::GetTimeStamp(), indx_nsec, indx_sec, RawBlockRegistry::Instance(), RawBlockProxy::IsDCS(), RawBlockRegistry::LookUp(), rdxsum_fill(), and zzzz_last.

00055    : RawDataBlock()
00056 {
00057    // Component ctor
00058 
00059    fSize = zzzz_last;
00060    if (fRawBlock) delete [] fRawBlock;
00061    fRawBlock = new Int_t [fSize];
00062 
00063    fRawBlock[0] = fSize;
00064 // fRawBlock[1] = checksum... see below
00065 
00066    RawBlockRegistry& rbr = RawBlockRegistry::Instance();
00067    RawBlockProxy*    rbp = rbr.LookUp("RawDcsHeaderBlock");
00068 
00069    Bool_t isDCS   = rbp->IsDCS();
00070    Int_t  majorId = rbp->GetMajorId();
00071    Int_t  minorId = 1;  // latest and greatest minor version #
00072    RawBlockId rbid(majorId,minorId,isDCS,
00073                    vldc.GetDetector(),vldc.GetSimFlag());
00074    fRawBlock[2] = rbid.GetEncoded();
00075 
00076    fRawBlock[indx_sec]     = vldc.GetTimeStamp().GetSec();
00077    fRawBlock[indx_nsec]    = vldc.GetTimeStamp().GetNanoSec();
00078 
00079    // fill checksum
00080    rdxsum_fill((int32_t*)fRawBlock,0); 
00081 
00082 }

RawDcsHeaderBlock::~RawDcsHeaderBlock (  )  [virtual]

Definition at line 85 of file RawDcsHeaderBlock.cxx.

00086 {
00087    // dtor
00088 }

RawDcsHeaderBlock::RawDcsHeaderBlock ( const RawDcsHeaderBlock rhs  )  [inline]

Definition at line 39 of file RawDcsHeaderBlock.h.

00040      : RawDataBlock(rhs) { ; }


Member Function Documentation

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

Reimplemented from RawDataBlock.

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

Definition at line 36 of file RawDcsHeaderBlock.h.

References fgDebugFlags.

00036 { return fgDebugFlags; }

VldTimeStamp RawDcsHeaderBlock::GetTimeStamp (  )  const

Definition at line 91 of file RawDcsHeaderBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, indx_nsec, and indx_sec.

Referenced by GetVldContext().

00092 {
00093    // get the timestamp
00094    if (fSize > indx_nsec) 
00095       return VldTimeStamp(fRawBlock[indx_sec],fRawBlock[indx_nsec]);
00096 
00097    return VldTimeStamp((time_t)0,(Int_t)0);
00098 }

VldContext RawDcsHeaderBlock::GetVldContext (  )  const

Definition at line 101 of file RawDcsHeaderBlock.cxx.

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

Referenced by RotoObjectifier::BuildRecord().

00102 {
00103    // build validity context
00104    RawBlockId rbid = GetBlockId();
00105    return VldContext(rbid.GetDetector(),rbid.GetSimFlag(),GetTimeStamp());
00106 }

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

Definition at line 35 of file RawDcsHeaderBlock.h.

References fgDebugFlags.

00035 {fgDebugFlags=dbgflgs;}


Member Data Documentation

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

Definition at line 47 of file RawDcsHeaderBlock.h.

Referenced by GetDebugFlags(), and SetDebugFlags().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1