CMS 3D CMS Logo

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