Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
CondTools
SiPixel
interface
PixelPopConDCSSourceHandler.h
Go to the documentation of this file.
1
#ifndef CondTools_SiPixel_PixelPopConDCSSourceHandler_h
2
#define CondTools_SiPixel_PixelPopConDCSSourceHandler_h
3
15
#include "CoralBase/Attribute.h"
16
#include "CoralBase/AttributeList.h"
17
#include "RelationalAccess/ICursor.h"
18
19
#include "
CondCore/PopCon/interface/PopConSourceHandler.h
"
20
#include "
CondFormats/SiPixelObjects/interface/PixelDCSObject.h
"
21
#include "CondTools/SiPixel/interface/PixelDCSBase.h"
22
23
template
<
class
Type>
24
class
PixelPopConDCSSourceHandler
:
25
public
PixelDCSBase,
26
public
popcon::PopConSourceHandler
< PixelDCSObject<Type> >
27
{
28
public
:
29
31
PixelPopConDCSSourceHandler
(
const
edm::ParameterSet
& );
32
34
virtual
void
getNewObjects
();
35
37
virtual
std::string
id
()
const
;
38
39
private
:
40
42
static
inline
void
setValue
(
Type
&
value
,
const
coral::AttributeList& );
43
45
virtual
void
fillObject
( coral::ICursor& );
46
};
47
48
template
<
class
Type>
49
PixelPopConDCSSourceHandler<Type>::PixelPopConDCSSourceHandler
(
const
edm::ParameterSet
&
cfg
):
50
PixelDCSBase(cfg)
51
{
52
}
53
54
template
<
class
Type>
55
void
PixelPopConDCSSourceHandler<Type>::setValue
(
Type
&
value
,
const
coral::AttributeList& row)
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
}
68
69
template
<>
70
void
PixelPopConDCSSourceHandler<CaenChannel>::setValue
(
CaenChannel
&
value
,
const
coral::AttributeList& row)
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
}
85
86
template
<
class
Type>
87
void
PixelPopConDCSSourceHandler<Type>::fillObject
(coral::ICursor& cursor)
88
{
89
PixelDCSObject<Type>
*
data
=
new
PixelDCSObject<Type>
;
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
}
104
105
template
<
class
Type>
106
void
PixelPopConDCSSourceHandler<Type>::getNewObjects
()
107
{
108
getData
();
109
}
110
111
template
<
class
Type>
112
std::string
PixelPopConDCSSourceHandler<Type>::id
()
const
113
{
114
std::string
name
=
"PixelPopCon"
;
115
116
name +=
typeid
(
Type
).
name
();
117
name +=
"SourceHandler"
;
118
119
return
name
;
120
}
121
122
#endif
looper.cfg
tuple cfg
Definition:
looper.py:259
Exception
Definition:
hltDiff.cc:318
PixelDCSObject::items
std::vector< Item > items
Definition:
PixelDCSObject.h:35
relativeConstraints.value
tuple value
Definition:
relativeConstraints.py:54
PixelPopConDCSSourceHandler::fillObject
virtual void fillObject(coral::ICursor &)
Fill object from all rows in DB.
Definition:
PixelPopConDCSSourceHandler.h:87
CaenChannel::isOn
bool isOn
Definition:
PixelDCSObject.h:42
susybsm::HSCParticleType::Type
Type
Definition:
HSCParticle.h:20
PixelDCSObject::Item::name
std::string name
Definition:
PixelDCSObject.h:28
mergeVDriftHistosByStation.name
string name
Definition:
mergeVDriftHistosByStation.py:77
reco::JetExtendedAssociation::setValue
bool setValue(Container &, const reco::JetBaseRef &, const JetExtendedData &)
associate jet with value. Returns false and associate nothing if jet is already associated ...
Definition:
JetExtendedAssociation.cc:44
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
PixelPopConDCSSourceHandler::getNewObjects
virtual void getNewObjects()
Get data from DB by calling PixelDCSBase::getData().
Definition:
PixelPopConDCSSourceHandler.h:106
PixelDCSObject
Definition:
PixelDCSRcds.h:8
CaenChannel
Definition:
PixelDCSObject.h:40
PixelPopConDCSSourceHandler::id
virtual std::string id() const
Name of this source handler.
Definition:
PixelPopConDCSSourceHandler.h:112
popcon::PopConSourceHandler
Definition:
PopConSourceHandler.h:36
PixelPopConDCSSourceHandler::PixelPopConDCSSourceHandler
PixelPopConDCSSourceHandler(const edm::ParameterSet &)
Init PixelDCSBase from cfg file.
Definition:
PixelPopConDCSSourceHandler.h:49
PixelDCSObject::Item::value
Type value
Definition:
PixelDCSObject.h:30
PixelPopConDCSSourceHandler
Definition:
PixelPopConDCSSourceHandler.h:24
PixelPopConDCSSourceHandler::setValue
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.
Definition:
PixelPopConDCSSourceHandler.h:55
CaenChannel::iMon
float iMon
Definition:
PixelDCSObject.h:43
PopConSourceHandler.h
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:82
AlCaHLTBitMon_QueryRunRegistry.getData
def getData
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:184
edm::ParameterSet
Definition:
ParameterSet.h:36
PixelDCSObject::Item
Definition:
PixelDCSObject.h:26
CaenChannel::vMon
float vMon
Definition:
PixelDCSObject.h:44
PixelDCSObject.h
Generated for CMSSW Reference Manual by
1.8.5