#include <MuonDetLayerGeometryESProducer.h>
Public Member Functions | |
MuonDetLayerGeometryESProducer (const edm::ParameterSet &p) | |
Constructor. | |
boost::shared_ptr < MuonDetLayerGeometry > | produce (const MuonRecoGeometryRecord &record) |
Produce MuonDeLayerGeometry. | |
virtual | ~MuonDetLayerGeometryESProducer () |
Destructor. |
Definition at line 20 of file MuonDetLayerGeometryESProducer.h.
MuonDetLayerGeometryESProducer::MuonDetLayerGeometryESProducer | ( | const edm::ParameterSet & | p | ) |
Constructor.
Definition at line 29 of file MuonDetLayerGeometryESProducer.cc.
{ setWhatProduced(this); }
MuonDetLayerGeometryESProducer::~MuonDetLayerGeometryESProducer | ( | ) | [virtual] |
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, and MuonDetLayerGeometry::sortLayers().
{ 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); }