RawDcsHvMonitorBlock Class Reference

#include <RawDcsHvMonitorBlock.h>

Inheritance diagram for RawDcsHvMonitorBlock:
RawDataBlock

List of all members.

Public Member Functions

 RawDcsHvMonitorBlock ()
 RawDcsHvMonitorBlock (const Int_t *block)
virtual ~RawDcsHvMonitorBlock ()
Int_t GetNumEvents () const
Int_t GetNumEntries () const
VldContext GetVldContext () const
VldTimeStamp GetTimeStamp (Int_t indx) const
Int_t GetRawChannel (Int_t indx) const
Int_t GetRawGeometry (Int_t indx) const
Int_t GetChannel (Int_t indx) const
Int_t GetFarIsTriggerPmt (Int_t indx) const
Int_t GetMainframe (Int_t indx) const
Int_t GetCard (Int_t indx) const
Int_t GetPlane (Int_t indx) const
Int_t GetSide (Int_t indx) const
Int_t GetPmt (Int_t indx) const
Int_t GetSetVoltage (Int_t indx) const
Int_t GetReadVoltage (Int_t indx) const
Int_t GetNearIsTriggerPmt (Int_t indx) const
Int_t GetAlarmbits (Int_t indx) const
Int_t GetFarIsShield (Int_t indx) const
Int_t GetFarShieldPlane (Int_t indx) const
Int_t GetHvDetector () const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const
 RawDcsHvMonitorBlock (const RawDcsHvMonitorBlock &rhs)

Static Public Member Functions

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

Protected Member Functions

void FillHvArray () const

Protected Attributes

const Int_t * HvArray

Static Private Attributes

static UInt_t fgDebugFlags = 0

Detailed Description

Definition at line 18 of file RawDcsHvMonitorBlock.h.


Constructor & Destructor Documentation

RawDcsHvMonitorBlock::RawDcsHvMonitorBlock (  ) 

Definition at line 33 of file RawDcsHvMonitorBlock.cxx.

00034   : HvArray(0)
00035 {
00036    // Default constructor
00037 }

RawDcsHvMonitorBlock::RawDcsHvMonitorBlock ( const Int_t *  block  ) 

Definition at line 40 of file RawDcsHvMonitorBlock.cxx.

00041   : RawDataBlock(block), HvArray(0)
00042 {
00043    //  stored block format is:
00044    //---------------------
00045    //  0   i = # words in block
00046    //  1   checksum
00047    //  2   Block Id
00048 
00049    /*
00050     * The data has the following repeating structure from here
00051     *  Int_t n = ((i-3)/6) = num blocks (test modulo for errors);
00052     *  Int_t d[n*6];  d = block+3;
00053     *  Int_t indx;
00054     *  d[(indx*6)+0] = timestamp (long secs)
00055     *  d[(indx*6)+1] = mfcdch (long)
00056     *  d[(indx*6)+2] = geom(long)
00057     *  d[(indx*6)+3] = setv(signed long)
00058     *  d[(indx*6)+4] = readv(signed long)
00059     *  d[(indx*6)+5] = alarm(long)
00060     *  indx++;(test if indx is greater than n, if so, finito)
00061 
00062     *  version 1 has timestamp off by 1 hour in sm2 records between 
00063     *  2003-06-03 12:24:00 and 2003-06-11 03:22:26 in GMT time.  
00064     *  add one hour to these when making final record.
00065 
00066     *  version 2 has some recs with order screwed up, check this by 
00067     *  checking whether mfcdch or geom is negative.  if so, then 
00068     *  swap mfcdch with setv and geom with readv.(version 1 also)
00069 
00070     *  version 3 has none of these problems, and also has the 
00071     *  new shield and trig pmt values (of adding 10000 to shield and 20000 to trig)
00072     */
00073 }

RawDcsHvMonitorBlock::~RawDcsHvMonitorBlock (  )  [virtual]

Definition at line 76 of file RawDcsHvMonitorBlock.cxx.

00077 {
00078    // dtor
00079 }

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

Definition at line 54 of file RawDcsHvMonitorBlock.h.

00055      : RawDataBlock(rhs) { ; }


Member Function Documentation

void RawDcsHvMonitorBlock::FillHvArray (  )  const [protected]

Definition at line 123 of file RawDcsHvMonitorBlock.cxx.

References RawDataBlock::GetData(), and HvArray.

Referenced by GetAlarmbits(), GetRawChannel(), GetRawGeometry(), GetReadVoltage(), GetSetVoltage(), and GetTimeStamp().

00124 {
00125         //off by 3 since the first three are 1: num words, 2: checksum
00126         // and 3:block ID
00127         HvArray = 3 + GetData();
00128 }

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

Reimplemented from RawDataBlock.

Int_t RawDcsHvMonitorBlock::GetAlarmbits ( Int_t  indx  )  const [inline]

Definition at line 71 of file RawDcsHvMonitorBlock.h.

References FillHvArray(), and HvArray.

Referenced by DcsWriter::ProcessRawRecord().

00072 { FillHvArray(); return HvArray[(indx*6)+5];}

Int_t RawDcsHvMonitorBlock::GetCard ( Int_t  indx  )  const

Definition at line 212 of file RawDcsHvMonitorBlock.cxx.

References GetRawChannel().

Referenced by GetFarIsShield(), GetPlane(), and DcsWriter::ProcessRawRecord().

00213 {
00214         Int_t nRawChan = GetRawChannel(indx);
00215         Int_t temp = nRawChan/1000;
00216         nRawChan = nRawChan - (temp*1000);
00217         return (nRawChan/16);
00218 }

Int_t RawDcsHvMonitorBlock::GetChannel ( Int_t  indx  )  const

Definition at line 198 of file RawDcsHvMonitorBlock.cxx.

References GetRawChannel().

Referenced by DcsWriter::ProcessRawRecord().

00199 {
00200         Int_t nRawChan = GetRawChannel(indx);
00201         Int_t temp = nRawChan/1000;
00202         nRawChan = nRawChan - (temp*1000);
00203         Int_t nCard = nRawChan/16;
00204         return (nRawChan-(nCard*16));
00205 }

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

Definition at line 51 of file RawDcsHvMonitorBlock.h.

References fgDebugFlags.

00051 { return fgDebugFlags; }

Int_t RawDcsHvMonitorBlock::GetFarIsShield ( Int_t  indx  )  const

Definition at line 157 of file RawDcsHvMonitorBlock.cxx.

References GetCard(), RawDataBlock::GetMinorId(), GetPlane(), and GetRawGeometry().

Referenced by GetFarShieldPlane().

00158 {
00159         if (GetMinorId()<3)
00160         {
00161                 if ( (GetPlane(indx)<100) && (GetCard(indx)==12) )
00162                         return 1;
00163         }
00164         else if (GetMinorId()==3)
00165         {
00166                 if ((GetRawGeometry(indx) > 10000)&& (GetRawGeometry(indx)<20000) )
00167                         return 1;
00168         }
00169         return 0;
00170 }

Int_t RawDcsHvMonitorBlock::GetFarIsTriggerPmt ( Int_t  indx  )  const

Definition at line 183 of file RawDcsHvMonitorBlock.cxx.

References RawDataBlock::GetMinorId(), GetRawChannel(), and GetRawGeometry().

Referenced by GetNearIsTriggerPmt(), and GetPlane().

00184 {
00185         if ( (GetMinorId()<3) && (GetRawChannel(indx)==3015) )
00186                 return 1;
00187         if (GetMinorId()==3)
00188                 if (GetRawGeometry(indx)>=20000)
00189                         return 1;
00190         return 0;
00191 }

Int_t RawDcsHvMonitorBlock::GetFarShieldPlane ( Int_t  indx  )  const

Definition at line 172 of file RawDcsHvMonitorBlock.cxx.

References GetFarIsShield(), RawDataBlock::GetMinorId(), GetPlane(), and GetRawGeometry().

00173 {
00174         if (GetFarIsShield(indx)==0)
00175                 return 0;
00176         if (GetMinorId()<3)
00177         {
00178                 return GetPlane(indx);
00179         }
00180         return ((GetRawGeometry(indx)/10)-1000);
00181 }

Int_t RawDcsHvMonitorBlock::GetHvDetector (  )  const

Definition at line 220 of file RawDcsHvMonitorBlock.cxx.

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

Referenced by GetPlane().

00221 {
00222         RawBlockId rbid = GetBlockId();
00223         return rbid.GetDetector();
00224 }

Int_t RawDcsHvMonitorBlock::GetMainframe ( Int_t  indx  )  const

Definition at line 207 of file RawDcsHvMonitorBlock.cxx.

References GetRawChannel().

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

00208 {
00209         return (GetRawChannel(indx)/1000);
00210 }

Int_t RawDcsHvMonitorBlock::GetNearIsTriggerPmt ( Int_t  indx  )  const

Definition at line 193 of file RawDcsHvMonitorBlock.cxx.

References GetFarIsTriggerPmt().

00194 {
00195         return GetFarIsTriggerPmt(indx);
00196 }

Int_t RawDcsHvMonitorBlock::GetNumEntries (  )  const

Definition at line 130 of file RawDcsHvMonitorBlock.cxx.

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

Referenced by DcsWriter::ProcessRawRecord().

00131 {
00132         // remember, all versions
00133         // have offset of 3 due to first 3 longs)
00134         if((fSize-3)%6)
00135         {
00136                 MSG("RawData",Msg::kError)
00137                         << " Size of Hv Block screwed up.  Have: " 
00138                         << (fSize-3)%6 << " left over from modulo 6."
00139                         << endl;
00140                 return -1;
00141         }
00142         return ((fSize-3)/6);
00143 }

Int_t RawDcsHvMonitorBlock::GetNumEvents (  )  const

Definition at line 145 of file RawDcsHvMonitorBlock.cxx.

00146 {
00147         return 1;
00148 }

Int_t RawDcsHvMonitorBlock::GetPlane ( Int_t  indx  )  const

Definition at line 226 of file RawDcsHvMonitorBlock.cxx.

References GetCard(), GetFarIsTriggerPmt(), GetHvDetector(), GetRawGeometry(), and Detector::kFar.

Referenced by GetFarIsShield(), GetFarShieldPlane(), and DcsWriter::ProcessRawRecord().

00227 {
00228         if (GetHvDetector()==Detector::kFar)
00229         {
00230                 if ( (GetFarIsTriggerPmt(indx)) || ( ((GetRawGeometry(indx)/10)<100) && (GetCard(indx)==12)) )
00231                         return 0;
00232         }
00233         return (GetRawGeometry(indx)/10);
00234 }

Int_t RawDcsHvMonitorBlock::GetPmt ( Int_t  indx  )  const

Definition at line 244 of file RawDcsHvMonitorBlock.cxx.

References GetRawGeometry().

Referenced by DcsWriter::ProcessRawRecord().

00245 {
00246         Int_t iRawGeom = GetRawGeometry(indx);
00247         Int_t iTemp = iRawGeom/10;
00248         iRawGeom = iRawGeom - (iTemp*10);
00249         iTemp = iRawGeom/3;
00250         return (iRawGeom-(iTemp*3));
00251 }

Int_t RawDcsHvMonitorBlock::GetRawChannel ( Int_t  indx  )  const

Definition at line 253 of file RawDcsHvMonitorBlock.cxx.

References FillHvArray(), RawDataBlock::GetMinorId(), and HvArray.

Referenced by GetCard(), GetChannel(), GetFarIsTriggerPmt(), GetMainframe(), and DcsWriter::ProcessRawRecord().

00254 {
00255         FillHvArray();
00256         Int_t hvtemp = HvArray[(indx*6)+1];
00257         if (GetMinorId()==3)
00258                 return hvtemp;
00259         if (hvtemp<0)
00260                 return HvArray[(indx*6)+3];
00261         return hvtemp;
00262 }

Int_t RawDcsHvMonitorBlock::GetRawGeometry ( Int_t  indx  )  const

Definition at line 264 of file RawDcsHvMonitorBlock.cxx.

References FillHvArray(), RawDataBlock::GetMinorId(), and HvArray.

Referenced by GetFarIsShield(), GetFarIsTriggerPmt(), GetFarShieldPlane(), GetPlane(), GetPmt(), GetSide(), and DcsWriter::ProcessRawRecord().

00265 {
00266         FillHvArray();
00267         Int_t hvtemp = HvArray[(indx*6)+2];
00268         if (GetMinorId()==3)
00269                 return hvtemp;
00270         if (hvtemp<0)
00271                 return HvArray[(indx*6)+4];
00272         return hvtemp;
00273 }

Int_t RawDcsHvMonitorBlock::GetReadVoltage ( Int_t  indx  )  const

Definition at line 284 of file RawDcsHvMonitorBlock.cxx.

References FillHvArray(), and HvArray.

Referenced by DcsWriter::ProcessRawRecord().

00285 {
00286         FillHvArray();
00287         Int_t hvtemp = HvArray[(indx*6)+2];
00288         if (hvtemp<0)
00289                 return hvtemp;
00290         return HvArray[(indx*6)+4];
00291 }

Int_t RawDcsHvMonitorBlock::GetSetVoltage ( Int_t  indx  )  const

Definition at line 275 of file RawDcsHvMonitorBlock.cxx.

References FillHvArray(), and HvArray.

Referenced by DcsWriter::ProcessRawRecord().

00276 {
00277         FillHvArray();
00278         Int_t hvtemp = HvArray[(indx*6)+1];
00279         if (hvtemp<0)
00280                 return hvtemp;
00281         return HvArray[(indx*6)+3];
00282 }

Int_t RawDcsHvMonitorBlock::GetSide ( Int_t  indx  )  const

Definition at line 236 of file RawDcsHvMonitorBlock.cxx.

References GetRawGeometry().

Referenced by DcsWriter::ProcessRawRecord().

00237 {
00238         Int_t iRawGeom = GetRawGeometry(indx);
00239         Int_t iTemp = iRawGeom/10;
00240         iRawGeom = iRawGeom - (iTemp*10);
00241         return (iRawGeom/3);
00242 }

VldTimeStamp RawDcsHvMonitorBlock::GetTimeStamp ( Int_t  indx  )  const

Definition at line 293 of file RawDcsHvMonitorBlock.cxx.

References FillHvArray(), GetMainframe(), RawDataBlock::GetMinorId(), and HvArray.

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

00294 {
00295         FillHvArray();
00296         Int_t temptime=HvArray[(indx*6)];
00297         if (GetMinorId()==1)
00298 /* fix the temptime offset to be between 2003-06-03 12:24 and 2003011 03:22:26 */
00299                 if ((temptime>1054643040)&&(temptime<1055301756))
00300                         if ((GetMainframe(indx)<=8)&&(GetMainframe(indx)>=5))
00301                                 temptime=temptime+3600;
00302         return VldTimeStamp(temptime,0);
00303 }

VldContext RawDcsHvMonitorBlock::GetVldContext (  )  const

Definition at line 150 of file RawDcsHvMonitorBlock.cxx.

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

Referenced by DcsWriter::ProcessRawRecord().

00151 {
00152            // build validity context
00153         RawBlockId rbid = GetBlockId();
00154         return VldContext(rbid.GetDetector(),rbid.GetSimFlag(),GetTimeStamp(0));
00155 }

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

Definition at line 50 of file RawDcsHvMonitorBlock.h.

References fgDebugFlags.

00050 {fgDebugFlags=dbgflgs;}


Member Data Documentation

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

Definition at line 66 of file RawDcsHvMonitorBlock.h.

Referenced by GetDebugFlags(), and SetDebugFlags().

const Int_t* RawDcsHvMonitorBlock::HvArray [mutable, protected]

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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1