#include <CondTools/DT/plugins/DTConfigDBInit.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &e, const edm::EventSetup &c) |
virtual void | beginJob (edm::EventSetup const &c) |
Operations. | |
DTConfigDBInit (const edm::ParameterSet &ps) | |
Constructor. | |
virtual | ~DTConfigDBInit () |
Destructor. | |
Private Attributes | |
std::string | authPath |
std::string | catalog |
std::string | contact |
std::string | name |
Definition at line 35 of file DTConfigDBInit.h.
DTConfigDBInit::DTConfigDBInit | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Constructor.
Definition at line 36 of file DTConfigDBInit.cc.
00036 : 00037 name( ps.getParameter<std::string> ( "name" ) ), 00038 contact( ps.getParameter<std::string> ( "contact" ) ), 00039 catalog( ps.getParameter<std::string> ( "catalog" ) ), 00040 authPath( ps.getParameter<std::string> ( "authPath" ) ) { 00041 }
DTConfigDBInit::~DTConfigDBInit | ( | ) | [virtual] |
void DTConfigDBInit::analyze | ( | const edm::Event & | e, | |
const edm::EventSetup & | c | |||
) | [virtual] |
void DTConfigDBInit::beginJob | ( | edm::EventSetup const & | c | ) | [virtual] |
Operations.
Reimplemented from edm::EDAnalyzer.
Definition at line 52 of file DTConfigDBInit.cc.
References authPath, catalog, DTDBSession::connect(), contact, GenMuonPlsPt100GeV_cfg::cout, DTDBSession::disconnect(), lat::endl(), DTConfigToken::id, name, DTDBSession::poolDB(), DTConfigToken::ref, python::TagTree::session, DTConfigList::set(), and DTConfigData::setId().
00052 { 00053 00054 DTDBSession* session = new DTDBSession( contact, catalog, authPath ); 00055 session->connect( false ); 00056 00057 int dummyId = -999999999; 00058 DTConfigData* dummyConf = new DTConfigData(); 00059 dummyConf->setId( dummyId ); 00060 cond::TypedRef<DTConfigData> confRef( *session->poolDB(), dummyConf ); 00061 confRef.markWrite( "DTConfigData" ); 00062 00063 DTConfigList* confList = new DTConfigList( name ); 00064 DTConfigToken token; 00065 token.id = 0; 00066 token.ref = confRef.token(); 00067 confList->set( dummyId, token ); 00068 cond::TypedRef<DTConfigList> setRef( *session->poolDB(), confList ); 00069 setRef.markWrite( "DTConfigList" ); 00070 std::string listToken = setRef.token(); 00071 std::cout << "configuration list stored with token: " << std::endl 00072 << listToken << std::endl; 00073 00074 session->disconnect(); 00075 delete session; 00076 return; 00077 00078 }
std::string DTConfigDBInit::authPath [private] |
std::string DTConfigDBInit::catalog [private] |
std::string DTConfigDBInit::contact [private] |
std::string DTConfigDBInit::name [private] |