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
43  record.getRecord<MuonGeometryRecord>().get(dt);
44  if (dt.isValid()) {
45  muonDetLayerGeometry->addDTLayers(MuonDTDetLayerGeometryBuilder::buildLayers(*dt));
46  } else {
47  LogInfo(metname) << "No DT geometry is available.";
48  }
49 
50  // Build CSC layers
52  record.getRecord<MuonGeometryRecord>().get(csc);
53  if (csc.isValid()) {
54  muonDetLayerGeometry->addCSCLayers(MuonCSCDetLayerGeometryBuilder::buildLayers(*csc));
55  } else {
56  LogInfo(metname) << "No CSC geometry is available.";
57  }
58 
59  // Build RPC layers
61  record.getRecord<MuonGeometryRecord>().get(rpc);
62  if (rpc.isValid()) {
64  } else {
65  LogInfo(metname) << "No RPC geometry is available.";
66  }
67 
68 
69  // Sort layers properly
70  muonDetLayerGeometry->sortLayers();
71 
72  return boost::shared_ptr<MuonDetLayerGeometry>(muonDetLayerGeometry);
73 }
float dt
Definition: AMPTWrapper.h:126
JetCorrectorParameters::Record record
Definition: classes.h:7
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:47
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.