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< const LumiCorrectionParamReturnParamType
 

Public Member Functions

 LumiCorrectionSource (const edm::ParameterSet &)
 
ReturnParamType produceLumiCorrectionParam (const LumiCorrectionParamRcd &)
 
 ~LumiCorrectionSource () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
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
bool concurrentFinder () const
 
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
 EventSetupRecordIntervalFinder (const EventSetupRecordIntervalFinder &)=delete
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
bool nonconcurrentAndIOVNeedsUpdate (const eventsetup::EventSetupRecordKey &key, const IOVSyncValue &syncValue) const
 
const EventSetupRecordIntervalFinderoperator= (const EventSetupRecordIntervalFinder &)=delete
 
void resetInterval (const eventsetup::EventSetupRecordKey &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Protected Member Functions

void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- 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 EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- 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< const LumiCorrectionParam > > m_paramcache
 
unsigned int m_paramcachedrun
 
std::shared_ptr< const 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 &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 

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

◆ ReturnParamType

Definition at line 28 of file LumiCorrectionSource.h.

Constructor & Destructor Documentation

◆ LumiCorrectionSource()

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

Definition at line 170 of file LumiCorrectionSource.cc.

171  : m_connectStr(""),
172  m_authfilename(""),
173  m_datatag(""),
174  m_globaltag(""),
175  m_normtag(""),
176  m_paramcachedrun(0),
177  m_cachesize(0) {
179  findingRecord<LumiCorrectionParamRcd>();
180  std::string connectStr = iConfig.getParameter<std::string>("connect");
182  if (iConfig.exists("globaltag")) {
183  m_globaltag = iConfig.getUntrackedParameter<std::string>("globaltag", "");
184  } else {
185  m_normtag = iConfig.getUntrackedParameter<std::string>("normtag", "");
186  }
187  m_datatag = iConfig.getUntrackedParameter<std::string>("datatag", "");
188  m_cachesize = iConfig.getUntrackedParameter<unsigned int>("ncacheEntries", 3);
189  m_siteconfpath = iConfig.getUntrackedParameter<std::string>("siteconfpath", "");
190  const std::string fproto("frontier://");
191  if (connectStr.substr(0, fproto.length()) == fproto) {
193  } else if (connectStr.substr(0, 11) == "sqlite_file") {
194  m_connectStr = connectStr;
195  } else {
196  m_connectStr = connectStr;
197  std::string authpath = iConfig.getUntrackedParameter<std::string>("authpath", "");
198  std::filesystem::path boostAuthPath(authpath);
199  if (std::filesystem::is_directory(boostAuthPath)) {
200  boostAuthPath /= std::filesystem::path("authentication.xml");
201  }
202  m_authfilename = boostAuthPath.string();
203  }
204 }

References l1RCTOmdsFedVectorProducer_cfi::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, castor_dqm_sourceclient_file_cfg::path, produceLumiCorrectionParam(), edm::ESProducer::setWhatProduced(), AlCaHLTBitMon_QueryRunRegistry::string, and translateFrontierConnect().

◆ ~LumiCorrectionSource()

LumiCorrectionSource::~LumiCorrectionSource ( )
override

Definition at line 410 of file LumiCorrectionSource.cc.

410 {}

Member Function Documentation

◆ fetchIntglumi()

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

Definition at line 386 of file LumiCorrectionSource.cc.

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

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

Referenced by fillparamcache().

◆ fillparamcache()

void LumiCorrectionSource::fillparamcache ( unsigned int  runnumber)
private

Definition at line 242 of file LumiCorrectionSource.cc.

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

References lumi::RevisionDML::currentHFDataTagId(), lumi::RevisionDML::dataIDForRun(), Exception, fetchIntglumi(), dqmdumpme::first, LumiCorrectionParam::HF, lumi::NormDML::HF, lumi::RevisionDML::HFDataTagIdByName(), instance, lumi::RevisionDML::DataID::lumi_id, cond::lumiid, m_authfilename, m_connectStr, m_datatag, m_globaltag, m_normtag, m_paramcache, m_paramcachedrun, eostools::move(), lumi::NormDML::normById(), lumi::NormDML::normIdByName(), lumi::NormDML::normIdByType(), parseGlobaltagForLumi(), reloadAuth(), mps_fire::result, cond::runnumber, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produceLumiCorrectionParam().

◆ parseGlobaltagForLumi()

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 354 of file LumiCorrectionSource.cc.

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

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

Referenced by fillparamcache().

◆ produceLumiCorrectionParam()

LumiCorrectionSource::ReturnParamType LumiCorrectionSource::produceLumiCorrectionParam ( const LumiCorrectionParamRcd )

Definition at line 206 of file LumiCorrectionSource.cc.

206  {
207  unsigned int currentrun = m_pcurrentTime->eventID().run();
208  if (currentrun == 0 || currentrun == 4294967295) {
209  return std::make_shared<const 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
216  }
217  }
218  if (m_paramcache.empty()) {
219  return std::make_shared<const LumiCorrectionParam>();
220  }
222  if (m_paramresult.get() == nullptr) {
223  return std::make_shared<const LumiCorrectionParam>();
224  }
225  return m_paramresult;
226 }

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

Referenced by LumiCorrectionSource().

◆ reloadAuth()

void LumiCorrectionSource::reloadAuth ( )
private

Definition at line 236 of file LumiCorrectionSource.cc.

236  {
237  //std::cout<<"old authfile "<<coral::Context::instance().PropertyManager().property("AuthenticationFile")->get()<<std::endl;
238  coral::Context::instance().PropertyManager().property("AuthenticationFile")->set(m_authfilename);
239  coral::Context::instance().loadComponent("CORAL/Services/XMLAuthenticationService");
240 }

References instance, and m_authfilename.

Referenced by fillparamcache().

◆ s2x()

XMLCh * LumiCorrectionSource::s2x ( const std::string &  input) const
private

Definition at line 72 of file LumiCorrectionSource.cc.

72  {
73  XMLCh* buff = xercesc::XMLString::transcode(temp.c_str());
74  return buff;
75 }

References groupFilesInBlocks::temp.

Referenced by servletTranslation().

◆ servletTranslation()

const std::string LumiCorrectionSource::servletTranslation ( const std::string &  servlet) const
private

Definition at line 101 of file LumiCorrectionSource.cc.

101  {
102  std::string frontierConnect;
103  std::string realconnect;
105  std::unique_ptr<xercesc::XercesDOMParser> parser(new xercesc::XercesDOMParser);
106  try {
107  parser->setValidationScheme(xercesc::XercesDOMParser::Val_Auto);
108  parser->setDoNamespaces(false);
109  parser->parse(m_siteconfpath.c_str());
110  xercesc::DOMDocument* doc = parser->getDocument();
111  if (!doc) {
112  return "";
113  }
114 
115  xercesc::DOMNodeList* frontierConnectList = doc->getElementsByTagName(s2x("frontier-connect"));
116  if (frontierConnectList->getLength() > 0) {
117  xercesc::DOMElement* frontierConnectElement = static_cast<xercesc::DOMElement*>(frontierConnectList->item(0));
118  frontierConnect = toParentString(*frontierConnectElement);
119  }
120  // Replace the last component of every "serverurl=" piece (up to the
121  // next close-paren) with the servlet
122  std::string::size_type nextparen = 0;
123  std::string::size_type serverurl, lastslash;
124  std::string complexstr = "";
125  while ((serverurl = frontierConnect.find("(serverurl=", nextparen)) != std::string::npos) {
126  realconnect.append(frontierConnect, nextparen, serverurl - nextparen);
127  nextparen = frontierConnect.find(')', serverurl);
128  lastslash = frontierConnect.rfind('/', nextparen);
129  realconnect.append(frontierConnect, serverurl, lastslash - serverurl + 1);
130  realconnect.append(servlet);
131  }
132  realconnect.append(frontierConnect, nextparen, frontierConnect.length() - nextparen);
133  } catch (xercesc::DOMException& e) {
134  }
135  return realconnect;
136 }

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

Referenced by translateFrontierConnect().

◆ setIntervalFor()

void LumiCorrectionSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey iKey,
const edm::IOVSyncValue iTime,
edm::ValidityInterval oValidity 
)
overrideprotectedvirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 228 of file LumiCorrectionSource.cc.

230  {
231  m_pcurrentTime = &iTime;
232  oValidity.setFirst(iTime);
233  oValidity.setLast(iTime);
234 }

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

◆ toParentString()

std::string LumiCorrectionSource::toParentString ( const xercesc::DOMNode &  nodeToConvert) const
private

Definition at line 77 of file LumiCorrectionSource.cc.

77  {
78  std::ostringstream oss;
79  xercesc::DOMNodeList* childList = nodeToConvert.getChildNodes();
80 
81  unsigned int numNodes = childList->getLength();
82  for (unsigned int i = 0; i < numNodes; ++i) {
83  xercesc::DOMNode* childNode = childList->item(i);
84  if (childNode->getNodeType() != xercesc::DOMNode::ELEMENT_NODE)
85  continue;
86  xercesc::DOMElement* child = static_cast<xercesc::DOMElement*>(childNode);
87  xercesc::DOMNamedNodeMap* attributes = child->getAttributes();
88  unsigned int numAttributes = attributes->getLength();
89  for (unsigned int j = 0; j < numAttributes; ++j) {
90  xercesc::DOMNode* attributeNode = attributes->item(j);
91  if (attributeNode->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
92  continue;
93  xercesc::DOMAttr* attribute = static_cast<xercesc::DOMAttr*>(attributeNode);
94 
95  oss << "(" << x2s(child->getTagName()) << x2s(attribute->getName()) << "=" << x2s(attribute->getValue()) << ")";
96  }
97  }
98  return oss.str();
99 }

References mps_fire::i, dqmiolumiharvest::j, and x2s().

Referenced by servletTranslation().

◆ translateFrontierConnect()

std::string LumiCorrectionSource::translateFrontierConnect ( const std::string &  connectStr)
private

Definition at line 138 of file LumiCorrectionSource.cc.

138  {
140  const std::string fproto("frontier://");
141  std::string::size_type startservlet = fproto.length();
142  std::string::size_type endservlet = connectStr.find('(', startservlet);
143  if (endservlet == std::string::npos) {
144  endservlet = connectStr.rfind('/', connectStr.length());
145  }
146  std::string servlet = connectStr.substr(startservlet, endservlet - startservlet);
147  if ((!servlet.empty()) && (servlet.find_first_of(":/)[]") == std::string::npos)) {
148  if (servlet == "cms_conditions_data")
149  servlet = "";
150  if (m_siteconfpath.length() == 0) {
151  std::string url = (std::filesystem::path("SITECONF") / std::filesystem::path("local") /
152  std::filesystem::path("JobConfig") / std::filesystem::path("site-local-config.xml"))
153  .string();
154  char* tmp = std::getenv("CMS_PATH");
155  if (tmp) {
157  }
158  } else {
159  if (!std::filesystem::exists(std::filesystem::path(m_siteconfpath))) {
160  throw cms::Exception("Non existing path ") << m_siteconfpath;
161  }
163  (std::filesystem::path(m_siteconfpath) / std::filesystem::path("site-local-config.xml")).string();
164  }
165  result = fproto + servletTranslation(servlet) + connectStr.substr(endservlet);
166  }
167  return result;
168 }

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

Referenced by LumiCorrectionSource(), and parseGlobaltagForLumi().

◆ x2s()

std::string LumiCorrectionSource::x2s ( const XMLCh *  input) const
private

Definition at line 67 of file LumiCorrectionSource.cc.

67  {
68  std::string tmp(xercesc::XMLString::transcode(toTranscode));
69  return tmp;
70 }

References AlCaHLTBitMon_QueryRunRegistry::string, and createJobs::tmp.

Referenced by toParentString().

Member Data Documentation

◆ m_authfilename

std::string LumiCorrectionSource::m_authfilename
private

Definition at line 47 of file LumiCorrectionSource.h.

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

◆ m_cachesize

unsigned int LumiCorrectionSource::m_cachesize
private

Definition at line 55 of file LumiCorrectionSource.h.

Referenced by LumiCorrectionSource().

◆ m_connectStr

std::string LumiCorrectionSource::m_connectStr
private

◆ m_datatag

std::string LumiCorrectionSource::m_datatag
private

Definition at line 48 of file LumiCorrectionSource.h.

Referenced by fillparamcache(), and LumiCorrectionSource().

◆ m_globaltag

std::string LumiCorrectionSource::m_globaltag
private

Definition at line 49 of file LumiCorrectionSource.h.

Referenced by fillparamcache(), and LumiCorrectionSource().

◆ m_isNullRun

bool LumiCorrectionSource::m_isNullRun
private

Definition at line 53 of file LumiCorrectionSource.h.

◆ m_normtag

std::string LumiCorrectionSource::m_normtag
private

◆ m_paramcache

std::map<unsigned int, std::shared_ptr<const LumiCorrectionParam> > LumiCorrectionSource::m_paramcache
private

Definition at line 52 of file LumiCorrectionSource.h.

Referenced by fillparamcache(), and produceLumiCorrectionParam().

◆ m_paramcachedrun

unsigned int LumiCorrectionSource::m_paramcachedrun
private

Definition at line 54 of file LumiCorrectionSource.h.

Referenced by fillparamcache(), and produceLumiCorrectionParam().

◆ m_paramresult

std::shared_ptr<const LumiCorrectionParam> LumiCorrectionSource::m_paramresult
private

Definition at line 56 of file LumiCorrectionSource.h.

Referenced by produceLumiCorrectionParam().

◆ m_pcurrentTime

const edm::IOVSyncValue* LumiCorrectionSource::m_pcurrentTime
private

Definition at line 57 of file LumiCorrectionSource.h.

Referenced by produceLumiCorrectionParam(), and setIntervalFor().

◆ m_siteconfpath

std::string LumiCorrectionSource::m_siteconfpath
private
lumi::NormDML::normIdByType
void normIdByType(const coral::ISchema &schema, std::map< std::string, unsigned long long > &resultMap, LumiType=HF, bool defaultonly=true)
Definition: NormDML.cc:47
LumiCorrectionSource::m_authfilename
std::string m_authfilename
Definition: LumiCorrectionSource.h:47
LumiCorrectionSource::translateFrontierConnect
std::string translateFrontierConnect(const std::string &connectStr)
Definition: LumiCorrectionSource.cc:138
cond::lumiid
Definition: Time.h:19
common_cff.doc
doc
Definition: common_cff.py:54
relmon_authenticated_wget.url
url
Definition: relmon_authenticated_wget.py:22
mps_fire.i
i
Definition: mps_fire.py:428
lumi::RevisionDML::DataID::lumi_id
unsigned long long lumi_id
Definition: RevisionDML.h:22
LumiCorrectionSource::m_paramcache
std::map< unsigned int, std::shared_ptr< const LumiCorrectionParam > > m_paramcache
Definition: LumiCorrectionSource.h:52
LumiCorrectionSource::m_paramcachedrun
unsigned int m_paramcachedrun
Definition: LumiCorrectionSource.h:54
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
lumi::NormDML::normIdByName
unsigned long long normIdByName(const coral::ISchema &schema, const std::string &normtagname)
Definition: NormDML.cc:16
writedatasetfile.parser
parser
Definition: writedatasetfile.py:7
LumiCorrectionSource::m_pcurrentTime
const edm::IOVSyncValue * m_pcurrentTime
Definition: LumiCorrectionSource.h:57
l1RCTOmdsFedVectorProducer_cfi.authpath
authpath
Definition: l1RCTOmdsFedVectorProducer_cfi.py:5
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
LumiCorrectionSource::parseGlobaltagForLumi
void parseGlobaltagForLumi(coral::ISchema &schema, const std::string &globaltag)
Definition: LumiCorrectionSource.cc:354
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::ValidityInterval::setFirst
void setFirst(const IOVSyncValue &iTime)
Definition: ValidityInterval.h:47
LumiCorrectionSource::m_datatag
std::string m_datatag
Definition: LumiCorrectionSource.h:48
dqmdumpme.first
first
Definition: dqmdumpme.py:55
lumi::NormDML::HF
Definition: NormDML.h:35
LumiCorrectionSource::m_globaltag
std::string m_globaltag
Definition: LumiCorrectionSource.h:49
LumiCorrectionSource::reloadAuth
void reloadAuth()
Definition: LumiCorrectionSource.cc:236
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
edm::ValidityInterval::setLast
void setLast(const IOVSyncValue &iTime)
Definition: ValidityInterval.h:48
LumiCorrectionSource::fetchIntglumi
float fetchIntglumi(coral::ISchema &schema, unsigned int runnumber)
Definition: LumiCorrectionSource.cc:386
LumiCorrectionParam::HF
Definition: LumiCorrectionParam.h:9
lumi::RevisionDML
Definition: RevisionDML.h:9
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
lumi::RevisionDML::DataID
Definition: RevisionDML.h:17
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
LumiCorrectionSource::m_paramresult
std::shared_ptr< const LumiCorrectionParam > m_paramresult
Definition: LumiCorrectionSource.h:56
edm::IOVSyncValue::eventID
const EventID & eventID() const
Definition: IOVSyncValue.h:40
cond::runnumber
Definition: Time.h:19
LumiCorrectionSource::m_siteconfpath
std::string m_siteconfpath
Definition: LumiCorrectionSource.h:51
LumiCorrectionSource::m_cachesize
unsigned int m_cachesize
Definition: LumiCorrectionSource.h:55
download_sqlite_cfg.globaltag
globaltag
Definition: download_sqlite_cfg.py:14
lumi::NormDML
Definition: NormDML.h:25
LumiCorrectionSource::x2s
std::string x2s(const XMLCh *input) const
Definition: LumiCorrectionSource.cc:67
LumiCorrectionSource::m_normtag
std::string m_normtag
Definition: LumiCorrectionSource.h:50
LumiCorrectionSource::m_connectStr
std::string m_connectStr
Definition: LumiCorrectionSource.h:46
lumi::RevisionDML::currentHFDataTagId
unsigned long long currentHFDataTagId(coral::ISchema &schema)
Definition: RevisionDML.cc:178
instance
static PFTauRenderPlugin instance
Definition: PFTauRenderPlugin.cc:70
lumi::LumiNames::intglumiv2TableName
static const std::string intglumiv2TableName()
Definition: LumiNames.cc:21
LumiCorrectionSource::fillparamcache
void fillparamcache(unsigned int runnumber)
Definition: LumiCorrectionSource.cc:242
eostools.move
def move(src, dest)
Definition: eostools.py:511
lumi::RevisionDML::HFDataTagIdByName
unsigned long long HFDataTagIdByName(coral::ISchema &schema, const std::string &datatagname)
Definition: RevisionDML.cc:201
lumi::RevisionDML::dataIDForRun
DataID dataIDForRun(coral::ISchema &schema, unsigned int runnum, unsigned long long tagid)
Definition: RevisionDML.cc:255
LumiCorrectionSource::s2x
XMLCh * s2x(const std::string &input) const
Definition: LumiCorrectionSource.cc:72
Exception
Definition: hltDiff.cc:246
LumiCorrectionSource::servletTranslation
const std::string servletTranslation(const std::string &servlet) const
Definition: LumiCorrectionSource.cc:101
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
LumiCorrectionSource::toParentString
std::string toParentString(const xercesc::DOMNode &nodeToConvert) const
Definition: LumiCorrectionSource.cc:77
mps_fire.result
result
Definition: mps_fire.py:311
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
dqmiodumpmetadata.currentrun
currentrun
Definition: dqmiodumpmetadata.py:34
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
lumi::NormDML::normById
void normById(const coral::ISchema &schema, unsigned long long normid, std::map< unsigned int, normData > &result)
Definition: NormDML.cc:97
child
Definition: simpleInheritance.h:11
cms::concurrency::xercesInitialize
void xercesInitialize()
Definition: Xerces.cc:18
LumiCorrectionSource::produceLumiCorrectionParam
ReturnParamType produceLumiCorrectionParam(const LumiCorrectionParamRcd &)
Definition: LumiCorrectionSource.cc:206
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37