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