CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

XMLIdealGeometryESSource Class Reference

#include <XMLIdealGeometryESSource.h>

Inheritance diagram for XMLIdealGeometryESSource:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Member Functions

std::auto_ptr< DDCompactViewproduce ()
std::auto_ptr< DDCompactViewproduceGeom (const IdealGeometryRecord &)
std::auto_ptr< DDCompactViewproduceMagField (const IdealMagneticFieldRecord &)
 XMLIdealGeometryESSource (const edm::ParameterSet &p)
virtual ~XMLIdealGeometryESSource ()

Protected Member Functions

virtual void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)

Private Member Functions

const XMLIdealGeometryESSourceoperator= (const XMLIdealGeometryESSource &)
 XMLIdealGeometryESSource (const XMLIdealGeometryESSource &)

Private Attributes

GeometryConfiguration geoConfig_
std::string rootNodeName_
bool userNS_

Detailed Description

Definition at line 16 of file XMLIdealGeometryESSource.h.


Constructor & Destructor Documentation

XMLIdealGeometryESSource::XMLIdealGeometryESSource ( const edm::ParameterSet p)

Definition at line 23 of file XMLIdealGeometryESSource.cc.

References Exception, edm::ParameterSet::getParameter(), produceGeom(), produceMagField(), rootNodeName_, and edm::ESProducer::setWhatProduced().

                                                                           : rootNodeName_(p.getParameter<std::string>("rootNodeName")),
                                                                                 userNS_(p.getUntrackedParameter<bool>("userControlledNamespace", false)),
                                                                                 geoConfig_(p)
{
  if ( rootNodeName_ == "" || rootNodeName_ == "\\" ) {
    throw cms::Exception("DDException") << "XMLIdealGeometryESSource must have a root node name.";
  }
  
  if ( rootNodeName_ == "MagneticFieldVolumes:MAGF" ||  rootNodeName_ == "cmsMagneticField:MAGF") {
    setWhatProduced(this, &XMLIdealGeometryESSource::produceMagField, 
                    edm::es::Label(p.getParameter<std::string>("@module_label")));
    findingRecord<IdealMagneticFieldRecord>();
  } else {
    setWhatProduced(this, &XMLIdealGeometryESSource::produceGeom, 
                    edm::es::Label(p.getParameter<std::string>("@module_label")));
    findingRecord<IdealGeometryRecord>();
  }
}
XMLIdealGeometryESSource::~XMLIdealGeometryESSource ( ) [virtual]

Definition at line 42 of file XMLIdealGeometryESSource.cc.

{ }
XMLIdealGeometryESSource::XMLIdealGeometryESSource ( const XMLIdealGeometryESSource ) [private]

Member Function Documentation

const XMLIdealGeometryESSource& XMLIdealGeometryESSource::operator= ( const XMLIdealGeometryESSource ) [private]
std::auto_ptr< DDCompactView > XMLIdealGeometryESSource::produce ( )

Definition at line 58 of file XMLIdealGeometryESSource.cc.

References Exception, geoConfig_, DDLParser::getDDLSAX2FileHandler(), instance, DDBase< N, C >::isValid(), DDLParser::parse(), geometryXMLtoCSV::parser, rootNodeName_, DDLSAX2Handler::setUserNS(), and userNS_.

Referenced by produceGeom(), and produceMagField().

                                  {
  
  DDName ddName(rootNodeName_);
  DDLogicalPart rootNode(ddName);
  DDRootDef::instance().set(rootNode);
  std::auto_ptr<DDCompactView> returnValue(new DDCompactView(rootNode));
  DDLParser parser(*returnValue); //* parser = DDLParser::instance();
  parser.getDDLSAX2FileHandler()->setUserNS(userNS_);
  int result2 = parser.parse(geoConfig_);
  if (result2 != 0) throw cms::Exception("DDException") << "DDD-Parser: parsing failed!";

  // after parsing the root node should be valid!

  if( !rootNode.isValid() ){
    throw cms::Exception("Geometry")<<"There is no valid node named \""
                                    <<rootNodeName_<<"\"";
  }
  returnValue->lockdown();  
  return returnValue;
}
std::auto_ptr< DDCompactView > XMLIdealGeometryESSource::produceGeom ( const IdealGeometryRecord )

Definition at line 45 of file XMLIdealGeometryESSource.cc.

References produce().

Referenced by XMLIdealGeometryESSource().

{
  return produce();
}
std::auto_ptr< DDCompactView > XMLIdealGeometryESSource::produceMagField ( const IdealMagneticFieldRecord )

Definition at line 51 of file XMLIdealGeometryESSource.cc.

References produce().

Referenced by XMLIdealGeometryESSource().

{ 
  return produce();
}
void XMLIdealGeometryESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue iosv,
edm::ValidityInterval oValidity 
) [protected, virtual]

Member Data Documentation

Definition at line 33 of file XMLIdealGeometryESSource.h.

Referenced by produce().

Definition at line 31 of file XMLIdealGeometryESSource.h.

Referenced by produce(), and XMLIdealGeometryESSource().

Definition at line 32 of file XMLIdealGeometryESSource.h.

Referenced by produce().