CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LutXml.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CaloOnlineTools/HcalOnlineDb
4 // Class : LutXml
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Gena Kukartsev, kukarzev@fnal.gov
10 // Created: Tue Mar 18 14:30:20 CDT 2008
11 // $Id: LutXml.cc,v 1.7 2013/04/19 22:21:02 wmtan Exp $
12 //
13 
14 #include <iostream>
15 #include <string>
16 #include <vector>
17 #include <sstream>
18 #include <iconv.h>
19 #include <sys/time.h>
20 
27 
28 using namespace std;
29 
30 //
31 //_____ following removed as a xalan-c component_____________________
32 //
33 // xalan-c init
34 //#include <xalanc/Include/PlatformDefinitions.hpp>
35 //#include <xalanc/XPath/XPathEvaluator.hpp>
36 //#include <xercesc/framework/LocalFileInputSource.hpp>
37 //XALAN_USING_XERCES(XMLPlatformUtils)
38 //#include <xalanc/XSLT/XSLTInputSource.hpp>
39 //#include <xalanc/PlatformSupport/XSLException.hpp>
40 //#include <xalanc/DOMSupport/XalanDocumentPrefixResolver.hpp>
41 //#include <xalanc/XPath/XObject.hpp>
42 //#include <xalanc/XalanSourceTree/XalanSourceTreeDOMSupport.hpp>
43 //#include <xalanc/XalanSourceTree/XalanSourceTreeInit.hpp>
44 //#include <xalanc/XalanSourceTree/XalanSourceTreeParserLiaison.hpp>
45 //using namespace xalanc;
46 
47 
48 
49 /*
50 LutXml & LutXml::operator+=( const LutXml & other)
51 {
52  DOMNodeList * _children = other.getDocumentConst()->getChildNodes();
53  int _length = _children->getLength();
54  std::cout << "Nodes added:" << _length << std::endl;
55  DOMNode * _node;
56  for(int i=0;i!=_length;i++){
57  _node = _children->item(i)->cloneNode(true);
58  this->getDocument()->getDocumentElement()->appendChild(_node);
59  }
60  return *this;
61 }
62 */
63 
64 
65 
67 {
68  ieta = -1000;
69  iphi = -1000;
70  depth = -1;
71  crate = -1;
72  slot = -1;
73  topbottom = -1;
74  fiber = -1;
75  fiberchan = -1;
76  lut_type = -1;
77  creationtag = "default_tag";
78 
79  char timebuf[50];
80  time_t _time = time( NULL );
81  //time_t _time = 1193697120;
82  //strftime( timebuf, 50, "%c", gmtime( &_time ) );
83  strftime( timebuf, 50, "%Y-%m-%d %H:%M:%S", gmtime( &_time ) );
84  creationstamp = timebuf;
85 
86  formatrevision = "default_revision";
87  targetfirmware = "default_revision";
88  generalizedindex = -1;
89 }
90 
91 LutXml::LutXml() : XMLDOMBlock( "CFGBrickSet", 1 )
92 {
93  init();
94 }
95 
96 
97 LutXml::LutXml(InputSource & _source ) : XMLDOMBlock( _source )
98 {
99  init();
100 }
101 
102 
104 {
105  init();
106 }
107 
108 
110 {
111  //delete brickElem; // belongs to document that belongs to parser???
114  //delete lut_map;
115 }
116 
117 
118 void LutXml::init( void )
119 {
120  root = XMLString::transcode("CFGBrickSet");
121  brick = XMLString::transcode("CFGBrick");
122  brickElem = 0;
123  //lut_map = 0;
124 }
125 
126 
127 std::vector<unsigned int> * LutXml::getLutFast( uint32_t det_id ){
128  /*
129  if (lut_map){
130  return &(*lut_map)[det_id];
131  }
132  else{
133  std::cerr << "LUT not found, null pointer is returned" << std::endl;
134  return 0;
135  }
136  */
137  if (lut_map.find(det_id) != lut_map.end()) return &(lut_map)[det_id];
138  std::cerr << "LUT not found, null pointer is returned" << std::endl;
139  return 0;
140 }
141 
142 //
143 //_____ following removed as a xalan-c component_____________________
144 //
145 /*
146 std::vector<unsigned int> LutXml::getLut( int lut_type, int crate, int slot, int topbottom, int fiber, int fiber_channel ){
147  std::vector<unsigned int> _lut;
148  //write();
149 
150  std::string _context = "/CFGBrickSet";
151  char buf[1024];
152  sprintf(buf,
153  "CFGBrick[Parameter[@name='LUT_TYPE']=%d and Parameter[@name='CRATE']=%d and Parameter[@name='SLOT']=%d and Parameter[@name='TOPBOTTOM']=%d and Parameter[@name='FIBER']=%d and Parameter[@name='FIBERCHAN']=%d]/Data",
154  lut_type, crate, slot, topbottom, fiber, fiber_channel);
155  std::string _expression(buf);
156 
157  std::cout << _expression << std::endl;
158 
159  const XObjectPtr theResult = eval_xpath(_context,_expression);
160 
161  if(theResult.null() == false){
162  std::cout << std::endl << theResult->str() << std::endl;
163  }
164 
165  const XalanDOMString & _string = theResult->str();
166  int _string_length = _string.length();
167  XalanVector<char> _str;
168  _string.transcode(_str);
169  unsigned int _base = 16;
170  unsigned int _item=0;
171  for (int i=0; i!=_string_length; i++){
172  bool _range;
173  char ch_cur = _str[i];
174  if (_base==16) _range = (ch_cur>='0' and ch_cur<='9') || (ch_cur>='a' and ch_cur<='f') || (ch_cur>='A' and ch_cur<='F');
175  else if (_base==10) _range = (ch_cur>='0' and ch_cur<='9');
176  if ( _range ){
177  if ( ch_cur>='a' and ch_cur<='f' ) ch_cur += 10-'a';
178  else if ( ch_cur>='A' and ch_cur<='F' ) ch_cur += 10-'A';
179  else if ( ch_cur>='0' and ch_cur<='9' ) ch_cur += -'0';
180  _item = _item*_base;
181  _item += ch_cur;
182  bool last_digit = false;
183  if ( (i+1)==_string_length ) last_digit=true;
184  else{
185  char ch_next = _str[i+1];
186  bool _range_next;
187  if (_base==16) _range_next = (ch_next>='0' and ch_next<='9') || (ch_next>='a' and ch_next<='f') || (ch_next>='A' and ch_next<='F');
188  else if (_base==10) _range_next = (ch_next>='0' and ch_next<='9');
189  if ( !_range_next ) last_digit=true;
190  }
191  if (last_digit){
192  _lut.push_back(_item);
193  _item=0;
194  }
195  }
196  }
197 
198  std::cout << "### ";
199  for (std::vector<unsigned int>::const_iterator l=_lut.begin(); l!=_lut.end(); l++){
200  std::cout << *l << " ";
201  }
202  std::cout << std::endl << std::endl;
203 
204  return _lut;
205 }
206 */
207 
208 
209 // checksums_xml is 0 by default
210 void LutXml::addLut( LutXml::Config & _config, XMLDOMBlock * checksums_xml )
211 {
212  DOMElement * rootElem = document -> getDocumentElement();
213 
214  brickElem = document->createElement( XMLProcessor::_toXMLCh("CFGBrick") );
215  rootElem->appendChild(brickElem);
216 
217  addParameter( "IETA", "int", _config.ieta );
218  addParameter( "IPHI", "int", _config.iphi );
219  addParameter( "CRATE", "int", _config.crate );
220  addParameter( "SLOT", "int", _config.slot );
221  addParameter( "TOPBOTTOM", "int", _config.topbottom );
222  addParameter( "LUT_TYPE", "int", _config.lut_type );
223  addParameter( "CREATIONTAG", "string", _config.creationtag );
224  addParameter( "CREATIONSTAMP", "string", _config.creationstamp );
225  addParameter( "FORMATREVISION", "string", _config.formatrevision );
226  addParameter( "TARGETFIRMWARE", "string", _config.targetfirmware );
227  addParameter( "GENERALIZEDINDEX", "int", _config.generalizedindex );
228  addParameter( "CHECKSUM", "string", get_checksum( _config.lut ) );
229 
230  if(_config.lut_type==1){ // linearizer LUT
231  addParameter( "FIBER", "int", _config.fiber );
232  addParameter( "FIBERCHAN", "int", _config.fiberchan );
233  addParameter( "DEPTH", "int", _config.depth );
234  addData( "128", "hex", _config.lut );
235  }
236  else if(_config.lut_type==2){ // compression LUT
237  addParameter( "SLB", "int", _config.fiber );
238  addParameter( "SLBCHAN", "int", _config.fiberchan );
239  addData( "1024", "hex", _config.lut );
240  }
241  else{
242  std::cout << "Unknown LUT type...produced XML will be incorrect" << std::endl;
243  }
244 
245  // if the pointer to the checksums XML was given,
246  // add the checksum to it
247  // checksums_xml is 0 unless explicitely given
248  if ( checksums_xml ){
249  add_checksum( checksums_xml->getDocument(), _config );
250  }
251 }
252 
253 DOMElement * LutXml::addData( std::string _elements, std::string _encoding, const std::vector<unsigned int>& _lut )
254 {
255  DOMElement * child = document -> createElement( XMLProcessor::_toXMLCh( "Data" ) );
256  child -> setAttribute( XMLProcessor::_toXMLCh("elements"), XMLProcessor::_toXMLCh( _elements ) );
257  child -> setAttribute( XMLProcessor::_toXMLCh("encoding"), XMLProcessor::_toXMLCh( _encoding ) );
258 
259  std::stringstream buf;
260 
261  for (std::vector<unsigned int>::const_iterator iter = _lut.begin();iter!=_lut.end();iter++){
262  char buf2[8];
263  sprintf(buf2,"%x",(*iter));
264  buf << buf2 << " ";
265  //buf << (*iter) << " ";
266  }
267 
268  std::string _value = buf . str();
269 
270  DOMText * data_value = document -> createTextNode( XMLProcessor::_toXMLCh(_value));
271  child -> appendChild( data_value );
272 
273  brickElem -> appendChild( child );
274 
275  return child;
276 }
277 
278 
279 
280 DOMElement * LutXml::add_checksum( DOMDocument * parent, Config & config )
281 {
282  //template
283  // <Data crate='0' slot='2' fpga='1' fiber='1' fiberchan='0' luttype='1' elements='1' encoding='hex'>c6cf91b39e3bff21623fb7366efda1fd</Data>
284  //
285  DOMElement * child = parent -> createElement( XMLProcessor::_toXMLCh( "Data" ) );
286  child -> setAttribute( XMLProcessor::_toXMLCh("crate"), XMLProcessor::_toXMLCh( config.crate ) );
287  child -> setAttribute( XMLProcessor::_toXMLCh("slot"), XMLProcessor::_toXMLCh( config.slot ) );
288  child -> setAttribute( XMLProcessor::_toXMLCh("fpga"), XMLProcessor::_toXMLCh( config.topbottom ) );
289  child -> setAttribute( XMLProcessor::_toXMLCh("fiber"), XMLProcessor::_toXMLCh( config.fiber ) );
290  child -> setAttribute( XMLProcessor::_toXMLCh("fiberchan"), XMLProcessor::_toXMLCh( config.fiberchan ) );
291  child -> setAttribute( XMLProcessor::_toXMLCh("luttype"), XMLProcessor::_toXMLCh( config.lut_type ) );
292  child -> setAttribute( XMLProcessor::_toXMLCh("elements"), XMLProcessor::_toXMLCh( "1" ) );
293  child -> setAttribute( XMLProcessor::_toXMLCh("encoding"), XMLProcessor::_toXMLCh( "hex" ) );
294  DOMText * checksum_value = parent -> createTextNode( XMLProcessor::_toXMLCh( get_checksum(config.lut) ));
295  child -> appendChild( checksum_value );
296 
297  parent -> getDocumentElement() -> appendChild( child );
298 
299  return child;
300 }
301 
302 
303 
304 DOMElement * LutXml::addParameter( std::string _name, std::string _type, std::string _value )
305 {
306  DOMElement * child = document -> createElement( XMLProcessor::_toXMLCh( "Parameter" ) );
307  child -> setAttribute( XMLProcessor::_toXMLCh("name"), XMLProcessor::_toXMLCh( _name ) );
308  child -> setAttribute( XMLProcessor::_toXMLCh("type"), XMLProcessor::_toXMLCh( _type ) );
309  DOMText * parameter_value = document -> createTextNode( XMLProcessor::_toXMLCh(_value));
310  child -> appendChild( parameter_value );
311 
312  brickElem -> appendChild( child );
313 
314  return child;
315 }
316 
317 
318 
319 DOMElement * LutXml::addParameter( std::string _name, std::string _type, int _value )
320 {
321  char buf[128];
322  sprintf(buf, "%d", _value);
323  std::string str_value = buf;
324  return addParameter( _name, _type, str_value );
325 }
326 
327 
328 
329 
331 {
332  return getString( brickElem );
333 }
334 
335 
336 
337 // do MD5 checksum
338 std::string LutXml::get_checksum( std::vector<unsigned int> & lut )
339 {
340  std::stringstream result;
341  md5_state_t md5er;
342  md5_byte_t digest[16];
343  md5_init(&md5er);
344  // linearizer LUT:
345  if ( lut . size() == 128 ){
346  unsigned char tool[2];
347  for (int i=0; i<128; i++) {
348  tool[0]=lut[i]&0xFF;
349  tool[1]=(lut[i]>>8)&0xFF;
350  md5_append(&md5er,tool,2);
351  }
352  }
353  // compression LUT:
354  else if ( lut . size() == 1024 ){
355  unsigned char tool;
356  for (int i=0; i<1024; i++) {
357  tool=lut[i]&0xFF;
358  md5_append(&md5er,&tool,1);
359  }
360  }
361  else{
362  std::cout << "ERROR: irregular LUT size, do not know how to compute checksum, exiting..." << std::endl;
363  exit(-1);
364  }
365  md5_finish(&md5er,digest);
366  for (int i=0; i<16; i++) result << std::hex << (((int)(digest[i]))&0xFF);
367 
368  //std::cout << "CHECKSUM: ";
369  //std::cout << result . str();
370  //std::cout << std::endl;
371 
372  return result . str();
373 }
374 
375 
377  //create_lut_map();
378  //std::cout << "Created map size: " << lut_map->size() << std::endl;
379  std::cout << "Created map size: " << lut_map.size() << std::endl;
380 
381  struct timeval _t;
382  gettimeofday( &_t, NULL );
383  double _time =(double)(_t . tv_sec) + (double)(_t . tv_usec)/1000000.0;
384 
385  HcalEmap _emap("./backup/official_emap_v6.04_080905.txt");
386  std::vector<HcalEmap::HcalEmapRow> & _map = _emap.get_map();
387  std::cout << "HcalEmap contains " << _map . size() << " entries" << std::endl;
388 
389  int _counter=0;
390  for (std::vector<HcalEmap::HcalEmapRow>::const_iterator row=_map.begin(); row!=_map.end(); row++){
391  if (row->subdet=="HB"){
392  HcalDetId det_id(HcalBarrel,row->ieta,row->iphi,row->idepth);
393  uint32_t raw_id = det_id.rawId();
394  std::vector<unsigned int> * l = getLutFast(raw_id);
395  if (l) _counter++;
396  }
397  if (row->subdet=="HE"){
398  HcalDetId det_id(HcalEndcap,row->ieta,row->iphi,row->idepth);
399  uint32_t raw_id = det_id.rawId();
400  std::vector<unsigned int> * l = getLutFast(raw_id);
401  if (l) _counter++;
402  }
403  if (row->subdet=="HF"){
404  HcalDetId det_id(HcalForward,row->ieta,row->iphi,row->idepth);
405  uint32_t raw_id = det_id.rawId();
406  std::vector<unsigned int> * l = getLutFast(raw_id);
407  if (l) _counter++;
408  }
409  if (row->subdet=="HO"){
410  HcalDetId det_id(HcalOuter,row->ieta,row->iphi,row->idepth);
411  uint32_t raw_id = det_id.rawId();
412  std::vector<unsigned int> * l = getLutFast(raw_id);
413  if (l) _counter++;
414  }
415  }
416  gettimeofday( &_t, NULL );
417  std::cout << "access to " << _counter << " HCAL channels took: " << (double)(_t . tv_sec) + (double)(_t . tv_usec)/1000000.0 - _time << "sec" << std::endl;
418 
419  //std::cout << std::endl;
420  //for (std::vector<unsigned int>::const_iterator i=l->begin();i!=l->end();i++){
421  // std::cout << *i << " ";
422  //}
423  //std::cout << std::endl;
424 
425  return 0;
426 }
427 
428 //
429 //_____ following removed as a xalan-c component_____________________
430 //
431 /*
432 int LutXml::test_xpath( std::string filename ){
433  // http://svn.apache.org/repos/asf/xalan/c/tags/Xalan-C_1_10_0/samples/SimpleXPathAPI/SimpleXPathAPI.cpp
434 
435  XMLProcessor::getInstance();
436 
437  read_xml_file_xalan( filename );
438 
439  std::string _context = "/CFGBrickSet";
440  //std::string _expression = "CFGBrick[Parameter[@name='IETA']=-1 and Parameter[@name='IPHI']=19]/Data";
441  std::string _expression = "CFGBrick[Parameter[@name='IETA']=-1]/Data";
442  std::cout << _expression << std::endl;
443 
444  const XObjectPtr theResult = eval_xpath(_context,_expression);
445 
446  if(theResult.null() == false){
447  std::cout << "Number of nodes: " << theResult->nodeset().getLength() << std::endl;
448 
449  std::cout << "The std::string value of the result is:"
450  << std::endl
451  << theResult->str()
452  << std::endl
453  << std::endl;
454  }
455  return 0;
456 }
457 */
458 
459 HcalSubdetector LutXml::subdet_from_crate(int crate, int eta, int depth){
461  // HBHE: 0,1,4,5,10,11,14,15,17
462  // HF: 2,9,12
463  // HO: 3,6,7,13
464 
465  if (crate==2 || crate==9 || crate==12) result=HcalForward;
466  else if (crate==3 || crate==6 || crate==7 || crate==13) result=HcalOuter;
467  else if (crate==0 || crate==1 || crate==4 || crate==5 || crate==10 || crate==11 || crate==14 || crate==15 || crate==17){
468  if (eta<16) result=HcalBarrel;
469  else if (eta>16) result=HcalEndcap;
470  else if (eta==16 && depth!=3) result=HcalBarrel;
471  else if (eta==16 && depth==3) result=HcalEndcap;
472  else{
473  std::cerr << "Impossible to determine HCAL subdetector!!!" << std::endl;
474  exit(-1);
475  }
476  }
477  else{
478  std::cerr << "Impossible to determine HCAL subdetector!!!" << std::endl;
479  exit(-1);
480  }
481 
482  return result;
483 }
484 
485 
486 int LutXml::a_to_i(char * inbuf){
487  int result;
488  sscanf(inbuf,"%d",&result);
489  return result;
490 }
491 
492 // organize all LUTs in XML into a map for fast access
493 //
494 // FIXME: uses hardcoded CRATE-to-subdetector mapping
495 // FIXME: it would be better to use some official map
496 //
498  //delete lut_map;
499  lut_map.clear();
500  //lut_map = new std::map<uint32_t,std::vector<unsigned int> >();
501 
502  if (document){
503  //DOMElement * rootElem =
504  DOMNodeList * brick_list = document->getDocumentElement()->getElementsByTagName(brick);
505  int n_of_bricks = brick_list->getLength();
506  for(int i=0; i!=n_of_bricks; i++){
507  DOMElement * aBrick = (DOMElement *)(brick_list->item(i));
508  DOMNodeList * par_list = aBrick->getElementsByTagName(XMLString::transcode("Parameter"));
509  int n_of_par = par_list->getLength();
510  int ieta=-99;
511  int iphi=-99;
512  int depth=-99;
513  int crate=-99;
514  int lut_type=-99;
515  HcalSubdetector subdet;
516  for(int j=0; j!=n_of_par; j++){
517  //std::cout << "DEBUG: i,j: " << i << ", " << j << std::endl;
518  DOMElement * aPar = (DOMElement *)(par_list->item(j));
519  char * aName = XMLString::transcode( aPar->getAttribute(XMLProcessor::_toXMLCh("name")) );
520  if ( strcmp(aName, "IETA")==0 ) ieta=a_to_i(XMLString::transcode(aPar->getFirstChild()->getNodeValue()));
521  if ( strcmp(aName, "IPHI")==0 ) iphi=a_to_i(XMLString::transcode(aPar->getFirstChild()->getNodeValue()));
522  if ( strcmp(aName, "DEPTH")==0 ) depth=a_to_i(XMLString::transcode(aPar->getFirstChild()->getNodeValue()));
523  if ( strcmp(aName, "CRATE")==0 ) crate=a_to_i(XMLString::transcode(aPar->getFirstChild()->getNodeValue()));
524  if ( strcmp(aName, "LUT_TYPE")==0 ) lut_type=a_to_i(XMLString::transcode(aPar->getFirstChild()->getNodeValue()));
525  }
526  subdet=subdet_from_crate(crate,abs(ieta),depth);
527  //std::cerr << "DEBUG: eta,phi,depth,crate,type,subdet: " << ieta << ", " << iphi << ", " << depth << ", " << crate << ", " << lut_type << ", " << subdet << std::endl;
528  DOMElement * _data = (DOMElement *)(aBrick->getElementsByTagName(XMLString::transcode("Data"))->item(0));
529  char * _str = XMLString::transcode(_data->getFirstChild()->getNodeValue());
530  //std::cout << _str << std::endl;
531  //
532  // get the LUT vector
533  int _string_length = strlen(_str);
534  std::vector<unsigned int> _lut;
535  unsigned int _base = 16;
536  unsigned int _item=0;
537  for (int i=0; i!=_string_length; i++){
538  bool _range;
539  char ch_cur = _str[i];
540  if (_base==16) _range = (ch_cur>='0' and ch_cur<='9') || (ch_cur>='a' and ch_cur<='f') || (ch_cur>='A' and ch_cur<='F');
541  else if (_base==10) _range = (ch_cur>='0' and ch_cur<='9');
542  if ( _range ){
543  if ( ch_cur>='a' and ch_cur<='f' ) ch_cur += 10-'a';
544  else if ( ch_cur>='A' and ch_cur<='F' ) ch_cur += 10-'A';
545  else if ( ch_cur>='0' and ch_cur<='9' ) ch_cur += -'0';
546  _item = _item*_base;
547  _item += ch_cur;
548  bool last_digit = false;
549  if ( (i+1)==_string_length ) last_digit=true;
550  else{
551  char ch_next = _str[i+1];
552  bool _range_next;
553  if (_base==16) _range_next = (ch_next>='0' and ch_next<='9') || (ch_next>='a' and ch_next<='f') || (ch_next>='A' and ch_next<='F');
554  else if (_base==10) _range_next = (ch_next>='0' and ch_next<='9');
555  if ( !_range_next ) last_digit=true;
556  }
557  if (last_digit){
558  _lut.push_back(_item);
559  _item=0;
560  }
561  }
562  }
564  //std::cout << _lut[127] << std::endl;
565  // filling the map
566  uint32_t _key = 0;
567  if (lut_type==1){
568  HcalDetId _id(subdet,ieta,iphi,depth);
569  _key = _id.rawId();
570  }
571  else if (lut_type==2){
572  HcalTrigTowerDetId _id(ieta,iphi);
573  _key = _id.rawId();
574  }
575  //lut_map->insert(std::pair<uint32_t,std::vector<unsigned int> >(_key,_lut));
576  lut_map.insert(std::pair<uint32_t,std::vector<unsigned int> >(_key,_lut));
577  }
578  }
579  else{
580  std::cerr << "XML file with LUTs is not loaded, cannot create map!" << std::endl;
581  }
582 
583 
584 
585  return 0;
586 }
587 
589  return lut_map.begin();
590 }
591 
593  return lut_map.end();
594 }
595 
597  return lut_map.find(id);
598 }
void md5_init(md5_state_t *pms)
DOMElement * addParameter(std::string _name, std::string _type, std::string _value)
Definition: LutXml.cc:304
int i
Definition: DBlmapReader.cc:9
std::string targetfirmware
Definition: LutXml.h:40
DOMDocument * document
Definition: XMLDOMBlock.h:98
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
#define abs(x)
Definition: mlp_lapack.h:159
#define NULL
Definition: scimark2.h:8
std::map< uint32_t, std::vector< unsigned int > >::const_iterator const_iterator
Definition: LutXml.h:75
T eta() const
int a_to_i(char *inbuf)
Definition: LutXml.cc:486
std::string & getCurrentBrick(void)
Definition: LutXml.cc:330
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
int topbottom
Definition: LutXml.h:36
std::string & getString(void)
Definition: XMLDOMBlock.cc:460
std::vector< unsigned int > lut
Definition: LutXml.h:42
void md5_finish(md5_state_t *pms, md5_byte_t digest[16])
std::string creationtag
Definition: LutXml.h:37
tuple result
Definition: query.py:137
DOMDocument * getDocument(void)
Definition: XMLDOMBlock.cc:313
static std::string get_checksum(std::vector< unsigned int > &lut)
Definition: LutXml.cc:338
HcalSubdetector
Definition: HcalAssistant.h:32
int j
Definition: DBlmapReader.cc:9
DOMElement * add_checksum(DOMDocument *parent, Config &config)
Definition: LutXml.cc:280
void init(void)
Definition: LutXml.cc:118
tuple lut
Definition: lumiPlot.py:244
std::string formatrevision
Definition: LutXml.h:39
const_iterator find(uint32_t) const
Definition: LutXml.cc:596
unsigned char md5_byte_t
Definition: md5.h:63
DOMElement * addData(std::string _elements, std::string _encoding, const std::vector< unsigned int > &_lut)
Definition: LutXml.cc:253
virtual ~LutXml()
Definition: LutXml.cc:109
DOMElement * brickElem
Definition: LutXml.h:90
std::vector< HcalEmap::HcalEmapRow > & get_map(void)
Definition: HcalEmap.cc:73
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
std::vector< unsigned int > * getLutFast(uint32_t det_id)
Definition: LutXml.cc:127
tuple targetfirmware
Definition: lut2db_cfg.py:26
void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
XMLCh * brick
Definition: LutXml.h:83
int test_access(std::string filename)
Definition: LutXml.cc:376
tuple filename
Definition: lut2db_cfg.py:20
tuple cout
Definition: gather_cfg.py:121
tuple creationtag
Definition: lut2db_cfg.py:27
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
tuple size
Write out results.
Helper class to handle FWLite file input sources.
const_iterator end() const
Definition: LutXml.cc:592