CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Private Member Functions

XMLHTRZeroSuppressionLoader Class Reference

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

Inheritance diagram for XMLHTRZeroSuppressionLoader:
XMLDOMBlock

List of all members.

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

Private Member Functions

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

Detailed Description

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

Usage: <usage>

Definition at line 30 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 AlCaRecoCosmics_cfg::name, XMLDOMBlock::setTagAttribute(), and XMLDOMBlock::setTagValue().

                                                                                                            : XMLDOMBlock( templateBase )
{
  setTagValue( "EXTENSION_TABLE_NAME", config -> extention_table_name );
  setTagValue( "NAME", config -> name );
  setTagValue( "RUN_TYPE", config -> run_type );
  setTagValue( "RUN_NUMBER", config -> run_number );
  char timebuf[50];
  strftime( timebuf, 50, "%Y-%m-%d %H:%M:%S.0", gmtime( &(config -> run_begin_timestamp) ) );
  setTagValue( "COMMENT_DESCRIPTION", config -> comment_description );
  setTagAttribute( "DATA_SET", "id", config -> data_set_id );
  setTagAttribute( "IOV", "id", config -> iov_id );
  setTagValue( "INTERVAL_OF_VALIDITY_BEGIN", config -> iov_begin );
  setTagValue( "INTERVAL_OF_VALIDITY_END", config -> iov_end );
  setTagAttribute( "TAG", "id", config -> tag_id );
  setTagAttribute( "TAG", "mode", config -> tag_mode );
  setTagValue( "TAG_NAME", config -> tag_name );
  setTagValue( "DETECTOR_NAME", config -> detector_name );
  setTagValue( "COMMENT_DESCRIPTION", config -> elements_comment_description, 1 );

  setTagAttribute( "TAG", "idref", config -> tag_id, 1 );
  setTagAttribute( "IOV", "idref", config -> iov_id, 1 );
  setTagAttribute( "DATA_SET", "idref", config -> data_set_id, 1 );
}
XMLHTRZeroSuppressionLoader::~XMLHTRZeroSuppressionLoader ( ) [virtual]

Definition at line 95 of file XMLHTRZeroSuppressionLoader.cc.

{
}
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 XMLDOMBlock::document, eta(), XMLDOMBlock::getDocument(), phi, dbtoconf::root, XMLDOMBlock::setTagValue(), AlCaRecoCosmics_cfg::version, and z.

{
  DOMElement * root = document -> getDocumentElement();

  XMLDOMBlock dataSetDoc( templateFileName );
  DOMDocument * dataSet = dataSetDoc . getDocument();

  // changes to the HTR Zero Suppression <data_set> node
  setTagValue( "VERSION", config -> version, 0, dataSet );
  setTagValue( "SUBVERSION", config -> subversion, 0, dataSet );
  char timebuf[50];
  //strftime( timebuf, 50, "%c", gmtime( &(config -> create_timestamp) ) );
  strftime( timebuf, 50, "%Y-%m-%d %H:%M:%S.0", gmtime( &(config -> create_timestamp) ) );
  setTagValue( "CREATE_TIMESTAMP", timebuf , 0, dataSet );

  setTagValue( "CREATED_BY_USER", config -> created_by_user, 0, dataSet );
  setTagValue( "COMMENT_DESCRIPTION", config -> comment_description, 0, dataSet );
  setTagValue( "EXTENSION_TABLE_NAME", config -> extention_table_name, 0, dataSet );

  setTagValue( "ETA", config -> eta, 0, dataSet );
  setTagValue( "PHI", config -> phi, 0, dataSet );
  setTagValue( "DEPTH", config -> depth, 0, dataSet );
  setTagValue( "Z", config -> z, 0, dataSet );
  setTagValue( "HCAL_CHANNEL_ID", config -> hcal_channel_id, 0, dataSet );
  setTagValue( "DETECTOR_NAME", config -> detector_name, 0, dataSet );
  setTagValue( "ZERO_SUPPRESSION", config -> zero_suppression, 0, dataSet );

  // copy the <data_set> node into the final XML
  DOMNode * cloneDataSet = document -> importNode( dataSet -> getDocumentElement(), true );
  root -> appendChild( cloneDataSet );

  return 0;
}
const XMLHTRZeroSuppressionLoader& XMLHTRZeroSuppressionLoader::operator= ( const XMLHTRZeroSuppressionLoader ) [private]