CMS 3D CMS Logo

CSCRecoIdealDBLoader.cc
Go to the documentation of this file.
20 
21 class CSCRecoIdealDBLoader : 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);
35 }
36 
38  edm::LogInfo("CSCRecoIdealDBLoader") << "CSCRecoIdealDBLoader::beginRun";
39 
43  if (!mydbservice.isAvailable()) {
44  edm::LogError("CSCRecoIdealDBLoader") << "PoolDBOutputService unavailable";
45  return;
46  }
47 
50 
51  if (fromDD4Hep_) {
53  es.get<IdealGeometryRecord>().get(pDD);
54  es.get<IdealGeometryRecord>().get(pMNDC);
55  const cms::DDCompactView& cpv = *pDD;
56  cscgp.build(&cpv, *pMNDC, *rig, *rdp);
57  } else {
59  es.get<IdealGeometryRecord>().get(pDD);
60  es.get<IdealGeometryRecord>().get(pMNDC);
61  const DDCompactView& cpv = *pDD;
62  cscgp.build(&cpv, *pMNDC, *rig, *rdp);
63  }
64 
65  if (mydbservice->isNewTagRequest("CSCRecoGeometryRcd")) {
66  mydbservice->createNewIOV<RecoIdealGeometry>(
67  rig, mydbservice->beginOfTime(), mydbservice->endOfTime(), "CSCRecoGeometryRcd");
68  } else {
69  edm::LogError("CSCRecoIdealDBLoader") << "CSCRecoGeometryRcd Tag is already present.";
70  }
71  if (mydbservice->isNewTagRequest("CSCRecoDigiParametersRcd")) {
72  mydbservice->createNewIOV<CSCRecoDigiParameters>(
73  rdp, mydbservice->beginOfTime(), mydbservice->endOfTime(), "CSCRecoDigiParametersRcd");
74  } else {
75  edm::LogError("CSCRecoIdealDBLoader") << "CSCRecoDigiParametersRcd Tag is already present.";
76  }
77 }
78 
CSCGeometryParsFromDD::build
bool build(const DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig, CSCRecoDigiParameters &rdp)
Build the geometry returning the RecoIdealGeometry and the CSCRecoDigiParameters objects.
Definition: CSCGeometryParsFromDD.cc:41
EDAnalyzer.h
ESTransientHandle.h
CSCRecoDigiParameters
Definition: CSCRecoDigiParameters.h:18
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:215
ESHandle.h
edm::Run
Definition: Run.h:45
CSCRecoIdealDBLoader::endRun
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
Definition: CSCRecoIdealDBLoader.cc:27
MuonGeometryConstants.h
CSCRecoIdealDBLoader::fromDD4Hep_
bool fromDD4Hep_
Definition: CSCRecoIdealDBLoader.cc:30
CSCRecoIdealDBLoader::CSCRecoIdealDBLoader
CSCRecoIdealDBLoader(edm::ParameterSet const &)
Definition: CSCRecoIdealDBLoader.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
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
CSCRecoGeometryRcd.h
edm::ESHandle
Definition: DTSurvey.h:22
CSCGeometryParsFromDD
Definition: CSCGeometryParsFromDD.h:29
DDCompactView.h
ParameterSetDescription.h
CSCRecoIdealDBLoader::analyze
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
Definition: CSCRecoIdealDBLoader.cc:26
RecoIdealGeometry.h
CSCRecoDigiParameters.h
edm::ParameterSet
Definition: ParameterSet.h:47
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
CSCRecoIdealDBLoader
Definition: CSCRecoIdealDBLoader.cc:21
CSCGeometryParsFromDD.h
cms::DDCompactView
Definition: DDCompactView.h:31
EventSetup.h
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition: PoolDBOutputService.cc:128
CSCRecoDigiParametersRcd.h
ParameterSet.h
MuonGeometryRecord.h
CSCRecoIdealDBLoader::beginRun
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
Definition: CSCRecoIdealDBLoader.cc:37
edm::Event
Definition: Event.h:73
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
RecoIdealGeometry
Definition: RecoIdealGeometry.h:28