test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
LumiCorrectionSource Class Reference

#include <RecoLuminosity/LumiProducer/src/LumiCorrectionSource.cc>

Inheritance diagram for LumiCorrectionSource:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef boost::shared_ptr
< LumiCorrectionParam
ReturnParamType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 

Public Member Functions

 LumiCorrectionSource (const edm::ParameterSet &)
 
ReturnParamType produceLumiCorrectionParam (const LumiCorrectionParamRcd &)
 
 ~LumiCorrectionSource ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider ()
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
const
eventsetup::ComponentDescription
descriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
std::set
< eventsetup::EventSetupRecordKey
findingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder ()
 

Protected Member Functions

virtual void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Private Member Functions

float fetchIntglumi (coral::ISchema &schema, unsigned int runnumber)
 
void fillparamcache (unsigned int runnumber)
 
void parseGlobaltagForLumi (coral::ISchema &schema, const std::string &globaltag)
 
void reloadAuth ()
 
XMLCh * s2x (const std::string &input) const
 
const std::string servletTranslation (const std::string &servlet) const
 
std::string toParentString (const xercesc::DOMNode &nodeToConvert) const
 
std::string translateFrontierConnect (const std::string &connectStr)
 
std::string x2s (const XMLCh *input) const
 

Private Attributes

std::string m_authfilename
 
unsigned int m_cachesize
 
std::string m_connectStr
 
std::string m_datatag
 
std::string m_globaltag
 
bool m_isNullRun
 
std::string m_normtag
 
std::map< unsigned int,
boost::shared_ptr
< LumiCorrectionParam > > 
m_paramcache
 
unsigned int m_paramcachedrun
 
boost::shared_ptr
< LumiCorrectionParam
m_paramresult
 
const edm::IOVSyncValuem_pcurrentTime
 
std::string m_siteconfpath
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

retrieve lumi corrections and perrun parameters needed by the correction funcs

Description: A essource/esproducer for lumi correction factor and run parameters needed to deduce the corrections Author: Zhen Xie

Definition at line 25 of file LumiCorrectionSource.h.

Member Typedef Documentation

Definition at line 28 of file LumiCorrectionSource.h.

Constructor & Destructor Documentation

LumiCorrectionSource::LumiCorrectionSource ( const edm::ParameterSet iConfig)

Definition at line 175 of file LumiCorrectionSource.cc.

References EcalCondDB::authpath, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), align_cfg::globaltag, m_authfilename, m_cachesize, m_connectStr, m_datatag, m_globaltag, m_normtag, m_siteconfpath, fed_dqm_sourceclient-live_cfg::path, produceLumiCorrectionParam(), edm::ESProducer::setWhatProduced(), AlCaHLTBitMon_QueryRunRegistry::string, and translateFrontierConnect().

177  findingRecord<LumiCorrectionParamRcd>();
178  std::string connectStr=iConfig.getParameter<std::string>("connect");
180  if(iConfig.exists("globaltag")){
181  m_globaltag=iConfig.getUntrackedParameter<std::string>("globaltag","");
182  }else{
183  m_normtag=iConfig.getUntrackedParameter<std::string>("normtag","");
184  }
185  m_datatag=iConfig.getUntrackedParameter<std::string>("datatag","");
186  m_cachesize=iConfig.getUntrackedParameter<unsigned int>("ncacheEntries",3);
187  m_siteconfpath=iConfig.getUntrackedParameter<std::string>("siteconfpath","");
188  const std::string fproto("frontier://");
189  if(connectStr.substr(0,fproto.length())==fproto){
191  }else if(connectStr.substr(0,11)=="sqlite_file"){
192  m_connectStr=connectStr;
193  }else{
194  m_connectStr=connectStr;
195  std::string authpath=iConfig.getUntrackedParameter<std::string>("authpath","");
196  boost::filesystem::path boostAuthPath( authpath );
197  if(boost::filesystem::is_directory(boostAuthPath)){
198  boostAuthPath /= boost::filesystem::path("authentication.xml");
199  }
200  m_authfilename = boostAuthPath.string();
201  }
202 }
std::string translateFrontierConnect(const std::string &connectStr)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
list globaltag
Definition: align_cfg.py:7
bool exists(std::string const &parameterName) const
checks if a parameter exists
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
string authpath
Definition: EcalCondDB.py:77
ReturnParamType produceLumiCorrectionParam(const LumiCorrectionParamRcd &)
LumiCorrectionSource::~LumiCorrectionSource ( )

Definition at line 414 of file LumiCorrectionSource.cc.

414 {}

Member Function Documentation

float LumiCorrectionSource::fetchIntglumi ( coral::ISchema &  schema,
unsigned int  runnumber 
)
private

Definition at line 390 of file LumiCorrectionSource.cc.

References lumi::LumiNames::intglumiv2TableName(), query::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by fillparamcache().

390  {
391  float result=0.;
392  coral::IQuery* qHandle=schema.newQuery();
393  qHandle->addToTableList(lumi::LumiNames::intglumiv2TableName());
394  coral::AttributeList qResult;
395  qResult.extend("INTGLUMI",typeid(float));
396  std::string conditionStr("RUNNUM=:runnumber");
397  coral::AttributeList qCondition;
398  qCondition.extend("runnumber",typeid(unsigned int));
399  qCondition["runnumber"].data<unsigned int>()=runnumber;
400  qHandle->setCondition(conditionStr,qCondition);
401  qHandle->addToOutputList("INTGLUMI");
402  qHandle->defineOutput(qResult);
403  coral::ICursor& intglumiCursor=qHandle->execute();
404  while( intglumiCursor.next() ){
405  const coral::AttributeList& row=intglumiCursor.currentRow();
406  if(!row["INTGLUMI"].isNull()){
407  result=row["INTGLUMI"].data<float>();
408  }
409  }
410  delete qHandle;
411  return result;
412 }
static const std::string intglumiv2TableName()
Definition: LumiNames.cc:59
tuple result
Definition: query.py:137
void LumiCorrectionSource::fillparamcache ( unsigned int  runnumber)
private

Definition at line 246 of file LumiCorrectionSource.cc.

References lumi::RevisionDML::currentHFDataTagId(), lumi::RevisionDML::dataIDForRun(), Exception, fetchIntglumi(), plotBeamSpotDB::first, LumiCorrectionParam::HF, lumi::NormDML::HF, lumi::RevisionDML::HFDataTagIdByName(), instance, normFunctors::intglumi, lumi::RevisionDML::DataID::lumi_id, cond::lumiid, m_authfilename, m_connectStr, m_datatag, m_globaltag, m_normtag, m_paramcache, m_paramcachedrun, lumi::NormDML::normById(), lumiCalc2::normid, lumi::NormDML::normIdByName(), lumi::NormDML::normIdByType(), parseGlobaltagForLumi(), reloadAuth(), query::result, cond::runnumber, python.IdGenerator::schema, python.CommonUtils::session, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produceLumiCorrectionParam().

246  {
247  m_paramcache.clear();
249  if(!m_authfilename.empty()){
250  coral::IHandle<coral::IAuthenticationService> authSvc=coral::Context::instance().query<coral::IAuthenticationService>();
251  if( authSvc.isValid() ){
252  try{
253  authSvc->credentials( m_connectStr );
254  }catch(const coral::UnknownConnectionException& er){
255  reloadAuth();
256  }
257  }else{
258  reloadAuth();
259  }
260  }
261  coral::ConnectionService* mydbservice=new coral::ConnectionService;
262  if(!m_globaltag.empty()){
263  coral::ISessionProxy* gsession=mydbservice->connect(m_connectStr,coral::ReadOnly);
264  gsession->transaction().start(true);
265  parseGlobaltagForLumi(gsession->nominalSchema(),m_globaltag);
266  gsession->transaction().commit();
267  delete gsession;
268  }
269  coral::ISessionProxy* session=mydbservice->connect(m_connectStr,coral::ReadOnly);
270  coral::ITypeConverter& tconverter=session->typeConverter();
271  tconverter.setCppTypeForSqlType(std::string("float"),std::string("FLOAT(63)"));
272  tconverter.setCppTypeForSqlType(std::string("unsigned int"),std::string("NUMBER(10)"));
273  tconverter.setCppTypeForSqlType(std::string("unsigned short"),std::string("NUMBER(1)"));
274  boost::shared_ptr<LumiCorrectionParam> result(new LumiCorrectionParam(LumiCorrectionParam::HF));
275  try{
276  session->transaction().start(true);
277  coral::ISchema& schema=session->nominalSchema();
278  lumi::RevisionDML dml;
279  unsigned long long tagid=0;
280  if(m_datatag.empty()){
281  tagid=dml.currentHFDataTagId(schema);//get datatag id
282  }else{
283  tagid=dml.HFDataTagIdByName(schema,m_datatag);
284  }
285  lumi::RevisionDML::DataID dataid=dml.dataIDForRun(schema,runnumber,tagid);//get data id
286  unsigned int lumiid=dataid.lumi_id;
287  if(lumiid==0){
288  result->setNBX(0);
289  m_paramcache.insert(std::make_pair(runnumber,result));
290  session->transaction().commit();
291  delete session;
292  delete mydbservice;
293  return;
294  }
295 
296  coral::AttributeList lumidataBindVariables;
297  lumidataBindVariables.extend("dataid",typeid(unsigned long long));
298  lumidataBindVariables["dataid"].data<unsigned long long>()=lumiid;
299  std::string conditionStr("DATA_ID=:dataid");
300  coral::AttributeList lumiparamOutput;
301  lumiparamOutput.extend("NCOLLIDINGBUNCHES",typeid(unsigned int));
302  coral::IQuery* lumiparamQuery=schema.newQuery();
303  lumiparamQuery->addToTableList(std::string("LUMIDATA"));
304  lumiparamQuery->setCondition(conditionStr,lumidataBindVariables);
305  lumiparamQuery->addToOutputList("NCOLLIDINGBUNCHES");
306  lumiparamQuery->defineOutput(lumiparamOutput);
307  coral::ICursor& lumiparamcursor=lumiparamQuery->execute();
308  unsigned int ncollidingbx=0;
309  while( lumiparamcursor.next() ){
310  const coral::AttributeList& row=lumiparamcursor.currentRow();
311  if(!row["NCOLLIDINGBUNCHES"].isNull()){
312  ncollidingbx=row["NCOLLIDINGBUNCHES"].data<unsigned int>();
313  }
314  result->setNBX(ncollidingbx);
315  }
316  delete lumiparamQuery;
317  lumi::NormDML normdml;
318  unsigned long long normid=0;
319  std::map<std::string,unsigned long long> normidmap;
320  if (m_normtag.empty()){
321  normdml.normIdByType(schema,normidmap,lumi::NormDML::HF,true);
322  m_normtag=normidmap.begin()->first;
323  normid=normidmap.begin()->second;
324  }else{
325  normid=normdml.normIdByName(schema,m_normtag);
326  }
327 
328  std::map< unsigned int,lumi::NormDML::normData > normDataMap;
329  normdml.normById(schema,normid,normDataMap);
330 
331  std::map< unsigned int,lumi::NormDML::normData >::iterator normIt=--normDataMap.end();
332  if(runnumber<normIt->first){
333  normIt=normDataMap.upper_bound(runnumber);
334  --normIt;
335  }
336  result->setNormtag(m_normtag);
337  result->setcorrFunc(normIt->second.corrfunc);
338  result->setnonlinearCoeff(normIt->second.coefficientmap);
339  result->setafterglows(normIt->second.afterglows);
340  result->setdescription(normIt->second.amodetag,normIt->second.beamegev);
341  m_paramcache.insert(std::make_pair(runnumber,result));
342  if(normIt->second.coefficientmap["DRIFT"]!=0.){
343  float intglumi=fetchIntglumi(schema,runnumber);
344  result->setintglumi(intglumi);
345  }
346  session->transaction().commit();
347  }catch(const coral::Exception& er){
348  session->transaction().rollback();
349  delete session;
350  delete mydbservice;
351  throw cms::Exception("DatabaseError ")<<er.what();
352  }
353  delete session;
354  delete mydbservice;
355 }
static PFTauRenderPlugin instance
DataID dataIDForRun(coral::ISchema &schema, unsigned int runnum, unsigned long long tagid)
Definition: RevisionDML.cc:272
void parseGlobaltagForLumi(coral::ISchema &schema, const std::string &globaltag)
float fetchIntglumi(coral::ISchema &schema, unsigned int runnumber)
tuple result
Definition: query.py:137
float intglumi
Definition: normFunctors.py:63
unsigned long long HFDataTagIdByName(coral::ISchema &schema, const std::string &datatagname)
Definition: RevisionDML.cc:214
void normById(const coral::ISchema &schema, unsigned long long normid, std::map< unsigned int, normData > &result)
Definition: NormDML.cc:98
std::map< unsigned int, boost::shared_ptr< LumiCorrectionParam > > m_paramcache
int normid
Definition: lumiCalc2.py:356
unsigned long long currentHFDataTagId(coral::ISchema &schema)
Definition: RevisionDML.cc:190
void normIdByType(const coral::ISchema &schema, std::map< std::string, unsigned long long > &resultMap, LumiType=HF, bool defaultonly=true)
Definition: NormDML.cc:50
unsigned long long lumi_id
Definition: RevisionDML.h:21
unsigned long long normIdByName(const coral::ISchema &schema, const std::string &normtagname)
Definition: NormDML.cc:18
void LumiCorrectionSource::parseGlobaltagForLumi ( coral::ISchema &  schema,
const std::string &  globaltag 
)
private

select i.pfn,i.tagname from TAGINVENTORY_TABLE i,TAGTREE_TABLE_GLOBALTAG v from i.tagid=v.tagid and i.recordname='LumiCorrectionParamRcd'

Definition at line 357 of file LumiCorrectionSource.cc.

References m_connectStr, m_normtag, AlCaHLTBitMon_QueryRunRegistry::string, and translateFrontierConnect().

Referenced by fillparamcache().

357  {
359  std::string tagtreetabname("TAGTREE_TABLE_");
360  tagtreetabname+=std::string(globaltag);
361  coral::IQuery* qHandle=schema.newQuery();
362  qHandle->addToTableList("TAGINVENTORY_TABLE","i");
363  qHandle->addToTableList(tagtreetabname,"v");
364  coral::AttributeList qResult;
365  qResult.extend("pfn",typeid(std::string));
366  qResult.extend("tagname",typeid(std::string));
367  std::string conditionStr("v.tagid=i.tagid and i.recordname=:recordname");
368  coral::AttributeList qCondition;
369  qCondition.extend("recordname",typeid(std::string));
370  qCondition["recordname"].data<std::string>()=std::string("LumiCorrectionParamRcd");
371  qHandle->setCondition(conditionStr,qCondition);
372  qHandle->addToOutputList("i.pfn");
373  qHandle->addToOutputList("i.tagname");
374  qHandle->defineOutput(qResult);
375  coral::ICursor& iCursor=qHandle->execute();
376  while( iCursor.next() ){
377  const coral::AttributeList& row=iCursor.currentRow();
378  std::string connectStr=row["pfn"].data<std::string>();
379  const std::string fproto("frontier://");
380  if(connectStr.substr(0,fproto.length())==fproto){
382  }else{
383  m_connectStr=connectStr;
384  }
385  m_normtag=row["tagname"].data<std::string>();
386  }
387  delete qHandle;
388 }
std::string translateFrontierConnect(const std::string &connectStr)
list globaltag
Definition: align_cfg.py:7
LumiCorrectionSource::ReturnParamType LumiCorrectionSource::produceLumiCorrectionParam ( const LumiCorrectionParamRcd )

Definition at line 205 of file LumiCorrectionSource.cc.

References edm::IOVSyncValue::eventID(), fillparamcache(), m_paramcache, m_paramcachedrun, m_paramresult, m_pcurrentTime, and edm::EventID::run().

Referenced by LumiCorrectionSource().

206 {
207  unsigned int currentrun=m_pcurrentTime->eventID().run();
208  if(currentrun==0||currentrun==4294967295){
209  return boost::shared_ptr<LumiCorrectionParam>(new LumiCorrectionParam());
210  }
211  if(m_paramcachedrun!=currentrun){//i'm in a new run
212  fillparamcache(currentrun);//fill cache
213  }else{ //i'm in an old run
214  if(m_paramcache.find(currentrun)==m_paramcache.end()){//i'm not cached
215  fillparamcache(currentrun);//
216  }
217  }
218  if(m_paramcache.empty()){
219  return boost::shared_ptr<LumiCorrectionParam>(new LumiCorrectionParam());
220  }
221  m_paramresult=m_paramcache[currentrun];
222  if(m_paramresult.get()==0){
223  return boost::shared_ptr<LumiCorrectionParam>(new LumiCorrectionParam());
224  }
225  return m_paramresult;
226 }
RunNumber_t run() const
Definition: EventID.h:39
const EventID & eventID() const
Definition: IOVSyncValue.h:42
const edm::IOVSyncValue * m_pcurrentTime
boost::shared_ptr< LumiCorrectionParam > m_paramresult
void fillparamcache(unsigned int runnumber)
std::map< unsigned int, boost::shared_ptr< LumiCorrectionParam > > m_paramcache
void LumiCorrectionSource::reloadAuth ( )
private

Definition at line 239 of file LumiCorrectionSource.cc.

References instance, and m_authfilename.

Referenced by fillparamcache().

239  {
240  //std::cout<<"old authfile "<<coral::Context::instance().PropertyManager().property("AuthenticationFile")->get()<<std::endl;
241  coral::Context::instance().PropertyManager().property("AuthenticationFile")->set(m_authfilename);
242  coral::Context::instance().loadComponent("CORAL/Services/XMLAuthenticationService");
243 }
static PFTauRenderPlugin instance
XMLCh * LumiCorrectionSource::s2x ( const std::string &  input) const
private

Definition at line 76 of file LumiCorrectionSource.cc.

References XERCES_CPP_NAMESPACE_USE::transcode().

Referenced by servletTranslation().

76  {
77  XMLCh* buff = xercesc::XMLString::transcode(temp.c_str());
78  return buff;
79 }
XMLCh * transcode(const T &fInput)
const std::string LumiCorrectionSource::servletTranslation ( const std::string &  servlet) const
private

Definition at line 109 of file LumiCorrectionSource.cc.

References alignCSCRings::e, m_siteconfpath, geometryXMLtoCSV::parser, s2x(), AlCaHLTBitMon_QueryRunRegistry::string, toParentString(), and cms::concurrency::xercesInitialize().

Referenced by translateFrontierConnect().

109  {
110  std::string frontierConnect;
111  std::string realconnect;
113  std::auto_ptr< xercesc::XercesDOMParser > parser(new xercesc::XercesDOMParser);
114  try{
115  parser->setValidationScheme(xercesc::XercesDOMParser::Val_Auto);
116  parser->setDoNamespaces(false);
117  parser->parse(m_siteconfpath.c_str());
118  xercesc::DOMDocument* doc=parser->getDocument();
119  if(!doc){
120  return "";
121  }
122 
123  xercesc::DOMNodeList *frontierConnectList=doc->getElementsByTagName(s2x("frontier-connect"));
124  if (frontierConnectList->getLength()>0){
125  xercesc::DOMElement *frontierConnectElement=static_cast < xercesc::DOMElement *> (frontierConnectList->item (0));
126  frontierConnect = toParentString(*frontierConnectElement);
127  }
128  // Replace the last component of every "serverurl=" piece (up to the
129  // next close-paren) with the servlet
130  std::string::size_type nextparen = 0;
131  std::string::size_type serverurl, lastslash;
132  std::string complexstr = "";
133  while ((serverurl=frontierConnect.find("(serverurl=", nextparen)) != std::string::npos){
134  realconnect.append(frontierConnect, nextparen, serverurl - nextparen);
135  nextparen=frontierConnect.find(')', serverurl);
136  lastslash=frontierConnect.rfind('/', nextparen);
137  realconnect.append(frontierConnect,serverurl,lastslash-serverurl+1);
138  realconnect.append(servlet);
139  }
140  realconnect.append(frontierConnect, nextparen,frontierConnect.length()-nextparen);
141  }catch(xercesc::DOMException &e){
142  }
143  return realconnect;
144 }
void xercesInitialize()
Definition: Xerces.cc:17
uint16_t size_type
std::string toParentString(const xercesc::DOMNode &nodeToConvert) const
XMLCh * s2x(const std::string &input) const
void LumiCorrectionSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey iKey,
const edm::IOVSyncValue iTime,
edm::ValidityInterval oValidity 
)
protectedvirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 229 of file LumiCorrectionSource.cc.

References m_pcurrentTime, edm::ValidityInterval::setFirst(), and edm::ValidityInterval::setLast().

232  {
233  m_pcurrentTime=&iTime;
234  oValidity.setFirst(iTime);
235  oValidity.setLast(iTime);
236 }
void setFirst(const IOVSyncValue &iTime)
const edm::IOVSyncValue * m_pcurrentTime
void setLast(const IOVSyncValue &iTime)
std::string LumiCorrectionSource::toParentString ( const xercesc::DOMNode &  nodeToConvert) const
private

Definition at line 82 of file LumiCorrectionSource.cc.

References i, j, and x2s().

Referenced by servletTranslation().

82  {
83  std::ostringstream oss;
84  xercesc::DOMNodeList *childList = nodeToConvert.getChildNodes();
85 
86  unsigned int numNodes = childList->getLength ();
87  for (unsigned int i = 0; i < numNodes; ++i){
88  xercesc::DOMNode *childNode = childList->item(i);
89  if (childNode->getNodeType() != xercesc::DOMNode::ELEMENT_NODE)
90  continue;
91  xercesc::DOMElement *child = static_cast < xercesc::DOMElement *> (childNode);
92  xercesc::DOMNamedNodeMap *attributes = child->getAttributes();
93  unsigned int numAttributes = attributes->getLength ();
94  for (unsigned int j = 0; j < numAttributes; ++j){
95  xercesc::DOMNode *attributeNode = attributes->item(j);
96  if (attributeNode->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
97  continue;
98  xercesc::DOMAttr *attribute = static_cast <xercesc::DOMAttr *> (attributeNode);
99 
100  oss << "(" << x2s(child->getTagName()) <<
101  x2s(attribute->getName()) << "=" <<
102  x2s(attribute->getValue()) << ")";
103  }
104  }
105  return oss.str();
106 }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
std::string x2s(const XMLCh *input) const
std::string LumiCorrectionSource::translateFrontierConnect ( const std::string &  connectStr)
private

Definition at line 147 of file LumiCorrectionSource.cc.

References Exception, m_siteconfpath, fed_dqm_sourceclient-live_cfg::path, query::result, servletTranslation(), AlCaHLTBitMon_QueryRunRegistry::string, tmp, and relmon_authenticated_wget::url.

Referenced by LumiCorrectionSource(), and parseGlobaltagForLumi().

147  {
149  const std::string fproto("frontier://");
150  std::string::size_type startservlet=fproto.length();
151  std::string::size_type endservlet=connectStr.find("(",startservlet);
152  if(endservlet==std::string::npos){
153  endservlet=connectStr.rfind('/',connectStr.length());
154  }
155  std::string servlet=connectStr.substr(startservlet,endservlet-startservlet);
156  if( (servlet !="")&& (servlet.find_first_of(":/)[]")==std::string::npos)){
157  if(servlet=="cms_conditions_data") servlet="";
158  if(m_siteconfpath.length()==0){
159  std::string url=(boost::filesystem::path("SITECONF")/boost::filesystem::path("local")/boost::filesystem::path("JobConfig")/boost::filesystem::path("site-local-config.xml")).string();
160  char * tmp = getenv ("CMS_PATH");
161  if(tmp){
163  }
164  }else{
165  if(!boost::filesystem::exists(boost::filesystem::path(m_siteconfpath))){
166  throw cms::Exception("Non existing path ")<<m_siteconfpath;
167  }
168  m_siteconfpath = (boost::filesystem::path(m_siteconfpath)/boost::filesystem::path("site-local-config.xml")).string();
169  }
170  result=fproto+servletTranslation(servlet)+connectStr.substr(endservlet);
171  }
172  return result;
173 }
const std::string servletTranslation(const std::string &servlet) const
uint16_t size_type
tuple result
Definition: query.py:137
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::string LumiCorrectionSource::x2s ( const XMLCh *  input) const
private

Definition at line 70 of file LumiCorrectionSource.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, tmp, and XERCES_CPP_NAMESPACE_USE::transcode().

Referenced by toParentString().

70  {
72  return tmp;
73 }
XMLCh * transcode(const T &fInput)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100

Member Data Documentation

std::string LumiCorrectionSource::m_authfilename
private

Definition at line 44 of file LumiCorrectionSource.h.

Referenced by fillparamcache(), LumiCorrectionSource(), and reloadAuth().

unsigned int LumiCorrectionSource::m_cachesize
private

Definition at line 52 of file LumiCorrectionSource.h.

Referenced by LumiCorrectionSource().

std::string LumiCorrectionSource::m_connectStr
private
std::string LumiCorrectionSource::m_datatag
private

Definition at line 45 of file LumiCorrectionSource.h.

Referenced by fillparamcache(), and LumiCorrectionSource().

std::string LumiCorrectionSource::m_globaltag
private

Definition at line 46 of file LumiCorrectionSource.h.

Referenced by fillparamcache(), and LumiCorrectionSource().

bool LumiCorrectionSource::m_isNullRun
private

Definition at line 50 of file LumiCorrectionSource.h.

std::string LumiCorrectionSource::m_normtag
private
std::map< unsigned int,boost::shared_ptr<LumiCorrectionParam> > LumiCorrectionSource::m_paramcache
private

Definition at line 49 of file LumiCorrectionSource.h.

Referenced by fillparamcache(), and produceLumiCorrectionParam().

unsigned int LumiCorrectionSource::m_paramcachedrun
private

Definition at line 51 of file LumiCorrectionSource.h.

Referenced by fillparamcache(), and produceLumiCorrectionParam().

boost::shared_ptr<LumiCorrectionParam> LumiCorrectionSource::m_paramresult
private

Definition at line 53 of file LumiCorrectionSource.h.

Referenced by produceLumiCorrectionParam().

const edm::IOVSyncValue* LumiCorrectionSource::m_pcurrentTime
private

Definition at line 54 of file LumiCorrectionSource.h.

Referenced by produceLumiCorrectionParam(), and setIntervalFor().

std::string LumiCorrectionSource::m_siteconfpath
private