CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 // user include files
22 
23 // DB includes
26 
27 // user include files
28 //this one
30 
31 //
32 // static data member definitions
33 //
34 
35 //
36 // constructors and destructor
37 //
39  : newTagRequest_(iConfig.getParameter<std::string>("NewTagRequest")), intercalibConstsToken_(esConsumes()) {}
40 
42 
43 //
44 // member functions
45 //
46 
47 // ------------ method called to for each event ------------
49  using namespace edm;
50  // Intercalib constants
52 
54  if (poolDbService.isAvailable()) {
55  if (poolDbService->isNewTagRequest(newTagRequest_)) {
56  edm::LogVerbatim("WriteEcalMiscalibConstantsMC") << "Creating a new IOV";
57  poolDbService->createOneIOV<const EcalIntercalibConstantsMC>(*Mcal, poolDbService->beginOfTime(), newTagRequest_);
58  edm::LogVerbatim("WriteEcalMiscalibConstantsMC") << "Done";
59  } else {
60  edm::LogVerbatim("WriteEcalMiscalibConstantsMC") << "Old IOV";
61  poolDbService->appendOneIOV<const EcalIntercalibConstantsMC>(*Mcal, poolDbService->currentTime(), newTagRequest_);
62  }
63  }
64 }
65 
66 // ------------ method called once each job just before starting event loop ------------
68 
69 // ------------ method called once each job just after ending the event loop ------------
70 void WriteEcalMiscalibConstantsMC::endJob() { edm::LogVerbatim("WriteEcalMiscalibConstantsMC") << "Here is the end"; }
Log< level::Info, true > LogVerbatim
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
void analyze(const edm::Event &, const edm::EventSetup &) override
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
int iEvent
Definition: GenABIO.cc:224
bool isNewTagRequest(const std::string &recordName)
HLT enums.
WriteEcalMiscalibConstantsMC(const edm::ParameterSet &)
bool isAvailable() const
Definition: Service.h:40
const edm::ESGetToken< EcalIntercalibConstantsMC, EcalIntercalibConstantsMCRcd > intercalibConstsToken_