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