Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members

MPDMgr Class Reference

Manage MevPerDAC calibration type. More...

#include <MPDMgr.h>

Inheritance diagram for MPDMgr:

Inheritance graph
[legend]
Collaboration diagram for MPDMgr:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MPDMgr (CalCalibShared &ccsShared)
const CalibData::CalMevPerDac * getMPD (const CalUtil::XtalIdx xtalIdx)
 get MeVPerDac ratios for given xtal


Private Member Functions

StatusCode loadIdealVals ()
 load ideal calibration values from local data store (bypass calib db)

StatusCode genLocalStore ()
 populate all internal calibration data


Static Private Member Functions

bool validateRangeBase (CalibData::CalMevPerDac const *const mpd)
 validate single crystal calibration data.


Private Attributes

std::auto_ptr< CalibData::CalMevPerDac > m_idealMPD
 ideal data is not available till after construction & I will be responsible for memory, hence use of auto_ptr<>


Detailed Description

Manage MevPerDAC calibration type.

Author:
Z.Fewtrell

Definition at line 23 of file MPDMgr.h.


Constructor & Destructor Documentation

MPDMgr::MPDMgr CalCalibShared ccsShared  )  [inline]
 

Definition at line 25 of file MPDMgr.h.

00025                                     :
00026     CalibItemMgr(ICalibPathSvc::Calib_CAL_MevPerDac,
00027                  ccsShared,
00028                  CalUtil::XtalIdx::N_VALS
00029                  ) {}


Member Function Documentation

StatusCode MPDMgr::genLocalStore  )  [private, virtual]
 

populate all internal calibration data

Implements CalibItemMgr.

Definition at line 46 of file MPDMgr.cxx.

References CalibItemMgr::getRangeBase(), CalibItemMgr::m_idealMode, m_idealMPD, CalibItemMgr::m_rngBases, and validateRangeBase().

00046                                  {
00047   for (XtalIdx xtalIdx; xtalIdx.isValid(); xtalIdx++) {
00048     if (!m_idealMode) {
00049       CalibData::CalMevPerDac const*const mpd = (CalMevPerDac*)getRangeBase(xtalIdx.getCalXtalId());
00050       if (!mpd) continue;
00051       if (!validateRangeBase(mpd)) continue;
00052       
00053       m_rngBases[xtalIdx] = mpd;
00054     } else m_rngBases[xtalIdx] = m_idealMPD.get();
00055   }
00056   
00057 
00058   return StatusCode::SUCCESS;
00059 }

const CalMevPerDac * MPDMgr::getMPD const CalUtil::XtalIdx  xtalIdx  ) 
 

get MeVPerDac ratios for given xtal

Definition at line 21 of file MPDMgr.cxx.

References CalibItemMgr::m_rngBases, and CalibItemMgr::updateCalib().

Referenced by CalCalibSvc::getMPD().

00021                                                   {
00022   // make sure we have valid calib data for this event.
00023   StatusCode sc;
00024   sc = updateCalib();
00025   if (sc.isFailure()) return NULL;
00026 
00027   // Get generic pointer to rng specific data
00028   return (CalMevPerDac*)m_rngBases[xtalIdx];
00029 }

StatusCode MPDMgr::loadIdealVals  )  [private, virtual]
 

load ideal calibration values from local data store (bypass calib db)

Implements CalibItemMgr.

Definition at line 31 of file MPDMgr.cxx.

References CalibItemMgr::m_ccsShared, CalCalibShared::m_idealCalib, m_idealMPD, IdealCalCalib::mpdLrg, IdealCalCalib::mpdSigPct, and IdealCalCalib::mpdSm.

00031                                  {
00032   const ValSig mpdLrg(m_ccsShared.m_idealCalib.mpdLrg,
00033                 m_ccsShared.m_idealCalib.mpdLrg * 
00034                 m_ccsShared.m_idealCalib.mpdSigPct);
00035 
00036   const ValSig mpdSm(m_ccsShared.m_idealCalib.mpdSm,
00037                m_ccsShared.m_idealCalib.mpdSm * 
00038                m_ccsShared.m_idealCalib.mpdSigPct);
00039 
00040   m_idealMPD.reset(new CalMevPerDac(&mpdLrg, &mpdSm));
00041   
00042   return StatusCode::SUCCESS;
00043 }

bool MPDMgr::validateRangeBase CalibData::CalMevPerDac const *const  mpd  )  [static, private]
 

validate single crystal calibration data.

Referenced by genLocalStore().


Member Data Documentation

std::auto_ptr<CalibData::CalMevPerDac> MPDMgr::m_idealMPD [private]
 

ideal data is not available till after construction & I will be responsible for memory, hence use of auto_ptr<>

Definition at line 46 of file MPDMgr.h.

Referenced by genLocalStore(), and loadIdealVals().


The documentation for this class was generated from the following files:
Generated on Mon Dec 1 13:29:52 2008 by doxygen 1.3.3