test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <stdint.h>
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  } Config;
43 
44  LutXml();
45  LutXml( XERCES_CPP_NAMESPACE::InputSource & _source );
47  virtual ~LutXml();
48 
49  void init( void );
50  void addLut( Config & _config, XMLDOMBlock * checksums_xml = 0 );
51  std::string & getCurrentBrick( void );
52 
53  std::vector<unsigned int> * getLutFast( uint32_t det_id );
54  //
55  //_____ following removed as a xalan-c component_____________________
56  //
57  //std::vector<unsigned int> getLut( int lut_type, int crate, int slot, int topbottom, int fiber, int fiber_channel );
58 
59  HcalSubdetector subdet_from_crate(int crate, int eta, int depth);
60  int a_to_i(char * inbuf);
61  int create_lut_map( void );
62 
63  static std::string get_checksum( std::vector<unsigned int> & lut );
64 
65  //
66  //_____ following removed as a xalan-c component_____________________
67  //
68  //int test_xpath( std::string filename );
70 
71  //LutXml & operator+=( const LutXml & other);
72 
73  //Iterators and find
74  typedef std::map<uint32_t,std::vector<unsigned int> >::const_iterator const_iterator;
75  const_iterator begin() const;
76  const_iterator end() const;
77  const_iterator find(uint32_t) const;
78 
79  protected:
80 
81  XMLCh * root;
82  XMLCh * brick;
83  XERCES_CPP_NAMESPACE::DOMElement * addParameter( std::string _name, std::string _type, std::string _value );
84  XERCES_CPP_NAMESPACE::DOMElement * addParameter( std::string _name, std::string _type, int _value );
85  XERCES_CPP_NAMESPACE::DOMElement * addData( std::string _elements, std::string _encoding, const std::vector<unsigned int>& _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 
96 
97 #endif
XERCES_CPP_NAMESPACE::DOMElement * addParameter(std::string _name, std::string _type, std::string _value)
Definition: LutXml.cc:304
std::string targetfirmware
Definition: LutXml.h:39
Definition: LutXml.h:27
int generalizedindex
Definition: LutXml.h:40
HcalSubdetector subdet_from_crate(int crate, int eta, int depth)
Definition: LutXml.cc:458
XMLCh * root
Definition: LutXml.h:81
XERCES_CPP_NAMESPACE::DOMElement * add_checksum(XERCES_CPP_NAMESPACE::DOMDocument *parent, Config &config)
Definition: LutXml.cc:280
std::map< uint32_t, std::vector< unsigned int > > lut_map
Definition: LutXml.h:92
int create_lut_map(void)
Definition: LutXml.cc:497
std::map< uint32_t, std::vector< unsigned int > >::const_iterator const_iterator
Definition: LutXml.h:74
struct LutXml::_Config Config
int a_to_i(char *inbuf)
Definition: LutXml.cc:486
std::string & getCurrentBrick(void)
Definition: LutXml.cc:330
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:338
HcalSubdetector
Definition: HcalAssistant.h:31
void init(void)
Definition: LutXml.cc:118
tuple lut
Definition: lumiPlot.py:244
std::string formatrevision
Definition: LutXml.h:38
const_iterator find(uint32_t) const
Definition: LutXml.cc:593
XERCES_CPP_NAMESPACE::DOMElement * addData(std::string _elements, std::string _encoding, const std::vector< unsigned int > &_lut)
Definition: LutXml.cc:253
virtual ~LutXml()
Definition: LutXml.cc:109
std::vector< unsigned int > * getLutFast(uint32_t det_id)
Definition: LutXml.cc:127
XMLCh * brick
Definition: LutXml.h:82
int test_access(std::string filename)
Definition: LutXml.cc:376
tuple filename
Definition: lut2db_cfg.py:20
XERCES_CPP_NAMESPACE::DOMElement * brickElem
Definition: LutXml.h:89
void addLut(Config &_config, XMLDOMBlock *checksums_xml=0)
Definition: LutXml.cc:210
const_iterator begin() const
Definition: LutXml.cc:585
int lut_type
Definition: LutXml.h:35
std::string creationstamp
Definition: LutXml.h:37
int fiberchan
Definition: LutXml.h:35
LutXml()
Definition: LutXml.cc:91
const_iterator end() const
Definition: LutXml.cc:589