RawBeamData Class Reference

#include <RawBeamData.h>

List of all members.

Public Member Functions

 RawBeamData ()
 absolute DAE time stamp msecs
 RawBeamData (const int *block_chunk)
virtual ~RawBeamData ()
const int * GetBlock () const
size_t GetBlockLength () const
const double * GetData () const
 Get the data converted to doubles.
size_t GetDataLength () const
 Get data length (1/2 block length).
void SetData (const int *data_chunk=0, size_t ndata=0)
std::string GetName () const
 Get device name.
int GetSeconds () const
 Get DAE timestamp seconds.
int GetMsecs () const
 Get DAE timestamp msecs.

Private Attributes

std::string fName
size_t fNdata
 ACNET device name.
const int * fData
 number of data
int fSeconds
 data array as in
int fMsecs
 absolute DAE time stamp seconds


Detailed Description

RawBeamData

Encapsulate one ACNET device worth of data.

The data has a name and a "payload" which is an array of doubles values (even if the ACNET device is really a scalar). It also has a second.millisecond timestamp.

This provides a base class for certain special data types (such as RawBeamSwicData).

Contact: bv@bnl.gov

Id
RawBeamData.h,v 1.6 2004/08/30 15:31:11 bv Exp

Definition at line 30 of file RawBeamData.h.


Constructor & Destructor Documentation

RawBeamData::RawBeamData (  ) 

absolute DAE time stamp msecs

Definition at line 5 of file RawBeamData.cxx.

00006     : fName(8u,' '), fNdata(0), fData(0)
00007 {
00008 
00009 }

RawBeamData::RawBeamData ( const int *  block_chunk  ) 

Create object to hold data from one Acnet device. This is called internally by RawBeamMonitorBlock.

Definition at line 23 of file RawBeamData.cxx.

References fData, fMsecs, fName, fNdata, fSeconds, and unpad().

00024     : fName(8u,' '), fNdata(0), fData(0)
00025 {
00026     if (!data_chunk) {
00027         fData=0;
00028         return;
00029     }
00030 
00031 
00032     // The data_chunk should look like:
00033     // ------------------
00034     // 0: ACNET name part 1
00035     // 1: ACNET name part 2
00036     // 2: second timestamp
00037     // 3: msec timestamp
00038     // 4: N = number of ints in the rest of the block
00039     // 5: value 0 first 32 bits of double
00040     // 6: value 0 second 32 bits of double
00041     // 7: value 1 first 32 bits of double
00042     // 8: value 1 second 32 bits of double
00043     //    ...
00044     // N+3: value N/2-1 first 32 bits of double
00045     // N+4: value N/2-1 second 32 bits of double
00046     // ------------------
00047 
00048     int w1 = data_chunk[0];
00049     fName[0] = w1>>24;
00050     fName[1] = (w1>>16)&0xff;
00051     fName[2] = (w1>>8)&0xff;
00052     fName[3] = w1&0xff;
00053     int w2 = data_chunk[1];
00054     fName[4] = w2>>24;
00055     fName[5] = (w2>>16)&0xff;
00056     fName[6] = (w2>>8)&0xff;
00057     fName[7] = w2&0xff;
00058 
00059     fName = unpad(fName);
00060 
00061     fSeconds = data_chunk[2];
00062     fMsecs = data_chunk[3];
00063 
00064     fNdata = data_chunk[4];
00065     fData = data_chunk+5;
00066 }

virtual RawBeamData::~RawBeamData (  )  [inline, virtual]

Definition at line 43 of file RawBeamData.h.

00043 {}


Member Function Documentation

const int* RawBeamData::GetBlock (  )  const [inline]

Get the raw, untouched block data for this device. Can return 0.

Definition at line 47 of file RawBeamData.h.

References fData.

00047 { return fData; }

size_t RawBeamData::GetBlockLength (  )  const [inline]

Definition at line 49 of file RawBeamData.h.

References fNdata.

00049 { return fNdata; }

const double* RawBeamData::GetData (  )  const [inline]

Get the data converted to doubles.

Definition at line 52 of file RawBeamData.h.

References fData.

Referenced by BDSwicCalibrator::CalibrateOne(), BDCheckDB::CheckSpill(), TempModule::Fill(), TargetModule::Fill(), NpotModule::Fill(), LossModule::Fill(), HornModule::Fill(), HadMuMonModule::Fill(), BmntImp::Fill(), BdntImp::Fill(), get_scalar(), BDScalar::GetScalar(), is_pm_there(), RawBeamSwicData::IsValid(), RawBeamPosData::IsValid(), set_toroid(), RawBeamSwicData::SetData(), RawBeamPosData::SetData(), BDTarget::TargetIn(), total(), RawBeamSwicData::VmeNanoseconds(), RawBeamPosData::VmeNanoseconds(), RawBeamSwicData::VmeSeconds(), and RawBeamPosData::VmeSeconds().

00052 { return (double*)fData; } // evil but correct!

size_t RawBeamData::GetDataLength (  )  const [inline]

Get data length (1/2 block length).

Definition at line 54 of file RawBeamData.h.

References fNdata.

Referenced by BDSwicCalibrator::CalibrateOne(), BDCheckDB::CheckSpill(), TempModule::Fill(), NpotModule::Fill(), LossModule::Fill(), HornModule::Fill(), HadMuMonModule::Fill(), BmntImp::Fill(), BdntImp::Fill(), get_dev(), BDTarget::GetNbatches(), BDScalar::GetScalar(), is_pm_there(), set_toroid(), RawBeamSwicData::SetData(), RawBeamPosData::SetData(), and total().

00054 { return fNdata/2; }

int RawBeamData::GetMsecs (  )  const

Get DAE timestamp msecs.

Definition at line 78 of file RawBeamData.cxx.

References fMsecs.

Referenced by BDAnaModule::Ana(), TempModule::Fill(), TargetModule::Fill(), NpotModule::Fill(), LossModule::Fill(), HornModule::Fill(), HadMuMonModule::Fill(), BmntImp::Fill(), and BdntImp::Fill().

00079 {
00080     return fMsecs;
00081 }

string RawBeamData::GetName (  )  const

Get device name.

Definition at line 68 of file RawBeamData.cxx.

References fName.

Referenced by BDSwicCalibrator::AddDevice(), BDSwicCalibrator::CalibrateOne(), HadMuMonModule::Fill(), BDSwicDevice::SetData(), BDProfMon::UpdateCache(), BDHadMuMon::UpdateCache(), and BDSwicDevice::UpdateType().

00069 {
00070     return fName;
00071 }

int RawBeamData::GetSeconds (  )  const

Get DAE timestamp seconds.

Definition at line 73 of file RawBeamData.cxx.

References fSeconds.

Referenced by BDAnaModule::Ana(), TempModule::Fill(), TargetModule::Fill(), NpotModule::Fill(), LossModule::Fill(), HornModule::Fill(), HadMuMonModule::Fill(), BmntImp::Fill(), and BdntImp::Fill().

00074 {
00075     return fSeconds;
00076 }

void RawBeamData::SetData ( const int *  data_chunk = 0,
size_t  ndata = 0 
) [inline]

Allow blind (re)setting the payload data after construction. You will not likely need this so only use it if you know what you are doing.

Definition at line 59 of file RawBeamData.h.

References fData, and fNdata.

Referenced by RawBeamSwicData::SetData(), RawBeamPosData::SetData(), RawBeamPosData::~RawBeamPosData(), and RawBeamSwicData::~RawBeamSwicData().

00060         {fData = data_chunk; fNdata = ndata; }


Member Data Documentation

const int* RawBeamData::fData [private]

number of data

Definition at line 33 of file RawBeamData.h.

Referenced by GetBlock(), GetData(), RawBeamData(), and SetData().

int RawBeamData::fMsecs [private]

absolute DAE time stamp seconds

Definition at line 35 of file RawBeamData.h.

Referenced by GetMsecs(), and RawBeamData().

std::string RawBeamData::fName [private]

Definition at line 31 of file RawBeamData.h.

Referenced by GetName(), and RawBeamData().

size_t RawBeamData::fNdata [private]

ACNET device name.

Definition at line 32 of file RawBeamData.h.

Referenced by GetBlockLength(), GetDataLength(), RawBeamData(), and SetData().

int RawBeamData::fSeconds [private]

data array as in

Definition at line 34 of file RawBeamData.h.

Referenced by GetSeconds(), and RawBeamData().


The documentation for this class was generated from the following files:
Generated on Wed Oct 1 22:53:25 2014 for loon by  doxygen 1.4.7