RawBeamMonHeaderBlock Class Reference

#include <RawBeamMonHeaderBlock.h>

Inheritance diagram for RawBeamMonHeaderBlock:

RawDataBlock List of all members.

Public Member Functions

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


Constructor & Destructor Documentation

RawBeamMonHeaderBlock::RawBeamMonHeaderBlock (  ) 

Definition at line 27 of file RawBeamMonHeaderBlock.cxx.

00027                                              : RawDataBlock()
00028 {
00029    // Default constructor
00030 }

RawBeamMonHeaderBlock::RawBeamMonHeaderBlock ( const Int_t *  block  ) 

Definition at line 33 of file RawBeamMonHeaderBlock.cxx.

00034    : RawDataBlock(block)
00035 {
00036    //  stored block format is:
00037    //---------------------
00038    //  0   # words in block
00039    //  1   checksum
00040    //  2   Block Id
00041    //-----
00042    //  3   timestamp (sec)
00043    //  4   timestamp (nsec)
00044    //  5   spill count
00045 }

RawBeamMonHeaderBlock::RawBeamMonHeaderBlock ( const VldContext vldc,
UInt_t  spillcnt 
)

Definition at line 47 of file RawBeamMonHeaderBlock.cxx.

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

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

RawBeamMonHeaderBlock::~RawBeamMonHeaderBlock (  )  [virtual]

Definition at line 80 of file RawBeamMonHeaderBlock.cxx.

00081 {
00082    // dtor
00083 }

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

Definition at line 41 of file RawBeamMonHeaderBlock.h.

00042      : RawDataBlock(rhs) { ; }


Member Function Documentation

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

Reimplemented from RawDataBlock.

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

Definition at line 38 of file RawBeamMonHeaderBlock.h.

References fgDebugFlags.

00038 { return fgDebugFlags; }

Int_t RawBeamMonHeaderBlock::GetSpillCountNum (  )  const

Definition at line 96 of file RawBeamMonHeaderBlock.cxx.

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

Referenced by RotoObjectifier::BuildRecord(), and dump().

00097 {
00098    // get the timeframe number
00099    if (fSize > hdr_indx_spillcnt) return fRawBlock[hdr_indx_spillcnt];
00100    return -1;
00101 }

VldTimeStamp RawBeamMonHeaderBlock::GetTimeStamp (  )  const

Definition at line 86 of file RawBeamMonHeaderBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, hdr_indx_nsec, and hdr_indx_sec.

Referenced by BDAnaModule::Ana(), dump(), GetVldContext(), BeamMonDbuModule::Process(), and BDSwicPeds::SetSpill().

00087 {
00088    // get the timestamp
00089    if (fSize > hdr_indx_nsec) 
00090       return VldTimeStamp(fRawBlock[hdr_indx_sec],fRawBlock[hdr_indx_nsec]);
00091 
00092    return VldTimeStamp((time_t)0,(Int_t)0);
00093 }

VldContext RawBeamMonHeaderBlock::GetVldContext (  )  const

Definition at line 104 of file RawBeamMonHeaderBlock.cxx.

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

Referenced by RotoObjectifier::BuildRecord(), BDSwicCalibrator::Calibrate(), fill_bdtest(), and NtpBDFullModule::Reco().

00105 {
00106    // build validity context
00107    RawBlockId rbid = GetBlockId();
00108    return VldContext(rbid.GetDetector(),rbid.GetSimFlag(),GetTimeStamp());
00109 }

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

Definition at line 37 of file RawBeamMonHeaderBlock.h.

References fgDebugFlags.

00037 {fgDebugFlags=dbgflgs;}


Member Data Documentation

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

Definition at line 49 of file RawBeamMonHeaderBlock.h.

Referenced by GetDebugFlags(), and SetDebugFlags().


The documentation for this class was generated from the following files:
Generated on Fri Oct 10 22:46:23 2014 for loon by  doxygen 1.4.7