RawSnarlHeaderBlock Class Reference

#include <RawSnarlHeaderBlock.h>

Inheritance diagram for RawSnarlHeaderBlock:
RawDataBlock

List of all members.

Public Member Functions

 RawSnarlHeaderBlock ()
 RawSnarlHeaderBlock (const Int_t *block)
 RawSnarlHeaderBlock (const VldContext &vldc, Int_t run, Short_t subrun, Short_t runtype, Int_t timeframe, Int_t snarl, Int_t trigsrc, Int_t err, Int_t nrawdigits, Int_t spilltype=0)
virtual ~RawSnarlHeaderBlock ()
VldTimeStamp GetTriggerTime () const
Int_t GetRun () const
Short_t GetSubRun () const
Short_t GetRunType () const
Int_t GetTimeFrameNum () const
Int_t GetSnarl () const
Int_t GetTriggerSource () const
Int_t GetErrorCode () const
Int_t GetNumRawDigits () const
Int_t GetRemoteSpillType () const
VldContext GetVldContext () const
Int_t GetTimeFrameNo () const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const
 RawSnarlHeaderBlock (const RawSnarlHeaderBlock &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 RawSnarlHeaderBlock.h.


Constructor & Destructor Documentation

RawSnarlHeaderBlock::RawSnarlHeaderBlock (  ) 

Definition at line 46 of file RawSnarlHeaderBlock.cxx.

00047 {
00048    // Default constructor
00049 }

RawSnarlHeaderBlock::RawSnarlHeaderBlock ( const Int_t *  block  ) 

Definition at line 52 of file RawSnarlHeaderBlock.cxx.

00053    : RawDataBlock(block)
00054 {
00055    //  stored block format is:
00056    //      version 0             version 1, 2
00057    //---   ---------------       ----------------      
00058    //  0   # words in block       # words in block     
00059    //  1   checksum               checksum             
00060    //  2   Block Id               Block Id             
00061    //---                                             
00062    //  3   run #                  run #                
00063    //  4   {subrun #| run type}   {subrun #| run type} 
00064    //  5   trigger time (sec)     trigger time (sec)   
00065    //  6   trigger time (nsec)    trigger time (nsec)  
00066    //  7   snarl #                timeframe #
00067    //  8   trigger source         snarl #              
00068    //  9   error code             trigger source       
00069    // 10                          error code 
00070    // 11                          # of raw digits in crate block ( >= v2 only )
00071    // 12                          remote spill type ( >= v3 only )
00072 }

RawSnarlHeaderBlock::RawSnarlHeaderBlock ( const VldContext vldc,
Int_t  run,
Short_t  subrun,
Short_t  runtype,
Int_t  timeframe,
Int_t  snarl,
Int_t  trigsrc,
Int_t  err,
Int_t  nrawdigits,
Int_t  spilltype = 0 
)

Definition at line 74 of file RawSnarlHeaderBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, VldContext::GetDetector(), RawBlockProxy::GetMajorId(), VldTimeStamp::GetNanoSec(), VldTimeStamp::GetSec(), VldContext::GetSimFlag(), VldContext::GetTimeStamp(), indx_errcode, indx_nrdigit, indx_nsec, indx_run, indx_sec, indx_snarl, indx_spilltype, indx_subrun, indx_tf, indx_trigsrc, RawBlockRegistry::Instance(), RawBlockProxy::IsDCS(), RawBlockRegistry::LookUp(), rdxsum_fill(), and zzzz_last.

00078    : RawDataBlock()
00079 {
00080    // Component ctor
00081 
00082    fSize = zzzz_last;
00083    fRawBlock = new Int_t [fSize];
00084 
00085    fRawBlock[0] = fSize;
00086 // fRawBlock[1] = checksum... see below
00087 
00088    RawBlockRegistry& rbr = RawBlockRegistry::Instance();
00089    RawBlockProxy*    rbp = rbr.LookUp("RawSnarlHeaderBlock");
00090 
00091    Bool_t isDCS   = rbp->IsDCS();
00092    Int_t  majorId = rbp->GetMajorId();
00093    Int_t  minorId = 3;  // latest and greatest minor version #
00094    RawBlockId rbid(majorId,minorId,isDCS,
00095                    vldc.GetDetector(),vldc.GetSimFlag());
00096    fRawBlock[2] = rbid.GetEncoded();
00097 
00098    fRawBlock[indx_run]       = run;
00099    fRawBlock[indx_subrun]    = (subrun&0xffff)<<16 | (runtype&0xffff);
00100    fRawBlock[indx_sec]       = vldc.GetTimeStamp().GetSec();
00101    fRawBlock[indx_nsec]      = vldc.GetTimeStamp().GetNanoSec();
00102    fRawBlock[indx_tf]        = timeframe;
00103 
00104    fRawBlock[indx_snarl]     = snarl;
00105    fRawBlock[indx_trigsrc]   = trigsrc;
00106    fRawBlock[indx_errcode]   = err;
00107    fRawBlock[indx_nrdigit]   = nrawdigits;
00108    fRawBlock[indx_spilltype] = spilltype;
00109 
00110    // fill checksum
00111    rdxsum_fill((int32_t*)fRawBlock,0); 
00112 }

RawSnarlHeaderBlock::~RawSnarlHeaderBlock (  )  [virtual]

Definition at line 115 of file RawSnarlHeaderBlock.cxx.

00116 {
00117    // dtor
00118 }

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

Definition at line 55 of file RawSnarlHeaderBlock.h.

00056      : RawDataBlock(rhs) { ; }


Member Function Documentation

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

Reimplemented from RawDataBlock.

Definition at line 223 of file RawSnarlHeaderBlock.cxx.

References VldTimeStamp::AsString(), fgDebugFlags, GetErrorCode(), RawDataBlock::GetMinorId(), GetNumRawDigits(), GetRemoteSpillType(), GetRun(), GetRunType(), GetSnarl(), GetSubRun(), GetTimeFrameNo(), GetTriggerSource(), GetTriggerTime(), and kdbg_ForceHexDump.

00225 {
00226 
00227   if (fgDebugFlags & kdbg_ForceHexDump) option = "x";
00228 
00229    RawDataBlock::FormatToOStream(os,option);
00230    if (option[0] == 'X') return os;
00231    
00232    // additional block specific formatted output is done here
00233    int minorid = GetMinorId();
00234 
00235    os << " TriggerTime " << GetTriggerTime().AsString("c") << endl;
00236    os << " Run " << GetRun() 
00237       << " SubRun " << GetSubRun() 
00238       << " RunType " << GetRunType();
00239    if (minorid > 0) {
00240       os << " TimeFrame " << GetTimeFrameNo();
00241    }
00242    os << endl; 
00243    os << " Snarl " << GetSnarl()
00244       << " TrigSource " << GetTriggerSource()
00245       << " ErrorCode " << GetErrorCode();
00246    if (minorid > 1) {
00247      os << " # RawDigits " << GetNumRawDigits();
00248    }
00249    if (minorid > 2) {
00250      os << " RemoteSpillType " << GetRemoteSpillType();
00251    }
00252    os << endl;
00253 
00254    return os;
00255 }

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

Definition at line 52 of file RawSnarlHeaderBlock.h.

References fgDebugFlags.

00052 { return fgDebugFlags; }

Int_t RawSnarlHeaderBlock::GetErrorCode (  )  const

Definition at line 186 of file RawSnarlHeaderBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, RawDataBlock::GetMinorId(), and indx_errcode.

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

00187 {
00188    // get the trigger source
00189 
00190    int indx_errcode_v = indx_errcode;
00191    if (GetMinorId() <= 0) indx_errcode_v--;
00192    if (fSize > indx_errcode_v) return fRawBlock[indx_errcode_v];
00193    return -1;
00194 }

Int_t RawSnarlHeaderBlock::GetNumRawDigits (  )  const

Definition at line 197 of file RawSnarlHeaderBlock.cxx.

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

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

00198 {
00199    // get the # of raw digits in crate readout block RawDigitDataBlock
00200 
00201    if (fSize > indx_nrdigit) return fRawBlock[indx_nrdigit];
00202    return -1;
00203 }

Int_t RawSnarlHeaderBlock::GetRemoteSpillType (  )  const

Definition at line 206 of file RawSnarlHeaderBlock.cxx.

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

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

00207 {
00208    // get the remote spill type (only valid for appropriate triggers)
00209 
00210    if (fSize > indx_spilltype) return fRawBlock[indx_spilltype];
00211    return -1;
00212 }

Int_t RawSnarlHeaderBlock::GetRun ( void   )  const
Short_t RawSnarlHeaderBlock::GetRunType (  )  const
Int_t RawSnarlHeaderBlock::GetSnarl (  )  const
Short_t RawSnarlHeaderBlock::GetSubRun (  )  const
Int_t RawSnarlHeaderBlock::GetTimeFrameNo (  )  const [inline]
Int_t RawSnarlHeaderBlock::GetTimeFrameNum (  )  const

Definition at line 155 of file RawSnarlHeaderBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, RawDataBlock::GetMinorId(), and indx_tf.

Referenced by AtNuTreeModule::Ana(), FarDetRawRateDump::Ana(), FarDetSliceListModule::Ana(), RecoTreeModule::Ana(), FarDetRawDigitDump::Ana(), RotoObjectifier::BuildRecord(), GetTimeFrameNo(), DQHeader::Process(), and FarDetDataQualityModule::ProcessBlock().

00156 {
00157    // get the timeframe number
00158    if (GetMinorId() <= 0) return -1;  // didn't exist in this version
00159    if (fSize > indx_tf) return fRawBlock[indx_tf];
00160    return -1;
00161 }

Int_t RawSnarlHeaderBlock::GetTriggerSource ( void   )  const

Definition at line 175 of file RawSnarlHeaderBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, RawDataBlock::GetMinorId(), and indx_trigsrc.

Referenced by AtNuTreeModule::Ana(), CountPot::Ana(), RecoTreeModule::Ana(), FarmListModule::Ana(), FarDetRawDigitDump::Ana(), RotoObjectifier::BuildRecord(), PEGainModule::DoMeanSigmaFromData(), FormatToOStream(), PEGainModule::MakeHistosFromData(), DQHeader::Process(), and AlgCalDetSI::RunAlg().

00176 {
00177    // get the trigger source
00178 
00179    int indx_trigsrc_v = indx_trigsrc;
00180    if (GetMinorId() <= 0) indx_trigsrc_v--;
00181    if (fSize > indx_trigsrc_v) return fRawBlock[indx_trigsrc_v];
00182    return -1;
00183 }

VldTimeStamp RawSnarlHeaderBlock::GetTriggerTime ( void   )  const
VldContext RawSnarlHeaderBlock::GetVldContext (  )  const
static void RawSnarlHeaderBlock::SetDebugFlags ( const UInt_t  dbgflgs  )  [inline, static]

Definition at line 51 of file RawSnarlHeaderBlock.h.

References fgDebugFlags.

00051 {fgDebugFlags=dbgflgs;}


Member Data Documentation

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

Definition at line 63 of file RawSnarlHeaderBlock.h.

Referenced by FormatToOStream(), 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