CMS 3D CMS Logo

Public Member Functions

MuonDetLayerGeometryESProducer Class Reference

#include <MuonDetLayerGeometryESProducer.h>

Inheritance diagram for MuonDetLayerGeometryESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Member Functions

 MuonDetLayerGeometryESProducer (const edm::ParameterSet &p)
 Constructor.
boost::shared_ptr
< MuonDetLayerGeometry
produce (const MuonRecoGeometryRecord &record)
 Produce MuonDeLayerGeometry.
virtual ~MuonDetLayerGeometryESProducer ()
 Destructor.

Detailed Description

Definition at line 20 of file MuonDetLayerGeometryESProducer.h.


Constructor & Destructor Documentation

MuonDetLayerGeometryESProducer::MuonDetLayerGeometryESProducer ( const edm::ParameterSet p)

Constructor.

Definition at line 29 of file MuonDetLayerGeometryESProducer.cc.

                                                                                       {
  setWhatProduced(this);
}
MuonDetLayerGeometryESProducer::~MuonDetLayerGeometryESProducer ( ) [virtual]

Destructor.

Definition at line 34 of file MuonDetLayerGeometryESProducer.cc.

{}

Member Function Documentation

boost::shared_ptr< MuonDetLayerGeometry > MuonDetLayerGeometryESProducer::produce ( const MuonRecoGeometryRecord record)

Produce MuonDeLayerGeometry.

Definition at line 38 of file MuonDetLayerGeometryESProducer.cc.

References MuonDetLayerGeometry::addCSCLayers(), MuonDetLayerGeometry::addDTLayers(), MuonDetLayerGeometry::addRPCLayers(), MuonRPCDetLayerGeometryBuilder::buildBarrelLayers(), MuonRPCDetLayerGeometryBuilder::buildEndcapLayers(), MuonCSCDetLayerGeometryBuilder::buildLayers(), MuonDTDetLayerGeometryBuilder::buildLayers(), dt, alignCSCRings::e, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), edm::ESHandleBase::isValid(), metname, MuonDetLayerGeometry::sortLayers(), and AlCaHLTBitMon_QueryRunRegistry::string.

                                                                             {

  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonDetLayerGeometryESProducer";
  MuonDetLayerGeometry* muonDetLayerGeometry = new MuonDetLayerGeometry();
  
  // Build DT layers  
  try {
    edm::ESHandle<DTGeometry> dt;
    record.getRecord<MuonGeometryRecord>().get(dt);
    if (dt.isValid()) {
      muonDetLayerGeometry->addDTLayers(MuonDTDetLayerGeometryBuilder::buildLayers(*dt));
    }
  } catch (edm::eventsetup::NoProxyException<DTGeometry>& e) {
    // No DT geo available: trap the exception.
    LogInfo(metname) << "No DT geometry is available."; 
  }

  // Build CSC layers
  try {
    edm::ESHandle<CSCGeometry> csc;
    record.getRecord<MuonGeometryRecord>().get(csc);
    if (csc.isValid()) {
      muonDetLayerGeometry->addCSCLayers(MuonCSCDetLayerGeometryBuilder::buildLayers(*csc));
    }
  } catch (edm::eventsetup::NoProxyException<CSCGeometry>& e) {
    // No CSC geo available: trap the exception.
    LogInfo(metname) << "No CSC geometry is available.";
  }
  
  // Build RPC layers
  try {
    edm::ESHandle<RPCGeometry> rpc;
    record.getRecord<MuonGeometryRecord>().get(rpc);
    if (rpc.isValid()) {
      muonDetLayerGeometry->addRPCLayers(MuonRPCDetLayerGeometryBuilder::buildBarrelLayers(*rpc),MuonRPCDetLayerGeometryBuilder::buildEndcapLayers(*rpc));
    }
    
  } catch (edm::eventsetup::NoProxyException<RPCGeometry>& e) {
    // No RPC geo available: trap the exception.
    LogInfo(metname) << "No RPC geometry is available.";
  }  
  

  // Sort layers properly
  muonDetLayerGeometry->sortLayers();

  return boost::shared_ptr<MuonDetLayerGeometry>(muonDetLayerGeometry);
}