CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonDetLayerGeometryESProducer.cc
Go to the documentation of this file.
1 
8 
12 
16 
19 
22 
23 #include <memory>
24 
25 using namespace edm;
26 
28  setWhatProduced(this);
29 }
30 
31 
33 
34 
35 boost::shared_ptr<MuonDetLayerGeometry>
37 
38  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonDetLayerGeometryESProducer";
39  MuonDetLayerGeometry* muonDetLayerGeometry = new MuonDetLayerGeometry();
40 
41  // Build DT layers
42  try {
44  record.getRecord<MuonGeometryRecord>().get(dt);
45  if (dt.isValid()) {
46  muonDetLayerGeometry->addDTLayers(MuonDTDetLayerGeometryBuilder::buildLayers(*dt));
47  }
49  // No DT geo available: trap the exception.
50  LogInfo(metname) << "No DT geometry is available.";
51  }
52 
53  // Build CSC layers
54  try {
56  record.getRecord<MuonGeometryRecord>().get(csc);
57  if (csc.isValid()) {
58  muonDetLayerGeometry->addCSCLayers(MuonCSCDetLayerGeometryBuilder::buildLayers(*csc));
59  }
61  // No CSC geo available: trap the exception.
62  LogInfo(metname) << "No CSC geometry is available.";
63  }
64 
65  // Build RPC layers
66  try {
68  record.getRecord<MuonGeometryRecord>().get(rpc);
69  if (rpc.isValid()) {
71  }
72 
74  // No RPC geo available: trap the exception.
75  LogInfo(metname) << "No RPC geometry is available.";
76  }
77 
78 
79  // Sort layers properly
80  muonDetLayerGeometry->sortLayers();
81 
82  return boost::shared_ptr<MuonDetLayerGeometry>(muonDetLayerGeometry);
83 }
float dt
Definition: AMPTWrapper.h:126
const std::string metname
void addDTLayers(const std::vector< DetLayer * > &dtlayers)
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildLayers(const CSCGeometry &geo)
static std::vector< DetLayer * > buildLayers(const DTGeometry &geo)
Operations.
boost::shared_ptr< MuonDetLayerGeometry > produce(const MuonRecoGeometryRecord &record)
Produce MuonDeLayerGeometry.
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildEndcapLayers(const RPCGeometry &geo)
void addRPCLayers(const std::vector< DetLayer * > &barrelRPCLayers, const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &endcapRPCLayers)
MuonDetLayerGeometryESProducer(const edm::ParameterSet &p)
Constructor.
bool isValid() const
Definition: ESHandle.h:37
void addCSCLayers(const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &csclayers)
static std::vector< DetLayer * > buildBarrelLayers(const RPCGeometry &geo)
Builds the barrel layers. Result vector is sorted inside-out.