CMS 3D CMS Logo

List of all members | Public Member Functions
lumi::HLTConfDummy2DB Class Reference
Inheritance diagram for lumi::HLTConfDummy2DB:
lumi::DataPipe

Public Member Functions

const std::string dataType () const override
 
 HLTConfDummy2DB (const std::string &dest)
 
unsigned long long retrieveData (unsigned int runnumber) override
 
const std::string sourceType () const override
 
 ~HLTConfDummy2DB () override
 
- Public Member Functions inherited from lumi::DataPipe
 DataPipe (const std::string &)
 
std::string getAuthPath () const
 
std::string getMode () const
 
float getNorm () const
 
std::string getSource () const
 
void setAuthPath (const std::string &authpath)
 
void setMode (const std::string &mode)
 
void setNoCheckingStableBeam ()
 
void setNorm (float norm)
 
void setNoValidate ()
 
void setSource (const std::string &source)
 
virtual ~DataPipe ()
 

Additional Inherited Members

- Protected Attributes inherited from lumi::DataPipe
std::string m_authpath
 
std::string m_dest
 
std::string m_mode
 
bool m_nocheckingstablebeam
 
float m_norm
 
bool m_novalidate
 
std::string m_source
 

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.

35 : DataPipe(dest) {}
DataPipe(const std::string &)
Definition: DataPipe.cc:2
lumi::HLTConfDummy2DB::~HLTConfDummy2DB ( )
override

Definition at line 87 of file HLTConfDummy2DB.cc.

References DEFINE_EDM_PLUGIN.

87 {}

Member Function Documentation

const std::string lumi::HLTConfDummy2DB::dataType ( ) const
overridevirtual

Implements lumi::DataPipe.

Definition at line 85 of file HLTConfDummy2DB.cc.

85 { return "HLTCONF"; }
unsigned long long lumi::HLTConfDummy2DB::retrieveData ( unsigned int  runnumber)
overridevirtual

Implements lumi::DataPipe.

Definition at line 36 of file HLTConfDummy2DB.cc.

References HltBtagPostValidation_cff::c, gather_cfg::cout, Exception, mps_fire::i, triggerObjects_cff::l1seed, lumi::DataPipe::m_authpath, lumi::DataPipe::m_dest, lumi::DBConfig::setAuthentication(), AlCaHLTBitMon_QueryRunRegistry::string, and lumi::LumiNames::trghltMapTableName().

36  {
37  //
38  //generate dummy configuration data for the given hltconfid and write data to LumiDB
39  //
40  //std::cout<<"retrieving data for run "<<runnumber<<std::endl;
41  std::string fakehltkey("/cdaq/Cosmic/V12");
42  coral::ConnectionService* svc = new coral::ConnectionService;
43  lumi::DBConfig dbconf(*svc);
44  if (!m_authpath.empty()) {
45  dbconf.setAuthentication(m_authpath);
46  }
47  coral::ISessionProxy* session = svc->connect(m_dest, coral::Update);
48  try {
49  unsigned int totalhltpath = 126;
50  session->transaction().start(false);
51  coral::ISchema& schema = session->nominalSchema();
52  coral::ITable& hltconftable = schema.tableHandle(LumiNames::trghltMapTableName());
53  coral::AttributeList hltconfData;
54  hltconfData.extend<std::string>("HLTKEY");
55  hltconfData.extend<std::string>("HLTPATHNAME");
56  hltconfData.extend<std::string>("L1SEED");
57  coral::IBulkOperation* hltconfInserter = hltconftable.dataEditor().bulkInsert(hltconfData, 200);
58  //
59  //loop over hltpaths
60  //
61  hltconfData["HLTKEY"].data<std::string>() = fakehltkey;
62  std::string& hltpathname = hltconfData["HLTPATHNAME"].data<std::string>();
63  std::string& l1seed = hltconfData["L1SEED"].data<std::string>();
64  for (unsigned int i = 1; i <= totalhltpath; ++i) {
65  char c[10];
66  ::sprintf(c, "-%d", i);
67  hltpathname = std::string("FakeHLTPATH_") + std::string(c);
68  l1seed = std::string("FakeL1SeedExpression_") + std::string(c);
69  hltconfInserter->processNextIteration();
70  }
71  hltconfInserter->flush();
72  delete hltconfInserter;
73  session->transaction().commit();
74  } catch (const coral::Exception& er) {
75  std::cout << "database problem " << er.what() << std::endl;
76  session->transaction().rollback();
77  delete session;
78  delete svc;
79  throw er;
80  }
81  delete session;
82  delete svc;
83  return 0;
84  }
std::string m_dest
Definition: DataPipe.h:27
static const std::string trghltMapTableName()
Definition: LumiNames.cc:19
std::string m_authpath
Definition: DataPipe.h:29
const std::string lumi::HLTConfDummy2DB::sourceType ( ) const
overridevirtual

Implements lumi::DataPipe.

Definition at line 86 of file HLTConfDummy2DB.cc.

86 { return "DUMMY"; }