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 // $Id: LutXml.h,v 1.4 2009/07/16 16:36:11 kukartse Exp $
20 //
21 
22 #include <vector>
23 #include <map>
26 #include <stdint.h>
27 
28 class LutXml : public XMLDOMBlock
29 {
30 
31  public:
32 
33  typedef struct _Config
34  {
35  _Config();
37  std::string creationtag;
38  std::string creationstamp;
39  std::string formatrevision;
40  std::string targetfirmware;
42  std::vector<unsigned int> lut;
43  } Config;
44 
45  LutXml();
46  LutXml( InputSource & _source );
47  LutXml( std::string filename );
48  virtual ~LutXml();
49 
50  void init( void );
51  void addLut( Config & _config, XMLDOMBlock * checksums_xml = 0 );
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 
60  HcalSubdetector subdet_from_crate(int crate, int eta, int depth);
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 );
70  int test_access( 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  DOMElement * addParameter( std::string _name, std::string _type, std::string _value );
85  DOMElement * addParameter( std::string _name, std::string _type, int _value );
86  DOMElement * addData( std::string _elements, std::string _encoding, std::vector<unsigned int> _lut );
87 
88  DOMElement * add_checksum( DOMDocument * parent, Config & config );
89 
90  DOMElement * brickElem;
91 
92  //std::map<uint32_t,std::vector<unsigned int> > * lut_map;
93  std::map<uint32_t,std::vector<unsigned int> > lut_map;
94 
95 };
96 
97 
98 #endif
DOMElement * addParameter(std::string _name, std::string _type, std::string _value)
Definition: LutXml.cc:304
std::string targetfirmware
Definition: LutXml.h:40
Definition: LutXml.h:28
int generalizedindex
Definition: LutXml.h:41
list parent
Definition: dbtoconf.py:74
HcalSubdetector subdet_from_crate(int crate, int eta, int depth)
Definition: LutXml.cc:459
XMLCh * root
Definition: LutXml.h:82
std::map< uint32_t, std::vector< unsigned int > > lut_map
Definition: LutXml.h:93
int create_lut_map(void)
Definition: LutXml.cc:497
std::map< uint32_t, std::vector< unsigned int > >::const_iterator const_iterator
Definition: LutXml.h:75
T eta() const
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:36
std::vector< unsigned int > lut
Definition: LutXml.h:42
DOMElement * addData(std::string _elements, std::string _encoding, std::vector< unsigned int > _lut)
Definition: LutXml.cc:253
std::string creationtag
Definition: LutXml.h:37
static std::string get_checksum(std::vector< unsigned int > &lut)
Definition: LutXml.cc:338
HcalSubdetector
Definition: HcalAssistant.h:32
DOMElement * add_checksum(DOMDocument *parent, Config &config)
Definition: LutXml.cc:280
void init(void)
Definition: LutXml.cc:118
std::string formatrevision
Definition: LutXml.h:39
const_iterator find(uint32_t) const
Definition: LutXml.cc:596
virtual ~LutXml()
Definition: LutXml.cc:109
DOMElement * brickElem
Definition: LutXml.h:90
std::vector< unsigned int > * getLutFast(uint32_t det_id)
Definition: LutXml.cc:127
XMLCh * brick
Definition: LutXml.h:83
int test_access(std::string filename)
Definition: LutXml.cc:376
tuple filename
Definition: lut2db_cfg.py:20
void addLut(Config &_config, XMLDOMBlock *checksums_xml=0)
Definition: LutXml.cc:210
const_iterator begin() const
Definition: LutXml.cc:588
int lut_type
Definition: LutXml.h:36
std::string creationstamp
Definition: LutXml.h:38
int fiberchan
Definition: LutXml.h:36
LutXml()
Definition: LutXml.cc:91
Helper class to handle FWLite file input sources.
const_iterator end() const
Definition: LutXml.cc:592