CMS 3D CMS Logo

ME0RecoIdealDBLoader.cc
Go to the documentation of this file.
6 
14 
15 class ME0RecoIdealDBLoader : public edm::one::EDAnalyzer<edm::one::WatchRuns>
16 {
17 public:
18 
20 
21  void beginRun(edm::Run const& iEvent, edm::EventSetup const&) override;
22  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {}
23  void endRun(edm::Run const& iEvent, edm::EventSetup const&) override {}
24 };
25 
26 void
28 {
29  edm::LogInfo("ME0RecoIdealDBLoader")<<"ME0RecoIdealDBLoader::beginRun";
30 
32  if( !mydbservice.isAvailable())
33  {
34  edm::LogError( "ME0RecoIdealDBLoader" ) << "PoolDBOutputService unavailable";
35  return;
36  }
37 
38  if( mydbservice->isNewTagRequest( "ME0RecoGeometryRcd" ))
39  {
42  es.get<IdealGeometryRecord>().get( pDD );
43  es.get<MuonNumberingRecord>().get( pMNDC );
44 
45  const DDCompactView& cpv = *pDD;
47 
49  me0pd.build( &cpv, *pMNDC, *rig );
50 
51  mydbservice->createNewIOV<RecoIdealGeometry>( rig,
52  mydbservice->beginOfTime(),
53  mydbservice->endOfTime(),
54  "ME0RecoGeometryRcd" );
55  }
56  else
57  {
58  edm::LogError( "ME0RecoIdealDBLoader" ) << "ME0RecoGeometryRcd Tag is already present";
59  }
60 }
61 
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
void build(const DDCompactView *, const MuonDDDConstants &, RecoIdealGeometry &)
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:40
ME0RecoIdealDBLoader(const edm::ParameterSet &)
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
T get() const
Definition: EventSetup.h:71
Definition: Run.h:45
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override