RawDaqDeadTimeBlock Class Reference

#include <RawDaqDeadTimeBlock.h>

Inheritance diagram for RawDaqDeadTimeBlock:
RawDataBlock

List of all members.

Public Member Functions

 RawDaqDeadTimeBlock ()
 RawDaqDeadTimeBlock (const Int_t *block)
 RawDaqDeadTimeBlock (const VldContext &vldc, Int_t run, Short_t subrun, Short_t runtype, Int_t tfBegin, Int_t tfEnd)
virtual ~RawDaqDeadTimeBlock ()
VldTimeStamp GetTime () const
Int_t GetRun () const
Short_t GetSubRun () const
Short_t GetRunType () const
Int_t GetTimeFrameBegin () const
Int_t GetTimeFrameEnd () const
VldContext GetVldContext () const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const
 RawDaqDeadTimeBlock (const RawDaqDeadTimeBlock &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 RawDaqDeadTimeBlock.h.


Constructor & Destructor Documentation

RawDaqDeadTimeBlock::RawDaqDeadTimeBlock (  ) 

Definition at line 40 of file RawDaqDeadTimeBlock.cxx.

00040                                          : RawDataBlock()
00041 {
00042    // Default constructor
00043 }

RawDaqDeadTimeBlock::RawDaqDeadTimeBlock ( const Int_t *  block  ) 

Definition at line 46 of file RawDaqDeadTimeBlock.cxx.

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

RawDaqDeadTimeBlock::RawDaqDeadTimeBlock ( const VldContext vldc,
Int_t  run,
Short_t  subrun,
Short_t  runtype,
Int_t  tfBegin,
Int_t  tfEnd 
)

Definition at line 64 of file RawDaqDeadTimeBlock.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, indx_tfbegin, indx_tfend, RawBlockRegistry::Instance(), RawBlockProxy::IsDCS(), RawBlockRegistry::LookUp(), rdxsum_fill(), and zzzz_last.

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

RawDaqDeadTimeBlock::~RawDaqDeadTimeBlock (  )  [virtual]

Definition at line 101 of file RawDaqDeadTimeBlock.cxx.

00102 {
00103    // dtor
00104 }

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

Definition at line 46 of file RawDaqDeadTimeBlock.h.

00047      : RawDataBlock(rhs) { ; }


Member Function Documentation

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

Reimplemented from RawDataBlock.

Definition at line 167 of file RawDaqDeadTimeBlock.cxx.

References VldTimeStamp::AsString(), GetRun(), GetRunType(), GetSubRun(), GetTime(), GetTimeFrameBegin(), and GetTimeFrameEnd().

00169 {
00170    RawDataBlock::FormatToOStream(os,option);
00171    if (option[0] == 'X') return os;
00172    
00173    // additional block specific formatted output is done here
00174 
00175    os << " DaqDeadTime " << GetTime().AsString("c") << endl;
00176    os << " Run " << GetRun() 
00177       << " SubRun " << GetSubRun() 
00178       << " RunType " << GetRunType() 
00179       << endl
00180       << " Dropped TimeFrames in range [" 
00181       << GetTimeFrameBegin() << "," << GetTimeFrameEnd() << "]"
00182       << endl; 
00183 
00184    return os;
00185 }

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

Definition at line 43 of file RawDaqDeadTimeBlock.h.

References fgDebugFlags.

00043 { return fgDebugFlags; }

Int_t RawDaqDeadTimeBlock::GetRun ( void   )  const

Definition at line 117 of file RawDaqDeadTimeBlock.cxx.

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

Referenced by FormatToOStream().

00118 {
00119    // get the run number
00120    if (fSize > indx_run) return fRawBlock[indx_run];
00121    return -1;
00122 }

Short_t RawDaqDeadTimeBlock::GetRunType (  )  const

Definition at line 133 of file RawDaqDeadTimeBlock.cxx.

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

Referenced by FormatToOStream().

00134 {
00135    // get the run type
00136    if (fSize > indx_runtype) return fRawBlock[indx_runtype]&0xffff;
00137    return -1;
00138 }

Short_t RawDaqDeadTimeBlock::GetSubRun (  )  const

Definition at line 125 of file RawDaqDeadTimeBlock.cxx.

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

Referenced by FormatToOStream().

00126 {
00127    // get the subrun number
00128    if (fSize > indx_subrun) return (fRawBlock[indx_subrun]>>16)&0xffff;
00129    return -1;
00130 }

VldTimeStamp RawDaqDeadTimeBlock::GetTime ( void   )  const

Definition at line 107 of file RawDaqDeadTimeBlock.cxx.

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

Referenced by FormatToOStream(), and GetVldContext().

00108 {
00109    // get the trigger time
00110    if (fSize > indx_startnsec) 
00111       return VldTimeStamp(fRawBlock[indx_startsec],fRawBlock[indx_startnsec]);
00112 
00113    return VldTimeStamp((time_t)0,(Int_t)0);
00114 }

Int_t RawDaqDeadTimeBlock::GetTimeFrameBegin (  )  const

Definition at line 141 of file RawDaqDeadTimeBlock.cxx.

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

Referenced by FormatToOStream().

00142 {
00143    // get the time frame when dropping started
00144    if (fSize > indx_tfbegin) return fRawBlock[indx_tfbegin];
00145 
00146    return -1;
00147 }

Int_t RawDaqDeadTimeBlock::GetTimeFrameEnd (  )  const

Definition at line 150 of file RawDaqDeadTimeBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, indx_tfbegin, and indx_tfend.

Referenced by FormatToOStream().

00151 {
00152    // get the time frame when dropping started
00153    if (fSize > indx_tfbegin) return fRawBlock[indx_tfend];
00154 
00155    return -1;
00156 }

VldContext RawDaqDeadTimeBlock::GetVldContext (  )  const

Definition at line 159 of file RawDaqDeadTimeBlock.cxx.

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

00160 {
00161    // build validity context
00162    RawBlockId rbid = GetBlockId();
00163    return VldContext(rbid.GetDetector(),rbid.GetSimFlag(),GetTime());
00164 }

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

Definition at line 42 of file RawDaqDeadTimeBlock.h.

References fgDebugFlags.

00042 {fgDebugFlags=dbgflgs;}


Member Data Documentation

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

Definition at line 54 of file RawDaqDeadTimeBlock.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