|
int | addHardware (std::map< std::string, std::map< std::string, std::map< std::string, std::map< int, std::string > > > > &hw_map) |
|
| HcalHardwareXml () |
|
| HcalHardwareXml (std::string _type) |
|
virtual | ~HcalHardwareXml () |
|
DOMElement * | add_element (DOMElement *parent, XMLCh *tagname, XMLCh *value) |
|
DOMDocument * | getDocument (void) |
|
DOMDocument * | getDocumentConst (void) const |
|
DOMDocument * | getNewDocument (std::string xmlFileName) |
|
std::string & | getString (void) |
|
std::string & | getString (DOMNode *_node) |
|
const char * | getTagAttribute (const std::string &tagName, const std::string &attrName, int _item=0) |
|
const char * | getTagValue (const std::string &tagName, int _item=0, DOMDocument *_document=NULL) |
|
const char * | getTagValue (const std::string &tagName, int _item, DOMElement *_document) |
|
std::string | getTimestamp (time_t _time) |
|
XMLDOMBlock & | operator+= (const XMLDOMBlock &other) |
|
void | parse (InputSource &_source) |
|
DOMNode * | setTagAttribute (const std::string &tagName, const std::string &attrName, const std::string &attrValue, int _item=0) |
|
DOMNode * | setTagAttribute (DOMElement *_elem, const std::string &tagName, const std::string &attrName, const std::string &attrValue, int _item=0) |
|
DOMNode * | setTagAttribute (const std::string &tagName, const std::string &attrName, const int &attrValue, int _item=0) |
|
DOMNode * | setTagAttribute (DOMElement *_elem, const std::string &tagName, const std::string &attrName, const int &attrValue, int _item=0) |
|
DOMNode * | setTagValue (const std::string &tagName, const std::string &tagValue, int _item=0, DOMDocument *_document=NULL) |
|
DOMNode * | setTagValue (DOMElement *_elem, const std::string &tagName, const std::string &tagValue, int _item=0) |
|
DOMNode * | setTagValue (const std::string &tagName, const int &tagValue, int _item=0, DOMDocument *_document=NULL) |
|
DOMNode * | setTagValue (DOMElement *_elem, const std::string &tagName, const int &tagValue, int _item=0) |
|
int | write (std::string target="stdout") |
|
| XMLDOMBlock () |
|
| XMLDOMBlock (std::string xmlFileName) |
|
| XMLDOMBlock (InputSource &_source) |
|
| XMLDOMBlock (std::string _root, int rootElementName) |
|
virtual | ~XMLDOMBlock () |
|
Description: <one line="" class="" summary>="">
Usage: <usage>
Definition at line 37 of file HcalHardwareXml.h.
int HcalHardwareXml::addHardware |
( |
std::map< std::string, std::map< std::string, std::map< std::string, std::map< int, std::string > > > > & |
hw_map | ) |
|
Definition at line 39 of file HcalHardwareXml.cc.
References addPart(), _HcalPart::barcode, begin, comment, gather_cfg::cout, end, first, alignBH_cfg::mode, partsElem, submit::rm, and edm::second().
43 std::map<std::string,int> double_entry;
45 std::map<std::string,std::map<std::string,std::map<std::string,std::map<int,std::string> > > >::const_iterator rbx_slot;
46 for (rbx_slot = hw_map .
begin(); rbx_slot != hw_map .
end(); rbx_slot++){
50 _p . kind_of_part =
"HCAL RBX Slot";
51 _p . name_label = rbx_slot ->
first;
53 DOMElement * rbx_slot_children_elem = (DOMElement *)rbx_slot_elem -> getElementsByTagName(XMLString::transcode(
"CHILDREN"))->item(0);
55 std::map<std::string,std::map<std::string,std::map<int,std::string> > >::const_iterator rbx;
56 for (rbx = rbx_slot->second .
begin(); rbx != rbx_slot->second .
end(); rbx++){
59 _p2 . kind_of_part =
"HCAL RBX";
60 _p2 . name_label = rbx ->
first;
61 DOMElement * rbx_elem =
addPart( rbx_slot_children_elem, _p2 );
62 DOMElement * rbx_children_elem = (DOMElement *)rbx_elem -> getElementsByTagName(XMLString::transcode(
"CHILDREN"))->item(0);
64 std::map<std::string,std::map<int,std::string> >::const_iterator
rm;
65 for (rm = rbx->second .
begin(); rm != rbx->second .
end(); rm++){
68 _p3 . kind_of_part =
"HCAL Readout Module";
69 _p3 . barcode = rm ->
first;
70 DOMElement * rm_elem =
addPart( rbx_children_elem, _p3 );
71 DOMElement * rm_children_elem = (DOMElement *)rm_elem -> getElementsByTagName(XMLString::transcode(
"CHILDREN"))->item(0);
73 std::map<int,std::string>::const_iterator qie;
74 for (qie = rm->second .
begin(); qie != rm->second .
end(); qie++){
77 _p4 . kind_of_part =
"HCAL QIE Card";
78 _p4 . barcode = qie ->
second;
79 _p4 .
comment =
"HCAL hardware remapping by Gena Kukartsev";
80 _p4 . attr_name =
"QIE Card Position";
81 std::stringstream _buffer;
83 _buffer << qie->first;
84 _p4 . attr_value = _buffer . str();
87 unsigned int _nqie = double_entry.size();
88 double_entry[_p4 . barcode]++;
89 if (double_entry.size() == _nqie){
90 std::cout <<
"QIE #" << _p4.
barcode <<
" found " << double_entry[_p4 . barcode] <<
"times!" << std::endl;
92 addPart( rm_children_elem, _p4 );
U second(std::pair< T, U > const &p)
DOMElement * addPart(DOMElement *parent, HcalPart &part)
DOMElement * HcalHardwareXml::addPart |
( |
DOMElement * |
parent, |
|
|
HcalPart & |
part |
|
) |
| |
|
private |
Definition at line 102 of file HcalHardwareXml.cc.
References _HcalPart::attr_name, _HcalPart::attr_value, _HcalPart::barcode, _HcalPart::comment, XMLDOMBlock::document, _HcalPart::kind_of_part, _HcalPart::mode, _HcalPart::name_label, and findQualityFiles::size.
Referenced by addHardware().
105 DOMElement *
child =
document -> createElement( XMLString::transcode(
"PART" ) );
106 child -> setAttribute( XMLString::transcode(
"mode"), XMLString::transcode(part.
mode.c_str()) );
108 DOMElement * kindElem =
document -> createElement( XMLString::transcode(
"KIND_OF_PART" ) );
109 DOMElement * nameElem =
document -> createElement( XMLString::transcode(
"NAME_LABEL" ) );
110 DOMElement * barElem =
document -> createElement( XMLString::transcode(
"BARCODE" ) );
111 DOMElement * childrenElem =
document -> createElement( XMLString::transcode(
"CHILDREN" ) );
112 DOMElement * commentElem =
document -> createElement( XMLString::transcode(
"COMMENT_DESCRIPTION" ) );
114 child -> appendChild( kindElem );
116 kindElem -> appendChild( _kind );
118 child -> appendChild( nameElem );
119 DOMText * _name =
document -> createTextNode( XMLString::transcode(part.
name_label.c_str()));
120 nameElem -> appendChild( _name );
123 child -> appendChild( barElem );
124 DOMText * _code =
document -> createTextNode( XMLString::transcode(part.
barcode.c_str()));
125 barElem -> appendChild( _code );
128 child -> appendChild( commentElem );
129 DOMText * _comment =
document -> createTextNode( XMLString::transcode(part.
comment.c_str()));
130 commentElem -> appendChild( _comment );
133 DOMElement * predefined_attr_elem =
document -> createElement( XMLString::transcode(
"PREDEFINED_ATTRIBUTES" ) );
134 child -> appendChild( predefined_attr_elem );
135 DOMElement * attr_elem =
document -> createElement( XMLString::transcode(
"ATTRIBUTE" ) );
136 predefined_attr_elem -> appendChild( attr_elem );
137 DOMElement * attr_name_elem =
document -> createElement( XMLString::transcode(
"NAME" ) );
138 attr_elem -> appendChild( attr_name_elem );
139 DOMText * _name =
document -> createTextNode( XMLString::transcode(part.
attr_name.c_str()));
140 attr_name_elem -> appendChild( _name );
141 DOMElement * attr_value_elem =
document -> createElement( XMLString::transcode(
"VALUE" ) );
142 attr_elem -> appendChild( attr_value_elem );
143 DOMText * _value =
document -> createTextNode( XMLString::transcode(part.
attr_value.c_str()));
144 attr_value_elem -> appendChild( _value );
146 child -> appendChild( childrenElem );
148 parent -> appendChild( child );
tuple size
Write out results.