CMS 3D CMS Logo

WriteEcalMiscalibConstantsMC.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: WriteEcalMiscalibConstantsMC
4 // Class: WriteEcalMiscalibConstantsMC
5 //
13 //
14 // Original Author: Stephanie BEAUCERON
15 // Created: Tue May 15 16:23:21 CEST 2007
16 //
17 //
18 
19 // system include files
20 #include <iostream>
21 
22 // user include files
23 
26 
27 // DB includes
30 
31 // user include files
34 //For Checks
35 
36 //this one
38 
39 //
40 // static data member definitions
41 //
42 
43 //
44 // constructors and destructor
45 //
47  //now do what ever initialization is needed
48  newTagRequest_ = iConfig.getParameter<std::string>("NewTagRequest");
49 }
50 
52  // do anything here that needs to be done at desctruction time
53  // (e.g. close files, deallocate resources etc.)
54 }
55 
56 //
57 // member functions
58 //
59 
60 // ------------ method called to for each event ------------
62  using namespace edm;
63  // Intercalib constants
65  iSetup.get<EcalIntercalibConstantsMCRcd>().get(pIcal);
66  const EcalIntercalibConstantsMC* Mcal = pIcal.product();
67 
69  if (poolDbService.isAvailable()) {
70  if (poolDbService->isNewTagRequest(newTagRequest_)) {
71  std::cout << " Creating a new one " << std::endl;
72  poolDbService->createNewIOV<const EcalIntercalibConstantsMC>(
73  Mcal, poolDbService->beginOfTime(), poolDbService->endOfTime(), newTagRequest_);
74  std::cout << "Done" << std::endl;
75  } else {
76  std::cout << "Old One " << std::endl;
77  poolDbService->appendSinceTime<const EcalIntercalibConstantsMC>(
78  Mcal, poolDbService->currentTime(), newTagRequest_);
79  }
80  }
81 }
82 
83 // ------------ method called once each job just before starting event loop ------------
85 
86 // ------------ method called once each job just after ending the event loop ------------
87 void
88 
90  std::cout << "Here is the end" << std::endl;
91 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
EcalIntercalibConstantsMC.h
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:187
ESHandle.h
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
WriteEcalMiscalibConstantsMC::beginJob
void beginJob() override
Definition: WriteEcalMiscalibConstantsMC.cc:84
cond::service::PoolDBOutputService::appendSinceTime
void appendSinceTime(const T *payloadObj, cond::Time_t sinceTime, const std::string &recordName)
Definition: PoolDBOutputService.h:135
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
WriteEcalMiscalibConstantsMC.h
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
PoolDBOutputService.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
WriteEcalMiscalibConstantsMC::~WriteEcalMiscalibConstantsMC
~WriteEcalMiscalibConstantsMC() override
Definition: WriteEcalMiscalibConstantsMC.cc:51
EcalIntercalibConstantsMCRcd.h
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition: PoolDBOutputService.h:110
Service.h
WriteEcalMiscalibConstantsMC::endJob
void endJob() override
Definition: WriteEcalMiscalibConstantsMC.cc:89
edm::ESHandle
Definition: DTSurvey.h:22
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalIntercalibConstantsMCRcd
Definition: EcalIntercalibConstantsMCRcd.h:5
edm::ParameterSet
Definition: ParameterSet.h:47
WriteEcalMiscalibConstantsMC::WriteEcalMiscalibConstantsMC
WriteEcalMiscalibConstantsMC(const edm::ParameterSet &)
Definition: WriteEcalMiscalibConstantsMC.cc:46
edm::Service< cond::service::PoolDBOutputService >
WriteEcalMiscalibConstantsMC::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: WriteEcalMiscalibConstantsMC.cc:61
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:185
EventSetup.h
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition: PoolDBOutputService.cc:100
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::Event
Definition: Event.h:73
WriteEcalMiscalibConstantsMC::newTagRequest_
std::string newTagRequest_
Definition: WriteEcalMiscalibConstantsMC.h:35
cond::service::PoolDBOutputService::currentTime
cond::Time_t currentTime() const
Definition: PoolDBOutputService.cc:189