CMS 3D CMS Logo

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 std::shared_ptr< LumiCorrectionParamReturnParamType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 

Public Member Functions

 LumiCorrectionSource (const edm::ParameterSet &)
 
ReturnParamType produceLumiCorrectionParam (const LumiCorrectionParamRcd &)
 
 ~LumiCorrectionSource ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- 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 () noexcept(false)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

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::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_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, std::shared_ptr< LumiCorrectionParam > > m_paramcache
 
unsigned int m_paramcachedrun
 
std::shared_ptr< LumiCorrectionParamm_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 174 of file LumiCorrectionSource.cc.

References dataDML::authpath, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), download_sqlite_cfg::globaltag, m_authfilename, m_cachesize, m_connectStr, m_datatag, m_globaltag, m_normtag, m_siteconfpath, callgraph::path, produceLumiCorrectionParam(), edm::ESProducer::setWhatProduced(), AlCaHLTBitMon_QueryRunRegistry::string, and translateFrontierConnect().

176  findingRecord<LumiCorrectionParamRcd>();
177  std::string connectStr=iConfig.getParameter<std::string>("connect");
179  if(iConfig.exists("globaltag")){
180  m_globaltag=iConfig.getUntrackedParameter<std::string>("globaltag","");
181  }else{
182  m_normtag=iConfig.getUntrackedParameter<std::string>("normtag","");
183  }
184  m_datatag=iConfig.getUntrackedParameter<std::string>("datatag","");
185  m_cachesize=iConfig.getUntrackedParameter<unsigned int>("ncacheEntries",3);
186  m_siteconfpath=iConfig.getUntrackedParameter<std::string>("siteconfpath","");
187  const std::string fproto("frontier://");
188  if(connectStr.substr(0,fproto.length())==fproto){
190  }else if(connectStr.substr(0,11)=="sqlite_file"){
191  m_connectStr=connectStr;
192  }else{
193  m_connectStr=connectStr;
194  std::string authpath=iConfig.getUntrackedParameter<std::string>("authpath","");
195  boost::filesystem::path boostAuthPath( authpath );
196  if(boost::filesystem::is_directory(boostAuthPath)){
197  boostAuthPath /= boost::filesystem::path("authentication.xml");
198  }
199  m_authfilename = boostAuthPath.string();
200  }
201 }
std::string translateFrontierConnect(const std::string &connectStr)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
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
ReturnParamType produceLumiCorrectionParam(const LumiCorrectionParamRcd &)
LumiCorrectionSource::~LumiCorrectionSource ( )

Definition at line 413 of file LumiCorrectionSource.cc.

References DEFINE_FWK_EVENTSETUP_SOURCE.

413 {}

Member Function Documentation

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

Definition at line 389 of file LumiCorrectionSource.cc.

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

Referenced by fillparamcache().

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

Definition at line 245 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(), mps_fire::result, cond::runnumber, dataDML::schema, dataDML::session, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produceLumiCorrectionParam().

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

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

Referenced by fillparamcache().

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

Definition at line 204 of file LumiCorrectionSource.cc.

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

Referenced by LumiCorrectionSource().

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

Definition at line 238 of file LumiCorrectionSource.cc.

References instance, and m_authfilename.

Referenced by fillparamcache().

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

Definition at line 75 of file LumiCorrectionSource.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by servletTranslation().

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

Definition at line 108 of file LumiCorrectionSource.cc.

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

Referenced by translateFrontierConnect().

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

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

231  {
232  m_pcurrentTime=&iTime;
233  oValidity.setFirst(iTime);
234  oValidity.setLast(iTime);
235 }
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 81 of file LumiCorrectionSource.cc.

References mps_fire::i, AlCaHLTBitMon_QueryRunRegistry::string, and x2s().

Referenced by servletTranslation().

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

Definition at line 146 of file LumiCorrectionSource.cc.

References Exception, m_siteconfpath, callgraph::path, mps_fire::result, servletTranslation(), AlCaHLTBitMon_QueryRunRegistry::string, tmp, and relmon_authenticated_wget::url.

Referenced by LumiCorrectionSource(), and parseGlobaltagForLumi().

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

Definition at line 69 of file LumiCorrectionSource.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, and tmp.

Referenced by toParentString().

69  {
70  std::string tmp(xercesc::XMLString::transcode(toTranscode));
71  return tmp;
72 }
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,std::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().

std::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