CMS 3D CMS Logo

MuonDetLayerGeometryESProducer.cc
Go to the documentation of this file.
1 
11 
17 
24 
30 
32 
33 #include <memory>
34 
36 public:
39 
41  std::unique_ptr<MuonDetLayerGeometry> produce(const MuonRecoGeometryRecord& record);
42 
43  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
44 
45 private:
51 };
52 
53 using namespace edm;
54 
56  auto cc = setWhatProduced(this);
57  dtToken_ = cc.consumes();
58  cscToken_ = cc.consumes();
59  gemToken_ = cc.consumes();
60  me0Token_ = cc.consumes();
61  rpcToken_ = cc.consumes();
62 }
63 
64 std::unique_ptr<MuonDetLayerGeometry> MuonDetLayerGeometryESProducer::produce(const MuonRecoGeometryRecord& record) {
65  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonDetLayerGeometryESProducer";
66  auto muonDetLayerGeometry = std::make_unique<MuonDetLayerGeometry>();
67 
68  // Build DT layers
69  if (auto dt = record.getHandle(dtToken_)) {
70  muonDetLayerGeometry->addDTLayers(MuonDTDetLayerGeometryBuilder::buildLayers(*dt));
71  } else {
72  LogInfo(metname) << "No DT geometry is available.";
73  }
74 
75  // Build CSC layers
76  if (auto csc = record.getHandle(cscToken_)) {
77  muonDetLayerGeometry->addCSCLayers(MuonCSCDetLayerGeometryBuilder::buildLayers(*csc));
78  } else {
79  LogInfo(metname) << "No CSC geometry is available.";
80  }
81 
82  // Build GEM layers
83  if (auto gem = record.getHandle(gemToken_)) {
84  muonDetLayerGeometry->addGEMLayers(MuonGEMDetLayerGeometryBuilder::buildEndcapLayers(*gem));
85  } else {
86  LogInfo(metname) << "No GEM geometry is available.";
87  }
88 
89  // Build ME0 layers
90  if (auto me0 = record.getHandle(me0Token_)) {
91  muonDetLayerGeometry->addME0Layers(MuonME0DetLayerGeometryBuilder::buildEndcapLayers(*me0));
92  } else {
93  LogDebug(metname) << "No ME0 geometry is available.";
94  }
95 
96  // Build RPC layers
97  if (auto rpc = record.getHandle(rpcToken_)) {
98  muonDetLayerGeometry->addRPCLayers(MuonRPCDetLayerGeometryBuilder::buildBarrelLayers(*rpc),
100  } else {
101  LogInfo(metname) << "No RPC geometry is available.";
102  }
103 
104  // Sort layers properly
105  muonDetLayerGeometry->sortLayers();
106 
107  return muonDetLayerGeometry;
108 }
109 
112  //no parameters are used
113  descriptions.addDefault(desc);
114 }
115 
float dt
Definition: AMPTWrapper.h:136
const std::string metname
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtToken_
void addDefault(ParameterSetDescription const &psetDescription)
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildLayers(const CSCGeometry &geo)
static std::vector< DetLayer * > buildLayers(const DTGeometry &geo)
Operations.
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
Definition: L1Track.h:19
Log< level::Info, false > LogInfo
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildEndcapLayers(const ME0Geometry &geo)
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildEndcapLayers(const RPCGeometry &geo)
std::unique_ptr< MuonDetLayerGeometry > produce(const MuonRecoGeometryRecord &record)
Produce MuonDeLayerGeometry.
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > me0Token_
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcToken_
HLT enums.
MuonDetLayerGeometryESProducer(const edm::ParameterSet &p)
Constructor.
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscToken_
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > gemToken_
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildEndcapLayers(const GEMGeometry &geo)
#define LogDebug(id)
static std::vector< DetLayer * > buildBarrelLayers(const RPCGeometry &geo)
Builds the barrel layers. Result vector is sorted inside-out.