CMS 3D CMS Logo

Public Member Functions

lumi::HLTConfDummy2DB Class Reference

Inheritance diagram for lumi::HLTConfDummy2DB:
lumi::DataPipe

List of all members.

Public Member Functions

virtual const std::string dataType () const
 HLTConfDummy2DB (const std::string &dest)
virtual void retrieveData (unsigned int runnumber)
virtual const std::string sourceType () const
virtual ~HLTConfDummy2DB ()

Detailed Description

Definition at line 24 of file HLTConfDummy2DB.cc.


Constructor & Destructor Documentation

lumi::HLTConfDummy2DB::HLTConfDummy2DB ( const std::string &  dest) [explicit]

Definition at line 35 of file HLTConfDummy2DB.cc.

lumi::HLTConfDummy2DB::~HLTConfDummy2DB ( ) [virtual]

Definition at line 90 of file HLTConfDummy2DB.cc.

{}

Member Function Documentation

const std::string lumi::HLTConfDummy2DB::dataType ( ) const [virtual]

Implements lumi::DataPipe.

Definition at line 84 of file HLTConfDummy2DB.cc.

                                                 {
    return "HLTCONF";
  }
void lumi::HLTConfDummy2DB::retrieveData ( unsigned int  runnumber) [virtual]

Implements lumi::DataPipe.

Definition at line 36 of file HLTConfDummy2DB.cc.

References trackerHits::c, gather_cfg::cout, Exception, i, lumi::DataPipe::m_authpath, lumi::DataPipe::m_dest, python::IdGenerator::schema, python::CommonUtils::session, lumi::DBConfig::setAuthentication(), python::CommonUtils::svc, and lumi::LumiNames::trghltMapTableName().

                                                           {
    //
    //generate dummy configuration data for the given hltconfid and write data to LumiDB
    //
    //std::cout<<"retrieving data for run "<<runnumber<<std::endl;
    std::string fakehltkey("/cdaq/Cosmic/V12");
    coral::ConnectionService* svc=new coral::ConnectionService;
    lumi::DBConfig dbconf(*svc);
    if(!m_authpath.empty()){
      dbconf.setAuthentication(m_authpath);
    }
    coral::ISessionProxy* session=svc->connect(m_dest,coral::Update);
    try{
      unsigned int totalhltpath=126;
      session->transaction().start(false);
      coral::ISchema& schema=session->nominalSchema();
      coral::ITable& hltconftable=schema.tableHandle(LumiNames::trghltMapTableName());
      coral::AttributeList hltconfData;
      hltconfData.extend<std::string>("HLTKEY");
      hltconfData.extend<std::string>("HLTPATHNAME");
      hltconfData.extend<std::string>("L1SEED");
      coral::IBulkOperation* hltconfInserter=hltconftable.dataEditor().bulkInsert(hltconfData,200);
      //
      //loop over hltpaths
      //
      hltconfData["HLTKEY"].data<std::string>()=fakehltkey;
      std::string& hltpathname=hltconfData["HLTPATHNAME"].data<std::string>();
      std::string& l1seed=hltconfData["L1SEED"].data<std::string>();
      for(unsigned int i=1;i<=totalhltpath;++i){
        char c[10];
        ::sprintf(c,"-%d",i);
        hltpathname=std::string("FakeHLTPATH_")+std::string(c);
        l1seed=std::string("FakeL1SeedExpression_")+std::string(c);
        hltconfInserter->processNextIteration();
      }
      hltconfInserter->flush();
      delete hltconfInserter;
      session->transaction().commit();
    }catch( const coral::Exception& er){
      std::cout<<"database problem "<<er.what()<<std::endl;
      session->transaction().rollback();
      delete session;
      delete svc;
      throw er;
    }
    delete session;
    delete svc;
  }
const std::string lumi::HLTConfDummy2DB::sourceType ( ) const [virtual]

Implements lumi::DataPipe.

Definition at line 87 of file HLTConfDummy2DB.cc.

                                                   {
    return "DUMMY";
  }