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( 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  DOMElement * addParameter( std::string _name, std::string _type, std::string _value );
84  DOMElement * addParameter( std::string _name, std::string _type, int _value );
85  DOMElement * addData( std::string _elements, std::string _encoding, const std::vector<unsigned int>& _lut );
86 
87  DOMElement * add_checksum( DOMDocument * parent, Config & config );
88 
89  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
DOMElement * addParameter(std::string _name, std::string _type, std::string _value)
Definition: LutXml.cc:303
std::string targetfirmware
Definition: LutXml.h:39
Definition: LutXml.h:27
int generalizedindex
Definition: LutXml.h:40
list parent
Definition: dbtoconf.py:74
HcalSubdetector subdet_from_crate(int crate, int eta, int depth)
Definition: LutXml.cc:458
XMLCh * root
Definition: LutXml.h:81
std::map< uint32_t, std::vector< unsigned int > > lut_map
Definition: LutXml.h:92
int create_lut_map(void)
Definition: LutXml.cc:496
std::map< uint32_t, std::vector< unsigned int > >::const_iterator const_iterator
Definition: LutXml.h:74
T eta() const
struct LutXml::_Config Config
int a_to_i(char *inbuf)
Definition: LutXml.cc:485
std::string & getCurrentBrick(void)
Definition: LutXml.cc:329
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:337
HcalSubdetector
Definition: HcalAssistant.h:31
DOMElement * add_checksum(DOMDocument *parent, Config &config)
Definition: LutXml.cc:279
void init(void)
Definition: LutXml.cc:117
tuple lut
Definition: lumiPlot.py:244
std::string formatrevision
Definition: LutXml.h:38
const_iterator find(uint32_t) const
Definition: LutXml.cc:592
DOMElement * addData(std::string _elements, std::string _encoding, const std::vector< unsigned int > &_lut)
Definition: LutXml.cc:252
virtual ~LutXml()
Definition: LutXml.cc:108
DOMElement * brickElem
Definition: LutXml.h:89
std::vector< unsigned int > * getLutFast(uint32_t det_id)
Definition: LutXml.cc:126
XMLCh * brick
Definition: LutXml.h:82
int test_access(std::string filename)
Definition: LutXml.cc:375
tuple filename
Definition: lut2db_cfg.py:20
void addLut(Config &_config, XMLDOMBlock *checksums_xml=0)
Definition: LutXml.cc:209
const_iterator begin() const
Definition: LutXml.cc:584
int lut_type
Definition: LutXml.h:35
std::string creationstamp
Definition: LutXml.h:37
int fiberchan
Definition: LutXml.h:35
LutXml()
Definition: LutXml.cc:90
Helper class to handle FWLite file input sources.
const_iterator end() const
Definition: LutXml.cc:588