#include <RecoMuon/DetLayers/plugins/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.
References edm::ESProducer::setWhatProduced().
00029 { 00030 setWhatProduced(this); 00031 }
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(), e, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), edm::ESHandle< T >::isValid(), and MuonDetLayerGeometry::sortLayers().
00038 { 00039 00040 const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonDetLayerGeometryESProducer"; 00041 MuonDetLayerGeometry* muonDetLayerGeometry = new MuonDetLayerGeometry(); 00042 00043 // Build DT layers 00044 try { 00045 edm::ESHandle<DTGeometry> dt; 00046 record.getRecord<MuonGeometryRecord>().get(dt); 00047 if (dt.isValid()) { 00048 muonDetLayerGeometry->addDTLayers(MuonDTDetLayerGeometryBuilder::buildLayers(*dt)); 00049 } 00050 } catch (edm::eventsetup::NoProxyException<DTGeometry>& e) { 00051 // No DT geo available: trap the exception. 00052 LogInfo(metname) << "No DT geometry is available."; 00053 } 00054 00055 // Build CSC layers 00056 try { 00057 edm::ESHandle<CSCGeometry> csc; 00058 record.getRecord<MuonGeometryRecord>().get(csc); 00059 if (csc.isValid()) { 00060 muonDetLayerGeometry->addCSCLayers(MuonCSCDetLayerGeometryBuilder::buildLayers(*csc)); 00061 } 00062 } catch (edm::eventsetup::NoProxyException<CSCGeometry>& e) { 00063 // No CSC geo available: trap the exception. 00064 LogInfo(metname) << "No CSC geometry is available."; 00065 } 00066 00067 // Build RPC layers 00068 try { 00069 edm::ESHandle<RPCGeometry> rpc; 00070 record.getRecord<MuonGeometryRecord>().get(rpc); 00071 if (rpc.isValid()) { 00072 muonDetLayerGeometry->addRPCLayers(MuonRPCDetLayerGeometryBuilder::buildBarrelLayers(*rpc),MuonRPCDetLayerGeometryBuilder::buildEndcapLayers(*rpc)); 00073 } 00074 00075 } catch (edm::eventsetup::NoProxyException<RPCGeometry>& e) { 00076 // No RPC geo available: trap the exception. 00077 LogInfo(metname) << "No RPC geometry is available."; 00078 } 00079 00080 00081 // Sort layers properly 00082 muonDetLayerGeometry->sortLayers(); 00083 00084 return boost::shared_ptr<MuonDetLayerGeometry>(muonDetLayerGeometry); 00085 }