CMS 3D CMS Logo

LutXml.h
Go to the documentation of this file.
1 #ifndef CaloOnlineTools_HcalOnlineDb_LutXml_h
2 #define CaloOnlineTools_HcalOnlineDb_LutXml_h
3 // -*- C++ -*-
4 //
5 // Package: CaloOnlineTools/HcalOnlineDb
6 // Class : LutXml
7 //
16 //
17 // Original Author: Gena Kukartsev, kukarzev@fnal.gov
18 // Created: Tue Mar 18 14:30:33 CDT 2008
19 //
20 
21 #include <vector>
22 #include <map>
25 #include <cstdint>
26 
27 class LutXml : public XMLDOMBlock {
28 public:
29  typedef struct _Config {
30  _Config();
38  int weight;
40  std::vector<unsigned int> lut;
41  std::vector<uint64_t> mask;
42  } Config;
43 
44  LutXml();
45  LutXml(XERCES_CPP_NAMESPACE::InputSource& _source);
47  ~LutXml() override;
48 
49  void init(void);
50  void addLut(Config& _config, XMLDOMBlock* checksums_xml = nullptr);
52 
53  std::vector<unsigned int>* getLutFast(uint32_t det_id);
54  //
55  //_____ following removed as a xalan-c component_____________________
56  //
57  //std::vector<unsigned int> getLut( int lut_type, int crate, int slot, int topbottom, int fiber, int fiber_channel );
58 
60  int a_to_i(char* inbuf);
61  int create_lut_map(void);
62 
63  static std::string get_checksum(std::vector<unsigned int>& lut);
64 
65  //
66  //_____ following removed as a xalan-c component_____________________
67  //
68  //int test_xpath( std::string filename );
70 
71  //LutXml & operator+=( const LutXml & other);
72 
73  //Iterators and find
74  typedef std::map<uint32_t, std::vector<unsigned int> >::const_iterator const_iterator;
75  const_iterator begin() const;
76  const_iterator end() const;
77  const_iterator find(uint32_t) const;
78 
79 protected:
80  XMLCh* root;
81  XMLCh* brick;
82  XERCES_CPP_NAMESPACE::DOMElement* addParameter(std::string _name, std::string _type, std::string _value);
83  XERCES_CPP_NAMESPACE::DOMElement* addParameter(std::string _name, std::string _type, int _value);
84 
85  template <typename T>
86  XERCES_CPP_NAMESPACE::DOMElement* addData(std::string _elements, std::string _encoding, const T& _lut);
87 
88  XERCES_CPP_NAMESPACE::DOMElement* add_checksum(XERCES_CPP_NAMESPACE::DOMDocument* parent, Config& config);
89 
90  XERCES_CPP_NAMESPACE::DOMElement* brickElem;
91 
92  //std::map<uint32_t,std::vector<unsigned int> > * lut_map;
93  std::map<uint32_t, std::vector<unsigned int> > lut_map;
94 };
95 
96 #endif
XERCES_CPP_NAMESPACE::DOMElement * addParameter(std::string _name, std::string _type, std::string _value)
Definition: LutXml.cc:191
std::string targetfirmware
Definition: LutXml.h:36
Definition: LutXml.h:27
int generalizedindex
Definition: LutXml.h:37
void addLut(Config &_config, XMLDOMBlock *checksums_xml=nullptr)
Definition: LutXml.cc:82
XMLCh * root
Definition: LutXml.h:80
XERCES_CPP_NAMESPACE::DOMElement * add_checksum(XERCES_CPP_NAMESPACE::DOMDocument *parent, Config &config)
Definition: LutXml.cc:173
XERCES_CPP_NAMESPACE::DOMElement * addData(std::string _elements, std::string _encoding, const T &_lut)
int create_lut_map(void)
Definition: LutXml.cc:352
Definition: config.py:1
struct LutXml::_Config Config
int a_to_i(char *inbuf)
Definition: LutXml.cc:341
std::string & getCurrentBrick(void)
Definition: LutXml.cc:210
~LutXml() override
Definition: LutXml.cc:63
int topbottom
Definition: LutXml.h:32
const_iterator find(uint32_t) const
Definition: LutXml.cc:464
std::vector< unsigned int > lut
Definition: LutXml.h:40
std::string creationtag
Definition: LutXml.h:33
static std::string get_checksum(std::vector< unsigned int > &lut)
Definition: LutXml.cc:213
HcalSubdetector
Definition: HcalAssistant.h:31
int codedvetothreshold
Definition: LutXml.h:39
void init(void)
Definition: LutXml.cc:68
std::string formatrevision
Definition: LutXml.h:35
HcalSubdetector subdet_from_crate(int crate, int slot, int fiber)
Definition: LutXml.cc:317
std::map< uint32_t, std::vector< unsigned int > > lut_map
Definition: LutXml.h:93
const_iterator end() const
Definition: LutXml.cc:462
std::string infotype
Definition: LutXml.h:31
std::map< uint32_t, std::vector< unsigned int > >::const_iterator const_iterator
Definition: LutXml.h:74
std::vector< unsigned int > * getLutFast(uint32_t det_id)
Definition: LutXml.cc:74
XMLCh * brick
Definition: LutXml.h:81
int test_access(std::string filename)
Definition: LutXml.cc:267
Definition: Config.py:1
long double T
XERCES_CPP_NAMESPACE::DOMElement * brickElem
Definition: LutXml.h:90
const_iterator begin() const
Definition: LutXml.cc:460
int lut_type
Definition: LutXml.h:32
std::string creationstamp
Definition: LutXml.h:34
int fiberchan
Definition: LutXml.h:32
LutXml()
Definition: LutXml.cc:57
std::vector< uint64_t > mask
Definition: LutXml.h:41