CMS 3D CMS Logo

MuonDetLayerGeometryESProducer.cc
Go to the documentation of this file.
1 
11 
17 
24 
30 
33 
34 #include <memory>
35 
37 public:
40 
42  std::unique_ptr<MuonDetLayerGeometry> produce(const MuonRecoGeometryRecord& record);
43 
44  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
45 
46 private:
52 };
53 
54 using namespace edm;
55 
57  setWhatProduced(this)
58  .setConsumes(dtToken_)
59  .setConsumes(cscToken_)
60  .setConsumes(gemToken_)
61  .setConsumes(me0Token_)
62  .setConsumes(rpcToken_);
63 }
64 
65 std::unique_ptr<MuonDetLayerGeometry> MuonDetLayerGeometryESProducer::produce(const MuonRecoGeometryRecord& record) {
66  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonDetLayerGeometryESProducer";
67  auto muonDetLayerGeometry = std::make_unique<MuonDetLayerGeometry>();
68 
69  // Build DT layers
70  if (auto dt = record.getHandle(dtToken_)) {
71  muonDetLayerGeometry->addDTLayers(MuonDTDetLayerGeometryBuilder::buildLayers(*dt));
72  } else {
73  LogInfo(metname) << "No DT geometry is available.";
74  }
75 
76  // Build CSC layers
77  if (auto csc = record.getHandle(cscToken_)) {
78  muonDetLayerGeometry->addCSCLayers(MuonCSCDetLayerGeometryBuilder::buildLayers(*csc));
79  } else {
80  LogInfo(metname) << "No CSC geometry is available.";
81  }
82 
83  // Build GEM layers
84  if (auto gem = record.getHandle(gemToken_)) {
85  muonDetLayerGeometry->addGEMLayers(MuonGEMDetLayerGeometryBuilder::buildEndcapLayers(*gem));
86  } else {
87  LogInfo(metname) << "No GEM geometry is available.";
88  }
89 
90  // Build ME0 layers
91  if (auto me0 = record.getHandle(me0Token_)) {
92  muonDetLayerGeometry->addME0Layers(MuonME0DetLayerGeometryBuilder::buildEndcapLayers(*me0));
93  } else {
94  LogDebug(metname) << "No ME0 geometry is available.";
95  }
96 
97  // Build RPC layers
98  if (auto rpc = record.getHandle(rpcToken_)) {
99  muonDetLayerGeometry->addRPCLayers(MuonRPCDetLayerGeometryBuilder::buildBarrelLayers(*rpc),
101  } else {
102  LogInfo(metname) << "No RPC geometry is available.";
103  }
104 
105  // Sort layers properly
106  muonDetLayerGeometry->sortLayers();
107 
108  return muonDetLayerGeometry;
109 }
110 
113  //no parameters are used
114  descriptions.addDefault(desc);
115 }
116 
MuonRPCDetLayerGeometryBuilder::buildEndcapLayers
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildEndcapLayers(const RPCGeometry &geo)
Definition: MuonRPCDetLayerGeometryBuilder.cc:32
MuonGEMDetLayerGeometryBuilder.h
MessageLogger.h
MuonDTDetLayerGeometryBuilder.h
ESHandle.h
MuonCSCDetLayerGeometryBuilder.h
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
GlobalPosition_Frontier_DevDB_cff.record
record
Definition: GlobalPosition_Frontier_DevDB_cff.py:10
MuonDetLayerGeometryESProducer
Definition: MuonDetLayerGeometryESProducer.cc:36
MuonDetLayerGeometryESProducer::rpcToken_
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcToken_
Definition: MuonDetLayerGeometryESProducer.cc:51
MuonDetLayerGeometry.h
MuonDetLayerGeometryESProducer::produce
std::unique_ptr< MuonDetLayerGeometry > produce(const MuonRecoGeometryRecord &record)
Produce MuonDeLayerGeometry.
Definition: MuonDetLayerGeometryESProducer.cc:65
MuonCSCDetLayerGeometryBuilder::buildLayers
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildLayers(const CSCGeometry &geo)
Definition: MuonCSCDetLayerGeometryBuilder.cc:17
dt
float dt
Definition: AMPTWrapper.h:136
MuonRecoGeometryRecord
Definition: MuonRecoGeometryRecord.h:17
csc
Definition: L1Track.h:19
MuonDetLayerGeometryESProducer::MuonDetLayerGeometryESProducer
MuonDetLayerGeometryESProducer(const edm::ParameterSet &p)
Constructor.
Definition: MuonDetLayerGeometryESProducer.cc:56
MuonDetLayerGeometryESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: MuonDetLayerGeometryESProducer.cc:111
MuonDetLayerGeometryESProducer::gemToken_
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > gemToken_
Definition: MuonDetLayerGeometryESProducer.cc:49
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DTGeometry.h
MuonME0DetLayerGeometryBuilder::buildEndcapLayers
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildEndcapLayers(const ME0Geometry &geo)
Definition: MuonME0DetLayerGeometryBuilder.cc:25
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
mixOne_premix_on_sim_cfi.me0
me0
Definition: mixOne_premix_on_sim_cfi.py:309
MuonME0DetLayerGeometryBuilder.h
MuonDetLayerGeometryESProducer::dtToken_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtToken_
Definition: MuonDetLayerGeometryESProducer.cc:47
MuonDetLayerGeometryESProducer::cscToken_
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscToken_
Definition: MuonDetLayerGeometryESProducer.cc:48
MuonDTDetLayerGeometryBuilder::buildLayers
static std::vector< DetLayer * > buildLayers(const DTGeometry &geo)
Operations.
Definition: MuonDTDetLayerGeometryBuilder.cc:21
MuonGEMDetLayerGeometryBuilder::buildEndcapLayers
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildEndcapLayers(const GEMGeometry &geo)
Definition: MuonGEMDetLayerGeometryBuilder.cc:24
MuonRecoGeometryRecord.h
gem
Definition: AMC13Event.h:6
edm::ESGetToken< DTGeometry, MuonGeometryRecord >
ME0Geometry.h
ModuleFactory.h
GEMGeometry.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
MuonRPCDetLayerGeometryBuilder::buildBarrelLayers
static std::vector< DetLayer * > buildBarrelLayers(const RPCGeometry &geo)
Builds the barrel layers. Result vector is sorted inside-out.
Definition: MuonRPCDetLayerGeometryBuilder.cc:150
MuonDetLayerGeometryESProducer::me0Token_
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > me0Token_
Definition: MuonDetLayerGeometryESProducer.cc:50
EventSetup.h
edm::ESProducer
Definition: ESProducer.h:101
ParameterSet.h
MuonRPCDetLayerGeometryBuilder.h
MuonGeometryRecord.h
NoProxyException.h
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
omtf::DataWord64::rpc
Definition: OmtfDataWord64.h:16
RPCGeometry.h
CSCGeometry.h
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:43