CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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 > >

Public Member Functions

virtual void getNewObjects ()
 Get data from DB by calling PixelDCSBase::getData(). More...
 
virtual std::string id () const
 Name of this source handler. More...
 
 PixelPopConDCSSourceHandler (const edm::ParameterSet &)
 Init PixelDCSBase from cfg file. More...
 
- Public Member Functions inherited from popcon::PopConSourceHandler< PixelDCSObject< Type > >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry_t const & logDBEntry () const
 
std::pair< Container const
*, std::string const > 
operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo_t const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Private Member Functions

virtual void fillObject (coral::ICursor &)
 Fill object from all rows in DB. More...
 
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. More...
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< PixelDCSObject< Type > >
typedef std::vector< TripletContainer
 
typedef std::vector< std::pair
< PixelDCSObject< Type >
*, cond::Time_t > > 
OldContainer
 
typedef PopConSourceHandler
< PixelDCSObject< Type > > 
self
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef PixelDCSObject< Type > value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< PixelDCSObject< Type > >
int add (value_type *payload, Summary *summary, Time_t time)
 
- Protected Attributes inherited from popcon::PopConSourceHandler< PixelDCSObject< Type > >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

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:
2008/11/30 19:41:09
Revision:
1.2
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.

49  :
50  PixelDCSBase(cfg)
51 {
52 }

Member Function Documentation

template<class Type >
void PixelPopConDCSSourceHandler< Type >::fillObject ( coral::ICursor &  cursor)
privatevirtual

Fill object from all rows in DB.

Definition at line 87 of file PixelPopConDCSSourceHandler.h.

References data, PixelDCSObject< class >::items, PixelDCSObject< class >::Item::name, reco::JetExtendedAssociation::setValue(), AlCaHLTBitMon_QueryRunRegistry::string, and PixelDCSObject< class >::Item::value.

88 {
90 
91  while ( cursor.next() )
92  {
93  const coral::AttributeList& row = cursor.currentRow();
94 
95  typename PixelDCSObject<Type>::Item datum;
96 
97  datum.name = row["name"].data<std::string>();
98  setValue(datum.value, row);
99  data->items.push_back(datum);
100  }
101 
102  this->m_to_transfer.push_back( std::make_pair(data, 1) );
103 }
std::vector< Item > items
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.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<class Type >
void PixelPopConDCSSourceHandler< Type >::getNewObjects ( )
virtual
template<class Type >
std::string PixelPopConDCSSourceHandler< Type >::id ( ) const
virtual

Name of this source handler.

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

Definition at line 112 of file PixelPopConDCSSourceHandler.h.

References mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

113 {
114  std::string name = "PixelPopCon";
115 
116  name += typeid(Type).name();
117  name += "SourceHandler";
118 
119  return name;
120 }
template<class Type >
void PixelPopConDCSSourceHandler< Type >::setValue ( Type &  value,
const coral::AttributeList &  row 
)
inlinestaticprivate

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.

Referenced by Vispa.Views.PropertyView.StringProperty::buttonClicked(), Vispa.Views.PropertyView.FileProperty::buttonClicked(), Vispa.Views.PropertyView.FileVectorProperty::buttonClicked(), Vispa.Views.PropertyView.TextEditWithButtonProperty::keyPressEvent(), and Vispa.Views.PropertyView.TextEditWithButtonProperty::setMultiline().

56 {
57  const size_t nTable = row.size() - 1; // row includes name
58 
59  if (1 != nTable)
60  {
61  throw cms::Exception("PixelPopConDCSSourceHandler")
62  << "Found " << nTable << " last value tables instead of 1. "
63  << "Check your cfg.\n";
64  }
65 
66  value = row[0].data<float>();
67 }
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.

71 {
72  const size_t nTable = row.size() - 1; // row includes name
73 
74  if (3 != nTable)
75  {
76  throw cms::Exception("PixelPopConDCSSourceHandler<CaenChannel>")
77  << "CaenChannel has 3 values (isOn, iMon, vMon) "
78  << "but your cfg has " << nTable << " last value tables.\n";
79  }
80 
81  value.isOn = row[0].data<float>();
82  value.iMon = row[1].data<float>();
83  value.vMon = row[2].data<float>();
84 }