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
XMLHTRZeroSuppressionLoader Class Reference

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

Inheritance diagram for XMLHTRZeroSuppressionLoader:
XMLDOMBlock

Classes

struct  _datasetDBConfig
 
struct  _loaderBaseConfig
 

Public Types

typedef
XMLHTRZeroSuppressionLoader::_datasetDBConfig 
datasetDBConfig
 
typedef struct
XMLHTRZeroSuppressionLoader::_loaderBaseConfig 
loaderBaseConfig
 

Public Member Functions

int addZS (datasetDBConfig *config, std::string templateFileName="HCAL_HTR_ZERO_SUPPRESSION.dataset.template")
 
 XMLHTRZeroSuppressionLoader ()
 
 XMLHTRZeroSuppressionLoader (loaderBaseConfig *config, std::string templateBase="HCAL_HTR_ZERO_SUPPRESSION.XMLloader.template")
 
virtual ~XMLHTRZeroSuppressionLoader ()
 
- 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

const XMLHTRZeroSuppressionLoaderoperator= (const XMLHTRZeroSuppressionLoader &)
 
 XMLHTRZeroSuppressionLoader (const XMLHTRZeroSuppressionLoader &)
 

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 29 of file XMLHTRZeroSuppressionLoader.h.

Member Typedef Documentation

Constructor & Destructor Documentation

XMLHTRZeroSuppressionLoader::XMLHTRZeroSuppressionLoader ( )
XMLHTRZeroSuppressionLoader::XMLHTRZeroSuppressionLoader ( loaderBaseConfig config,
std::string  templateBase = "HCAL_HTR_ZERO_SUPPRESSION.XMLloader.template" 
)

Definition at line 65 of file XMLHTRZeroSuppressionLoader.cc.

References mergeVDriftHistosByStation::name, cmsHarvester::run_number, XMLDOMBlock::setTagAttribute(), and XMLDOMBlock::setTagValue().

65  : XMLDOMBlock( templateBase )
66 {
67  setTagValue( "EXTENSION_TABLE_NAME", config -> extention_table_name );
68  setTagValue( "NAME", config -> name );
69  setTagValue( "RUN_TYPE", config -> run_type );
70  setTagValue( "RUN_NUMBER", config -> run_number );
71  char timebuf[50];
72  strftime( timebuf, 50, "%Y-%m-%d %H:%M:%S.0", gmtime( &(config -> run_begin_timestamp) ) );
73  setTagValue( "COMMENT_DESCRIPTION", config -> comment_description );
74  setTagAttribute( "DATA_SET", "id", config -> data_set_id );
75  setTagAttribute( "IOV", "id", config -> iov_id );
76  setTagValue( "INTERVAL_OF_VALIDITY_BEGIN", config -> iov_begin );
77  setTagValue( "INTERVAL_OF_VALIDITY_END", config -> iov_end );
78  setTagAttribute( "TAG", "id", config -> tag_id );
79  setTagAttribute( "TAG", "mode", config -> tag_mode );
80  setTagValue( "TAG_NAME", config -> tag_name );
81  setTagValue( "DETECTOR_NAME", config -> detector_name );
82  setTagValue( "COMMENT_DESCRIPTION", config -> elements_comment_description, 1 );
83 
84  setTagAttribute( "TAG", "idref", config -> tag_id, 1 );
85  setTagAttribute( "IOV", "idref", config -> iov_id, 1 );
86  setTagAttribute( "DATA_SET", "idref", config -> data_set_id, 1 );
87 }
DOMNode * setTagValue(const std::string &tagName, const std::string &tagValue, int _item=0, DOMDocument *_document=NULL)
Definition: XMLDOMBlock.cc:364
DOMNode * setTagAttribute(const std::string &tagName, const std::string &attrName, const std::string &attrValue, int _item=0)
Definition: XMLDOMBlock.cc:408
XMLHTRZeroSuppressionLoader::~XMLHTRZeroSuppressionLoader ( )
virtual

Definition at line 94 of file XMLHTRZeroSuppressionLoader.cc.

95 {
96 }
XMLHTRZeroSuppressionLoader::XMLHTRZeroSuppressionLoader ( const XMLHTRZeroSuppressionLoader )
private

Member Function Documentation

int XMLHTRZeroSuppressionLoader::addZS ( datasetDBConfig config,
std::string  templateFileName = "HCAL_HTR_ZERO_SUPPRESSION.dataset.template" 
)

Definition at line 113 of file XMLHTRZeroSuppressionLoader.cc.

References HLT_25ns14e33_v1_cff::depth, XMLDOMBlock::document, eta(), XMLDOMBlock::getDocument(), phi, dbtoconf::root, XMLDOMBlock::setTagValue(), relval_steps::version, and detailsBasic3DVector::z.

114 {
115  DOMElement * root = document -> getDocumentElement();
116 
117  XMLDOMBlock dataSetDoc( templateFileName );
118  DOMDocument * dataSet = dataSetDoc . getDocument();
119 
120  // changes to the HTR Zero Suppression <data_set> node
121  setTagValue( "VERSION", config -> version, 0, dataSet );
122  setTagValue( "SUBVERSION", config -> subversion, 0, dataSet );
123  char timebuf[50];
124  //strftime( timebuf, 50, "%c", gmtime( &(config -> create_timestamp) ) );
125  strftime( timebuf, 50, "%Y-%m-%d %H:%M:%S.0", gmtime( &(config -> create_timestamp) ) );
126  setTagValue( "CREATE_TIMESTAMP", timebuf , 0, dataSet );
127 
128  setTagValue( "CREATED_BY_USER", config -> created_by_user, 0, dataSet );
129  setTagValue( "COMMENT_DESCRIPTION", config -> comment_description, 0, dataSet );
130  setTagValue( "EXTENSION_TABLE_NAME", config -> extention_table_name, 0, dataSet );
131 
132  setTagValue( "ETA", config -> eta, 0, dataSet );
133  setTagValue( "PHI", config -> phi, 0, dataSet );
134  setTagValue( "DEPTH", config -> depth, 0, dataSet );
135  setTagValue( "Z", config -> z, 0, dataSet );
136  setTagValue( "HCAL_CHANNEL_ID", config -> hcal_channel_id, 0, dataSet );
137  setTagValue( "DETECTOR_NAME", config -> detector_name, 0, dataSet );
138  setTagValue( "ZERO_SUPPRESSION", config -> zero_suppression, 0, dataSet );
139 
140  // copy the <data_set> node into the final XML
141  DOMNode * cloneDataSet = document -> importNode( dataSet -> getDocumentElement(), true );
142  root -> appendChild( cloneDataSet );
143 
144  return 0;
145 }
DOMDocument * document
Definition: XMLDOMBlock.h:97
T eta() const
float float float z
DOMDocument * getDocument(void)
Definition: XMLDOMBlock.cc:312
DOMNode * setTagValue(const std::string &tagName, const std::string &tagValue, int _item=0, DOMDocument *_document=NULL)
Definition: XMLDOMBlock.cc:364
string root
initialization
Definition: dbtoconf.py:70
Definition: DDAxes.h:10
const XMLHTRZeroSuppressionLoader& XMLHTRZeroSuppressionLoader::operator= ( const XMLHTRZeroSuppressionLoader )
private