RawQieLookUpTableBlock Class Reference

#include <RawQieLookUpTableBlock.h>

Inheritance diagram for RawQieLookUpTableBlock:
RawDataBlock

List of all members.

Public Member Functions

 RawQieLookUpTableBlock ()
 RawQieLookUpTableBlock (const Int_t *block)
virtual ~RawQieLookUpTableBlock ()
Int_t GetRun () const
Short_t GetSubRun () const
Short_t GetRunType () const
ElecType::Elec_t GetElecType () const
Bool_t GetPedMode () const
Bool_t GetSparsMode () const
Bool_t GetCommonMode () const
UShort_t GetCrate () const
Int_t GetCrateIdInfo () const
Int_t GetModuleNum () const
Int_t GetHeaderSizeBytes () const
const Int_t * GetRawLookUpTable () const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const
 RawQieLookUpTableBlock (const RawQieLookUpTableBlock &rhs)
RawQieLookUpTableBlockoperator= (const RawQieLookUpTableBlock &rhs)

Static Public Member Functions

static void SetDebugFlags (const UInt_t dbgflgs)
static UInt_t GetDebugFlags ()

Protected Member Functions

virtual void FillCrateId () const

Protected Attributes

RawChannelId fCrateId

Static Private Attributes

static UInt_t fgDebugFlags = 0
 unpacked crateinfo

Detailed Description

Definition at line 24 of file RawQieLookUpTableBlock.h.


Constructor & Destructor Documentation

RawQieLookUpTableBlock::RawQieLookUpTableBlock (  ) 

Definition at line 47 of file RawQieLookUpTableBlock.cxx.

00048   : RawDataBlock(), fCrateId()
00049 {
00050    // Default constructor
00051 }

RawQieLookUpTableBlock::RawQieLookUpTableBlock ( const Int_t *  block  ) 

Definition at line 54 of file RawQieLookUpTableBlock.cxx.

00055   : RawDataBlock(block), fCrateId()
00056 {
00057    //  stored block format is:
00058    //---------------------
00059    //  0   # words in block
00060    //  1   checksum
00061    //  2   Block Id
00062    //-----
00063    //  3   run #
00064    //  4   subRunAndType
00065    //  5   crateIdentifier
00066    //  6   moduleNr
00067    //  7   headerSize (version >= 2)
00068    //     ... possible pure unadulterated trash (depending on headerSize)
00069    //  ...    look up table for that module ...
00070 
00071 }

RawQieLookUpTableBlock::~RawQieLookUpTableBlock (  )  [virtual]

Definition at line 74 of file RawQieLookUpTableBlock.cxx.

00075 {
00076   // dtor
00077 }

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

Definition at line 54 of file RawQieLookUpTableBlock.h.

00055      : RawDataBlock(rhs), fCrateId(rhs.fCrateId)
00056      { ; }


Member Function Documentation

void RawQieLookUpTableBlock::FillCrateId (  )  const [protected, virtual]

Definition at line 227 of file RawQieLookUpTableBlock.cxx.

References fCrateId, RawDataBlock::GetBlockId(), GetCrateIdInfo(), DataUtil::GetDetector(), and RawChannelId::IsNull().

Referenced by GetCommonMode(), GetCrate(), GetElecType(), GetPedMode(), and GetSparsMode().

00228 {
00229    // unpack crate info
00230    if (!fCrateId.IsNull()) return;
00231    fCrateId = RawChannelId(GetBlockId().GetDetector(),GetCrateIdInfo(),0x1fff);
00232 }

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

Reimplemented from RawDataBlock.

Definition at line 150 of file RawQieLookUpTableBlock.cxx.

References fgDebugFlags, GetCrateIdInfo(), RawDataBlock::GetData(), GetHeaderSizeBytes(), RawDataBlock::GetMinorId(), GetModuleNum(), GetRawLookUpTable(), GetRun(), GetRunType(), RawDataBlock::GetSize(), GetSubRun(), kdbg_DumpPaddingData, kdbg_DumpPaddingInfo, kdbg_ForceHexDump, kdbg_LUTas16BitPairs, zzzz_last, and zzzz_last_v1.

00152 {
00153    if (fgDebugFlags & kdbg_ForceHexDump) option = "x";
00154 
00155    RawDataBlock::FormatToOStream(os,option);
00156    if (option[0] == 'X') return os;
00157 
00158    // additional block specific formatted output is done here
00159 
00160    os << " Run " << GetRun()
00161       << " SubRun " << GetSubRun()
00162       << " RunType " << GetRunType();
00163    int crateid = GetCrateIdInfo();
00164 
00165    int minorid = GetMinorId();
00166 
00167    os << " Crate " << (crateid&0x3f)
00168       << " (0x" << hex << crateid << dec << "),"
00169       << " Module " << GetModuleNum()
00170       << endl;
00171    if ( minorid >= 2) 
00172      os << " HeaderSize " << GetHeaderSizeBytes() << " bytes";
00173 
00174    const Int_t* blk_end = GetData() + GetSize();
00175    const Int_t* lookup_data = GetRawLookUpTable();
00176    
00177    const Int_t* nonheader = 
00178      GetData() + (( minorid < 2 ) ? zzzz_last_v1 : zzzz_last );
00179 
00180    // dump (if it exists and is requested) the padding words
00181    //fgDebugFlags |= kdbg_DumpPaddingInfo;  // testing purposes!
00182    //fgDebugFlags |= kdbg_DumpPaddingData;  // testing purposes!
00183    if ( lookup_data > nonheader && 
00184         fgDebugFlags & kdbg_DumpPaddingInfo ) {
00185      os << ", " << (Int_t)(lookup_data-nonheader)
00186         << " unassigned words:" << endl;
00187      if ( fgDebugFlags & kdbg_DumpPaddingData ) {
00188        int i = 0;
00189        while ( nonheader != lookup_data ) {
00190          os << "    [" << setw(3) << i 
00191             << "] " << setw(12) << *nonheader
00192             << endl;
00193          nonheader++;
00194        }
00195      } // if DumpPaddingWords
00196    }
00197    else 
00198      os << endl;
00199 
00200    os << " LookUpTable:";
00201    // simple format of 
00202    const unsigned int mxonline = 5;
00203    unsigned int nonline = mxonline;
00204    while ( lookup_data != blk_end ) {
00205      if (nonline == mxonline) {
00206        os << endl << "\t| ";
00207        nonline = 0;
00208      }
00209      if (fgDebugFlags & kdbg_LUTas16BitPairs) {
00210        UInt_t onelong = *lookup_data;
00211        UShort_t low  =  onelong        & 0xFFFF;
00212        UShort_t high = (onelong >> 16) & 0xFFFF;
00213        os << setw(5) << high << ":" << setw(5) << low << " | ";
00214      }
00215      else {
00216        os << setw(12) << *lookup_data << " ";
00217      }
00218      nonline++;
00219      lookup_data++;
00220    }
00221    os << endl;
00222 
00223    return os;
00224 }

Bool_t RawQieLookUpTableBlock::GetCommonMode (  )  const [inline]

Definition at line 85 of file RawQieLookUpTableBlock.h.

References fCrateId, FillCrateId(), and RawChannelId::GetCommonMode().

00086 { FillCrateId(); return fCrateId.GetCommonMode(); }

UShort_t RawQieLookUpTableBlock::GetCrate (  )  const [inline]

Definition at line 88 of file RawQieLookUpTableBlock.h.

References fCrateId, FillCrateId(), and RawChannelId::GetCrate().

00089 { FillCrateId(); return fCrateId.GetCrate(); }

Int_t RawQieLookUpTableBlock::GetCrateIdInfo (  )  const

Definition at line 115 of file RawQieLookUpTableBlock.cxx.

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

Referenced by FillCrateId(), and FormatToOStream().

00116 {
00117    // get the crate id info (packed)
00118    if (fSize > indx_crateid) return fRawBlock[indx_crateid];
00119    return -1;
00120 }

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

Definition at line 51 of file RawQieLookUpTableBlock.h.

References fgDebugFlags.

00051 { return fgDebugFlags; }

ElecType::Elec_t RawQieLookUpTableBlock::GetElecType (  )  const [inline]

Definition at line 76 of file RawQieLookUpTableBlock.h.

References fCrateId, FillCrateId(), and RawChannelId::GetElecType().

00077 { FillCrateId(); return fCrateId.GetElecType(); }

Int_t RawQieLookUpTableBlock::GetHeaderSizeBytes (  )  const

Definition at line 131 of file RawQieLookUpTableBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, RawDataBlock::GetMinorId(), indx_headerSize, and zzzz_last.

Referenced by FormatToOStream(), and GetRawLookUpTable().

00132 {
00133    // get the header size
00134    if (GetMinorId() < 2) return -2;
00135    if (fSize > zzzz_last) return fRawBlock[indx_headerSize];
00136    return -1;
00137 }

Int_t RawQieLookUpTableBlock::GetModuleNum (  )  const

Definition at line 123 of file RawQieLookUpTableBlock.cxx.

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

Referenced by FormatToOStream().

00124 {
00125    // get the module #
00126    if (fSize > indx_modulenr) return fRawBlock[indx_modulenr];
00127    return -1;
00128 }

Bool_t RawQieLookUpTableBlock::GetPedMode (  )  const [inline]

Definition at line 79 of file RawQieLookUpTableBlock.h.

References fCrateId, FillCrateId(), and RawChannelId::GetPedMode().

00080 { FillCrateId(); return fCrateId.GetPedMode(); }

const Int_t * RawQieLookUpTableBlock::GetRawLookUpTable (  )  const

Definition at line 140 of file RawQieLookUpTableBlock.cxx.

References RawDataBlock::fRawBlock, RawDataBlock::fSize, GetHeaderSizeBytes(), RawDataBlock::GetMinorId(), zzzz_last, and zzzz_last_v1.

Referenced by FormatToOStream().

00141 {
00142    // get the actual lookup table info 
00143    int indx_data = GetHeaderSizeBytes()/sizeof(Int_t);
00144    if (GetMinorId() < 2) indx_data = zzzz_last_v1;
00145    if (fSize > zzzz_last) return fRawBlock + indx_data;
00146    return 0;
00147 }

Int_t RawQieLookUpTableBlock::GetRun ( void   )  const

Definition at line 91 of file RawQieLookUpTableBlock.cxx.

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

Referenced by FormatToOStream().

00092 {
00093    // get the run number
00094    if (fSize > indx_run) return fRawBlock[indx_run];
00095    return -1;
00096 }

Short_t RawQieLookUpTableBlock::GetRunType (  )  const

Definition at line 107 of file RawQieLookUpTableBlock.cxx.

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

Referenced by FormatToOStream().

00108 {
00109    // get the run type
00110    if (fSize > indx_runtype) return fRawBlock[indx_runtype]&0xffff;
00111    return -1;
00112 }

Bool_t RawQieLookUpTableBlock::GetSparsMode (  )  const [inline]

Definition at line 82 of file RawQieLookUpTableBlock.h.

References fCrateId, FillCrateId(), and RawChannelId::GetSparsMode().

00083 { FillCrateId(); return fCrateId.GetSparsMode(); }

Short_t RawQieLookUpTableBlock::GetSubRun (  )  const

Definition at line 99 of file RawQieLookUpTableBlock.cxx.

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

Referenced by FormatToOStream().

00100 {
00101    // get the subrun number
00102    if (fSize > indx_subrun) return (fRawBlock[indx_subrun]>>16)&0xffff;
00103    return -1;
00104 }

RawQieLookUpTableBlock & RawQieLookUpTableBlock::operator= ( const RawQieLookUpTableBlock rhs  ) 

Reimplemented from RawDataBlock.

Definition at line 80 of file RawQieLookUpTableBlock.cxx.

References fCrateId.

00081 {
00082    // deep copy assignment 
00083    if (this != &rhs) {
00084      RawDataBlock::operator=(rhs);
00085      fCrateId = rhs.fCrateId;
00086    }
00087    return *this;
00088 }

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

Definition at line 50 of file RawQieLookUpTableBlock.h.

References fgDebugFlags.

00050 {fgDebugFlags=dbgflgs;}


Member Data Documentation

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

unpacked crateinfo

Definition at line 71 of file RawQieLookUpTableBlock.h.

Referenced by FormatToOStream(), GetDebugFlags(), and SetDebugFlags().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1