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
LutXml::LutXml
LutXml()
Definition: LutXml.cc:55
LutXml::_Config::creationtag
std::string creationtag
Definition: LutXml.h:33
LutXml::addParameter
XERCES_CPP_NAMESPACE::DOMElement * addParameter(std::string _name, std::string _type, std::string _value)
Definition: LutXml.cc:177
LutXml::create_lut_map
int create_lut_map(void)
Definition: LutXml.cc:338
LutXml::Config
struct LutXml::_Config Config
LutXml::_Config::mask
std::vector< uint64_t > mask
Definition: LutXml.h:40
LutXml::_Config::topbottom
int topbottom
Definition: LutXml.h:32
LutXml::_Config::slot
int slot
Definition: LutXml.h:32
LutXml::~LutXml
~LutXml() override
Definition: LutXml.cc:61
LutXml::end
const_iterator end() const
Definition: LutXml.cc:448
LutXml::const_iterator
std::map< uint32_t, std::vector< unsigned int > >::const_iterator const_iterator
Definition: LutXml.h:73
LutXml::add_checksum
XERCES_CPP_NAMESPACE::DOMElement * add_checksum(XERCES_CPP_NAMESPACE::DOMDocument *parent, Config &config)
Definition: LutXml.cc:159
LutXml::_Config::targetfirmware
std::string targetfirmware
Definition: LutXml.h:36
XMLDOMBlock
Definition: XMLDOMBlock.h:39
LutXml::_Config::generalizedindex
int generalizedindex
Definition: LutXml.h:37
LutXml::root
XMLCh * root
Definition: LutXml.h:79
LutXml::test_access
int test_access(std::string filename)
Definition: LutXml.cc:253
config
Definition: config.py:1
LutXml::init
void init(void)
Definition: LutXml.cc:66
LutXml::_Config::iphi
int iphi
Definition: LutXml.h:32
LutXml::_Config::lut_type
int lut_type
Definition: LutXml.h:32
LutXml::brickElem
XERCES_CPP_NAMESPACE::DOMElement * brickElem
Definition: LutXml.h:89
LutXml::get_checksum
static std::string get_checksum(std::vector< unsigned int > &lut)
Definition: LutXml.cc:199
LutXml::a_to_i
int a_to_i(char *inbuf)
Definition: LutXml.cc:327
LutXml::begin
const_iterator begin() const
Definition: LutXml.cc:446
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
LutXml::_Config::creationstamp
std::string creationstamp
Definition: LutXml.h:34
LutXml::_Config::weight
int weight
Definition: LutXml.h:38
LutXml::find
const_iterator find(uint32_t) const
Definition: LutXml.cc:450
LutXml::brick
XMLCh * brick
Definition: LutXml.h:80
LutXml::_Config::ieta
int ieta
Definition: LutXml.h:32
LutXml::_Config::crate
int crate
Definition: LutXml.h:32
LutXml::_Config::lut
std::vector< unsigned int > lut
Definition: LutXml.h:39
LutXml::getCurrentBrick
std::string & getCurrentBrick(void)
Definition: LutXml.cc:196
LutXml::_Config::depth
int depth
Definition: LutXml.h:32
LutXml::addLut
void addLut(Config &_config, XMLDOMBlock *checksums_xml=nullptr)
Definition: LutXml.cc:80
LutXml::getLutFast
std::vector< unsigned int > * getLutFast(uint32_t det_id)
Definition: LutXml.cc:72
LutXml::_Config::fiber
int fiber
Definition: LutXml.h:32
LutXml::_Config::_Config
_Config()
Definition: LutXml.cc:31
HcalSubdetector.h
XMLDOMBlock.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LutXml::_Config::fiberchan
int fiberchan
Definition: LutXml.h:32
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
LutXml::_Config::formatrevision
std::string formatrevision
Definition: LutXml.h:35
LutXml::_Config
Definition: LutXml.h:29
LutXml::lut_map
std::map< uint32_t, std::vector< unsigned int > > lut_map
Definition: LutXml.h:92
T
long double T
Definition: Basic3DVectorLD.h:48
LutXml::subdet_from_crate
HcalSubdetector subdet_from_crate(int crate, int slot, int fiber)
Definition: LutXml.cc:303
LutXml::_Config::infotype
std::string infotype
Definition: LutXml.h:31
Config
Definition: Config.py:1
LutXml
Definition: LutXml.h:27
LutXml::addData
XERCES_CPP_NAMESPACE::DOMElement * addData(std::string _elements, std::string _encoding, const T &_lut)
class-composition.parent
parent
Definition: class-composition.py:98