CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
WriteEcalMiscalibConstants.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: WriteEcalMiscalibConstants
4 // Class: WriteEcalMiscalibConstants
5 //
13 //
14 // Original Author: Stephanie BEAUCERON
15 // Created: Tue May 15 16:23:21 CEST 2007
16 //
17 //
18 
19 
20 // system include files
21 #include <iostream>
22 
23 // user include files
24 
25 
26 
27 
30 
31 // DB includes
34 
35 // user include files
38 //For Checks
39 
40 //this one
42 
43 //
44 // static data member definitions
45 //
46 
47 //
48 // constructors and destructor
49 //
51 {
52  //now do what ever initialization is needed
53  newTagRequest_ = iConfig.getParameter< std::string > ("NewTagRequest");
54 
55 
56 }
57 
58 
60 {
61 
62  // do anything here that needs to be done at desctruction time
63  // (e.g. close files, deallocate resources etc.)
64 
65 }
66 
67 
68 //
69 // member functions
70 //
71 
72 // ------------ method called to for each event ------------
73 void
75 {
76  using namespace edm;
77  // Intercalib constants
79  iSetup.get<EcalIntercalibConstantsRcd>().get(pIcal);
80  const EcalIntercalibConstants* Mcal = pIcal.product();
81 
83  if( poolDbService.isAvailable() ){
84  if ( poolDbService->isNewTagRequest(newTagRequest_) ){
85  std::cout<<" Creating a new one "<<std::endl;
86  poolDbService->createNewIOV<const EcalIntercalibConstants>( Mcal, poolDbService->beginOfTime(), poolDbService->endOfTime(),newTagRequest_);
87  std::cout<<"Done" << std::endl;
88  }else{
89  std::cout<<"Old One "<<std::endl;
90  poolDbService->appendSinceTime<const EcalIntercalibConstants>( Mcal, poolDbService->currentTime(),newTagRequest_);
91  }
92  }
93 }
94 
95 
96 // ------------ method called once each job just before starting event loop ------------
97 void
99 {
100 }
101 
102 // ------------ method called once each job just after ending the event loop ------------
103 void
104 
106  std::cout << "Here is the end" << std::endl;
107 }
108 
T getParameter(std::string const &) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
int iEvent
Definition: GenABIO.cc:230
WriteEcalMiscalibConstants(const edm::ParameterSet &)
const T & get() const
Definition: EventSetup.h:55
tuple cout
Definition: gather_cfg.py:121