BeamMonSwicPeds Class Reference
[BeamDataUtil]

A DbiTableRow for accessing the BEAMMONSWICPEDS table which holds pedestals for all channels of one SWIC device. More...

#include <BeamMonSwicPeds.h>

Inheritance diagram for BeamMonSwicPeds:
DbiTableRow

List of all members.

Public Member Functions

 BeamMonSwicPeds (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 SetNsamples (int nsamp)
std::vector< float > & GetChannelMeans ()
std::vector< float > & GetChannelSigmas ()
void SetChannelMeans (const std::vector< double > &means)
void SetChannelSigmas (const std::vector< double > &sigmas)
void SetChannelMeans (const std::vector< float > &means)
void SetChannelSigmas (const std::vector< float > &sigmas)
void ClearData ()
 Clear all data except device name.
const char * GetDeviceName () const
int GetNsamples () const
const std::vector< float > & GetMeans () const
const std::vector< float > & GetSigmas () const
std::vector< double > GetMeansAsDoubles () const
std::vector< double > GetSigmasAsDoubles () const

Private Attributes

std::string fDeviceName
int fNsamples
std::vector< float > fMean
std::vector< float > fSigma

Detailed Description

A DbiTableRow for accessing the BEAMMONSWICPEDS table which holds pedestals for all channels of one SWIC device.

Author:
(last to touch it)
Author
minoscvs
Version:
Revision
1.3
Date:
Date
2005/05/02 15:13:14

Contact: bv@bnl.gov

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

Id
BeamMonSwicPeds.h,v 1.3 2005/05/02 15:13:14 minoscvs Exp

Definition at line 40 of file BeamMonSwicPeds.h.


Constructor & Destructor Documentation

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

Definition at line 8 of file BeamMonSwicPeds.cxx.

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


Member Function Documentation

void BeamMonSwicPeds::ClearData (  ) 

Clear all data except device name.

Definition at line 45 of file BeamMonSwicPeds.cxx.

References fMean, fNsamples, and fSigma.

Referenced by Fill().

00046 {
00047     for (int ind=0; ind<96; ++ind) fMean[ind] = fSigma[ind] = 0.0;
00048     fNsamples = 0;
00049 }

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

DbiTableRow API.

Implements DbiTableRow.

Definition at line 14 of file BeamMonSwicPeds.cxx.

00015 {
00016     return new BeamMonSwicPeds;
00017 }

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

DbiTableRow API.

DbiTableRow API >>.

Implements DbiTableRow.

Definition at line 20 of file BeamMonSwicPeds.cxx.

References ClearData(), fDeviceName, fMean, fNsamples, and fSigma.

00021 {
00022     this->ClearData();
00023 
00024     rs >> fDeviceName >> fNsamples;
00025     for (int ind=0; ind<96; ++ind) {
00026         float tmp=0;
00027         rs >> tmp;
00028         fMean[ind] = tmp;
00029     }
00030     for (int ind=0; ind<96; ++ind) {
00031         float tmp=0;
00032         rs >> tmp;
00033         fSigma[ind] = tmp;
00034     }
00035 }

std::vector<float>& BeamMonSwicPeds::GetChannelMeans (  )  [inline]

Definition at line 56 of file BeamMonSwicPeds.h.

References fMean.

00056 { return fMean; }

std::vector<float>& BeamMonSwicPeds::GetChannelSigmas (  )  [inline]

Definition at line 57 of file BeamMonSwicPeds.h.

References fSigma.

00057 { return fSigma; }

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

Definition at line 66 of file BeamMonSwicPeds.h.

References fDeviceName.

Referenced by BDSwicPedAccessor::SetSpillTime(), PlotPeds::Update(), and PlotAllPedsImp::Update().

00066 { return fDeviceName.c_str(); }

const std::vector<float>& BeamMonSwicPeds::GetMeans (  )  const [inline]

Get the mean pedestals. This returns a 96 element vector. Units are ADC counts

Definition at line 70 of file BeamMonSwicPeds.h.

References fMean.

Referenced by PlotPeds::Update(), and PlotAllPedsImp::Update().

00070 { return fMean; }

std::vector< double > BeamMonSwicPeds::GetMeansAsDoubles (  )  const

Definition at line 62 of file BeamMonSwicPeds.cxx.

References fMean.

Referenced by BDSwicPedAccessor::SetSpillTime().

00063 {
00064     vector<double> ret(96,0);
00065     for (size_t ind=0; ind<96; ++ind) ret[ind] = fMean[ind];
00066     return ret;
00067 }

int BeamMonSwicPeds::GetNsamples (  )  const [inline]

Definition at line 67 of file BeamMonSwicPeds.h.

References fNsamples.

Referenced by BDSwicPedAccessor::SetSpillTime(), PlotPeds::Update(), and PlotAllPedsImp::Update().

00067 { return fNsamples; }

const std::vector<float>& BeamMonSwicPeds::GetSigmas (  )  const [inline]

Definition at line 71 of file BeamMonSwicPeds.h.

References fSigma.

Referenced by PlotAllPedsImp::Update().

00071 { return fSigma; }

std::vector< double > BeamMonSwicPeds::GetSigmasAsDoubles (  )  const

Definition at line 69 of file BeamMonSwicPeds.cxx.

References fSigma.

Referenced by BDSwicPedAccessor::SetSpillTime().

00070 {
00071     vector<double> ret(96,0);
00072     for (size_t ind=0; ind<96; ++ind) ret[ind] = fSigma[ind];
00073     return ret;
00074 }

void BeamMonSwicPeds::SetChannelMeans ( const std::vector< float > &  means  )  [inline]

Definition at line 60 of file BeamMonSwicPeds.h.

References fMean.

00060 { fMean = means; }

void BeamMonSwicPeds::SetChannelMeans ( const std::vector< double > &  means  ) 

Definition at line 51 of file BeamMonSwicPeds.cxx.

References fMean.

00052 {
00053     if (means.size() != 96) return; // shouldn't happen
00054     for (size_t ind=0; ind<96; ++ind) fMean[ind] = (float)means[ind];
00055 }

void BeamMonSwicPeds::SetChannelSigmas ( const std::vector< float > &  sigmas  )  [inline]

Definition at line 61 of file BeamMonSwicPeds.h.

References fSigma.

00061 { fSigma = sigmas; }

void BeamMonSwicPeds::SetChannelSigmas ( const std::vector< double > &  sigmas  ) 

Definition at line 56 of file BeamMonSwicPeds.cxx.

References fSigma.

00057 {
00058     if (sigmas.size() != 96) return; // shouldn't happen
00059     for (size_t ind=0; ind<96; ++ind) fSigma[ind] = (float)sigmas[ind];
00060 }

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

Routines to load data. Typically used for BeamMonSwicPedsDbuModule.

Definition at line 53 of file BeamMonSwicPeds.h.

References fDeviceName.

00053 { fDeviceName=devicename; }

void BeamMonSwicPeds::SetNsamples ( int  nsamp  )  [inline]

Definition at line 54 of file BeamMonSwicPeds.h.

References fNsamples.

00054 { fNsamples = nsamp; }

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

DbiTableRow API.

DbiTableRow API <<.

Reimplemented from DbiTableRow.

Definition at line 38 of file BeamMonSwicPeds.cxx.

References fDeviceName, fMean, fNsamples, and fSigma.

00039 {
00040     ors << fDeviceName<< fNsamples;
00041     for (int ind=0; ind<96; ++ind) ors << fMean[ind];
00042     for (int ind=0; ind<96; ++ind) ors << fSigma[ind];
00043 }


Member Data Documentation

std::string BeamMonSwicPeds::fDeviceName [private]

Definition at line 78 of file BeamMonSwicPeds.h.

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

std::vector<float> BeamMonSwicPeds::fMean [private]

Definition at line 79 of file BeamMonSwicPeds.h.

Referenced by ClearData(), Fill(), GetNsamples(), SetNsamples(), and Store().

std::vector<float> BeamMonSwicPeds::fSigma [private]

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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1