RawBeamSwicData Class Reference

Access RawBeamData assuming it came from a SWIC scanner. More...

#include <RawBeamSwicData.h>

Inheritance diagram for RawBeamSwicData:

BDSwicDevice BDHadMuMon BDProfMon List of all members.

Public Member Functions

 RawBeamSwicData ()
 RawBeamSwicData (const RawBeamData &data)
virtual ~RawBeamSwicData ()
bool IsValid () const
 Return true if the data is valid.
RawBeamDataGetData ()
 Access the underlying data. May not necessarily be valid.
const RawBeamDataGetData () const
bool SetData (const RawBeamData &data)
int VmeSeconds () const
 VME timesamp, seconds.
int VmeNanoseconds () const
 VME timesamp, nanoseconds.
void UnscaledWireData (std::vector< int > &wd) const
void ScaledWireData (std::vector< double > &wd) const

Private Attributes

RawBeamData fData

Detailed Description

Access RawBeamData assuming it came from a SWIC scanner.

This decorates RawBeamData object as if the data was taken from a SWIC scanner. Some sanity checks are done to try to assure the data really is from a SWIC scanner.

Id
RawBeamSwicData.h,v 1.9 2005/08/01 18:46:24 bv Exp

Definition at line 18 of file RawBeamSwicData.h.


Constructor & Destructor Documentation

RawBeamSwicData::RawBeamSwicData (  ) 

Definition at line 8 of file RawBeamSwicData.cxx.

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

RawBeamSwicData::RawBeamSwicData ( const RawBeamData data  ) 

Definition at line 13 of file RawBeamSwicData.cxx.

References SetData().

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

RawBeamSwicData::~RawBeamSwicData (  )  [virtual]

Definition at line 18 of file RawBeamSwicData.cxx.

References fData, and RawBeamData::SetData().

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


Member Function Documentation

const RawBeamData & RawBeamSwicData::GetData (  )  const

Definition at line 27 of file RawBeamSwicData.cxx.

References fData.

00028 {
00029     return fData;
00030 }

RawBeamData & RawBeamSwicData::GetData (  ) 

Access the underlying data. May not necessarily be valid.

Definition at line 23 of file RawBeamSwicData.cxx.

References fData.

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

00024 {
00025     return fData;
00026 }

bool RawBeamSwicData::IsValid (  )  const

Return true if the data is valid.

Definition at line 49 of file RawBeamSwicData.cxx.

References fData, and RawBeamData::GetData().

Referenced by BDSwicCalibrator::AddDevice(), BDSwicCalibrator::CalibrateOne(), and BdntImp::Fill().

00050 {
00051     return fData.GetData() != 0;
00052 }

void RawBeamSwicData::ScaledWireData ( std::vector< double > &  wd  )  const

Fill passed in vetcor with the 96 channels of raw scaled (untouched) wire data.

bool RawBeamSwicData::SetData ( const RawBeamData data  ) 

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

Reimplemented in BDHadMuMon, BDProfMon, and BDSwicDevice.

Definition at line 31 of file RawBeamSwicData.cxx.

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

Referenced by BDEarliest::CalculateEarliest(), BdntImp::Fill(), BDSwicPeds::IsPedSpill(), PedStudy::OneRecord(), RawBeamSwicData(), and BDSwicDevice::SetData().

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

void RawBeamSwicData::UnscaledWireData ( std::vector< int > &  wd  )  const

Fill passed in vetcor with the 96 channels of raw unscaled wire data. vector not clear()ed.

Referenced by BDSwicDevice::BDSwicDevice(), dump_hadmu_monitor(), dump_profile_monitor(), PedStudy::OneRecord(), BDSwicDevice::SetData(), and BDSwicPeds::SetSpill().

int RawBeamSwicData::VmeNanoseconds (  )  const

VME timesamp, nanoseconds.

Definition at line 162 of file RawBeamSwicData.cxx.

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

Referenced by BDAnaModule::Ana(), BDEarliest::CalculateEarliest(), dump_hadmu_monitor(), BdntImp::Fill(), and BDSwicPeds::IsPedSpill().

00163 {
00164     const double* data = fData.GetData();
00165     return ul2int(data[GPSTIMESTAMP_OFFSET+2],
00166                   data[GPSTIMESTAMP_OFFSET+3]);
00167 }

int RawBeamSwicData::VmeSeconds (  )  const

VME timesamp, seconds.

Definition at line 155 of file RawBeamSwicData.cxx.

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

Referenced by BDAnaModule::Ana(), BDEarliest::CalculateEarliest(), dump_hadmu_monitor(), BdntImp::Fill(), and BDSwicPeds::IsPedSpill().

00156 {
00157     const double* data = fData.GetData();
00158     return ul2int(data[GPSTIMESTAMP_OFFSET],
00159                   data[GPSTIMESTAMP_OFFSET+1]);
00160 }


Member Data Documentation

RawBeamData RawBeamSwicData::fData [private]

Reimplemented in BDSwicDevice.

Definition at line 19 of file RawBeamSwicData.h.

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


The documentation for this class was generated from the following files:
Generated on Thu Apr 10 23:03:33 2014 for loon by  doxygen 1.4.7