CMS 3D CMS Logo

HcalL1TriggerObjects.h
Go to the documentation of this file.
1 #ifndef HcalL1TriggerObjects_h
2 #define HcalL1TriggerObjects_h
3 
5 
6 #include <cstring>
7 #include <string>
8 
11 
13 
14 class HcalL1TriggerObjects : public HcalCondObjectContainer<HcalL1TriggerObject> {
15 public:
16 #ifndef HCAL_COND_SUPPRESS_DEFAULT
18 #endif
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;
48 
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