RawDcsRpsMonitorBlock Class Reference

#include <RawDcsRpsMonitorBlock.h>

Inheritance diagram for RawDcsRpsMonitorBlock:
RawDataBlock

List of all members.

Public Member Functions

 RawDcsRpsMonitorBlock ()
 RawDcsRpsMonitorBlock (const Int_t *block)
virtual ~RawDcsRpsMonitorBlock ()
Int_t GetNumEvents () const
Int_t GetNumEntries () const
VldContext GetVldContext () const
VldTimeStamp GetTimeStamp (Int_t indx) const
Int_t GetRackNumber (Int_t indx) const
Int_t GetUnpackedRpsStruct (Int_t indx) const
Int_t GetStatus (Int_t indx) const
Int_t GetIsError (Int_t indx) const
Int_t GetIsWarning (Int_t indx) const
Int_t GetIsVoltageEvent (Int_t indx) const
Int_t GetIsEnvEvent (Int_t indx) const
Int_t GetIsExternalEvent (Int_t indx) const
Int_t GetIsCommandEvent (Int_t indx) const
TString GetRpsString (Int_t indx) const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const
 RawDcsRpsMonitorBlock (const RawDcsRpsMonitorBlock &rhs)

Static Public Member Functions

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

Protected Member Functions

void FillRpsArray () const

Protected Attributes

const Int_t * RpsArray

Static Private Attributes

static UInt_t fgDebugFlags = 0

Detailed Description

Definition at line 19 of file RawDcsRpsMonitorBlock.h.


Constructor & Destructor Documentation

RawDcsRpsMonitorBlock::RawDcsRpsMonitorBlock (  ) 

Definition at line 112 of file RawDcsRpsMonitorBlock.cxx.

00113 {
00114    // Default constructor
00115 }

RawDcsRpsMonitorBlock::RawDcsRpsMonitorBlock ( const Int_t *  block  ) 

Definition at line 118 of file RawDcsRpsMonitorBlock.cxx.

00119    : RawDataBlock(block)
00120 {
00121    //  stored block format is:
00122    //---------------------
00123    //  0   # words in block
00124    //  1   checksum
00125    //  2   Block Id
00126    //-----
00127    /*
00128     *  The data has the following repeating structure from here
00129     *  Int_t n = ((i-3)/4) = num blocks (test modulo for errors);
00130     *  Int_t d[n*4];  d = block+3;
00131     *  Int_t indx;
00132     *  d[(indx*4)+0] = timestamp (long sec)
00133     *  d[(indx*4)+1] = rackno (long)
00134     *  d[(indx*4)+2] = raw(long)
00135     *  d[(indx*4)+3] = status(signed long)
00136     *  indx++;(test if indx is greater than n, if so, finito)
00137         *                                          *
00138     */
00139 }

RawDcsRpsMonitorBlock::~RawDcsRpsMonitorBlock (  )  [virtual]

Definition at line 142 of file RawDcsRpsMonitorBlock.cxx.

00143 {
00144    // dtor
00145 }

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

Definition at line 48 of file RawDcsRpsMonitorBlock.h.

00049      : RawDataBlock(rhs) { ; }


Member Function Documentation

void RawDcsRpsMonitorBlock::FillRpsArray (  )  const [protected]

Definition at line 167 of file RawDcsRpsMonitorBlock.cxx.

References RawDataBlock::GetData(), and RpsArray.

Referenced by GetNumEvents(), GetRackNumber(), GetStatus(), GetTimeStamp(), and GetUnpackedRpsStruct().

00168 {
00169 //off by 3 since the first three are 1:num words, 2: checksum
00170 // and 3:block ID
00171         RpsArray = 3 + GetData();
00172 }

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

Reimplemented from RawDataBlock.

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

Definition at line 45 of file RawDcsRpsMonitorBlock.h.

References fgDebugFlags.

00045 { return fgDebugFlags; }

Int_t RawDcsRpsMonitorBlock::GetIsCommandEvent ( Int_t  indx  )  const

Definition at line 270 of file RawDcsRpsMonitorBlock.cxx.

References GetUnpackedRpsStruct().

00271 {
00272         Int_t mydata=GetUnpackedRpsStruct(indx);
00273         mydata=(mydata>>24)&0xff;       //shift over to get just the third port
00274         if (mydata!=0)
00275                 return 1;
00276         return 0;
00277 }

Int_t RawDcsRpsMonitorBlock::GetIsEnvEvent ( Int_t  indx  )  const

Definition at line 246 of file RawDcsRpsMonitorBlock.cxx.

References GetUnpackedRpsStruct(), RPS_AIRFLOWIN, RPS_AIRTEMPALARM, RPS_AIRTEMPDIFFALARM, RPS_AIRTEMPDIFFWARN, RPS_AIRTEMPWARN, RPS_EXTTEMP, RPS_FANFAIL, RPS_H2OFLOWALARM, RPS_H2OFLOWWARN, RPS_HUMIDITY, and RPS_SMOKEALARM.

00247 {
00248         Int_t mydata=GetUnpackedRpsStruct(indx);
00249         Int_t port0,port1,port2;
00250         port0=mydata&0xff;
00251         port1=(mydata>>8)&0xff;
00252         port2=(mydata>>16)&0xff;
00253         if((port0&RPS_SMOKEALARM)||(port0&RPS_FANFAIL)||(port1&RPS_H2OFLOWWARN)||(port1&RPS_H2OFLOWALARM)||(port1&RPS_AIRTEMPDIFFWARN)||(port1&RPS_AIRTEMPALARM)||(port2&RPS_AIRTEMPDIFFALARM)||(port2&RPS_AIRTEMPWARN)||(port2&RPS_HUMIDITY)||(port2&RPS_AIRFLOWIN)||(port1&RPS_EXTTEMP))
00254                 return 1;
00255         return 0;
00256 }

Int_t RawDcsRpsMonitorBlock::GetIsError ( Int_t  indx  )  const

Definition at line 210 of file RawDcsRpsMonitorBlock.cxx.

References GetUnpackedRpsStruct(), RPS_AIRFLOWIN, RPS_AIRFLOWOUT, RPS_AIRTEMPALARM, RPS_EXTALARM, RPS_EXTTEMP, RPS_H2OFLOWALARM, RPS_H2OLEAK, RPS_H2OTEMPALARM, RPS_MAINALARM, RPS_SMOKEALARM, and RPS_VMONALARM.

Referenced by DcsWriter::ProcessRawRecord().

00211 {
00212         Int_t mydata=GetUnpackedRpsStruct(indx);
00213         Int_t port0,port1,port2;
00214         port0=mydata&0xff;
00215         port1=(mydata>>8)&0xff;
00216         port2=(mydata>>16)&0xff;
00217         if((port0&RPS_MAINALARM)||(port0&RPS_VMONALARM)||(port0&RPS_SMOKEALARM)||(port0&RPS_EXTALARM)||(port1&RPS_EXTTEMP)||(port1&RPS_H2OFLOWALARM)||(port1&RPS_H2OTEMPALARM)||(port1&RPS_AIRTEMPALARM)||(port2&RPS_AIRFLOWOUT)||(port2&RPS_H2OLEAK)||(port2&RPS_AIRFLOWIN))
00218                 return 1;
00219         return 0;
00220 }

Int_t RawDcsRpsMonitorBlock::GetIsExternalEvent ( Int_t  indx  )  const

Definition at line 258 of file RawDcsRpsMonitorBlock.cxx.

References GetUnpackedRpsStruct(), and RPS_EXTALARM.

00259 {
00260         Int_t mydata=GetUnpackedRpsStruct(indx);
00261         Int_t port0; //,port1,port2;
00262         port0=mydata&0xff;
00263         //port1=(mydata>>8)&0xff;
00264         //port2=(mydata>>16)&0xff;
00265         if((port0&RPS_EXTALARM))
00266                 return 1;
00267         return 0;
00268 }

Int_t RawDcsRpsMonitorBlock::GetIsVoltageEvent ( Int_t  indx  )  const

Definition at line 234 of file RawDcsRpsMonitorBlock.cxx.

References GetUnpackedRpsStruct(), RPS_VMONALARM, and RPS_VMONWARN.

00235 {
00236         Int_t mydata=GetUnpackedRpsStruct(indx);
00237         Int_t port0; //,port1,port2;
00238         port0=mydata&0xff;
00239         //port1=(mydata>>8)&0xff;
00240         //port2=(mydata>>16)&0xff;
00241         if((port0&RPS_VMONALARM)||(port0&RPS_VMONWARN))
00242                 return 1;
00243         return 0;
00244 }

Int_t RawDcsRpsMonitorBlock::GetIsWarning ( Int_t  indx  )  const

Definition at line 222 of file RawDcsRpsMonitorBlock.cxx.

References GetUnpackedRpsStruct(), RPS_AIRTEMPDIFFWARN, RPS_AIRTEMPWARN, RPS_FANFAIL, RPS_H2OFLOWWARN, RPS_H2OTEMPWARN, RPS_HUMIDITY, RPS_MAINWARN, and RPS_VMONWARN.

Referenced by DcsWriter::ProcessRawRecord().

00223 {
00224         Int_t mydata=GetUnpackedRpsStruct(indx);
00225         Int_t port0,port1,port2;
00226         port0=mydata&0xff;
00227         port1=(mydata>>8)&0xff;
00228         port2=(mydata>>16)&0xff;
00229         if((port0&RPS_MAINWARN)||(port0&RPS_VMONWARN)||(port0&RPS_FANFAIL)||(port1&RPS_H2OFLOWWARN)||(port1&RPS_H2OTEMPWARN)||(port1&RPS_AIRTEMPDIFFWARN)||(port2&RPS_AIRTEMPWARN)||(port2&RPS_HUMIDITY))
00230                 return 1;
00231         return 0;
00232 }

Int_t RawDcsRpsMonitorBlock::GetNumEntries (  )  const

Definition at line 174 of file RawDcsRpsMonitorBlock.cxx.

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

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

00175 {
00176 // remember, all versions
00177 // have offset of 3 due to first 3 longs)
00178         if((fSize-3)%4)
00179         {
00180                 MSG("RawData",Msg::kError)
00181                 << " Size of Rps Block screwed up.  Have: "
00182                 << (fSize-3)%4 << " left over from modulo 4."
00183                 << endl;
00184                 return -1;
00185         }
00186         return ((fSize-3)/4);
00187 }

Int_t RawDcsRpsMonitorBlock::GetNumEvents (  )  const

Definition at line 189 of file RawDcsRpsMonitorBlock.cxx.

References FillRpsArray(), and GetNumEntries().

00190 {
00191         Int_t numEvents = 1;
00192         Int_t numEntries = GetNumEntries();
00193         FillRpsArray();
00194 
00195         //seek throughout for the number of events (not entries)
00196         //so look for entries where
00197         // FOR RPS THERE IS ONLY ONE EVENT PER BLOCK
00198 
00199         numEvents=numEntries;
00200         return numEvents;
00201 }

Int_t RawDcsRpsMonitorBlock::GetRackNumber ( Int_t  indx  )  const [inline]

Definition at line 68 of file RawDcsRpsMonitorBlock.h.

References FillRpsArray(), and RpsArray.

Referenced by DcsWriter::ProcessRawRecord().

00069 { FillRpsArray(); return RpsArray[(indx*4)+1]; }

TString RawDcsRpsMonitorBlock::GetRpsString ( Int_t  indx  )  const

Definition at line 279 of file RawDcsRpsMonitorBlock.cxx.

References GetUnpackedRpsStruct(), initstring, and rps_translate().

00280 {
00281         unsigned short vmon_id=0;
00282         unsigned char diodata[4];
00283         Int_t original=GetUnpackedRpsStruct(indx);
00284         memcpy(diodata,&original,4);
00285         rps_translate(diodata, initstring,&vmon_id);
00286         TString mystring(initstring);
00287         return mystring;
00288 }

Int_t RawDcsRpsMonitorBlock::GetStatus ( Int_t  indx  )  const [inline]

Definition at line 74 of file RawDcsRpsMonitorBlock.h.

References FillRpsArray(), and RpsArray.

Referenced by DcsWriter::ProcessRawRecord().

00075 { FillRpsArray(); return RpsArray[(indx*4)+3]; }

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

Definition at line 64 of file RawDcsRpsMonitorBlock.h.

References FillRpsArray(), and RpsArray.

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

00065 { FillRpsArray(); return VldTimeStamp(RpsArray[(indx*4)],0); }

Int_t RawDcsRpsMonitorBlock::GetUnpackedRpsStruct ( Int_t  indx  )  const [inline]
VldContext RawDcsRpsMonitorBlock::GetVldContext (  )  const

Definition at line 203 of file RawDcsRpsMonitorBlock.cxx.

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

Referenced by DcsWriter::ProcessRawRecord().

00204 {
00205 // build validity context
00206         RawBlockId rbid = GetBlockId();
00207         return VldContext(rbid.GetDetector(),rbid.GetSimFlag(),GetTimeStamp(0));
00208 }

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

Definition at line 44 of file RawDcsRpsMonitorBlock.h.

References fgDebugFlags.

00044 {fgDebugFlags=dbgflgs;}


Member Data Documentation

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

Definition at line 60 of file RawDcsRpsMonitorBlock.h.

Referenced by GetDebugFlags(), and SetDebugFlags().

const Int_t* RawDcsRpsMonitorBlock::RpsArray [mutable, protected]

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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1