CMS 3D CMS Logo

DTConfigDBDump Class Reference

Description:. More...

#include <CondTools/DT/plugins/DTConfigDBDump.h>

Inheritance diagram for DTConfigDBDump:

edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &e, const edm::EventSetup &c)
virtual void beginJob (edm::EventSetup const &c)
 Operations.
 DTConfigDBDump (const edm::ParameterSet &ps)
 Constructor.
virtual ~DTConfigDBDump ()
 Destructor.

Private Attributes

std::string authPath
std::string catalog
std::string contact
std::string token


Detailed Description

Description:.

Date
2007/12/07 15:12:54
Revision
1.2
Author:
Paolo Ronchese INFN Padova

Definition at line 35 of file DTConfigDBDump.h.


Constructor & Destructor Documentation

DTConfigDBDump::DTConfigDBDump ( const edm::ParameterSet ps  )  [explicit]

Constructor.

Definition at line 35 of file DTConfigDBDump.cc.

00035                                                          :
00036  contact(  ps.getParameter<std::string> ( "contact"  ) ),
00037  catalog(  ps.getParameter<std::string> ( "catalog"  ) ),
00038  token(    ps.getParameter<std::string> ( "token"    ) ),
00039  authPath( ps.getParameter<std::string> ( "authPath" ) ) {
00040 }

DTConfigDBDump::~DTConfigDBDump (  )  [virtual]

Destructor.

Definition at line 45 of file DTConfigDBDump.cc.

00045                                 {
00046 }


Member Function Documentation

void DTConfigDBDump::analyze ( const edm::Event e,
const edm::EventSetup c 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 100 of file DTConfigDBDump.cc.

00101                                                        {
00102   return;
00103 }

void DTConfigDBDump::beginJob ( edm::EventSetup const &  c  )  [virtual]

Operations.

Reimplemented from edm::EDAnalyzer.

Definition at line 51 of file DTConfigDBDump.cc.

References authPath, DTConfigList::begin(), catalog, DTDBSession::connect(), contact, GenMuonPlsPt100GeV_cfg::cout, DTConfigHandler::create(), DTConfigData::dataBegin(), DTConfigData::dataEnd(), DTDBSession::disconnect(), DTConfigList::end(), lat::endl(), DTConfigHandler::get(), DTConfigHandler::getContainer(), DTConfigHandler::getData(), iter, DTConfigData::linkBegin(), DTConfigData::linkEnd(), list(), DTConfigHandler::remove(), python::TagTree::session, token, and DTConfigList::version().

00051                                                       {
00052 
00053   DTDBSession* session = new DTDBSession( contact, catalog, authPath );
00054   session->connect( false );
00055 
00056   const DTConfigList* confList = 0;
00057   DTConfigHandler* confHandler = DTConfigHandler::create( session, token );
00058   confList = confHandler->getContainer();
00059   if ( confList != 0 ) {
00060     std::cout << confList->version() << std::endl;
00061     DTConfigList::const_iterator iter = confList->begin();
00062     DTConfigList::const_iterator iend = confList->end();
00063     std::cout << std::distance( iter, iend )
00064               << " configurations in the list " << confList << std::endl;
00065     while ( iter != iend ) {
00066       int confId = iter->first;
00067       std::cout << confId << " -> "
00068                 << iter->second.ref << std::endl;
00069       std::cout << "========> " << std::endl;
00070       DTConfigData* configPtr;
00071       confHandler->get( confId, configPtr );
00072       std::cout << confId << "--->" << std::endl;
00073       DTConfigData::data_iterator d_iter = configPtr->dataBegin();
00074       DTConfigData::data_iterator d_iend = configPtr->dataEnd();
00075       while ( d_iter != d_iend ) std::cout << "    " << *d_iter++
00076                                            << std:: endl;
00077       DTConfigData::link_iterator l_iter = configPtr->linkBegin();
00078       DTConfigData::link_iterator l_iend = configPtr->linkEnd();
00079       while ( l_iter != l_iend ) std::cout << "     + " << *l_iter++
00080                                            << std:: endl;
00081       std::vector<const std::string*> list;
00082       confHandler->getData( confId, list );
00083       std::vector<const std::string*>::const_iterator s_iter = list.begin();
00084       std::vector<const std::string*>::const_iterator s_iend = list.end();
00085       while ( s_iter != s_iend ) std::cout << "        ----> "
00086                                            << **s_iter++ << std::endl;
00087       iter++;
00088     }
00089   }
00090 
00091   DTConfigHandler::remove( session );
00092   session->disconnect();
00093   delete session;
00094 
00095   return;
00096 
00097 }


Member Data Documentation

std::string DTConfigDBDump::authPath [private]

Definition at line 58 of file DTConfigDBDump.h.

Referenced by beginJob().

std::string DTConfigDBDump::catalog [private]

Definition at line 56 of file DTConfigDBDump.h.

Referenced by beginJob().

std::string DTConfigDBDump::contact [private]

Definition at line 55 of file DTConfigDBDump.h.

Referenced by beginJob().

std::string DTConfigDBDump::token [private]

Definition at line 57 of file DTConfigDBDump.h.

Referenced by beginJob().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:18:48 2009 for CMSSW by  doxygen 1.5.4