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();
37  std::vector<unsigned int> lut;
38  std::vector<uint64_t> mask;
39  } Config;
40 
41  LutXml();
42  LutXml(XERCES_CPP_NAMESPACE::InputSource& _source);
44  ~LutXml() override;
45 
46  void init(void);
47  void addLut(Config& _config, XMLDOMBlock* checksums_xml = nullptr);
49 
50  std::vector<unsigned int>* getLutFast(uint32_t det_id);
51  //
52  //_____ following removed as a xalan-c component_____________________
53  //
54  //std::vector<unsigned int> getLut( int lut_type, int crate, int slot, int topbottom, int fiber, int fiber_channel );
55 
57  int a_to_i(char* inbuf);
58  int create_lut_map(void);
59 
60  static std::string get_checksum(std::vector<unsigned int>& lut);
61 
62  //
63  //_____ following removed as a xalan-c component_____________________
64  //
65  //int test_xpath( std::string filename );
67 
68  //LutXml & operator+=( const LutXml & other);
69 
70  //Iterators and find
71  typedef std::map<uint32_t, std::vector<unsigned int> >::const_iterator const_iterator;
72  const_iterator begin() const;
73  const_iterator end() const;
74  const_iterator find(uint32_t) const;
75 
76 protected:
77  XMLCh* root;
78  XMLCh* brick;
79  XERCES_CPP_NAMESPACE::DOMElement* addParameter(std::string _name, std::string _type, std::string _value);
80  XERCES_CPP_NAMESPACE::DOMElement* addParameter(std::string _name, std::string _type, int _value);
81 
82  template <typename T>
83  XERCES_CPP_NAMESPACE::DOMElement* addData(std::string _elements, std::string _encoding, const T& _lut);
84 
85  XERCES_CPP_NAMESPACE::DOMElement* add_checksum(XERCES_CPP_NAMESPACE::DOMDocument* parent, Config& config);
86 
87  XERCES_CPP_NAMESPACE::DOMElement* brickElem;
88 
89  //std::map<uint32_t,std::vector<unsigned int> > * lut_map;
90  std::map<uint32_t, std::vector<unsigned int> > lut_map;
91 };
92 
93 #endif
XERCES_CPP_NAMESPACE::DOMElement * addParameter(std::string _name, std::string _type, std::string _value)
Definition: LutXml.cc:173
std::string targetfirmware
Definition: LutXml.h:35
Definition: LutXml.h:27
int generalizedindex
Definition: LutXml.h:36
void addLut(Config &_config, XMLDOMBlock *checksums_xml=nullptr)
Definition: LutXml.cc:78
HcalSubdetector subdet_from_crate(int crate, int eta, int depth)
Definition: LutXml.cc:299
XMLCh * root
Definition: LutXml.h:77
XERCES_CPP_NAMESPACE::DOMElement * add_checksum(XERCES_CPP_NAMESPACE::DOMDocument *parent, Config &config)
Definition: LutXml.cc:155
XERCES_CPP_NAMESPACE::DOMElement * addData(std::string _elements, std::string _encoding, const T &_lut)
int create_lut_map(void)
Definition: LutXml.cc:343
Definition: config.py:1
struct LutXml::_Config Config
int a_to_i(char *inbuf)
Definition: LutXml.cc:332
std::string & getCurrentBrick(void)
Definition: LutXml.cc:192
~LutXml() override
Definition: LutXml.cc:59
int topbottom
Definition: LutXml.h:31
std::vector< unsigned int > lut
Definition: LutXml.h:37
std::string creationtag
Definition: LutXml.h:32
static std::string get_checksum(std::vector< unsigned int > &lut)
Definition: LutXml.cc:195
HcalSubdetector
Definition: HcalAssistant.h:31
void init(void)
Definition: LutXml.cc:64
std::string formatrevision
Definition: LutXml.h:34
const_iterator find(uint32_t) const
Definition: LutXml.cc:449
std::map< uint32_t, std::vector< unsigned int > > lut_map
Definition: LutXml.h:90
std::map< uint32_t, std::vector< unsigned int > >::const_iterator const_iterator
Definition: LutXml.h:71
std::vector< unsigned int > * getLutFast(uint32_t det_id)
Definition: LutXml.cc:70
XMLCh * brick
Definition: LutXml.h:78
int test_access(std::string filename)
Definition: LutXml.cc:249
Definition: Config.py:1
long double T
XERCES_CPP_NAMESPACE::DOMElement * brickElem
Definition: LutXml.h:87
const_iterator begin() const
Definition: LutXml.cc:445
int lut_type
Definition: LutXml.h:31
std::string creationstamp
Definition: LutXml.h:33
int fiberchan
Definition: LutXml.h:31
LutXml()
Definition: LutXml.cc:53
std::vector< uint64_t > mask
Definition: LutXml.h:38
const_iterator end() const
Definition: LutXml.cc:447