CMS 3D CMS Logo

ME0RecoIdealDBLoader.cc
Go to the documentation of this file.
20 
21 class ME0RecoIdealDBLoader : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
22 public:
24 
25  void beginRun(edm::Run const& iEvent, edm::EventSetup const&) override;
26  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {}
27  void endRun(edm::Run const& iEvent, edm::EventSetup const&) override {}
28 
29 private:
31 };
32 
34  fromDD4Hep_ = iC.getUntrackedParameter<bool>("fromDD4Hep", false); // set true for DD4HEP
35 }
36 
38  edm::LogInfo("ME0RecoIdealDBLoader") << "ME0RecoIdealDBLoader::beginRun";
39 
41  if (!mydbservice.isAvailable()) {
42  edm::LogError("ME0RecoIdealDBLoader") << "PoolDBOutputService unavailable";
43  return;
44  }
45 
46  if (mydbservice->isNewTagRequest("ME0RecoGeometryRcd")) {
50  if (fromDD4Hep_) {
51  edm::LogVerbatim("ME0RecoIdealDBLoader") << "(0) ME0RecoIdealDBLoader - DD4HEP ";
53  es.get<IdealGeometryRecord>().get(pDD);
54  es.get<IdealGeometryRecord>().get(pMNDC);
55  const cms::DDCompactView& cpv = *pDD;
56  me0pd.build(&cpv, *pMNDC, *rig);
57  } else {
58  edm::LogVerbatim("ME0RecoIdealDBLoader") << "(0) ME0RecoIdealDBLoader - DDD ";
60  es.get<IdealGeometryRecord>().get(pDD);
61  es.get<IdealGeometryRecord>().get(pMNDC);
62  const DDCompactView& cpv = *pDD;
63  me0pd.build(&cpv, *pMNDC, *rig);
64  }
65  mydbservice->createNewIOV<RecoIdealGeometry>(
66  rig, mydbservice->beginOfTime(), mydbservice->endOfTime(), "ME0RecoGeometryRcd");
67  } else {
68  edm::LogError("ME0RecoIdealDBLoader") << "ME0RecoGeometryRcd Tag is already present";
69  }
70 }
71 
EDAnalyzer.h
ESTransientHandle.h
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:215
ESHandle.h
edm::Run
Definition: Run.h:45
MuonGeometryConstants.h
ME0RecoIdealDBLoader::ME0RecoIdealDBLoader
ME0RecoIdealDBLoader(const edm::ParameterSet &)
Definition: ME0RecoIdealDBLoader.cc:33
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
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
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
DDCompactView.h
ParameterSetDescription.h
RecoIdealGeometry.h
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
ME0GeometryParsFromDD.h
ME0RecoIdealDBLoader::fromDD4Hep_
bool fromDD4Hep_
Definition: ME0RecoIdealDBLoader.cc:30
ME0RecoIdealDBLoader::analyze
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
Definition: ME0RecoIdealDBLoader.cc:26
edm::Service< cond::service::PoolDBOutputService >
iEvent
int iEvent
Definition: GenABIO.cc:224
ME0RecoIdealDBLoader
Definition: ME0RecoIdealDBLoader.cc:21
ME0RecoIdealDBLoader::beginRun
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
Definition: ME0RecoIdealDBLoader.cc:37
IdealGeometryRecord.h
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
ME0RecoIdealDBLoader::endRun
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
Definition: ME0RecoIdealDBLoader.cc:27
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
ME0GeometryParsFromDD::build
void build(const DDCompactView *, const MuonGeometryConstants &, RecoIdealGeometry &)
Definition: ME0GeometryParsFromDD.cc:29
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:213
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
ME0RecoGeometryRcd.h
cms::DDCompactView
Definition: DDCompactView.h:31
EventSetup.h
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition: PoolDBOutputService.cc:128
ME0GeometryParsFromDD
Definition: ME0GeometryParsFromDD.h:25
ParameterSet.h
MuonGeometryRecord.h
edm::Event
Definition: Event.h:73
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
RecoIdealGeometry
Definition: RecoIdealGeometry.h:28