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 
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<EcalIntercalibConstantsMCRcd>().get(pIcal);
80  const EcalIntercalibConstantsMC* 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 EcalIntercalibConstantsMC>( 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 EcalIntercalibConstantsMC>( 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
void analyze(const edm::Event &, const edm::EventSetup &) override
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
int iEvent
Definition: GenABIO.cc:230
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:46
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
HLT enums.
T get() const
Definition: EventSetup.h:68
WriteEcalMiscalibConstantsMC(const edm::ParameterSet &)
T const * product() const
Definition: ESHandle.h:84