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 
10 
14 
18 
21 
24 
25 #include <memory>
26 
27 using namespace edm;
28 
30  setWhatProduced(this);
31 }
32 
33 
35 
36 
37 boost::shared_ptr<MuonDetLayerGeometry>
39 
40  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonDetLayerGeometryESProducer";
41  MuonDetLayerGeometry* muonDetLayerGeometry = new MuonDetLayerGeometry();
42 
43  // Build DT layers
44  try {
46  record.getRecord<MuonGeometryRecord>().get(dt);
47  if (dt.isValid()) {
48  muonDetLayerGeometry->addDTLayers(MuonDTDetLayerGeometryBuilder::buildLayers(*dt));
49  }
51  // No DT geo available: trap the exception.
52  LogInfo(metname) << "No DT geometry is available.";
53  }
54 
55  // Build CSC layers
56  try {
58  record.getRecord<MuonGeometryRecord>().get(csc);
59  if (csc.isValid()) {
60  muonDetLayerGeometry->addCSCLayers(MuonCSCDetLayerGeometryBuilder::buildLayers(*csc));
61  }
63  // No CSC geo available: trap the exception.
64  LogInfo(metname) << "No CSC geometry is available.";
65  }
66 
67  // Build RPC layers
68  try {
70  record.getRecord<MuonGeometryRecord>().get(rpc);
71  if (rpc.isValid()) {
73  }
74 
76  // No RPC geo available: trap the exception.
77  LogInfo(metname) << "No RPC geometry is available.";
78  }
79 
80 
81  // Sort layers properly
82  muonDetLayerGeometry->sortLayers();
83 
84  return boost::shared_ptr<MuonDetLayerGeometry>(muonDetLayerGeometry);
85 }
float dt
Definition: AMPTWrapper.h:126
JetCorrectorParameters::Record record
Definition: classes.h:13
const std::string metname
void addDTLayers(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.
void addRPCLayers(std::vector< DetLayer * > barrelRPCLayers, std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > endcapRPCLayers)
void addCSCLayers(std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > csclayers)
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildEndcapLayers(const RPCGeometry &geo)
MuonDetLayerGeometryESProducer(const edm::ParameterSet &p)
Constructor.
bool isValid() const
Definition: ESHandle.h:37
static std::vector< DetLayer * > buildBarrelLayers(const RPCGeometry &geo)
Builds the barrel layers. Result vector is sorted inside-out.