CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Member Functions
LMapLoader Class Reference

#include <CaloOnlineTools/HcalOnlineDb/interface/LMapLoader.h>

Inheritance diagram for LMapLoader:
XMLDOMBlock

Classes

struct  _LMapRowHBEF
 
struct  _LMapRowHO
 

Public Types

typedef struct
LMapLoader::_LMapRowHBEF 
LMapRowHBEF
 
typedef struct
LMapLoader::_LMapRowHO 
LMapRowHO
 

Public Member Functions

int addLMapHBEFDataset (LMapRowHBEF *row, std::string templateFileName)
 
int addLMapHODataset (LMapRowHO *row, std::string templateFileName)
 
int createLMapHBEFXMLBase (void)
 
 LMapLoader ()
 
 LMapLoader (std::string templateLoaderBase)
 
virtual ~LMapLoader ()
 
- Public Member Functions inherited from XMLDOMBlock
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)
 
XMLDOMBlockoperator+= (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 ()
 

Private Member Functions

 LMapLoader (const LMapLoader &)
 
const LMapLoaderoperator= (const LMapLoader &)
 

Additional Inherited Members

- Protected Member Functions inherited from XMLDOMBlock
int init (std::string _root)
 
- Protected Attributes inherited from XMLDOMBlock
DOMDocument * document
 
ErrorHandler * errHandler
 
XercesDOMParser * parser
 
std::string * the_string
 
std::string theFileName
 
XMLProcessortheProcessor
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 30 of file LMapLoader.h.

Member Typedef Documentation

Constructor & Destructor Documentation

LMapLoader::LMapLoader ( )

Definition at line 33 of file LMapLoader.cc.

References createLMapHBEFXMLBase().

33  : XMLDOMBlock( "FullLmapBase.xml" )
34 {
36 }
int createLMapHBEFXMLBase(void)
Definition: LMapLoader.cc:43
LMapLoader::LMapLoader ( std::string  templateLoaderBase)

Definition at line 38 of file LMapLoader.cc.

References createLMapHBEFXMLBase().

38  : XMLDOMBlock( templateLoaderBase )
39 {
41 }
int createLMapHBEFXMLBase(void)
Definition: LMapLoader.cc:43
LMapLoader::~LMapLoader ( )
virtual

Definition at line 54 of file LMapLoader.cc.

55 {
56 }
LMapLoader::LMapLoader ( const LMapLoader )
private

Member Function Documentation

int LMapLoader::addLMapHBEFDataset ( LMapRowHBEF row,
std::string  templateFileName 
)

Definition at line 74 of file LMapLoader.cc.

References XMLProcessor::_toXMLCh(), ecalMGPA::adc(), XMLDOMBlock::document, eta(), XMLDOMBlock::getDocument(), phi, submit::rm, and dbtoconf::root.

75 {
76  DOMDocument * loader = document;
77  //DOMElement * root = loader -> getDocumentElement();
78  DOMElement * root = (DOMElement *)(loader -> getElementsByTagName( XMLProcessor::_toXMLCh( "DATA_SET" ) ) -> item(2));
79 
80  XMLDOMBlock dataSetDoc( templateFileName );
81  DOMDocument * dataSet = dataSetDoc . getDocument();
82 
83  //Dataset
84  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "SIDE" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> side ) );
85  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "ETA" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> eta) );
86  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "PHI" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> phi ) );
87  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "DELTA_PHI" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> dphi ) );
88 
89  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "DEPTH" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> depth ) );
90  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "SUBDETECTOR" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> det ) );
91  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "RBX" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> rbx ) );
92  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "WEDGE" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> wedge ) );
93 
94  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "RM_SLOT" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> rm ) );
95  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "HPD_PIXEL" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> pixel ) );
96  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "QIE_SLOT" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> qie ) );
97  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "ADC" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> adc ) );
98  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "RM_FIBER" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> rm_fi ) );
99 
100  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "FIBER_CHANNEL" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> fi_ch));
101  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "CRATE" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> crate ) );
102  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "HTR_SLOT" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> htr ) );
103  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "HTR_FPGA" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> fpga ) );
104 
105  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "HTR_FIBER" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> htr_fi ));
106  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "DCC_SL" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> dcc_sl ) );
107  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "SPIGOT" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> spigo ) );
108  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "DCC_SLOT" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> dcc ) );
109  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "SLB_SITE" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> slb ) );
110  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "SLB_CHANNEL" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> slbin ));
111  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "SLB_CHANNEL2" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> slbin2));
112 
113  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "SLB_CABLE" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> slnam ) );
114  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "RCT_CRATE" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> rctcra ) );
115  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "RCT_CARD" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> rctcar ) );
116  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "RCT_CONNECTOR" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row ->rctcon));
117  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "RCT_NAME" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> rctnam ) );
118  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "FED_ID" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> fedid ) );
119 
120 
121  // copy the <data_set> node into the final XML
122  DOMNode * cloneDataSet = loader -> importNode( dataSet -> getDocumentElement(), true );
123  root -> appendChild( cloneDataSet );
124 
125  return 0;
126 }
int adc(sample_type sample)
get the ADC sample (12 bits)
DOMDocument * document
Definition: XMLDOMBlock.h:98
T eta() const
DOMDocument * getDocument(void)
Definition: XMLDOMBlock.cc:313
string rm
Definition: submit.py:76
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
string root
initialization
Definition: dbtoconf.py:70
Definition: DDAxes.h:10
int LMapLoader::addLMapHODataset ( LMapRowHO row,
std::string  templateFileName 
)

Definition at line 128 of file LMapLoader.cc.

References XMLProcessor::_toXMLCh(), XMLDOMBlock::document, XMLDOMBlock::getDocument(), and dbtoconf::root.

129 {
130  DOMDocument * loader = document;
131  //DOMElement * root = loader -> getDocumentElement();
132  DOMElement * root = (DOMElement *)(loader -> getElementsByTagName( XMLProcessor::_toXMLCh( "DATA_SET" ) ) -> item(2));
133 
134  XMLDOMBlock dataSetDoc( templateFileName );
135  DOMDocument * dataSet = dataSetDoc . getDocument();
136 
137  //Dataset
138  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "SIDE" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> sideO ) );
139  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "ETA" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> etaO ) );
140  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "PHI" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> phiO ) );
141  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "DELTA_PHI" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> dphiO ) );
142 
143  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "DEPTH" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> depthO ) );
144  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "SUBDETECTOR" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> detO ) );
145  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "RBX" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> rbxO ) );
146  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "SECTOR" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> sectorO ) );
147 
148  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "RM_SLOT" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> rmO ) );
149  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "HPD_PIXEL" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> pixelO ) );
150  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "QIE_SLOT" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> qieO ) );
151  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "ADC" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> adcO ) );
152  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "RM_FIBER" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> rm_fiO ) );
153  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "FIBER_CHANNEL" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row ->fi_chO));
154 
155  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "LETTER_CODE" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh(row ->let_codeO));
156  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "CRATE" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> crateO ) );
157  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "HTR_SLOT" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> htrO ) );
158  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "HTR_FPGA" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> fpgaO ) );
159 
160  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "HTR_FIBER" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> htr_fiO ) );
161  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "DCC_SL" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> dcc_slO ) );
162  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "SPIGOT" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> spigoO ) );
163  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "DCC_SLOT" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> dccO ) );
164  dataSet -> getElementsByTagName( XMLProcessor::_toXMLCh( "FED_ID" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( row -> fedidO ) );
165 
166 
167  // copy the <data_set> node into the final XML
168  DOMNode * cloneDataSet = loader -> importNode( dataSet -> getDocumentElement(), true );
169  root -> appendChild( cloneDataSet );
170 
171  return 0;
172 }
DOMDocument * document
Definition: XMLDOMBlock.h:98
DOMDocument * getDocument(void)
Definition: XMLDOMBlock.cc:313
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
string root
initialization
Definition: dbtoconf.py:70
int LMapLoader::createLMapHBEFXMLBase ( void  )

Definition at line 43 of file LMapLoader.cc.

References XMLProcessor::_toXMLCh(), and XMLDOMBlock::document.

Referenced by LMapLoader().

43  {
44  document -> getElementsByTagName( XMLProcessor::_toXMLCh( "NAME" ) ) -> item(0) -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( "HCAL hardware logical channel maps v3" ) );
45 
46  return 0;
47 }
DOMDocument * document
Definition: XMLDOMBlock.h:98
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
const LMapLoader& LMapLoader::operator= ( const LMapLoader )
private