CMS 3D CMS Logo

GlobalDetLayerGeometryESProducer.cc
Go to the documentation of this file.
2 
7 
8 #include <memory>
9 #include <string>
10 
11 using namespace edm;
12 
14  std::string myName = p.getParameter<std::string>("ComponentName");
15  auto cc = setWhatProduced(this, myName);
16  trackerToken_ = cc.consumes();
17  muonToken_ = cc.consumes();
18  mtdToken_ = cc.consumes();
19 }
20 
22 
23 std::unique_ptr<DetLayerGeometry> GlobalDetLayerGeometryESProducer::produce(const RecoGeometryRecord& iRecord) {
24  auto const& tracker = iRecord.get(trackerToken_);
25  auto const& muon = iRecord.get(muonToken_);
27 
28  // get the MTD if it is available
29  if (auto mtdRecord = iRecord.tryToGetRecord<MTDRecoGeometryRecord>()) {
30  mtd = mtdRecord->getHandle(mtdToken_);
31  if (!mtd.isValid()) {
32  LogInfo("GlobalDetLayergGeometryBuilder") << "No MTD geometry is available.";
33  }
34  } else {
35  LogInfo("GlobalDetLayerGeometryBuilder") << "No MTDRecoGeometryRecord is available.";
36  }
37 
38  // if we've got MTD initialize it
39  if (mtd.isValid())
40  return std::make_unique<GlobalDetLayerGeometry>(&tracker, &muon, mtd.product());
41 
42  return std::make_unique<GlobalDetLayerGeometry>(&tracker, &muon);
43 }
44 
ESHandle.h
muon
Definition: MuonCocktails.h:17
edm
HLT enums.
Definition: AlignableModifier.h:19
ESProducer.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
cc
edm::ESHandle
Definition: DTSurvey.h:22
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
GlobalDetLayerGeometryESProducer
Definition: GlobalDetLayerGeometryESProducer.h:10
GlobalDetLayerGeometryESProducer::GlobalDetLayerGeometryESProducer
GlobalDetLayerGeometryESProducer(const edm::ParameterSet &p)
Definition: GlobalDetLayerGeometryESProducer.cc:13
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
GlobalDetLayerGeometryESProducer::produce
std::unique_ptr< DetLayerGeometry > produce(const RecoGeometryRecord &)
Definition: GlobalDetLayerGeometryESProducer.cc:23
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
GlobalDetLayerGeometryESProducer::~GlobalDetLayerGeometryESProducer
~GlobalDetLayerGeometryESProducer() override
Definition: GlobalDetLayerGeometryESProducer.cc:21
GlobalDetLayerGeometryESProducer.h
RecoGeometryRecord
Definition: RecoGeometryRecord.h:15
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MTDRecoGeometryRecord
Definition: MTDRecoGeometryRecord.h:18
ModuleFactory.h
edm::eventsetup::DependentRecordImplementation::tryToGetRecord
std::optional< DepRecordT > tryToGetRecord() const
Definition: DependentRecordImplementation.h:71
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
EventSetup.h
mtd_digitizer
Definition: MTDDigitizer.h:34