RawBeamPosData Class Reference

Access RawBeamData assuming it came from a new style Beam Position Monitor (BPM). More...

#include <RawBeamPosData.h>

List of all members.

Public Member Functions

 RawBeamPosData ()
 RawBeamPosData (const RawBeamData &data)
virtual ~RawBeamPosData ()
bool IsValid ()
 Return true if the data is valid.
RawBeamDataGetData ()
 Access the underlying data. May not necessarily be valid.
bool SetData (const RawBeamData &data)
int VmeSeconds ()
 VME timesamp, seconds.
int VmeNanoseconds ()
 VME timesamp, nanoseconds.

Private Attributes

RawBeamData fData

Detailed Description

Access RawBeamData assuming it came from a new style Beam Position Monitor (BPM).

This decorates RawBeamData object as if the data was taken from a new style beam position monitor.

Id
RawBeamPosData.h,v 1.1 2004/09/09 18:41:33 bv Exp

Definition at line 16 of file RawBeamPosData.h.


Constructor & Destructor Documentation

RawBeamPosData::RawBeamPosData (  ) 

Definition at line 9 of file RawBeamPosData.cxx.

00010 {
00011     fData.SetData(0);
00012 }

RawBeamPosData::RawBeamPosData ( const RawBeamData data  ) 

Definition at line 14 of file RawBeamPosData.cxx.

References SetData().

00015 {
00016     this->SetData(data);
00017 }

RawBeamPosData::~RawBeamPosData (  )  [virtual]

Definition at line 19 of file RawBeamPosData.cxx.

References fData, and RawBeamData::SetData().

00020 {
00021     fData.SetData(0);
00022 }


Member Function Documentation

RawBeamData & RawBeamPosData::GetData (  ) 

Access the underlying data. May not necessarily be valid.

Definition at line 24 of file RawBeamPosData.cxx.

References fData.

00025 {
00026     return fData;
00027 }

bool RawBeamPosData::IsValid (  ) 

Return true if the data is valid.

Definition at line 46 of file RawBeamPosData.cxx.

References fData, and RawBeamData::GetData().

Referenced by BdntImp::Fill().

00047 {
00048     return fData.GetData() != 0;
00049 }

bool RawBeamPosData::SetData ( const RawBeamData data  ) 

This (re)sets the underlying RawBeamData. A shallow copy is made. The data is sanity checked for being BPM data. If it fails it is invalidated and false is returned.

Definition at line 28 of file RawBeamPosData.cxx.

References fData, RawBeamData::GetData(), RawBeamData::GetDataLength(), and RawBeamData::SetData().

Referenced by BdntImp::Fill(), and RawBeamPosData().

00029 {
00030     fData = data;
00031 
00032     if (!fData.GetData()) return false;
00033 
00034     // Sanity checks
00035     const size_t bpm_data_size = 216;
00036     const size_t siz = fData.GetDataLength();
00037     if (siz != bpm_data_size) {
00038         cerr << "Not right size: 216 != " << siz << endl;
00039         fData.SetData(0);
00040         return false;
00041     }
00042 
00043     return true;
00044 }

int RawBeamPosData::VmeNanoseconds (  ) 

VME timesamp, nanoseconds.

Definition at line 118 of file RawBeamPosData.cxx.

References fData, RawBeamData::GetData(), and GPSTIMESTAMP_OFFSET.

Referenced by BdntImp::Fill().

00119 {
00120     const double* data = fData.GetData();
00121     float f = (float)data[GPSTIMESTAMP_OFFSET+1];
00122     int i;
00123     memcpy(&i,&f,sizeof(int));
00124     return i;
00125 }

int RawBeamPosData::VmeSeconds (  ) 

VME timesamp, seconds.

Definition at line 109 of file RawBeamPosData.cxx.

References fData, RawBeamData::GetData(), and GPSTIMESTAMP_OFFSET.

Referenced by BdntImp::Fill().

00110 {
00111     const double* data = fData.GetData();
00112     float f = (float)data[GPSTIMESTAMP_OFFSET];
00113     int i;
00114     memcpy(&i,&f,sizeof(int));
00115     return i;
00116 }


Member Data Documentation

Definition at line 17 of file RawBeamPosData.h.

Referenced by GetData(), IsValid(), SetData(), VmeNanoseconds(), VmeSeconds(), and ~RawBeamPosData().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1