test
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
XERCES_CPP_NAMESPACE::DOMElement * add_element (XERCES_CPP_NAMESPACE::DOMElement *parent, XMLCh *tagname, XMLCh *value)
 
XERCES_CPP_NAMESPACE::DOMDocument * getDocument (void)
 
XERCES_CPP_NAMESPACE::DOMDocument * getDocumentConst (void) const
 
XERCES_CPP_NAMESPACE::DOMDocument * getNewDocument (std::string xmlFileName)
 
std::string & getString (void)
 
std::string & getString (XERCES_CPP_NAMESPACE::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, XERCES_CPP_NAMESPACE::DOMDocument *_document=NULL)
 
const char * getTagValue (const std::string &tagName, int _item, XERCES_CPP_NAMESPACE::DOMElement *_document)
 
std::string getTimestamp (time_t _time)
 
XMLDOMBlockoperator+= (const XMLDOMBlock &other)
 
void parse (XERCES_CPP_NAMESPACE::InputSource &_source)
 
XERCES_CPP_NAMESPACE::DOMNode * setTagAttribute (const std::string &tagName, const std::string &attrName, const std::string &attrValue, int _item=0)
 
XERCES_CPP_NAMESPACE::DOMNode * setTagAttribute (XERCES_CPP_NAMESPACE::DOMElement *_elem, const std::string &tagName, const std::string &attrName, const std::string &attrValue, int _item=0)
 
XERCES_CPP_NAMESPACE::DOMNode * setTagAttribute (const std::string &tagName, const std::string &attrName, const int &attrValue, int _item=0)
 
XERCES_CPP_NAMESPACE::DOMNode * setTagAttribute (XERCES_CPP_NAMESPACE::DOMElement *_elem, const std::string &tagName, const std::string &attrName, const int &attrValue, int _item=0)
 
XERCES_CPP_NAMESPACE::DOMNode * setTagValue (const std::string &tagName, const std::string &tagValue, int _item=0, XERCES_CPP_NAMESPACE::DOMDocument *_document=NULL)
 
XERCES_CPP_NAMESPACE::DOMNode * setTagValue (XERCES_CPP_NAMESPACE::DOMElement *_elem, const std::string &tagName, const std::string &tagValue, int _item=0)
 
XERCES_CPP_NAMESPACE::DOMNode * setTagValue (const std::string &tagName, const int &tagValue, int _item=0, XERCES_CPP_NAMESPACE::DOMDocument *_document=NULL)
 
XERCES_CPP_NAMESPACE::DOMNode * setTagValue (XERCES_CPP_NAMESPACE::DOMElement *_elem, const std::string &tagName, const int &tagValue, int _item=0)
 
int write (std::string target="stdout")
 
 XMLDOMBlock ()
 
 XMLDOMBlock (std::string xmlFileName)
 
 XMLDOMBlock (XERCES_CPP_NAMESPACE::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
XERCES_CPP_NAMESPACE::DOMDocument * document
 
XERCES_CPP_NAMESPACE::ErrorHandler * errHandler
 
XERCES_CPP_NAMESPACE::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 66 of file XMLHTRZeroSuppressionLoader.cc.

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

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

96 {
97 }
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 114 of file XMLHTRZeroSuppressionLoader.cc.

References HLT_25ns10e33_v2_cff::depth, XMLDOMBlock::document, eta, XMLDOMBlock::getDocument(), phi, pyrootRender::root, XMLDOMBlock::setTagValue(), relval_steps::version, and z.

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