CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/CondTools/DT/plugins/DTKeyedConfigDBInit.cc

Go to the documentation of this file.
00001 /*
00002  *  See header file for a description of this class.
00003  *
00004  *  $Date: 2012/02/15 16:04:15 $
00005  *  $Revision: 1.4 $
00006  *  \author Paolo Ronchese INFN Padova
00007  *
00008  */
00009 
00010 //-----------------------
00011 // This Class' Header --
00012 //-----------------------
00013 #include "CondTools/DT/plugins/DTKeyedConfigDBInit.h"
00014 
00015 //-------------------------------
00016 // Collaborating Class Headers --
00017 //-------------------------------
00018 #include "CondFormats/DTObjects/interface/DTKeyedConfig.h"
00019 #include "FWCore/Framework/interface/MakerMacros.h"
00020 #include "FWCore/ServiceRegistry/interface/Service.h"
00021 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
00022 #include "CondCore/DBOutputService/interface/KeyedElement.h"
00023 
00024 //---------------
00025 // C++ Headers --
00026 //---------------
00027 #include <iostream>
00028 
00029 //-------------------
00030 // Initializations --
00031 //-------------------
00032 
00033 
00034 //----------------
00035 // Constructors --
00036 //----------------
00037 DTKeyedConfigDBInit::DTKeyedConfigDBInit( const edm::ParameterSet& ps ):
00038  container(  ps.getParameter<std::string> ( "container" ) ),
00039  iov(        ps.getParameter<std::string> ( "iov"       ) ) {
00040 }
00041 
00042 //--------------
00043 // Destructor --
00044 //--------------
00045 DTKeyedConfigDBInit::~DTKeyedConfigDBInit() {
00046 }
00047 
00048 //--------------
00049 // Operations --
00050 //--------------
00051 void DTKeyedConfigDBInit::beginJob() {
00052   return;
00053 }
00054 
00055 
00056 void DTKeyedConfigDBInit::analyze( const edm::Event& e,
00057                                    const edm::EventSetup& c ) {
00058   return;
00059 }
00060 
00061 
00062 void DTKeyedConfigDBInit::endJob() {
00063 
00064   edm::Service<cond::service::PoolDBOutputService> outdb;
00065   DTKeyedConfig* bk = new DTKeyedConfig();
00066   bk->setId( 999999999 );
00067   bk->add( "dummy" );
00068   cond::KeyedElement k( bk, 999999999 );
00069   outdb->writeOne( k.m_obj, k.m_key, container );
00070 
00071   std::vector<cond::Time_t> * kl = new std::vector<cond::Time_t>;
00072   kl->push_back( 999999999 );
00073   outdb->writeOne(kl,1,iov);
00074 
00075   return;
00076 
00077 }
00078 
00079 
00080 DEFINE_FWK_MODULE(DTKeyedConfigDBInit);
00081