CMS 3D CMS Logo

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