CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/CondTools/DT/plugins/DTUserKeyedConfigPopConAnalyzer.cc

Go to the documentation of this file.
00001 #include "CondCore/PopCon/interface/PopConAnalyzer.h"
00002 #include "CondTools/DT/interface/DTUserKeyedConfigHandler.h"
00003 #include "FWCore/Framework/interface/ESHandle.h"
00004 #include "FWCore/Framework/interface/EventSetup.h"
00005 #include "CondCore/IOVService/interface/KeyList.h"
00006 #include "FWCore/Framework/interface/MakerMacros.h"
00007 #include "CondFormats/DTObjects/interface/DTKeyedConfig.h"
00008 #include "CondFormats/DataRecord/interface/DTKeyedConfigListRcd.h"
00009 
00010 //typedef popcon::PopConAnalyzer<DTUserKeyedConfigHandler> DTUserKeyedConfigPopConAnalyzer;
00011 class DTUserKeyedConfigPopConAnalyzer: public popcon::PopConAnalyzer<DTUserKeyedConfigHandler> {
00012  public:
00013   DTUserKeyedConfigPopConAnalyzer(const edm::ParameterSet& pset):
00014     popcon::PopConAnalyzer<DTUserKeyedConfigHandler>( pset ) {}
00015   virtual ~DTUserKeyedConfigPopConAnalyzer(){}
00016   virtual void analyze(const edm::Event& e, const edm::EventSetup& s){
00017 
00018     edm::ESHandle<cond::KeyList> klh;
00019     std::cout<<"got eshandle"<<std::endl;
00020     s.get<DTKeyedConfigListRcd>().get(klh);
00021     std::cout<<"got context"<<std::endl;
00022     cond::KeyList const &  kl= *klh.product();
00023     cond::KeyList* list = const_cast<cond::KeyList*>( &kl );
00024     for ( int i = 0; i < list->size(); i++ ) {
00025       if ( list->elem( i ) )
00026            std::cout << list->get<DTKeyedConfig>( i )->getId() << std::endl;
00027     }
00028     DTUserKeyedConfigHandler::setList( list );
00029 
00030   }
00031  private:
00032 };
00033 
00034 
00035 DEFINE_FWK_MODULE(DTUserKeyedConfigPopConAnalyzer);
00036