CMS 3D CMS Logo

Typedefs | Functions

xuti Namespace Reference

Typedefs

typedef std::basic_string< XMLCh > XercesString
 Define an intermediate type.

Functions

const std::string ADCToGeVConstant_tag ("EcalADCToGeVConstant")
const std::string AlignmentConstant_tag ("EcalAlignmentConstant")
const std::string Barrel_tag ("BarrelValue")
const std::string Cell_tag ("cell")
const std::string ChannelStatus_tag ("EcalChannelStatus")
const std::string ChannelStatusCode_tag ("ChannelStatusCode")
const std::string DAQStatusCode_tag ("DAQStatusCode")
const std::string DAQTowerStatus_tag ("EcalDAQTowerStatus")
const std::string DCSStatusCode_tag ("DCSStatusCode")
const std::string DCSTowerStatus_tag ("EcalDCSTowerStatus")
const std::string EcalFloatCondObjectContainer_tag ("EcalFloatCondObjectContainer")
const std::string EcalTBWeight_tag ("EcalTBWeight")
const std::string EcalTBWeights_tag ("EcalTBWeights")
const std::string EcalTDCId_tag ("EcalTDCId")
const std::string EcalWeightSet_tag ("EcalWeightSet")
const std::string EcalXtalGroupId_tag ("EcalXtalGroupId")
const std::string Endcap_tag ("EndcapValue")
const std::string ESGain_tag ("ESGain")
XercesString fromNative (const char *str)
XercesString fromNative (const std::string &str)
const std::string Gain12Over6_tag ("Gain12Over6")
const std::string Gain6Over1_tag ("Gain6Over1")
const std::string GainRatios_tag ("EcalGainRatios")
xercesc::DOMNode * getChildNode (xercesc::DOMNode *node, const std::string &nodename)
 get the child of
template<class T >
void GetNodeData (xercesc::DOMNode *node, T &value)
 get the node data
void GetNodeStringData (xercesc::DOMNode *node, std::string &value)
 get the node data as string. Needs to be used to avoid splitting
const std::string Header_datasourcetag ("datasource")
const std::string Header_datetag ("date")
const std::string Header_methodtag ("method")
const std::string Header_sincetag ("since")
const std::string Header_tag ("EcalCondHeader")
const std::string Header_tagtag ("tag")
const std::string Header_versiontag ("version")
const std::string id_tag ("id")
const std::string iEta_tag ("iEta")
const std::string IntercalibConstant_tag ("IntercalibConstant")
const std::string IntercalibConstants_tag ("EcalIntercalibConstants")
const std::string IntercalibError_tag ("IntercalibError")
const std::string iPhi_tag ("iPhi")
const std::string ix_tag ("ix")
const std::string ixSC_tag ("ixSC")
const std::string iy_tag ("iy")
const std::string iySC_tag ("iySC")
const std::string Laser_p1_tag ("p1")
const std::string Laser_p2_tag ("p2")
const std::string Laser_p3_tag ("p3")
const std::string Laser_t1_tag ("t1")
const std::string Laser_t2_tag ("t2")
const std::string Laser_t3_tag ("t3")
const std::string Laser_tag ("EcalLaserAPDPNRatios")
const std::string LinearCorrections_tag ("EcalLinearCorrections")
const std::string Linearization_m12_tag ("mult12")
const std::string Linearization_m1_tag ("mult1")
const std::string Linearization_m6_tag ("mult6")
const std::string Linearization_s12_tag ("shift12")
const std::string Linearization_s1_tag ("shift1")
const std::string Linearization_s6_tag ("shift6")
const std::string Linearization_tag ("EcalTPGLinearizationConts")
const std::string mean12_tag ("mean_x12")
const std::string mean1_tag ("mean_x1")
const std::string mean6_tag ("mean_x6")
const std::string Pedestals_tag ("EcalPedestals")
const std::string Phi_tag ("Phi")
const std::string Psi_tag ("Psi")
const DetId readCellId (xercesc::DOMElement *node)
 Assuming.
void readHeader (xercesc::DOMNode *parentNode, EcalCondHeader &header)
 read header from
int readHeader (const std::string &filename, EcalCondHeader &header)
 read header from any xml file, return -1 in case of error
const std::string rms12_tag ("rms_x12")
const std::string rms1_tag ("rms_x1")
const std::string rms6_tag ("rms_x6")
const std::string row_tag ("row")
const std::string subdet_tag ("SubDet")
const std::string Theta_tag ("Theta")
const std::string TimeOffsetConstant_tag ("EcalTimeOffsetConstant")
std::string toNative (const XercesString &str)
std::string toNative (const XMLCh *str)
const std::string TPGCrystalStatus_tag ("EcalTPGCrystalStatus")
const std::string TPGStripStatus_tag ("EcalTPGStripStatus")
const std::string TPGTowerStatus_tag ("EcalTPGTowerStatus")
const std::string Value_tag ("Value")
const std::string WeightGroup_tag ("EcalWeightGroup")
const std::string WeightGroups_tag ("EcalWeightGroups")
const std::string wgtAfterSwitch_tag ("WeightAfterSwitch")
const std::string wgtBeforeSwitch_tag ("WeightBeforeSwitch")
const std::string wgtChi2AfterSwitch_tag ("Chi2WeightAfterSwitch")
const std::string wgtChi2BeforeSwitch_tag ("Chi2WeightBeforeSwitch")
xercesc::DOMElement * writeCell (xercesc::DOMNode *node, const DetId &detid)
 Append a Cell node with attributes to.
void writeHeader (xercesc::DOMNode *parentNode, const EcalCondHeader &header)
 write
template<class T >
void WriteNodeWithValue (xercesc::DOMNode *parentNode, const std::string &tag, const T &value)
 write a node with
const std::string x_tag ("x")
const std::string y_tag ("y")
const std::string z_tag ("z")
const std::string zside_tag ("zside")

Detailed Description

Helper function for converting Ecal DB Objects to XML

Author:
S. Argiro, F. Rubbo
Id:
DOMHelperFunctions.h,v 1.2 2009/10/28 13:34:46 argiro Exp

Utility functions to convert from unhandy XMLCh * to std::string and back

To convert a XMLCh* into a std::string:

std::string aString= toNative(const XMLCh* str);

to convert a std::string into XMLCh* and not worry about memory:

XMLCh * aCh = fromNative(std::string str).c_str();

Author:
Stefano Argiro' (seen somehwere on the internet)
Id:
XercesString.h,v 1.1 2008/11/14 15:46:05 argiro Exp

Typedef Documentation

typedef std::basic_string<XMLCh> xuti::XercesString

Define an intermediate type.

Definition at line 28 of file XercesString.h.


Function Documentation

const std::string xuti::ADCToGeVConstant_tag ( "EcalADCToGeVConstant"  )
const std::string xuti::AlignmentConstant_tag ( "EcalAlignmentConstant"  )
const std::string xuti::Barrel_tag ( "BarrelValue"  )
const std::string xuti::Cell_tag ( "cell"  )
const std::string xuti::ChannelStatus_tag ( "EcalChannelStatus"  )
const std::string xuti::ChannelStatusCode_tag ( "ChannelStatusCode"  )
const std::string xuti::DAQStatusCode_tag ( "DAQStatusCode"  )
const std::string xuti::DAQTowerStatus_tag ( "EcalDAQTowerStatus"  )
const std::string xuti::DCSStatusCode_tag ( "DCSStatusCode"  )
const std::string xuti::DCSTowerStatus_tag ( "EcalDCSTowerStatus"  )
const std::string xuti::EcalFloatCondObjectContainer_tag ( "EcalFloatCondObjectContainer"  )
const std::string xuti::EcalTBWeight_tag ( "EcalTBWeight"  )
const std::string xuti::EcalTBWeights_tag ( "EcalTBWeights"  )
const std::string xuti::EcalTDCId_tag ( "EcalTDCId"  )
const std::string xuti::EcalWeightSet_tag ( "EcalWeightSet"  )
const std::string xuti::EcalXtalGroupId_tag ( "EcalXtalGroupId"  )
const std::string xuti::Endcap_tag ( "EndcapValue"  )
const std::string xuti::ESGain_tag ( "ESGain"  )
XercesString xuti::fromNative ( const char *  str) [inline]

Definition at line 31 of file XercesString.h.

Referenced by EcalTPGCrystalStatusXMLTranslator::dumpXML(), EcalPedestalsXMLTranslator::dumpXML(), EcalClusterEnergyCorrectionObjectSpecificXMLTranslator::dumpXML(), EcalChannelStatusXMLTranslator::dumpXML(), EcalADCToGeVXMLTranslator::dumpXML(), EcalDCSTowerStatusXMLTranslator::dumpXML(), EcalAlignmentXMLTranslator::dumpXML(), EcalTPGStripStatusXMLTranslator::dumpXML(), EcalTPGLinearizationConstXMLTranslator::dumpXML(), EcalClusterEnergyCorrectionXMLTranslator::dumpXML(), EcalLinearCorrectionsXMLTranslator::dumpXML(), EcalDAQTowerStatusXMLTranslator::dumpXML(), EcalTBWeightsXMLTranslator::dumpXML(), EcalTPGTowerStatusXMLTranslator::dumpXML(), EcalWeightGroupXMLTranslator::dumpXML(), ESGainXMLTranslator::dumpXML(), EcalGainRatiosXMLTranslator::dumpXML(), EcalLaserAPDPNRatiosXMLTranslator::dumpXML(), EcalFloatCondObjectContainerXMLTranslator::dumpXML(), EcalClusterCrackCorrXMLTranslator::dumpXML(), EcalWeightSetXMLTranslator::dumpXML(), EcalTimeOffsetXMLTranslator::dumpXML(), EcalClusterLocalContCorrXMLTranslator::dumpXML(), fromNative(), readCellId(), EcalTBWeightsXMLTranslator::readWeightSet(), EcalWeightSetXMLTranslator::write10x10(), EcalWeightSetXMLTranslator::write3x10(), writeCell(), EcalTBWeightsXMLTranslator::writeChi2WeightMatrix(), writeHeader(), WriteNodeWithValue(), EcalTBWeightsXMLTranslator::writeWeightMatrix(), and EcalTBWeightsXMLTranslator::writeWeightSet().

                                                 {
    boost::scoped_array<XMLCh> ptr(xercesc::XMLString::transcode(str));
    return XercesString(ptr.get( ));
  }
XercesString xuti::fromNative ( const std::string &  str) [inline]

Definition at line 37 of file XercesString.h.

References fromNative().

                                                      {
    return fromNative(str.c_str( ));
  }
const std::string xuti::Gain12Over6_tag ( "Gain12Over6"  )
const std::string xuti::Gain6Over1_tag ( "Gain6Over1"  )
const std::string xuti::GainRatios_tag ( "EcalGainRatios"  )
xercesc::DOMNode* xuti::getChildNode ( xercesc::DOMNode *  node,
const std::string &  nodename 
)
template<class T >
void xuti::GetNodeData ( xercesc::DOMNode *  node,
T value 
)
void xuti::GetNodeStringData ( xercesc::DOMNode *  node,
std::string &  value 
)

get the node data as string. Needs to be used to avoid splitting

Definition at line 244 of file DOMHelperFunctions.cc.

References toNative().

Referenced by readHeader().

                                                                   {
  value=  toNative(node->getTextContent());       
}
const std::string xuti::Header_datasourcetag ( "datasource"  )

Referenced by readHeader(), and writeHeader().

const std::string xuti::Header_datetag ( "date"  )

Referenced by readHeader(), and writeHeader().

const std::string xuti::Header_methodtag ( "method"  )

Referenced by readHeader(), and writeHeader().

const std::string xuti::Header_sincetag ( "since"  )

Referenced by readHeader(), and writeHeader().

const std::string xuti::Header_tag ( "EcalCondHeader"  )

Referenced by readHeader(), and writeHeader().

const std::string xuti::Header_tagtag ( "tag"  )

Referenced by readHeader(), and writeHeader().

const std::string xuti::Header_versiontag ( "version"  )

Referenced by readHeader(), and writeHeader().

const std::string xuti::id_tag ( "id"  )
const std::string xuti::iEta_tag ( "iEta"  )

Referenced by readCellId(), and writeCell().

const std::string xuti::IntercalibConstant_tag ( "IntercalibConstant"  )
const std::string xuti::IntercalibConstants_tag ( "EcalIntercalibConstants"  )
const std::string xuti::IntercalibError_tag ( "IntercalibError"  )
const std::string xuti::iPhi_tag ( "iPhi"  )

Referenced by readCellId(), and writeCell().

const std::string xuti::ix_tag ( "ix"  )

Referenced by readCellId(), and writeCell().

const std::string xuti::ixSC_tag ( "ixSC"  )

Referenced by readCellId(), and writeCell().

const std::string xuti::iy_tag ( "iy"  )

Referenced by readCellId(), and writeCell().

const std::string xuti::iySC_tag ( "iySC"  )

Referenced by readCellId(), and writeCell().

const std::string xuti::Laser_p1_tag ( "p1"  )
const std::string xuti::Laser_p2_tag ( "p2"  )
const std::string xuti::Laser_p3_tag ( "p3"  )
const std::string xuti::Laser_t1_tag ( "t1"  )
const std::string xuti::Laser_t2_tag ( "t2"  )
const std::string xuti::Laser_t3_tag ( "t3"  )
const std::string xuti::Laser_tag ( "EcalLaserAPDPNRatios"  )
const std::string xuti::LinearCorrections_tag ( "EcalLinearCorrections"  )
const std::string xuti::Linearization_m12_tag ( "mult12"  )
const std::string xuti::Linearization_m1_tag ( "mult1"  )
const std::string xuti::Linearization_m6_tag ( "mult6"  )
const std::string xuti::Linearization_s12_tag ( "shift12"  )
const std::string xuti::Linearization_s1_tag ( "shift1"  )
const std::string xuti::Linearization_s6_tag ( "shift6"  )
const std::string xuti::Linearization_tag ( "EcalTPGLinearizationConts"  )
const std::string xuti::mean12_tag ( "mean_x12"  )
const std::string xuti::mean1_tag ( "mean_x1"  )
const std::string xuti::mean6_tag ( "mean_x6"  )
const std::string xuti::Pedestals_tag ( "EcalPedestals"  )
const std::string xuti::Phi_tag ( "Phi"  )
const std::string xuti::Psi_tag ( "Psi"  )
const DetId xuti::readCellId ( xercesc::DOMElement *  node)

Assuming.

Parameters:
nodeis a <cell> node, read the id

Definition at line 25 of file DOMHelperFunctions.cc.

References dtNoiseDBValidation_cfg::cerr, fromNative(), iEta_tag(), iPhi_tag(), ix_tag(), ixSC_tag(), iy_tag(), iySC_tag(), toNative(), and zside_tag().

Referenced by EcalLaserAPDPNRatiosXMLTranslator::readXML(), EcalGainRatiosXMLTranslator::readXML(), EcalDCSTowerStatusXMLTranslator::readXML(), EcalChannelStatusXMLTranslator::readXML(), EcalWeightGroupXMLTranslator::readXML(), EcalDAQTowerStatusXMLTranslator::readXML(), EcalPedestalsXMLTranslator::readXML(), and EcalLinearCorrectionsXMLTranslator::readXML().

                                                   {
  

  int ieta =0;
  int iphi =0;
  int ix   =0;
  int iy   =0;
  int ixSC =0;
  int iySC =0;
  int zside=0;
  
  stringstream ieta_str ;
  stringstream iphi_str;
  stringstream ix_str;
  stringstream iy_str ;
  stringstream ixSC_str;
  stringstream iySC_str ;
  stringstream zside_str ;

 
  ieta_str << toNative(node->getAttribute(fromNative(iEta_tag).c_str()));
  iphi_str << toNative(node->getAttribute(fromNative(iPhi_tag).c_str()));
  ix_str   << toNative(node->getAttribute(fromNative(ix_tag).c_str()));
  iy_str   << toNative(node->getAttribute(fromNative(iy_tag).c_str()));
  ixSC_str << toNative(node->getAttribute(fromNative(ixSC_tag).c_str()));
  iySC_str << toNative(node->getAttribute(fromNative(iySC_tag).c_str()));
  zside_str<< toNative(node->getAttribute(fromNative(zside_tag).c_str()));
  
  ieta_str>> ieta;
  iphi_str>> iphi;
  ix_str  >> ix;
  iy_str  >> iy;
  ixSC_str >> ixSC;
  iySC_str >> iySC;
  zside_str >> zside;

  if (ieta && iphi)        {return EBDetId(ieta,iphi);}
  if (ix   && iy  && zside){return EEDetId(ix,iy,zside);}
  if (ixSC && iySC && zside){return EcalScDetId(ixSC, iySC, zside);}
  
  cerr<<"XMLCell: error reading cell, missing field ?"<<std::endl;
  return 0;
 
}
void xuti::readHeader ( xercesc::DOMNode *  parentNode,
EcalCondHeader header 
)

read header from

Parameters:
parentNode

Definition at line 189 of file DOMHelperFunctions.cc.

References EcalCondHeader::datasource_, EcalCondHeader::date_, getChildNode(), GetNodeData(), GetNodeStringData(), Header_datasourcetag(), Header_datetag(), Header_methodtag(), Header_sincetag(), Header_tag(), Header_tagtag(), Header_versiontag(), EcalCondHeader::method_, EcalCondHeader::since_, EcalCondHeader::tag_, and EcalCondHeader::version_.

Referenced by edm::EventStreamHttpReader::EventStreamHttpReader(), EcalFloatCondObjectContainerHandler::id(), readHeader(), EcalWeightSetXMLTranslator::readXML(), EcalLaserAPDPNRatiosXMLTranslator::readXML(), EcalChannelStatusXMLTranslator::readXML(), EcalDCSTowerStatusXMLTranslator::readXML(), EcalGainRatiosXMLTranslator::readXML(), EcalTimeOffsetXMLTranslator::readXML(), EcalTPGTowerStatusXMLTranslator::readXML(), EcalDAQTowerStatusXMLTranslator::readXML(), EcalWeightGroupXMLTranslator::readXML(), EcalADCToGeVXMLTranslator::readXML(), EcalTBWeightsXMLTranslator::readXML(), EcalPedestalsXMLTranslator::readXML(), EcalTPGStripStatusXMLTranslator::readXML(), and EcalLinearCorrectionsXMLTranslator::readXML().

                                             {

  DOMNode * hnode = getChildNode(parentNode,Header_tag);

  DOMNode * node  = getChildNode(hnode,Header_methodtag);
  GetNodeStringData(node,header.method_);

  node  = getChildNode(hnode,Header_versiontag);
  GetNodeStringData(node,header.version_);

  node  = getChildNode(hnode,Header_datasourcetag);
  GetNodeStringData(node,header.datasource_);

  node  = getChildNode(hnode,Header_sincetag);
  GetNodeData(node,header.since_);

  node  = getChildNode(hnode,Header_tagtag);
  GetNodeStringData(node,header.tag_);

  
  node  = getChildNode(hnode,Header_datetag);
  GetNodeStringData(node,header.date_);

}
int xuti::readHeader ( const std::string &  filename,
EcalCondHeader header 
)

read header from any xml file, return -1 in case of error

Definition at line 215 of file DOMHelperFunctions.cc.

References gather_cfg::cout, geometryXMLtoCSV::parser, and readHeader().

                                                                     {
  
  XMLPlatformUtils::Initialize();

  XercesDOMParser* parser = new XercesDOMParser;
  parser->setValidationScheme( XercesDOMParser::Val_Never );
  parser->setDoNamespaces( false );
  parser->setDoSchema( false );
  
  parser->parse(filename.c_str());

  DOMDocument* xmlDoc = parser->getDocument();
  

  if (!xmlDoc) {
    std::cout << "Error parsing document" << std::endl;
    return -1;
  }

  DOMElement* elementRoot = xmlDoc->getDocumentElement();

  xuti::readHeader(elementRoot, header);
  
  delete parser;
  XMLPlatformUtils::Terminate();

  return 0;
}
const std::string xuti::rms12_tag ( "rms_x12"  )
const std::string xuti::rms1_tag ( "rms_x1"  )
const std::string xuti::rms6_tag ( "rms_x6"  )
const std::string xuti::row_tag ( "row"  )
const std::string xuti::subdet_tag ( "SubDet"  )
const std::string xuti::Theta_tag ( "Theta"  )
const std::string xuti::TimeOffsetConstant_tag ( "EcalTimeOffsetConstant"  )
std::string xuti::toNative ( const XercesString &  str) [inline]

Definition at line 48 of file XercesString.h.

References toNative().

                                                    {
    return toNative(str.c_str( ));
  }
std::string xuti::toNative ( const XMLCh *  str) [inline]
const std::string xuti::TPGCrystalStatus_tag ( "EcalTPGCrystalStatus"  )
const std::string xuti::TPGStripStatus_tag ( "EcalTPGStripStatus"  )
const std::string xuti::TPGTowerStatus_tag ( "EcalTPGTowerStatus"  )
const std::string xuti::Value_tag ( "Value"  )
const std::string xuti::WeightGroup_tag ( "EcalWeightGroup"  )
const std::string xuti::WeightGroups_tag ( "EcalWeightGroups"  )
const std::string xuti::wgtAfterSwitch_tag ( "WeightAfterSwitch"  )
const std::string xuti::wgtBeforeSwitch_tag ( "WeightBeforeSwitch"  )
const std::string xuti::wgtChi2AfterSwitch_tag ( "Chi2WeightAfterSwitch"  )
const std::string xuti::wgtChi2BeforeSwitch_tag ( "Chi2WeightBeforeSwitch"  )
DOMElement * xuti::writeCell ( xercesc::DOMNode *  node,
const DetId detid 
)

Append a Cell node with attributes to.

Parameters:
node

Definition at line 72 of file DOMHelperFunctions.cc.

References Cell_tag(), EcalBarrel, EcalEndcap, EcalTriggerTower, fromNative(), EBDetId::ieta(), EcalTrigTowerDetId::ieta(), iEta_tag(), EcalTrigTowerDetId::iphi(), EBDetId::iphi(), iPhi_tag(), EEDetId::ix(), EcalScDetId::ix(), ix_tag(), ixSC_tag(), EEDetId::iy(), EcalScDetId::iy(), iy_tag(), iySC_tag(), DetId::rawId(), DetId::subdetId(), EcalScDetId::zside(), EEDetId::zside(), and zside_tag().

Referenced by EcalTPGCrystalStatusXMLTranslator::dumpXML(), EcalPedestalsXMLTranslator::dumpXML(), EcalChannelStatusXMLTranslator::dumpXML(), EcalDCSTowerStatusXMLTranslator::dumpXML(), EcalTPGLinearizationConstXMLTranslator::dumpXML(), EcalLinearCorrectionsXMLTranslator::dumpXML(), EcalDAQTowerStatusXMLTranslator::dumpXML(), EcalTPGTowerStatusXMLTranslator::dumpXML(), EcalWeightGroupXMLTranslator::dumpXML(), EcalGainRatiosXMLTranslator::dumpXML(), EcalLaserAPDPNRatiosXMLTranslator::dumpXML(), and EcalFloatCondObjectContainerXMLTranslator::dumpXML().

                                     {
  
  DOMElement* cell_node = 
      node->getOwnerDocument()->createElement( fromNative(Cell_tag).c_str());

  node->appendChild(cell_node);
  
  if (detid.subdetId() == EcalBarrel ){ 
   
    stringstream value_s;
    value_s <<EBDetId(detid).ieta() ;

    cell_node->setAttribute(fromNative(iEta_tag).c_str(),
                            fromNative(value_s.str()).c_str());
    value_s.str("");
    value_s <<EBDetId(detid).iphi() ;

    cell_node->setAttribute(fromNative(iPhi_tag).c_str(),
                            fromNative(value_s.str()).c_str());

  } else if (detid.subdetId() == EcalEndcap){
    
    // is it a EcalScDetId ?
    unsigned int ScIdCheck = detid.rawId() & 0x00008000;
    if (ScIdCheck == 0) {
      stringstream value_s;
      value_s <<EEDetId(detid).ix() ;
  
      cell_node->setAttribute(fromNative(ix_tag).c_str(),
                              fromNative(value_s.str()).c_str());
      value_s.str("");
      value_s <<EEDetId(detid).iy() ;

      cell_node->setAttribute(fromNative(iy_tag).c_str(),
                              fromNative(value_s.str()).c_str());
      value_s.str("");
      value_s <<EEDetId(detid).zside() ;

      cell_node->setAttribute(fromNative(zside_tag).c_str(),
                              fromNative(value_s.str()).c_str());
    }
    else {
      stringstream value_s;
      value_s << EcalScDetId(detid).ix() ;
  
      cell_node->setAttribute(fromNative(ixSC_tag).c_str(),
                              fromNative(value_s.str()).c_str());
      value_s.str("");
      value_s << EcalScDetId(detid).iy() ;

      cell_node->setAttribute(fromNative(iySC_tag).c_str(),
                              fromNative(value_s.str()).c_str());
      value_s.str("");
      value_s << EcalScDetId(detid).zside() ;

      cell_node->setAttribute(fromNative(zside_tag).c_str(),
                              fromNative(value_s.str()).c_str());
    }

  } else if (detid.subdetId() == EcalTriggerTower ){ 
    stringstream value_s;
    value_s <<EcalTrigTowerDetId(detid).ieta() ;
  
    cell_node->setAttribute(fromNative(iEta_tag).c_str(),
                            fromNative(value_s.str()).c_str());
    value_s.str("");
    value_s <<EcalTrigTowerDetId(detid).iphi() ;

    cell_node->setAttribute(fromNative(iPhi_tag).c_str(),
                            fromNative(value_s.str()).c_str());
  }
  return cell_node;
}
void xuti::writeHeader ( xercesc::DOMNode *  parentNode,
const EcalCondHeader header 
)

write

Parameters:
headerunder
parentNode

Definition at line 169 of file DOMHelperFunctions.cc.

References EcalCondHeader::datasource_, EcalCondHeader::date_, fromNative(), Header_datasourcetag(), Header_datetag(), Header_methodtag(), Header_sincetag(), Header_tag(), Header_tagtag(), Header_versiontag(), EcalCondHeader::method_, EcalCondHeader::since_, EcalCondHeader::tag_, EcalCondHeader::version_, and WriteNodeWithValue().

Referenced by EcalADCToGeVXMLTranslator::dumpXML(), EcalChannelStatusXMLTranslator::dumpXML(), EcalClusterEnergyCorrectionObjectSpecificXMLTranslator::dumpXML(), EcalPedestalsXMLTranslator::dumpXML(), EcalTPGCrystalStatusXMLTranslator::dumpXML(), EcalDCSTowerStatusXMLTranslator::dumpXML(), EcalAlignmentXMLTranslator::dumpXML(), EcalClusterEnergyCorrectionXMLTranslator::dumpXML(), EcalTPGLinearizationConstXMLTranslator::dumpXML(), EcalTPGStripStatusXMLTranslator::dumpXML(), EcalLinearCorrectionsXMLTranslator::dumpXML(), EcalDAQTowerStatusXMLTranslator::dumpXML(), EcalTBWeightsXMLTranslator::dumpXML(), EcalTPGTowerStatusXMLTranslator::dumpXML(), EcalWeightGroupXMLTranslator::dumpXML(), EcalGainRatiosXMLTranslator::dumpXML(), ESGainXMLTranslator::dumpXML(), EcalFloatCondObjectContainerXMLTranslator::dumpXML(), EcalLaserAPDPNRatiosXMLTranslator::dumpXML(), EcalClusterCrackCorrXMLTranslator::dumpXML(), EcalClusterLocalContCorrXMLTranslator::dumpXML(), EcalTimeOffsetXMLTranslator::dumpXML(), EcalWeightSetXMLTranslator::dumpXML(), and stor::EventFileHandler::EventFileHandler().

                                                      {


  
  DOMElement* headernode =
    parentNode->getOwnerDocument()->createElement( fromNative(Header_tag).c_str());
  parentNode->appendChild(headernode);

  // write the actual header
  WriteNodeWithValue(headernode, Header_methodtag, header.method_);
  WriteNodeWithValue(headernode, Header_versiontag, header.version_);
  WriteNodeWithValue(headernode, Header_datasourcetag, header.datasource_);
  WriteNodeWithValue(headernode, Header_sincetag, header.since_);
  WriteNodeWithValue(headernode, Header_tagtag, header.tag_);
  WriteNodeWithValue(headernode, Header_datetag, header.date_);

}
template<class T >
void xuti::WriteNodeWithValue ( xercesc::DOMNode *  parentNode,
const std::string &  tag,
const T value 
)

write a node with

Parameters:
tagand
valueunder
parentNode

Definition at line 52 of file DOMHelperFunctions.h.

References asciidump::doc, fromNative(), and relativeConstraints::value.

Referenced by EcalTPGCrystalStatusXMLTranslator::dumpXML(), EcalPedestalsXMLTranslator::dumpXML(), EcalClusterEnergyCorrectionObjectSpecificXMLTranslator::dumpXML(), EcalChannelStatusXMLTranslator::dumpXML(), EcalADCToGeVXMLTranslator::dumpXML(), EcalDCSTowerStatusXMLTranslator::dumpXML(), EcalAlignmentXMLTranslator::dumpXML(), EcalTPGStripStatusXMLTranslator::dumpXML(), EcalTPGLinearizationConstXMLTranslator::dumpXML(), EcalClusterEnergyCorrectionXMLTranslator::dumpXML(), EcalLinearCorrectionsXMLTranslator::dumpXML(), EcalDAQTowerStatusXMLTranslator::dumpXML(), EcalTBWeightsXMLTranslator::dumpXML(), EcalTPGTowerStatusXMLTranslator::dumpXML(), EcalWeightGroupXMLTranslator::dumpXML(), ESGainXMLTranslator::dumpXML(), EcalGainRatiosXMLTranslator::dumpXML(), EcalLaserAPDPNRatiosXMLTranslator::dumpXML(), EcalFloatCondObjectContainerXMLTranslator::dumpXML(), EcalClusterCrackCorrXMLTranslator::dumpXML(), EcalTimeOffsetXMLTranslator::dumpXML(), EcalClusterLocalContCorrXMLTranslator::dumpXML(), and writeHeader().

    {

      xercesc::DOMDocument * doc = parentNode->getOwnerDocument();
      xercesc::DOMElement* new_node = doc->createElement(fromNative(tag).c_str());
      parentNode->appendChild(new_node);
      
      std::stringstream value_ss;
      value_ss <<value;
 
      xercesc::DOMText* tvalue = 
        doc->createTextNode(fromNative(value_ss.str()).c_str());
      new_node->appendChild(tvalue);
      
    }
const std::string xuti::x_tag ( "x"  )
const std::string xuti::y_tag ( "y"  )
const std::string xuti::z_tag ( "z"  )
const std::string xuti::zside_tag ( "zside"  )

Referenced by readCellId(), and writeCell().