CMS 3D CMS Logo

HcalParametersDBBuilder.cc
Go to the documentation of this file.
10 
11 class HcalParametersDBBuilder : public edm::one::EDAnalyzer<edm::one::WatchRuns>
12 {
13 public:
14 
16 
17  void beginRun(edm::Run const& iEvent, edm::EventSetup const&) override;
18  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {}
19  void endRun(edm::Run const& iEvent, edm::EventSetup const&) override {}
20 };
21 
22 void
24 {
25  HcalParameters* php = new HcalParameters;
27  if( !mydbservice.isAvailable()) {
28  edm::LogError( "HcalParametersDBBuilder" ) << "PoolDBOutputService unavailable";
29  return;
30  }
32  es.get<IdealGeometryRecord>().get( cpv );
33 
34  HcalParametersFromDD builder;
35  builder.build( &(*cpv), *php );
36 
37  if( mydbservice->isNewTagRequest( "HcalParametersRcd" )) {
38  mydbservice->createNewIOV<HcalParameters>( php, mydbservice->beginOfTime(), mydbservice->endOfTime(), "HcalParametersRcd" );
39  } else {
40  edm::LogError( "HcalParametersDBBuilder" ) << "HcalParameters and HcalParametersRcd Tag already present";
41  }
42 }
43 
bool build(const DDCompactView *, HcalParameters &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
HcalParametersDBBuilder(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:230
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:46
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
const T & get() const
Definition: EventSetup.h:59
Definition: Run.h:43