RawDcsCanMonitorBlock Class Reference

#include <RawDcsCanMonitorBlock.h>

Inheritance diagram for RawDcsCanMonitorBlock:
RawDataBlock

List of all members.

Public Member Functions

 RawDcsCanMonitorBlock ()
 RawDcsCanMonitorBlock (const Int_t *block)
virtual ~RawDcsCanMonitorBlock ()
Int_t GetNumEvents () const
Int_t GetNumEntries () const
VldContext GetVldContext () const
VldTimeStamp GetTimeStamp (Int_t indx) const
Int_t GetPowerSupplyId (Int_t indx) const
Int_t GetPowerState (Int_t indx) const
Float_t GetVoltage1 (Int_t indx) const
Float_t GetVoltage2 (Int_t indx) const
Float_t GetVoltage3 (Int_t indx) const
Float_t GetVoltage4 (Int_t indx) const
Float_t GetCurrent1 (Int_t indx) const
Float_t GetCurrent2 (Int_t indx) const
Float_t GetCurrent3 (Int_t indx) const
Float_t GetCurrent4 (Int_t indx) const
Int_t GetTemperatureInt (Int_t indx) const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const
 RawDcsCanMonitorBlock (const RawDcsCanMonitorBlock &rhs)

Static Public Member Functions

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

Protected Member Functions

void FillCanArray () const

Protected Attributes

const Int_t * CanArray

Static Private Attributes

static UInt_t fgDebugFlags = 0

Detailed Description

Definition at line 19 of file RawDcsCanMonitorBlock.h.


Constructor & Destructor Documentation

RawDcsCanMonitorBlock::RawDcsCanMonitorBlock (  ) 

Definition at line 26 of file RawDcsCanMonitorBlock.cxx.

00027 {
00028    // Default constructor
00029 }

RawDcsCanMonitorBlock::RawDcsCanMonitorBlock ( const Int_t *  block  ) 

Definition at line 32 of file RawDcsCanMonitorBlock.cxx.

00033    : RawDataBlock(block)
00034 {
00035    //  stored block format is:
00036    //---------------------
00037    //  0   # words in block
00038    //  1   checksum
00039    //  2   Block Id
00040    //-----
00041 }

RawDcsCanMonitorBlock::~RawDcsCanMonitorBlock (  )  [virtual]

Definition at line 44 of file RawDcsCanMonitorBlock.cxx.

00045 {
00046    // dtor
00047 }

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

Definition at line 49 of file RawDcsCanMonitorBlock.h.

00050      : RawDataBlock(rhs) { ; }


Member Function Documentation

void RawDcsCanMonitorBlock::FillCanArray (  )  const [protected]

Definition at line 72 of file RawDcsCanMonitorBlock.cxx.

References CanArray, and RawDataBlock::GetData().

Referenced by GetCurrent1(), GetCurrent2(), GetCurrent3(), GetCurrent4(), GetNumEvents(), GetPowerState(), GetPowerSupplyId(), GetTemperatureInt(), GetTimeStamp(), GetVoltage1(), GetVoltage2(), GetVoltage3(), and GetVoltage4().

00073 {
00074 //off by 3 since the first three are 1:num words, 2: checksum
00075 // and 3:block ID
00076         CanArray = 3 + GetData();
00077 }

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

Reimplemented from RawDataBlock.

Float_t RawDcsCanMonitorBlock::GetCurrent1 ( Int_t  indx  )  const

Definition at line 147 of file RawDcsCanMonitorBlock.cxx.

References CanArray, and FillCanArray().

Referenced by DcsWriter::ProcessRawRecord().

00148 {
00149         FillCanArray();
00150         Float_t fValue = 0.0;
00151         memcpy(&fValue,&CanArray[(indx*12)+7],4);
00152         return fValue;
00153 }

Float_t RawDcsCanMonitorBlock::GetCurrent2 ( Int_t  indx  )  const

Definition at line 155 of file RawDcsCanMonitorBlock.cxx.

References CanArray, and FillCanArray().

Referenced by DcsWriter::ProcessRawRecord().

00156 {
00157         FillCanArray();
00158         Float_t fValue = 0.0;
00159         memcpy(&fValue,&CanArray[(indx*12)+8],4);
00160         return fValue;
00161 }

Float_t RawDcsCanMonitorBlock::GetCurrent3 ( Int_t  indx  )  const

Definition at line 163 of file RawDcsCanMonitorBlock.cxx.

References CanArray, and FillCanArray().

Referenced by DcsWriter::ProcessRawRecord().

00164 {
00165         FillCanArray();
00166         Float_t fValue = 0.0;
00167         memcpy(&fValue,&CanArray[(indx*12)+9],4);
00168         return fValue;
00169 }

Float_t RawDcsCanMonitorBlock::GetCurrent4 ( Int_t  indx  )  const

Definition at line 171 of file RawDcsCanMonitorBlock.cxx.

References CanArray, and FillCanArray().

Referenced by DcsWriter::ProcessRawRecord().

00172 {
00173         FillCanArray();
00174         Float_t fValue = 0.0;
00175         memcpy(&fValue,&CanArray[(indx*12)+10],4);
00176         return fValue;
00177 }

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

Definition at line 46 of file RawDcsCanMonitorBlock.h.

References fgDebugFlags.

00046 { return fgDebugFlags; }

Int_t RawDcsCanMonitorBlock::GetNumEntries (  )  const

Definition at line 79 of file RawDcsCanMonitorBlock.cxx.

References RawDataBlock::fSize, Msg::kError, and MSG.

Referenced by GetNumEvents(), and DcsWriter::ProcessRawRecord().

00080 {
00081 // remember, all versions
00082 // have offset of 3 due to first 3 longs)
00083         if((fSize-3)%12)
00084         {
00085                 MSG("RawData",Msg::kError)
00086                 << " Size of Can Block screwed up.  Have: "
00087                 << (fSize-3)%12 << " left over from modulo 12."
00088                 << endl;
00089                 return -1;
00090         }
00091         return ((fSize-3)/12);
00092 }

Int_t RawDcsCanMonitorBlock::GetNumEvents (  )  const

Definition at line 94 of file RawDcsCanMonitorBlock.cxx.

References FillCanArray(), and GetNumEntries().

00095 {
00096         Int_t numEvents = 1;
00097         Int_t numEntries = GetNumEntries();
00098         FillCanArray();
00099 
00100         //seek throughout for the number of events (not entries)
00101         //so look for entries where
00102         // FOR CHILLER THERE IS ONLY ONE EVENT PER BLOCK
00103 
00104         numEvents=numEntries;
00105         return numEvents;
00106 }

Int_t RawDcsCanMonitorBlock::GetPowerState ( Int_t  indx  )  const [inline]

Definition at line 71 of file RawDcsCanMonitorBlock.h.

References CanArray, and FillCanArray().

Referenced by DcsWriter::ProcessRawRecord().

00072 { FillCanArray(); return CanArray[(indx*12)+2]; }

Int_t RawDcsCanMonitorBlock::GetPowerSupplyId ( Int_t  indx  )  const [inline]

Definition at line 68 of file RawDcsCanMonitorBlock.h.

References CanArray, and FillCanArray().

Referenced by DcsWriter::ProcessRawRecord().

00069 { FillCanArray(); return CanArray[(indx*12)+1]; }

Int_t RawDcsCanMonitorBlock::GetTemperatureInt ( Int_t  indx  )  const [inline]

Definition at line 74 of file RawDcsCanMonitorBlock.h.

References CanArray, and FillCanArray().

Referenced by DcsWriter::ProcessRawRecord().

00075 { FillCanArray(); return CanArray[(indx*12)+11]; }

VldTimeStamp RawDcsCanMonitorBlock::GetTimeStamp ( Int_t  indx  )  const [inline]

Definition at line 65 of file RawDcsCanMonitorBlock.h.

References CanArray, and FillCanArray().

Referenced by GetVldContext(), and DcsWriter::ProcessRawRecord().

00066 { FillCanArray(); return VldTimeStamp(CanArray[(indx*11)],0); }

VldContext RawDcsCanMonitorBlock::GetVldContext (  )  const

Definition at line 108 of file RawDcsCanMonitorBlock.cxx.

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

Referenced by DcsWriter::ProcessRawRecord().

00109 {
00110 // build validity context
00111         RawBlockId rbid = GetBlockId();
00112         return VldContext(rbid.GetDetector(),rbid.GetSimFlag(),GetTimeStamp(0));
00113 }

Float_t RawDcsCanMonitorBlock::GetVoltage1 ( Int_t  indx  )  const

Definition at line 115 of file RawDcsCanMonitorBlock.cxx.

References CanArray, and FillCanArray().

Referenced by DcsWriter::ProcessRawRecord().

00116 {
00117         FillCanArray();
00118         Float_t fValue = 0.0;
00119         memcpy(&fValue,&CanArray[(indx*12)+3],4);
00120         return fValue;
00121 }

Float_t RawDcsCanMonitorBlock::GetVoltage2 ( Int_t  indx  )  const

Definition at line 123 of file RawDcsCanMonitorBlock.cxx.

References CanArray, and FillCanArray().

Referenced by DcsWriter::ProcessRawRecord().

00124 {
00125         FillCanArray();
00126         Float_t fValue = 0.0;
00127         memcpy(&fValue,&CanArray[(indx*12)+4],4);
00128         return fValue;
00129 }

Float_t RawDcsCanMonitorBlock::GetVoltage3 ( Int_t  indx  )  const

Definition at line 131 of file RawDcsCanMonitorBlock.cxx.

References CanArray, and FillCanArray().

Referenced by DcsWriter::ProcessRawRecord().

00132 {
00133         FillCanArray();
00134         Float_t fValue = 0.0;
00135         memcpy(&fValue,&CanArray[(indx*12)+5],4);
00136         return fValue;
00137 }

Float_t RawDcsCanMonitorBlock::GetVoltage4 ( Int_t  indx  )  const

Definition at line 139 of file RawDcsCanMonitorBlock.cxx.

References CanArray, and FillCanArray().

Referenced by DcsWriter::ProcessRawRecord().

00140 {
00141         FillCanArray();
00142         Float_t fValue = 0.0;
00143         memcpy(&fValue,&CanArray[(indx*12)+6],4);
00144         return fValue;
00145 }

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

Definition at line 45 of file RawDcsCanMonitorBlock.h.

References fgDebugFlags.

00045 {fgDebugFlags=dbgflgs;}


Member Data Documentation

const Int_t* RawDcsCanMonitorBlock::CanArray [mutable, protected]
UInt_t RawDcsCanMonitorBlock::fgDebugFlags = 0 [static, private]

Definition at line 61 of file RawDcsCanMonitorBlock.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