CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Static Private Member Functions

PixelPopConDCSSourceHandler< Type > Class Template Reference

#include <PixelPopConDCSSourceHandler.h>

Inheritance diagram for PixelPopConDCSSourceHandler< Type >:
popcon::PopConSourceHandler< PixelDCSObject< Type > >

List of all members.

Public Member Functions

virtual void getNewObjects ()
 Get data from DB by calling PixelDCSBase::getData().
virtual std::string id () const
 Name of this source handler.
 PixelPopConDCSSourceHandler (const edm::ParameterSet &)
 Init PixelDCSBase from cfg file.

Private Member Functions

virtual void fillObject (coral::ICursor &)
 Fill object from all rows in DB.
template<>
void setValue (CaenChannel &value, const coral::AttributeList &row)

Static Private Member Functions

static void setValue (Type &value, const coral::AttributeList &)
 Specialise this template to assign values to a non-POD object type from a row in DB.

Detailed Description

template<class Type>
class PixelPopConDCSSourceHandler< Type >

Template class for the source handler of DCS data.

Specify the object type via the template parameter Type.

Date:
2009/10/21 16:22:11
Revision:
1.4
Author:
Chung Khim Lae

Definition at line 24 of file PixelPopConDCSSourceHandler.h.


Constructor & Destructor Documentation

template<class Type >
PixelPopConDCSSourceHandler< Type >::PixelPopConDCSSourceHandler ( const edm::ParameterSet cfg)

Init PixelDCSBase from cfg file.

Definition at line 49 of file PixelPopConDCSSourceHandler.h.

                                                                                        :
  PixelDCSBase(cfg)
{
}

Member Function Documentation

template<class Type >
void PixelPopConDCSSourceHandler< Type >::fillObject ( coral::ICursor &  cursor) [private, virtual]

Fill object from all rows in DB.

Definition at line 87 of file PixelPopConDCSSourceHandler.h.

References runTheMatrix::data, PixelDCSObject< T >::items, PixelDCSObject< T >::Item::name, reco::JetExtendedAssociation::setValue(), and PixelDCSObject< T >::Item::value.

{
  PixelDCSObject<Type>* data = new PixelDCSObject<Type>;

  while ( cursor.next() )
  {
    const coral::AttributeList& row = cursor.currentRow();

    typename PixelDCSObject<Type>::Item datum;

    datum.name = row["name"].data<std::string>();
    setValue(datum.value, row);
    data->items.push_back(datum);
  }

  this->m_to_transfer.push_back( std::make_pair(data, 1) );
}
template<class Type >
void PixelPopConDCSSourceHandler< Type >::getNewObjects ( ) [virtual]

Get data from DB by calling PixelDCSBase::getData().

Implements popcon::PopConSourceHandler< PixelDCSObject< Type > >.

Definition at line 106 of file PixelPopConDCSSourceHandler.h.

{
  getData();
}
template<class Type >
std::string PixelPopConDCSSourceHandler< Type >::id ( void  ) const [virtual]

Name of this source handler.

Implements popcon::PopConSourceHandler< PixelDCSObject< Type > >.

Definition at line 112 of file PixelPopConDCSSourceHandler.h.

References AlCaRecoCosmics_cfg::name.

{
  std::string name = "PixelPopCon";

  name += typeid(Type).name();
  name += "SourceHandler";

  return name;
}
template<class Type >
void PixelPopConDCSSourceHandler< Type >::setValue ( Type &  value,
const coral::AttributeList &  row 
) [inline, static, private]

Specialise this template to assign values to a non-POD object type from a row in DB.

Definition at line 55 of file PixelPopConDCSSourceHandler.h.

References Exception.

{
  const size_t nTable = row.size() - 1; // row includes name

  if (1 != nTable)
  {
    throw cms::Exception("PixelPopConDCSSourceHandler")
        << "Found " << nTable << " last value tables instead of 1. "
        << "Check your cfg.\n";
  }

  value = row[0].data<float>();
}
template<>
void PixelPopConDCSSourceHandler< CaenChannel >::setValue ( CaenChannel value,
const coral::AttributeList &  row 
) [private]

Definition at line 70 of file PixelPopConDCSSourceHandler.h.

References Exception, CaenChannel::iMon, CaenChannel::isOn, and CaenChannel::vMon.

{
  const size_t nTable = row.size() - 1; // row includes name

  if (3 != nTable)
  {
    throw cms::Exception("PixelPopConDCSSourceHandler<CaenChannel>")
        << "CaenChannel has 3 values (isOn, iMon, vMon) "
        << "but your cfg has " << nTable << " last value tables.\n";
  }

  value.isOn = row[0].data<float>();
  value.iMon = row[1].data<float>();
  value.vMon = row[2].data<float>();
}