23 #include "boost/shared_ptr.hpp"
32 #include "RelationalAccess/ISession.h"
33 #include "RelationalAccess/ITransaction.h"
34 #include "RelationalAccess/IRelationalDomain.h"
35 #include "RelationalAccess/ISchema.h"
36 #include "RelationalAccess/IQuery.h"
37 #include "RelationalAccess/ICursor.h"
38 #include "RelationalAccess/IConnection.h"
39 #include "CoralBase/AttributeList.h"
40 #include "CoralBase/Attribute.h"
41 #include "CoralKernel/Context.h"
87 connectionString(iConfig.getParameter<std::string>(
"connectionString")),
88 authpath(iConfig.getParameter<std::string>(
"authpath")),
89 tableToRead(iConfig.getParameter<std::string>(
"tableToRead"))
118 using namespace edm::es;
119 boost::shared_ptr<RunInfo> pRunInfo ;
130 pRunInfo = boost::shared_ptr<RunInfo>(
new RunInfo() );
140 connection.configure();
147 session.transaction().start(
true);
152 coral::AttributeList conditionData;
153 conditionData.extend<
int>(
"n_run" );
154 conditionData[0].data<
int>() =
runNumber;
156 std::string columnToRead_val =
"VALUE";
158 std::string tableToRead_fed =
"RUNSESSION_STRING";
159 coral::IQuery* queryV =
schema.newQuery();
161 queryV->addToTableList(tableToRead_fed);
162 queryV->addToOutputList(tableToRead_fed +
"." + columnToRead_val, columnToRead_val);
165 std::string condition =
tableToRead +
".RUNNUMBER=:n_run AND " +
tableToRead +
".NAME='CMS.LVL0:FED_ENABLE_MASK' AND RUNSESSION_PARAMETER.ID = RUNSESSION_STRING.RUNSESSION_PARAMETER_ID";
167 queryV->setCondition(condition, conditionData);
168 coral::ICursor& cursorV = queryV->execute();
170 if ( cursorV.next() ) {
172 const coral::AttributeList& row = cursorV.currentRow();
173 fed = row[columnToRead_val].data<std::string>();
182 std::stringstream stream(fed);
186 if ( !(stream >> word) ){
break;}
188 std::stringstream ss(word);
191 ss >> fedNumber >> val;
194 if( (val & 0001) == 1 && (val != 5) && (val != 7) )
195 pRunInfo->m_fed_in.push_back(fedNumber);
boost::shared_ptr< RunInfo > ReturnType
L1RCTOmdsFedVectorProducer(const edm::ParameterSet &)
DbConnectionConfiguration & configuration()
std::string connectionString
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
void get(HolderT &iHolder) const
~L1RCTOmdsFedVectorProducer()
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
void setAuthenticationPath(const std::string &p)
ReturnType produce(const RunInfoRcd &)