CMS 3D CMS Logo

GEMRecoIdealDBLoader.cc
Go to the documentation of this file.
22 
23 class GEMRecoIdealDBLoader : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
24 public:
26 
27  void beginRun(edm::Run const& iEvent, edm::EventSetup const&) override;
28  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {}
29  void endRun(edm::Run const& iEvent, edm::EventSetup const&) override {}
30 
31 private:
33 };
34 
36  fromDD4Hep_ = iC.getUntrackedParameter<bool>("fromDD4Hep", false); // set true for DD4HEP
37 }
38 
40  edm::LogInfo("GEMRecoIdealDBLoader") << "GEMRecoIdealDBLoader::beginRun";
41 
43  if (!mydbservice.isAvailable()) {
44  edm::LogError("GEMRecoIdealDBLoader") << "PoolDBOutputService unavailable";
45  return;
46  }
47 
48  if (mydbservice->isNewTagRequest("GEMRecoGeometryRcd")) {
52 
53  if (fromDD4Hep_) {
54  edm::LogVerbatim("GEMRecoIdealDBLoader") << "(0) GEMRecoIdealDBLoader - DD4HEP ";
56  es.get<IdealGeometryRecord>().get(pDD);
57  es.get<IdealGeometryRecord>().get(pMNDC);
58  const cms::DDCompactView& cpv = *pDD;
59  rpcpd.build(&cpv, *pMNDC, *rig);
60  } else {
61  edm::LogVerbatim("GEMRecoIdealDBLoader") << "(0) GEMRecoIdealDBLoader - DDD ";
63  es.get<IdealGeometryRecord>().get(pDD);
64  es.get<IdealGeometryRecord>().get(pMNDC);
65  const DDCompactView& cpv = *pDD;
66  rpcpd.build(&cpv, *pMNDC, *rig);
67  }
68  mydbservice->createNewIOV<RecoIdealGeometry>(
69  rig, mydbservice->beginOfTime(), mydbservice->endOfTime(), "GEMRecoGeometryRcd");
70  } else {
71  edm::LogError("GEMRecoIdealDBLoader") << "GEMRecoGeometryRcd Tag is already present";
72  }
73 }
74 
EDAnalyzer.h
ESTransientHandle.h
GEMGeometryParsFromDD
Definition: GEMGeometryParsFromDD.h:28
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:215
ESHandle.h
GEMRecoIdealDBLoader::beginRun
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
Definition: GEMRecoIdealDBLoader.cc:39
edm::Run
Definition: Run.h:45
GEMRecoIdealDBLoader
Definition: GEMRecoIdealDBLoader.cc:23
MuonGeometryConstants.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
MuonNumberingRecord.h
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
DDCompactView.h
GEMRecoIdealDBLoader::GEMRecoIdealDBLoader
GEMRecoIdealDBLoader(const edm::ParameterSet &)
Definition: GEMRecoIdealDBLoader.cc:35
MakerMacros.h
PoolDBOutputService.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
GEMRecoIdealDBLoader::fromDD4Hep_
bool fromDD4Hep_
Definition: GEMRecoIdealDBLoader.cc:32
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition: PoolDBOutputService.h:116
Service.h
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
edm::ESHandle
Definition: DTSurvey.h:22
GEMGeometryParsFromDD::build
void build(const DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
Definition: GEMGeometryParsFromDD.cc:37
DDCompactView.h
ParameterSetDescription.h
RecoIdealGeometry.h
GEMGeometryParsFromDD.h
GEMRecoIdealDBLoader::endRun
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
Definition: GEMRecoIdealDBLoader.cc:29
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
edm::Service< cond::service::PoolDBOutputService >
iEvent
int iEvent
Definition: GenABIO.cc:224
IdealGeometryRecord.h
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:213
GEMRecoIdealDBLoader::analyze
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
Definition: GEMRecoIdealDBLoader.cc:28
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
cms::DDCompactView
Definition: DDCompactView.h:31
EventSetup.h
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition: PoolDBOutputService.cc:128
GEMRecoGeometryRcd.h
ParameterSet.h
MuonGeometryRecord.h
edm::Event
Definition: Event.h:73
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
RecoIdealGeometry
Definition: RecoIdealGeometry.h:28