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