BeamMonCuts Class Reference
[BeamDataUtil]

A DbiTableRow for accessing BEAMMONCUTS. More...

#include <BeamMonCuts.h>

Inheritance diagram for BeamMonCuts:
DbiTableRow

List of all members.

Public Member Functions

 BeamMonCuts (const string &cutValues="")
 BeamMonCuts (const Registry *reg)
 ~BeamMonCuts ()
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.
const string & GetCutValues () const
 return private member
void FillRegistry (Registry *reg) const
 fill a registry with the cut values
void SetCutValues (const string &cutValues)
 State changing member functions.
void SetCutValues (const Registry *reg)

Private Attributes

string fCutValues

Detailed Description

A DbiTableRow for accessing BEAMMONCUTS.

Author:
(last to touch it)
Author
mdier
Version:
Revision
1.2
Date:
Date
2006/11/22 20:28:23

Contact: mdier@bnl.gov

Created on: Thu Oct 26 17:40:13 2006

Id
BeamMonCuts.h,v 1.2 2006/11/22 20:28:23 mdier Exp

Definition at line 33 of file BeamMonCuts.h.


Constructor & Destructor Documentation

BeamMonCuts::BeamMonCuts ( const string &  cutValues = ""  ) 

Definition at line 17 of file BeamMonCuts.cxx.

00018     : fCutValues(cutValues)
00019 {}

BeamMonCuts::BeamMonCuts ( const Registry reg  ) 

Definition at line 21 of file BeamMonCuts.cxx.

References SetCutValues().

00022 {
00023     if (reg) this->SetCutValues(reg);
00024 }

BeamMonCuts::~BeamMonCuts (  ) 

Definition at line 27 of file BeamMonCuts.cxx.

00028 {}


Member Function Documentation

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

DbiTableRow API.

Implements DbiTableRow.

Definition at line 30 of file BeamMonCuts.cxx.

00031 {
00032     return new BeamMonCuts;
00033 }

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

DbiTableRow API.

Implements DbiTableRow.

Definition at line 35 of file BeamMonCuts.cxx.

References fCutValues.

00036 {
00037     rs >> fCutValues;
00038 }

void BeamMonCuts::FillRegistry ( Registry reg  )  const

fill a registry with the cut values

Definition at line 45 of file BeamMonCuts.cxx.

References Registry::Clear(), fCutValues, Registry::KeysLocked(), Registry::LockKeys(), Registry::LockValues(), Registry::ReadStream(), Registry::UnLockKeys(), Registry::UnLockValues(), and Registry::ValuesLocked().

Referenced by BMSpillAna::SelectSpill().

00046 {
00047     // Do nothing if pointer to registry is 0
00048     if (!reg) return;
00049 
00050     // Record the current state of reg and then clear it
00051     Bool_t keysLocked = reg->KeysLocked();
00052     Bool_t valuesLocked = reg->ValuesLocked();
00053     reg->UnLockKeys();
00054     reg->UnLockValues();
00055     reg->Clear();
00056 
00057     // use the owned BeamMonCuts to fill reg
00058     std::istringstream is(fCutValues);
00059     reg->ReadStream(is);
00060 
00061     if ( keysLocked   ) reg->LockKeys();
00062     if ( valuesLocked ) reg->LockValues();
00063 
00064 }

const string& BeamMonCuts::GetCutValues (  )  const [inline]

return private member

Definition at line 50 of file BeamMonCuts.h.

References fCutValues.

00050 { return fCutValues; }

void BeamMonCuts::SetCutValues ( const Registry reg  ) 

Definition at line 66 of file BeamMonCuts.cxx.

References fCutValues, Msg::kError, MAXMSG, and Registry::PrintStream().

00067 {
00068     if (!reg){
00069         MAXMSG("BeamMonCuts",Msg::kError,20) << "No valid registry to use!" << endl;
00070         return;
00071     }
00072 
00073     std::ostringstream os;
00074     reg->PrintStream(os);
00075     fCutValues = os.str();              
00076 }

void BeamMonCuts::SetCutValues ( const string &  cutValues  )  [inline]

State changing member functions.

Definition at line 56 of file BeamMonCuts.h.

References fCutValues.

Referenced by BeamMonCuts().

00056 { fCutValues = cutValues;}

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

DbiTableRow API.

Reimplemented from DbiTableRow.

Definition at line 40 of file BeamMonCuts.cxx.

References fCutValues.

00041 {
00042     ors << fCutValues;
00043 }


Member Data Documentation

string BeamMonCuts::fCutValues [private]

Definition at line 61 of file BeamMonCuts.h.

Referenced by Fill(), FillRegistry(), GetCutValues(), SetCutValues(), and Store().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1