CondFormats
HcalObjects
interface
HcalL1TriggerObjects.h
Go to the documentation of this file.
1
#ifndef HcalL1TriggerObjects_h
2
#define HcalL1TriggerObjects_h
3
4
#include "
CondFormats/Serialization/interface/Serializable.h
"
5
6
#include <cstring>
7
#include <string>
8
9
#include "
CondFormats/HcalObjects/interface/HcalL1TriggerObject.h
"
10
#include "
CondFormats/HcalObjects/interface/HcalCondObjectContainer.h
"
11
12
#include "
FWCore/Utilities/interface/Exception.h
"
13
14
class
HcalL1TriggerObjects
:
public
HcalCondObjectContainer
<HcalL1TriggerObject> {
15
public
:
16
#ifndef HCAL_COND_SUPPRESS_DEFAULT
17
HcalL1TriggerObjects
() :
HcalCondObjectContainer
<
HcalL1TriggerObject
>(nullptr) {}
18
#endif
19
HcalL1TriggerObjects
(
const
HcalTopology
*
topo
) :
HcalCondObjectContainer
<
HcalL1TriggerObject
>(
topo
) {}
20
21
//fill the chars and read them
22
void
setTagString
(
std::string
const
& fTag) {
23
std::size_t maxCharacters =
charArraySize
- 1;
24
if
(fTag.size() > maxCharacters) {
25
throw
cms::Exception
(
"HcalL1TriggerObjects::setTagString: string exceeds array size"
);
26
}
27
strncpy(
mTag
, fTag.c_str(), maxCharacters);
28
mTag
[maxCharacters] =
'\0'
;
29
}
30
31
void
setAlgoString
(
std::string
const
& fAlgo) {
32
std::size_t maxCharacters =
charArraySize
- 1;
33
if
(fAlgo.size() > maxCharacters) {
34
throw
cms::Exception
(
"HcalL1TriggerObjects::setAlgoString: string exceeds array size"
);
35
}
36
strncpy(
mAlgo
, fAlgo.c_str(), maxCharacters);
37
mAlgo
[maxCharacters] =
'\0'
;
38
}
39
40
std::string
getTagString
()
const
{
return
mTag
; }
41
std::string
getAlgoString
()
const
{
return
mAlgo
; }
42
std::string
myname
()
const override
{
return
"HcalL1TriggerObjects"
; }
43
44
private
:
45
static
constexpr std::size_t
charArraySize
= 128;
46
char
mTag
[
charArraySize
];
47
char
mAlgo
[
charArraySize
];
48
49
COND_SERIALIZABLE
;
50
};
51
#endif
HcalL1TriggerObjects::HcalL1TriggerObjects
HcalL1TriggerObjects()
Definition:
HcalL1TriggerObjects.h:17
HcalL1TriggerObjects::HcalL1TriggerObjects
HcalL1TriggerObjects(const HcalTopology *topo)
Definition:
HcalL1TriggerObjects.h:19
HcalTopology
Definition:
HcalTopology.h:26
HcalL1TriggerObject.h
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition:
Serializable.h:39
HcalL1TriggerObjects::getAlgoString
std::string getAlgoString() const
Definition:
HcalL1TriggerObjects.h:41
HcalCondObjectContainer
Definition:
HcalCondObjectContainer.h:55
HcalL1TriggerObjects
Definition:
HcalL1TriggerObjects.h:14
HcalL1TriggerObjects::mTag
char mTag[charArraySize]
Definition:
HcalL1TriggerObjects.h:46
HcalL1TriggerObjects::myname
std::string myname() const override
Definition:
HcalL1TriggerObjects.h:42
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
HcalL1TriggerObject
Definition:
HcalL1TriggerObject.h:13
HcalL1TriggerObjects::getTagString
std::string getTagString() const
Definition:
HcalL1TriggerObjects.h:40
HcalL1TriggerObjects::setAlgoString
void setAlgoString(std::string const &fAlgo)
Definition:
HcalL1TriggerObjects.h:31
HcalL1TriggerObjects::setTagString
void setTagString(std::string const &fTag)
Definition:
HcalL1TriggerObjects.h:22
HcalCondObjectContainerBase::topo
const HcalTopology * topo() const
Definition:
HcalCondObjectContainer.h:22
Serializable.h
HcalCondObjectContainer.h
HcalL1TriggerObjects::charArraySize
static constexpr std::size_t charArraySize
Definition:
HcalL1TriggerObjects.h:45
Exception
Definition:
hltDiff.cc:246
Exception.h
HcalL1TriggerObjects::mAlgo
char mAlgo[charArraySize]
Definition:
HcalL1TriggerObjects.h:47
Generated for CMSSW Reference Manual by
1.8.16