RawRunStartBlock Class Reference

#include <RawRunStartBlock.h>

Inheritance diagram for RawRunStartBlock:
RawDataBlock

List of all members.

Public Member Functions

 RawRunStartBlock ()
 RawRunStartBlock (const Int_t *block)
 RawRunStartBlock (const VldContext &vldc, Int_t run, Short_t subrun, Short_t runtype)
virtual ~RawRunStartBlock ()
VldTimeStamp GetStartTime () const
Int_t GetRun () const
Short_t GetSubRun () const
Short_t GetRunType () const
VldContext GetVldContext () const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const
 RawRunStartBlock (const RawRunStartBlock &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 19 of file RawRunStartBlock.h.


Constructor & Destructor Documentation

RawRunStartBlock::RawRunStartBlock (  ) 

Definition at line 38 of file RawRunStartBlock.cxx.

00039 {
00040    // Default constructor
00041 }

RawRunStartBlock::RawRunStartBlock ( const Int_t *  block  ) 

Definition at line 44 of file RawRunStartBlock.cxx.

00045    : RawDataBlock(block)
00046 {
00047    //  stored block format is:
00048    //---------------------
00049    //  0   # words in block
00050    //  1   checksum
00051    //  2   Block Id
00052    //-----
00053    //  3   run #
00054    //  4   {subrun#| run type}
00055    //  5   start time (sec)
00056    //  6   start time (nsec)
00057 }

RawRunStartBlock::RawRunStartBlock ( const VldContext vldc,
Int_t  run,
Short_t  subrun,
Short_t  runtype 
)

Definition at line 60 of file RawRunStartBlock.cxx.

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

00062    : RawDataBlock()
00063 {
00064    // Component ctor
00065 
00066    fSize = zzzz_last;
00067    fRawBlock = new Int_t [fSize];
00068 
00069    fRawBlock[0] = fSize;
00070 // fRawBlock[1] = checksum... see below
00071 
00072    RawBlockRegistry& rbr = RawBlockRegistry::Instance();
00073    RawBlockProxy*    rbp = rbr.LookUp("RawRunStartBlock");
00074 
00075    Bool_t isDCS   = rbp->IsDCS();
00076    Int_t  majorId = rbp->GetMajorId();
00077    Int_t  minorId = 0;
00078    RawBlockId rbid(majorId,minorId,isDCS,
00079                    vldc.GetDetector(),vldc.GetSimFlag());
00080    fRawBlock[2] = rbid.GetEncoded();
00081 
00082    fRawBlock[indx_run]     = run;
00083    fRawBlock[indx_subrun]  = (subrun&0xffff)<<16 | (runtype&0xffff);
00084    fRawBlock[indx_startsec]     = vldc.GetTimeStamp().GetSec();
00085    fRawBlock[indx_startnsec]    = vldc.GetTimeStamp().GetNanoSec();
00086 
00087    // fill checksum
00088    rdxsum_fill((int32_t*)fRawBlock,0); 
00089 
00090 }

RawRunStartBlock::~RawRunStartBlock (  )  [virtual]

Definition at line 93 of file RawRunStartBlock.cxx.

00094 {
00095    // dtor
00096 }

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

Definition at line 43 of file RawRunStartBlock.h.

00044      : RawDataBlock(rhs) { ; }


Member Function Documentation

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

Reimplemented from RawDataBlock.

Definition at line 141 of file RawRunStartBlock.cxx.

References VldTimeStamp::AsString(), GetRun(), GetRunType(), GetStartTime(), and GetSubRun().

00143 {
00144    RawDataBlock::FormatToOStream(os,option);
00145    if (option[0] == 'X') return os;
00146    
00147    // additional block specific formatted output is done here
00148 
00149    os << " StartTime " << GetStartTime().AsString("c") << endl;
00150    os << " Run " << GetRun() 
00151       << " SubRun " << GetSubRun() 
00152       << " RunType " << GetRunType() << endl; 
00153 
00154    return os;
00155 }

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

Definition at line 40 of file RawRunStartBlock.h.

References fgDebugFlags.

00040 { return fgDebugFlags; }

Int_t RawRunStartBlock::GetRun ( void   )  const

Definition at line 109 of file RawRunStartBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, indx_run, and zzzz_last.

Referenced by RunSummary::Ana(), RotoObjectifier::BuildRecord(), and FormatToOStream().

00110 {
00111    // get the run number
00112    if (fSize >= zzzz_last) return fRawBlock[indx_run];
00113    return -1;
00114 }

Short_t RawRunStartBlock::GetRunType (  )  const

Definition at line 125 of file RawRunStartBlock.cxx.

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

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

00126 {
00127    // get the run type
00128    if (fSize >= zzzz_last) return fRawBlock[indx_runtype]&0xffff;
00129    return -1;
00130 }

VldTimeStamp RawRunStartBlock::GetStartTime (  )  const

Definition at line 99 of file RawRunStartBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, indx_startnsec, indx_startsec, and zzzz_last.

Referenced by RunSummary::Ana(), FormatToOStream(), GetVldContext(), FillFarRunQuality::ProcessBlock(), and DbuDaqMonitorModule::ProcessRawRecord().

00100 {
00101    // get the trigger time
00102    if (fSize >= zzzz_last) 
00103       return VldTimeStamp(fRawBlock[indx_startsec],fRawBlock[indx_startnsec]);
00104 
00105    return VldTimeStamp((time_t)0,(Int_t)0);
00106 }

Short_t RawRunStartBlock::GetSubRun (  )  const

Definition at line 117 of file RawRunStartBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, indx_subrun, and zzzz_last.

Referenced by RunSummary::Ana(), RotoObjectifier::BuildRecord(), and FormatToOStream().

00118 {
00119    // get the subrun number
00120    if (fSize >= zzzz_last) return (fRawBlock[indx_subrun]>>16)&0xffff;
00121    return -1;
00122 }

VldContext RawRunStartBlock::GetVldContext (  )  const

Definition at line 133 of file RawRunStartBlock.cxx.

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

Referenced by RotoObjectifier::BuildRecord().

00134 {
00135    // build validity context
00136    RawBlockId rbid = GetBlockId();
00137    return VldContext(rbid.GetDetector(),rbid.GetSimFlag(),GetStartTime());
00138 }

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

Definition at line 39 of file RawRunStartBlock.h.

References fgDebugFlags.

00039 {fgDebugFlags=dbgflgs;}


Member Data Documentation

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

Definition at line 51 of file RawRunStartBlock.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