BeamMonSwicRel Class Reference
[BeamDataUtil]

A DbiTableRow for accessing the BEAMMONSWICREL table which holds per-channel relative calibrations. More...

#include <BeamMonSwicRel.h>

Inheritance diagram for BeamMonSwicRel:
DbiTableRow

List of all members.

Public Member Functions

 BeamMonSwicRel (const char *devicename="")
virtual DbiTableRowCreateTableRow () const
 DbiTableRow API.
void Fill (DbiResultSet &rs, const DbiValidityRec *vrec)
 DbiTableRow API.
virtual void Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const
 DbiTableRow API.
void SetDeviceName (const char *devicename)
 Routines to load data. Typically used for BeamMonSwicPedsDbuModule.
void SetChannels (const std::vector< double > &channels)
void SetChannels (const std::vector< float > &channels)
void ClearData ()
 Clear all data except device name.
const char * GetDeviceName () const
std::vector< float > & GetChannels ()
const std::vector< float > & GetChannels () const
std::vector< double > GetChannelsAsDoubles () const

Private Attributes

std::string fDeviceName
std::vector< float > fChannel

Detailed Description

A DbiTableRow for accessing the BEAMMONSWICREL table which holds per-channel relative calibrations.

Author:
(last to touch it)
Author
minoscvs
Version:
Revision
1.2
Date:
Date
2005/04/29 20:17:56

Contact: bv@bnl.gov

Created on: Wed Apr 13 18:18:44 2005

Id
BeamMonSwicRel.h,v 1.2 2005/04/29 20:17:56 minoscvs Exp

Definition at line 38 of file BeamMonSwicRel.h.


Constructor & Destructor Documentation

BeamMonSwicRel::BeamMonSwicRel ( const char *  devicename = ""  ) 

Definition at line 8 of file BeamMonSwicRel.cxx.

00009     : fDeviceName(devicename), fChannel(96,0)
00010 {
00011 }


Member Function Documentation

void BeamMonSwicRel::ClearData (  ) 

Clear all data except device name.

Definition at line 39 of file BeamMonSwicRel.cxx.

References fChannel.

Referenced by Fill().

00040 {
00041     for (int ind=0; ind<96; ++ind) fChannel[ind] = 0.0;
00042 }

DbiTableRow * BeamMonSwicRel::CreateTableRow (  )  const [virtual]

DbiTableRow API.

Implements DbiTableRow.

Definition at line 14 of file BeamMonSwicRel.cxx.

00015 {
00016     return new BeamMonSwicRel;
00017 }

void BeamMonSwicRel::Fill ( DbiResultSet rs,
const DbiValidityRec vrec 
) [virtual]

DbiTableRow API.

DbiTableRow API >>.

Implements DbiTableRow.

Definition at line 20 of file BeamMonSwicRel.cxx.

References ClearData(), fChannel, and fDeviceName.

00021 {
00022     this->ClearData();
00023 
00024     rs >> fDeviceName ;
00025     for (int ind=0; ind<96; ++ind) {
00026         float tmp=0;
00027         rs >> tmp;
00028         fChannel[ind] = tmp;
00029     }
00030 }

const std::vector<float>& BeamMonSwicRel::GetChannels (  )  const [inline]

Definition at line 61 of file BeamMonSwicRel.h.

References fChannel.

00061 { return fChannel; }

std::vector<float>& BeamMonSwicRel::GetChannels (  )  [inline]

Definition at line 60 of file BeamMonSwicRel.h.

References fChannel.

Referenced by BMWriteHadMuRel::Write().

00060 { return fChannel; }

std::vector< double > BeamMonSwicRel::GetChannelsAsDoubles (  )  const

Definition at line 50 of file BeamMonSwicRel.cxx.

References fChannel.

Referenced by BDSwicMaskAccessor::SetSpillTime().

00051 {
00052     vector<double> ret(96,0);
00053     for (size_t ind=0; ind<96; ++ind) ret[ind] = fChannel[ind];
00054     return ret;
00055 }

const char* BeamMonSwicRel::GetDeviceName (  )  const [inline]

Definition at line 59 of file BeamMonSwicRel.h.

References fDeviceName.

Referenced by BDSwicMaskAccessor::SetSpillTime().

00059 { return fDeviceName.c_str(); }

void BeamMonSwicRel::SetChannels ( const std::vector< float > &  channels  )  [inline]

Definition at line 53 of file BeamMonSwicRel.h.

References fChannel.

00054     { fChannel = channels; }

void BeamMonSwicRel::SetChannels ( const std::vector< double > &  channels  ) 

Definition at line 44 of file BeamMonSwicRel.cxx.

References fChannel.

00045 {
00046     if (channels.size() != 96) return; // shouldn't happen
00047     for (size_t ind=0; ind<96; ++ind) fChannel[ind] = (float)channels[ind];
00048 }

void BeamMonSwicRel::SetDeviceName ( const char *  devicename  )  [inline]

Routines to load data. Typically used for BeamMonSwicPedsDbuModule.

Definition at line 51 of file BeamMonSwicRel.h.

References fDeviceName.

00051 { fDeviceName=devicename; }

void BeamMonSwicRel::Store ( DbiOutRowStream ors,
const DbiValidityRec vrec 
) const [virtual]

DbiTableRow API.

DbiTableRow API <<.

Reimplemented from DbiTableRow.

Definition at line 33 of file BeamMonSwicRel.cxx.

References fChannel, and fDeviceName.

00034 {
00035     ors << fDeviceName;
00036     for (int ind=0; ind<96; ++ind) ors << fChannel[ind];
00037 }


Member Data Documentation

std::vector<float> BeamMonSwicRel::fChannel [private]

Definition at line 69 of file BeamMonSwicRel.h.

Referenced by ClearData(), Fill(), GetChannels(), GetChannelsAsDoubles(), SetChannels(), and Store().

std::string BeamMonSwicRel::fDeviceName [private]

Definition at line 68 of file BeamMonSwicRel.h.

Referenced by Fill(), GetDeviceName(), SetDeviceName(), and Store().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1