CMS 3D CMS Logo

LumiProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: LumiProducer
4 // Class: LumiProducer
5 //
16 //
17 // Original Author: Valerie Halyo
18 // David Dagenhart
19 // Zhen Xie
20 // Created: Tue Jun 12 00:47:28 CEST 2007
21 
34 
35 #include "CoralBase/Exception.h"
36 #include "CoralBase/AttributeList.h"
37 #include "CoralBase/Attribute.h"
38 #include "CoralBase/AttributeSpecification.h"
39 #include "CoralBase/Exception.h"
40 #include "CoralBase/Blob.h"
41 #include "RelationalAccess/ISessionProxy.h"
42 #include "RelationalAccess/ITransaction.h"
43 #include "RelationalAccess/AccessMode.h"
44 #include "RelationalAccess/ITypeConverter.h"
45 #include "RelationalAccess/IQuery.h"
46 #include "RelationalAccess/ICursor.h"
47 #include "RelationalAccess/ISchema.h"
48 #include "RelationalAccess/ITable.h"
49 
51 
56 #include <iostream>
57 #include <sstream>
58 #include <string>
59 #include <memory>
60 #include <algorithm>
61 #include <vector>
62 #include <cstring>
63 #include <iterator>
64 #include <boost/tokenizer.hpp>
65 #include <xercesc/dom/DOM.hpp>
66 #include <xercesc/parsers/XercesDOMParser.hpp>
68 #include <xercesc/util/XMLString.hpp>
69 
70 #include "boost/filesystem/path.hpp"
71 #include "boost/filesystem/operations.hpp"
72 
73 namespace edm {
74  class EventSetup;
75 }
76 
77 //
78 // class declaration
79 //
81  : public edm::one::EDProducer<edm::one::WatchRuns, edm::BeginLuminosityBlockProducer, edm::EndRunProducer> {
82 public:
83  struct HLTData {
85  unsigned int prescale;
86  unsigned int l1passcount;
87  unsigned int acceptcount;
88  };
89  struct L1Data {
91  unsigned int prescale;
92  unsigned int ratecount;
93  };
94  struct PerRunData {
95  std::string bitzeroname; //norm bit name
96  std::map<std::string, unsigned int> TRGBitNameToIndex;
97  std::map<std::string, unsigned int> HLTPathNameToIndex;
98  std::vector<std::string> TRGBitNames;
99  std::vector<std::string> HLTPathNames;
100  };
101  struct PerLSData {
102  float lumivalue;
103  float lumierror;
104  short lumiquality;
105  unsigned long long deadcount;
106  unsigned int numorbit;
107  unsigned int startorbit;
108  unsigned int bitzerocount;
109  unsigned int bitzeroprescale;
110  std::vector<HLTData> hltdata;
111  std::vector<L1Data> l1data;
112  std::vector<std::pair<std::string, std::vector<float> > > bunchlumivalue;
113  std::vector<std::pair<std::string, std::vector<float> > > bunchlumierror;
114  std::vector<std::pair<std::string, std::vector<short> > > bunchlumiquality;
115  std::vector<float> beam1intensity;
116  std::vector<float> beam2intensity;
117  };
118 
119  explicit LumiProducer(const edm::ParameterSet&);
120 
121  ~LumiProducer() override;
122 
123 private:
124  void produce(edm::Event&, const edm::EventSetup&) final;
125 
126  void beginRun(edm::Run const&, edm::EventSetup const&) final;
127 
128  void beginLuminosityBlockProduce(edm::LuminosityBlock& iLBlock, edm::EventSetup const& iSetup) final;
129 
130  void endRun(edm::Run const&, edm::EventSetup const&) final;
131  void endRunProduce(edm::Run&, edm::EventSetup const&) final;
132 
133  bool fillLumi(edm::LuminosityBlock& iLBlock);
134  void fillRunCache(const coral::ISchema& schema, unsigned int runnumber);
135  void fillLSCache(unsigned int luminum);
136  void writeProductsForEntry(edm::LuminosityBlock& iLBlock, unsigned int runnumber, unsigned int luminum);
137  const std::string servletTranslation(const std::string& servlet) const;
138  std::string x2s(const XMLCh* input) const;
139  XMLCh* s2x(const std::string& input) const;
140  std::string toParentString(const xercesc::DOMNode& nodeToConvert) const;
141  unsigned long long getLumiDataId(const coral::ISchema& schema, unsigned int runnumber);
142  unsigned long long getTrgDataId(const coral::ISchema& schema, unsigned int runnumber);
143  unsigned long long getHltDataId(const coral::ISchema& schema, unsigned int runnumber);
144  std::string getCurrentDataTag(const coral::ISchema& schema);
148  unsigned int m_cachedrun;
149  unsigned long long m_cachedlumidataid;
150  unsigned long long m_cachedtrgdataid;
151  unsigned long long m_cachedhltdataid;
153  std::map<unsigned int, PerLSData> m_lscache;
155  unsigned int m_cachesize;
156 };
157 
158 //
159 // constructors and destructor
160 //
161 
162 std::string LumiProducer::x2s(const XMLCh* toTranscode) const {
163  std::string tmp(xercesc::XMLString::transcode(toTranscode));
164  return tmp;
165 }
166 
167 XMLCh* LumiProducer::s2x(const std::string& temp) const {
168  XMLCh* buff = xercesc::XMLString::transcode(temp.c_str());
169  return buff;
170 }
171 
172 std::string LumiProducer::toParentString(const xercesc::DOMNode& nodeToConvert) const {
173  std::ostringstream oss;
174  xercesc::DOMNodeList* childList = nodeToConvert.getChildNodes();
175 
176  unsigned int numNodes = childList->getLength();
177  for (unsigned int i = 0; i < numNodes; ++i) {
178  xercesc::DOMNode* childNode = childList->item(i);
179  if (childNode->getNodeType() != xercesc::DOMNode::ELEMENT_NODE)
180  continue;
181  xercesc::DOMElement* child = static_cast<xercesc::DOMElement*>(childNode);
182  xercesc::DOMNamedNodeMap* attributes = child->getAttributes();
183  unsigned int numAttributes = attributes->getLength();
184  for (unsigned int j = 0; j < numAttributes; ++j) {
185  xercesc::DOMNode* attributeNode = attributes->item(j);
186  if (attributeNode->getNodeType() != xercesc::DOMNode::ATTRIBUTE_NODE)
187  continue;
188  xercesc::DOMAttr* attribute = static_cast<xercesc::DOMAttr*>(attributeNode);
189 
190  oss << "(" << x2s(child->getTagName()) << x2s(attribute->getName()) << "=" << x2s(attribute->getValue()) << ")";
191  }
192  }
193  return oss.str();
194 }
195 
197  std::string frontierConnect;
198  std::string realconnect;
200  std::unique_ptr<xercesc::XercesDOMParser> parser(new xercesc::XercesDOMParser);
201  try {
202  parser->setValidationScheme(xercesc::XercesDOMParser::Val_Auto);
203  parser->setDoNamespaces(false);
204  parser->parse(m_siteconfpath.c_str());
205  xercesc::DOMDocument* doc = parser->getDocument();
206  if (!doc) {
207  return "";
208  }
209 
210  xercesc::DOMNodeList* frontierConnectList = doc->getElementsByTagName(s2x("frontier-connect"));
211  if (frontierConnectList->getLength() > 0) {
212  xercesc::DOMElement* frontierConnectElement = static_cast<xercesc::DOMElement*>(frontierConnectList->item(0));
213  frontierConnect = toParentString(*frontierConnectElement);
214  }
215  // Replace the last component of every "serverurl=" piece (up to the
216  // next close-paren) with the servlet
217  std::string::size_type nextparen = 0;
218  std::string::size_type serverurl, lastslash;
219  std::string complexstr = "";
220  while ((serverurl = frontierConnect.find("(serverurl=", nextparen)) != std::string::npos) {
221  realconnect.append(frontierConnect, nextparen, serverurl - nextparen);
222  nextparen = frontierConnect.find(')', serverurl);
223  lastslash = frontierConnect.rfind('/', nextparen);
224  realconnect.append(frontierConnect, serverurl, lastslash - serverurl + 1);
225  realconnect.append(servlet);
226  }
227  realconnect.append(frontierConnect, nextparen, frontierConnect.length() - nextparen);
228  } catch (xercesc::DOMException& e) {
229  }
230  return realconnect;
231 }
232 
233 LumiProducer::LumiProducer::LumiProducer(const edm::ParameterSet& iConfig)
234  : m_cachedrun(0), m_isNullRun(false), m_cachesize(0) {
235  // register your products
236  produces<LumiSummaryRunHeader, edm::Transition::EndRun>();
237  produces<LumiSummary, edm::Transition::BeginLuminosityBlock>();
238  produces<LumiDetails, edm::Transition::BeginLuminosityBlock>();
239  // set up cache
240  std::string connectStr = iConfig.getParameter<std::string>("connect");
241  m_cachesize = iConfig.getUntrackedParameter<unsigned int>("ncacheEntries", 5);
242  m_lumiversion = iConfig.getUntrackedParameter<std::string>("lumiversion", "");
243  const std::string fproto("frontier://");
244  //test if need frontier servlet site-local translation
245  if (connectStr.substr(0, fproto.length()) == fproto) {
246  std::string::size_type startservlet = fproto.length();
247  std::string::size_type endservlet = connectStr.find("(", startservlet);
248  if (endservlet == std::string::npos) {
249  endservlet = connectStr.rfind('/', connectStr.length());
250  }
251  std::string servlet = connectStr.substr(startservlet, endservlet - startservlet);
252  if ((!servlet.empty()) && (servlet.find_first_of(":/)[]") == std::string::npos)) {
253  if (servlet == "cms_conditions_data")
254  servlet = "";
255 
256  std::string siteconfpath = iConfig.getUntrackedParameter<std::string>("siteconfpath", "");
257  if (siteconfpath.length() == 0) {
259  boost::filesystem::path("JobConfig") / boost::filesystem::path("site-local-config.xml"))
260  .string();
261  char* tmp = std::getenv("CMS_PATH");
262  if (tmp) {
264  }
265  } else {
266  if (!boost::filesystem::exists(boost::filesystem::path(siteconfpath))) {
267  throw cms::Exception("Non existing path ") << siteconfpath;
268  }
270  (boost::filesystem::path(siteconfpath) / boost::filesystem::path("site-local-config.xml")).string();
271  }
272  //std::cout<<"servlet : "<<servlet<<std::endl;
273  m_connectStr = fproto + servletTranslation(servlet) + connectStr.substr(endservlet);
274  } else {
275  m_connectStr = connectStr;
276  }
277  } else {
278  m_connectStr = connectStr;
279  }
280  //std::cout<<"connect string "<< m_connectStr<<std::endl;
281 }
282 
284 
285 //
286 // member functions
287 //
289 unsigned long long LumiProducer::getLumiDataId(const coral::ISchema& schema, unsigned int runnumber) {
290  //
291  //select max(data_id) from lumidata where runnum=:runnum
292  //
293  //std::count<<"entering getLumiDataId "<<std::endl;
294  unsigned long long lumidataid = 0;
295  coral::AttributeList bindVariables;
296  bindVariables.extend("runnum", typeid(unsigned int));
297  bindVariables["runnum"].data<unsigned int>() = runnumber;
298  coral::AttributeList lumiidOutput;
299  lumiidOutput.extend("lumidataid", typeid(unsigned long long));
300  coral::IQuery* lumiQuery = schema.newQuery();
301  lumiQuery->addToTableList(lumi::LumiNames::lumidataTableName());
302  lumiQuery->addToOutputList("MAX(DATA_ID)", "lumidataid");
303  lumiQuery->setCondition("RUNNUM=:runnum", bindVariables);
304  lumiQuery->defineOutput(lumiidOutput);
305  coral::ICursor& lumicursor = lumiQuery->execute();
306  while (lumicursor.next()) {
307  const coral::AttributeList& row = lumicursor.currentRow();
308  if (!row["lumidataid"].isNull()) {
309  lumidataid = row["lumidataid"].data<unsigned long long>();
310  }
311  }
312  delete lumiQuery;
313  return lumidataid;
314 }
315 unsigned long long LumiProducer::getTrgDataId(const coral::ISchema& schema, unsigned int runnumber) {
316  //
317  //select max(data_id) from trgdata where runnum=:runnum
318  //
319  unsigned long long trgdataid = 0;
320  coral::AttributeList bindVariables;
321  bindVariables.extend("runnum", typeid(unsigned int));
322  bindVariables["runnum"].data<unsigned int>() = runnumber;
323  coral::AttributeList trgidOutput;
324  trgidOutput.extend("trgdataid", typeid(unsigned long long));
325  coral::IQuery* trgQuery = schema.newQuery();
326  trgQuery->addToTableList(lumi::LumiNames::trgdataTableName());
327  trgQuery->addToOutputList("MAX(DATA_ID)", "trgdataid");
328  trgQuery->setCondition("RUNNUM=:runnum", bindVariables);
329  trgQuery->defineOutput(trgidOutput);
330  coral::ICursor& trgcursor = trgQuery->execute();
331  while (trgcursor.next()) {
332  const coral::AttributeList& row = trgcursor.currentRow();
333  if (!row["trgdataid"].isNull()) {
334  trgdataid = row["trgdataid"].data<unsigned long long>();
335  }
336  }
337  delete trgQuery;
338  return trgdataid;
339 }
340 unsigned long long LumiProducer::getHltDataId(const coral::ISchema& schema, unsigned int runnumber) {
341  //
342  //select max(data_id) from hltdata where runnum=:runnum
343  //
344  unsigned long long hltdataid = 0;
345  coral::AttributeList bindVariables;
346  bindVariables.extend("runnum", typeid(unsigned int));
347  bindVariables["runnum"].data<unsigned int>() = runnumber;
348  coral::AttributeList hltidOutput;
349  hltidOutput.extend("hltdataid", typeid(unsigned long long));
350  coral::IQuery* hltQuery = schema.newQuery();
351  hltQuery->addToTableList(lumi::LumiNames::hltdataTableName());
352  hltQuery->addToOutputList("MAX(DATA_ID)", "hltdataid");
353  hltQuery->setCondition("RUNNUM=:runnum", bindVariables);
354  hltQuery->defineOutput(hltidOutput);
355  coral::ICursor& hltcursor = hltQuery->execute();
356  while (hltcursor.next()) {
357  const coral::AttributeList& row = hltcursor.currentRow();
358  if (!row["hltdataid"].isNull()) {
359  hltdataid = row["hltdataid"].data<unsigned long long>();
360  }
361  }
362  delete hltQuery;
363  return hltdataid;
364 }
365 
366 std::string LumiProducer::getCurrentDataTag(const coral::ISchema& schema) {
367  //select tagid,tagname from tags
369  std::map<unsigned long long, std::string> alltags;
370  coral::IQuery* tagQuery = schema.newQuery();
371  tagQuery->addToTableList(lumi::LumiNames::tagsTableName());
372  tagQuery->addToOutputList("TAGID");
373  tagQuery->addToOutputList("TAGNAME");
374  coral::AttributeList tagoutput;
375  tagoutput.extend("TAGID", typeid(unsigned long long));
376  tagoutput.extend("TAGNAME", typeid(std::string));
377  tagQuery->defineOutput(tagoutput);
378  coral::ICursor& tagcursor = tagQuery->execute();
379  while (tagcursor.next()) {
380  const coral::AttributeList& row = tagcursor.currentRow();
381  unsigned long long tagid = row["TAGID"].data<unsigned long long>();
382  const std::string tagname = row["TAGNAME"].data<std::string>();
383  alltags.insert(std::make_pair(tagid, tagname));
384  }
385  delete tagQuery;
386  unsigned long long maxid = 0;
387  for (std::map<unsigned long long, std::string>::iterator it = alltags.begin(); it != alltags.end(); ++it) {
388  if (it->first > maxid) {
389  maxid = it->first;
390  }
391  }
392  result = alltags[maxid];
393  return result;
394 }
395 
396 void LumiProducer::beginRun(edm::Run const& run, edm::EventSetup const& iSetup) {
397  unsigned int runnumber = run.run();
398  if (m_cachedrun != runnumber) {
399  //queries once per run
402  if (!mydbservice.isAvailable()) {
403  throw cms::Exception("Non existing service lumi::service::DBService");
404  }
405  auto session = mydbservice->connectReadOnly(m_connectStr);
406  try {
407  session->transaction().start(true);
408  m_cachedlumidataid = getLumiDataId(session->nominalSchema(), runnumber);
409  if (m_cachedlumidataid != 0) { //if no lumi, do not bother other info
410  m_cachedtrgdataid = getTrgDataId(session->nominalSchema(), runnumber);
411  m_cachedhltdataid = getHltDataId(session->nominalSchema(), runnumber);
412  fillRunCache(session->nominalSchema(), runnumber);
413  } else {
414  m_isNullRun = true;
415  }
416  session->transaction().commit();
417  } catch (const coral::Exception& er) {
418  session->transaction().rollback();
419  throw cms::Exception("DatabaseError ") << er.what();
420  }
421  }
422  //std::cout<<"end of beginRun "<<runnumber<<std::endl;
423 }
424 
426  unsigned int runnumber = iLBlock.run();
427  unsigned int luminum = iLBlock.luminosityBlock();
428  //std::cout<<"beg of beginLuminosityBlock "<<luminum<<std::endl;
429  //if is null run, fill empty values and return
430  if (m_isNullRun) {
431  iLBlock.put(std::make_unique<LumiSummary>());
432  iLBlock.put(std::make_unique<LumiDetails>());
433  return;
434  }
435  if (m_lscache.find(luminum) == m_lscache.end()) {
436  //if runnumber is cached but LS is not, this is the first LS, fill LS cache to full capacity
437  fillLSCache(luminum);
438  }
439  //here the presence of ls is guaranteed
440  writeProductsForEntry(iLBlock, runnumber, luminum);
441 }
442 void LumiProducer::endRun(edm::Run const& run, edm::EventSetup const& iSetup) {}
444  auto lsrh = std::make_unique<LumiSummaryRunHeader>();
445  lsrh->swapL1Names(m_runcache.TRGBitNames);
446  lsrh->swapHLTNames(m_runcache.HLTPathNames);
447  run.put(std::move(lsrh));
450 }
451 void LumiProducer::fillRunCache(const coral::ISchema& schema, unsigned int runnumber) {
452  if (m_lumiversion.empty()) {
454  }
455  std::cout << "lumi tag version 2 " << m_lumiversion << std::endl;
456  if (m_cachedtrgdataid != 0) {
457  coral::AttributeList trgBindVariables;
458  trgBindVariables.extend("trgdataid", typeid(unsigned long long));
459  trgBindVariables["trgdataid"].data<unsigned long long>() = m_cachedtrgdataid;
460  //std::cout<<"cached trgdataid "<<m_cachedtrgdataid<<std::endl;
461  coral::AttributeList trgOutput;
462  trgOutput.extend("bitzeroname", typeid(std::string));
463  trgOutput.extend("bitnameclob", typeid(std::string));
464  coral::IQuery* trgQuery = schema.newQuery();
465  trgQuery->addToTableList(lumi::LumiNames::trgdataTableName());
466  trgQuery->addToOutputList("BITZERONAME");
467  trgQuery->addToOutputList("BITNAMECLOB");
468  trgQuery->setCondition("DATA_ID=:trgdataid", trgBindVariables);
469  trgQuery->defineOutput(trgOutput);
470  coral::ICursor& trgcursor = trgQuery->execute();
471  while (trgcursor.next()) {
472  const coral::AttributeList& row = trgcursor.currentRow();
473  m_runcache.bitzeroname = row["bitzeroname"].data<std::string>();
474  //std::cout<<"bitzeroname "<<m_runcache.bitzeroname<<std::endl;
475  std::string bitnames = row["bitnameclob"].data<std::string>();
476  boost::char_separator<char> sep(",");
477  boost::tokenizer<boost::char_separator<char> > tokens(bitnames, sep);
478  for (boost::tokenizer<boost::char_separator<char> >::iterator tok_it = tokens.begin(); tok_it != tokens.end();
479  ++tok_it) {
480  m_runcache.TRGBitNames.push_back(*tok_it);
481  }
482  for (unsigned int i = 0; i < m_runcache.TRGBitNames.size(); ++i) {
483  m_runcache.TRGBitNameToIndex.insert(std::make_pair(m_runcache.TRGBitNames.at(i), i));
484  }
485  }
486  delete trgQuery;
487  }
488  if (m_cachedhltdataid != 0) {
489  //
490  //select pathnameclob from hltdata where data_id=:hltdataid
491  //
492  coral::AttributeList hltBindVariables;
493  hltBindVariables.extend("hltdataid", typeid(unsigned long long));
494  hltBindVariables["hltdataid"].data<unsigned long long>() = m_cachedhltdataid;
495  coral::AttributeList hltOutput;
496  hltOutput.extend("PATHNAMECLOB", typeid(std::string));
497  coral::IQuery* hltQuery = schema.newQuery();
498  hltQuery->addToTableList(lumi::LumiNames::hltdataTableName());
499  hltQuery->addToOutputList("PATHNAMECLOB");
500  hltQuery->setCondition("DATA_ID=:hltdataid", hltBindVariables);
501  hltQuery->defineOutput(hltOutput);
502  coral::ICursor& hltcursor = hltQuery->execute();
503  while (hltcursor.next()) {
504  const coral::AttributeList& row = hltcursor.currentRow();
505  std::string pathnames = row["PATHNAMECLOB"].data<std::string>();
506  boost::char_separator<char> sep(",");
507  boost::tokenizer<boost::char_separator<char> > tokens(pathnames, sep);
508  for (boost::tokenizer<boost::char_separator<char> >::iterator tok_it = tokens.begin(); tok_it != tokens.end();
509  ++tok_it) {
510  m_runcache.HLTPathNames.push_back(*tok_it);
511  }
512  for (unsigned int i = 0; i < m_runcache.HLTPathNames.size(); ++i) {
513  m_runcache.HLTPathNameToIndex.insert(std::make_pair(m_runcache.HLTPathNames.at(i), i));
514  }
515  }
516  delete hltQuery;
517  }
518 }
519 void LumiProducer::fillLSCache(unsigned int luminum) {
520  //initialize cache
521  if (m_isNullRun)
522  return;
523  m_lscache.clear();
524  for (unsigned int n = luminum; n < luminum + m_cachesize; ++n) {
525  PerLSData l;
526  l.hltdata.reserve(250);
527  l.l1data.reserve(192);
528  l.bunchlumivalue.reserve(5);
529  l.bunchlumierror.reserve(5);
530  l.bunchlumiquality.reserve(5);
531  l.beam1intensity.resize(3564, 0.0);
532  l.beam2intensity.resize(3564, 0.0);
533  m_lscache.insert(std::make_pair(n, l));
534  }
535  //queries once per cache refill
536  //
537  //select cmslsnum,instlumi,startorbit,numorbit,bxindex,beam1intensity,beam2intensity,bxlumivalue_occ1,bxlumivalue_occ2,bxlumivalue_et from lumisummaryv2 where cmslsnum>=:lsmin and cmslsnum<:lsmax and data_id=:lumidataid;
538  //
540  if (!mydbservice.isAvailable()) {
541  throw cms::Exception("Non existing service lumi::service::DBService");
542  }
543  auto session = mydbservice->connectReadOnly(m_connectStr);
544  try {
545  session->transaction().start(true);
546  coral::ISchema& schema = session->nominalSchema();
547  coral::AttributeList lumisummaryBindVariables;
548  lumisummaryBindVariables.extend("lsmin", typeid(unsigned int));
549  lumisummaryBindVariables.extend("lsmax", typeid(unsigned int));
550  lumisummaryBindVariables.extend("lumidataid", typeid(unsigned long long));
551  lumisummaryBindVariables["lumidataid"].data<unsigned long long>() = m_cachedlumidataid;
552  lumisummaryBindVariables["lsmin"].data<unsigned int>() = luminum;
553  lumisummaryBindVariables["lsmax"].data<unsigned int>() = luminum + m_cachesize;
554  coral::AttributeList lumisummaryOutput;
555  lumisummaryOutput.extend("CMSLSNUM", typeid(unsigned int));
556  lumisummaryOutput.extend("INSTLUMI", typeid(float));
557  lumisummaryOutput.extend("STARTORBIT", typeid(unsigned int));
558  lumisummaryOutput.extend("NUMORBIT", typeid(unsigned int));
559  lumisummaryOutput.extend("CMSBXINDEXBLOB", typeid(coral::Blob));
560  lumisummaryOutput.extend("BEAMINTENSITYBLOB_1", typeid(coral::Blob));
561  lumisummaryOutput.extend("BEAMINTENSITYBLOB_2", typeid(coral::Blob));
562  lumisummaryOutput.extend("BXLUMIVALUE_OCC1", typeid(coral::Blob));
563  lumisummaryOutput.extend("BXLUMIVALUE_OCC2", typeid(coral::Blob));
564  lumisummaryOutput.extend("BXLUMIVALUE_ET", typeid(coral::Blob));
565  coral::IQuery* lumisummaryQuery = schema.newQuery();
566  lumisummaryQuery->addToTableList(lumi::LumiNames::lumisummaryv2TableName());
567  lumisummaryQuery->addToOutputList("CMSLSNUM");
568  lumisummaryQuery->addToOutputList("INSTLUMI");
569  lumisummaryQuery->addToOutputList("STARTORBIT");
570  lumisummaryQuery->addToOutputList("NUMORBIT");
571  lumisummaryQuery->addToOutputList("CMSBXINDEXBLOB");
572  lumisummaryQuery->addToOutputList("BEAMINTENSITYBLOB_1");
573  lumisummaryQuery->addToOutputList("BEAMINTENSITYBLOB_2");
574  lumisummaryQuery->addToOutputList("BXLUMIVALUE_OCC1");
575  lumisummaryQuery->addToOutputList("BXLUMIVALUE_OCC2");
576  lumisummaryQuery->addToOutputList("BXLUMIVALUE_ET");
577  lumisummaryQuery->setCondition("CMSLSNUM>=:lsmin AND CMSLSNUM<:lsmax AND DATA_ID=:lumidataid",
578  lumisummaryBindVariables);
579  lumisummaryQuery->defineOutput(lumisummaryOutput);
580  coral::ICursor& lumisummarycursor = lumisummaryQuery->execute();
581  unsigned int rowcounter = 0;
582  while (lumisummarycursor.next()) {
583  const coral::AttributeList& row = lumisummarycursor.currentRow();
584  unsigned int cmslsnum = row["CMSLSNUM"].data<unsigned int>();
585  //std::cout<<"cmslsnum "<<cmslsnum<<std::endl;
586  PerLSData& lsdata = m_lscache[cmslsnum];
587  lsdata.lumivalue = row["INSTLUMI"].data<float>();
588  lsdata.lumierror = 0.0;
589  lsdata.lumiquality = 0;
590  lsdata.startorbit = row["STARTORBIT"].data<unsigned int>();
591  lsdata.numorbit = row["NUMORBIT"].data<unsigned int>();
592 
593  if (!row["CMSBXINDEXBLOB"].isNull() && !row["BXLUMIVALUE_OCC1"].isNull()) {
594  const coral::Blob& bxindexBlob = row["CMSBXINDEXBLOB"].data<coral::Blob>();
595  const void* bxindex_StartAddress = bxindexBlob.startingAddress();
596  short* bxindex = (short*)::malloc(bxindexBlob.size());
597  const coral::Blob& beam1intensityBlob = row["BEAMINTENSITYBLOB_1"].data<coral::Blob>();
598  const void* beam1intensityBlob_StartAddress = beam1intensityBlob.startingAddress();
599  float* beam1intensity = (float*)::malloc(beam1intensityBlob.size());
600  const coral::Blob& beam2intensityBlob = row["BEAMINTENSITYBLOB_2"].data<coral::Blob>();
601  const void* beam2intensityBlob_StartAddress = beam2intensityBlob.startingAddress();
602  float* beam2intensity = (float*)::malloc(beam2intensityBlob.size());
603  std::memmove(bxindex, bxindex_StartAddress, bxindexBlob.size());
604  std::memmove(beam1intensity, beam1intensityBlob_StartAddress, beam1intensityBlob.size());
605  std::memmove(beam2intensity, beam2intensityBlob_StartAddress, beam2intensityBlob.size());
606 
607  unsigned int iMax = bxindexBlob.size() / sizeof(short);
608  unsigned int lsb1Max = lsdata.beam1intensity.size();
609  unsigned int lsb2Max = lsdata.beam2intensity.size();
610  unsigned int ib1Max = beam1intensityBlob.size() / sizeof(float);
611  unsigned int ib2Max = beam2intensityBlob.size() / sizeof(float);
612  for (unsigned int i = 0; i < iMax; ++i) {
613  unsigned int idx = bxindex[i];
614  if (ib1Max > i && lsb1Max > idx) {
615  lsdata.beam1intensity.at(idx) = beam1intensity[i];
616  }
617  if (ib2Max > i && lsb2Max > idx) {
618  lsdata.beam2intensity.at(idx) = beam2intensity[i];
619  }
620  }
621  ::free(bxindex);
622  ::free(beam1intensity);
623  ::free(beam2intensity);
624 
625  const coral::Blob& bxlumivalBlob_occ1 = row["BXLUMIVALUE_OCC1"].data<coral::Blob>();
626  const void* bxlumival_occ1_StartAddress = bxlumivalBlob_occ1.startingAddress();
627  float* bxlumival_occ1 = (float*)::malloc(bxlumivalBlob_occ1.size());
628  std::memmove(bxlumival_occ1, bxlumival_occ1_StartAddress, bxlumivalBlob_occ1.size());
629  std::vector<float> bxlumivalVec_occ1(bxlumival_occ1,
630  bxlumival_occ1 + bxlumivalBlob_occ1.size() / sizeof(float));
631  ::free(bxlumival_occ1);
632  lsdata.bunchlumivalue.push_back(std::make_pair(std::string("OCC1"), bxlumivalVec_occ1));
633  lsdata.bunchlumierror.push_back(std::make_pair(std::string("OCC1"), std::vector<float>(3564)));
634  lsdata.bunchlumiquality.push_back(std::make_pair(std::string("OCC1"), std::vector<short>(3564)));
635  const coral::Blob& bxlumivalBlob_occ2 = row["BXLUMIVALUE_OCC2"].data<coral::Blob>();
636  const void* bxlumival_occ2_StartAddress = bxlumivalBlob_occ2.startingAddress();
637  float* bxlumival_occ2 = (float*)::malloc(bxlumivalBlob_occ2.size());
638  std::memmove(bxlumival_occ2, bxlumival_occ2_StartAddress, bxlumivalBlob_occ2.size());
639  std::vector<float> bxlumivalVec_occ2(bxlumival_occ2,
640  bxlumival_occ2 + bxlumivalBlob_occ1.size() / sizeof(float));
641  ::free(bxlumival_occ2);
642  lsdata.bunchlumivalue.push_back(std::make_pair(std::string("OCC2"), bxlumivalVec_occ2));
643  lsdata.bunchlumierror.push_back(std::make_pair(std::string("OCC2"), std::vector<float>(3564)));
644  lsdata.bunchlumiquality.push_back(std::make_pair(std::string("OCC2"), std::vector<short>(3564)));
645 
646  const coral::Blob& bxlumivalBlob_et = row["BXLUMIVALUE_ET"].data<coral::Blob>();
647  const void* bxlumival_et_StartAddress = bxlumivalBlob_et.startingAddress();
648  float* bxlumival_et = (float*)::malloc(bxlumivalBlob_et.size());
649  std::memmove(bxlumival_et, bxlumival_et_StartAddress, bxlumivalBlob_et.size());
650  std::vector<float> bxlumivalVec_et(bxlumival_et, bxlumival_et + bxlumivalBlob_et.size() / sizeof(float));
651  ::free(bxlumival_et);
652  lsdata.bunchlumivalue.push_back(std::make_pair(std::string("ET"), bxlumivalVec_et));
653  lsdata.bunchlumierror.push_back(std::make_pair(std::string("ET"), std::vector<float>(3564)));
654  lsdata.bunchlumiquality.push_back(std::make_pair(std::string("ET"), std::vector<short>(3564)));
655  }
656  ++rowcounter;
657  }
658  if (rowcounter == 0) {
659  m_isNullRun = true;
660  return;
661  }
662  delete lumisummaryQuery;
663 
664  //
665  //select cmslsnum,deadtimecount,bitzerocount,bitzeroprescale,prescaleblob,trgcountblob from lstrg where cmslsnum >=:luminum and cmslsnum<:luminum+cachesize AND data_id=:trgdataid;
666  //
667  coral::AttributeList trgBindVariables;
668  trgBindVariables.extend("lsmin", typeid(unsigned int));
669  trgBindVariables.extend("lsmax", typeid(unsigned int));
670  trgBindVariables.extend("trgdataid", typeid(unsigned long long));
671  trgBindVariables["lsmin"].data<unsigned int>() = luminum;
672  trgBindVariables["lsmax"].data<unsigned int>() = luminum + m_cachesize;
673  trgBindVariables["trgdataid"].data<unsigned long long>() = m_cachedtrgdataid;
674  coral::AttributeList trgOutput;
675  trgOutput.extend("CMSLSNUM", typeid(unsigned int));
676  trgOutput.extend("DEADTIMECOUNT", typeid(unsigned long long));
677  trgOutput.extend("BITZEROCOUNT", typeid(unsigned int));
678  trgOutput.extend("BITZEROPRESCALE", typeid(unsigned int));
679  trgOutput.extend("PRESCALEBLOB", typeid(coral::Blob));
680  trgOutput.extend("TRGCOUNTBLOB", typeid(coral::Blob));
681 
682  coral::IQuery* trgQuery = schema.newQuery();
683  trgQuery->addToTableList(lumi::LumiNames::lstrgTableName());
684  trgQuery->addToOutputList("CMSLSNUM");
685  trgQuery->addToOutputList("DEADTIMECOUNT");
686  trgQuery->addToOutputList("BITZEROCOUNT");
687  trgQuery->addToOutputList("BITZEROPRESCALE");
688  trgQuery->addToOutputList("PRESCALEBLOB");
689  trgQuery->addToOutputList("TRGCOUNTBLOB");
690  trgQuery->setCondition("CMSLSNUM>=:lsmin AND CMSLSNUM<:lsmax AND DATA_ID=:trgdataid", trgBindVariables);
691  trgQuery->defineOutput(trgOutput);
692  coral::ICursor& trgcursor = trgQuery->execute();
693  while (trgcursor.next()) {
694  const coral::AttributeList& row = trgcursor.currentRow();
695  unsigned int cmslsnum = row["CMSLSNUM"].data<unsigned int>();
696  PerLSData& lsdata = m_lscache[cmslsnum];
697  lsdata.deadcount = row["DEADTIMECOUNT"].data<unsigned long long>();
698  lsdata.bitzerocount = row["BITZEROCOUNT"].data<unsigned int>();
699  lsdata.bitzeroprescale = row["BITZEROPRESCALE"].data<unsigned int>();
700  if (!row["PRESCALEBLOB"].isNull()) {
701  const coral::Blob& prescaleblob = row["PRESCALEBLOB"].data<coral::Blob>();
702  const void* prescaleblob_StartAddress = prescaleblob.startingAddress();
703  unsigned int* prescales = (unsigned int*)::malloc(prescaleblob.size());
704  std::memmove(prescales, prescaleblob_StartAddress, prescaleblob.size());
705  const coral::Blob& trgcountblob = row["TRGCOUNTBLOB"].data<coral::Blob>();
706  const void* trgcountblob_StartAddress = trgcountblob.startingAddress();
707  unsigned int* trgcounts = (unsigned int*)::malloc(trgcountblob.size());
708  std::memmove(trgcounts, trgcountblob_StartAddress, trgcountblob.size());
709  for (unsigned int i = 0; i < trgcountblob.size() / sizeof(unsigned int); ++i) {
710  L1Data l1tmp;
711  l1tmp.bitname = m_runcache.TRGBitNames[i];
712  l1tmp.prescale = prescales[i];
713  l1tmp.ratecount = trgcounts[i];
714  lsdata.l1data.push_back(l1tmp);
715  }
716  ::free(prescales);
717  ::free(trgcounts);
718  }
719  }
720  delete trgQuery;
721  //
722  //select cmslsnum,hltcountblob,hltacceptblob,prescaleblob from hlt where cmslsnum >=:luminum and cmslsnum<=:luminum+cachesize and data_id=:hltdataid
723  //
724  coral::AttributeList hltBindVariables;
725  hltBindVariables.extend("lsmin", typeid(unsigned int));
726  hltBindVariables.extend("lsmax", typeid(unsigned int));
727  hltBindVariables.extend("hltdataid", typeid(unsigned long long));
728  hltBindVariables["lsmin"].data<unsigned int>() = luminum;
729  hltBindVariables["lsmax"].data<unsigned int>() = luminum + m_cachesize;
730  hltBindVariables["hltdataid"].data<unsigned long long>() = m_cachedhltdataid;
731  coral::AttributeList hltOutput;
732  hltOutput.extend("CMSLSNUM", typeid(unsigned int));
733  hltOutput.extend("HLTCOUNTBLOB", typeid(coral::Blob));
734  hltOutput.extend("HLTACCEPTBLOB", typeid(coral::Blob));
735  hltOutput.extend("PRESCALEBLOB", typeid(coral::Blob));
736  coral::IQuery* hltQuery = schema.newQuery();
737  hltQuery->addToTableList(lumi::LumiNames::lshltTableName());
738  hltQuery->addToOutputList("CMSLSNUM");
739  hltQuery->addToOutputList("HLTCOUNTBLOB");
740  hltQuery->addToOutputList("HLTACCEPTBLOB");
741  hltQuery->addToOutputList("PRESCALEBLOB");
742  hltQuery->setCondition("CMSLSNUM>=:lsmin AND CMSLSNUM<:lsmax AND DATA_ID=:hltdataid", hltBindVariables);
743  hltQuery->defineOutput(hltOutput);
744  coral::ICursor& hltcursor = hltQuery->execute();
745  while (hltcursor.next()) {
746  const coral::AttributeList& row = hltcursor.currentRow();
747  unsigned int cmslsnum = row["CMSLSNUM"].data<unsigned int>();
748  PerLSData& lsdata = m_lscache[cmslsnum];
749  if (!row["PRESCALEBLOB"].isNull()) {
750  const coral::Blob& hltprescaleblob = row["PRESCALEBLOB"].data<coral::Blob>();
751  const void* hltprescaleblob_StartAddress = hltprescaleblob.startingAddress();
752  unsigned int* hltprescales = (unsigned int*)::malloc(hltprescaleblob.size());
753  std::memmove(hltprescales, hltprescaleblob_StartAddress, hltprescaleblob.size());
754  const coral::Blob& hltcountblob = row["HLTCOUNTBLOB"].data<coral::Blob>();
755  const void* hltcountblob_StartAddress = hltcountblob.startingAddress();
756  unsigned int* hltcounts = (unsigned int*)::malloc(hltcountblob.size());
757  std::memmove(hltcounts, hltcountblob_StartAddress, hltcountblob.size());
758  const coral::Blob& hltacceptblob = row["HLTACCEPTBLOB"].data<coral::Blob>();
759  const void* hltacceptblob_StartAddress = hltacceptblob.startingAddress();
760  unsigned int* hltaccepts = (unsigned int*)::malloc(hltacceptblob.size());
761  std::memmove(hltaccepts, hltacceptblob_StartAddress, hltacceptblob.size());
762  unsigned int nhltaccepts = hltacceptblob.size() / sizeof(unsigned int);
763  if (nhltaccepts > 0 && m_runcache.HLTPathNames.empty()) {
764  edm::LogWarning("CorruptOrMissingHLTData")
765  << "Got " << nhltaccepts << " hltaccepts, but the run chache is empty. hltdata will not be written";
766  break;
767  }
768 
769  for (unsigned int i = 0; i < hltacceptblob.size() / sizeof(unsigned int); ++i) {
770  HLTData hlttmp;
771  hlttmp.pathname = m_runcache.HLTPathNames[i];
772  hlttmp.prescale = hltprescales[i];
773  hlttmp.l1passcount = hltcounts[i];
774  hlttmp.acceptcount = hltaccepts[i];
775  lsdata.hltdata.push_back(hlttmp);
776  }
777  ::free(hltprescales);
778  ::free(hltcounts);
779  ::free(hltaccepts);
780  }
781  }
782  delete hltQuery;
783  session->transaction().commit();
784  } catch (const coral::Exception& er) {
785  session->transaction().rollback();
786  throw cms::Exception("DatabaseError ") << er.what();
787  }
788 }
789 void LumiProducer::writeProductsForEntry(edm::LuminosityBlock& iLBlock, unsigned int runnumber, unsigned int luminum) {
790  //std::cout<<"writing runnumber,luminum "<<runnumber<<" "<<luminum<<std::endl;
791  auto pIn1 = std::make_unique<LumiSummary>();
792  auto pIn2 = std::make_unique<LumiDetails>();
793  if (m_isNullRun) {
794  pIn1->setLumiVersion("-1");
795  pIn2->setLumiVersion("-1");
796  iLBlock.put(std::move(pIn1));
797  iLBlock.put(std::move(pIn2));
798  return;
799  }
800  PerLSData& lsdata = m_lscache[luminum];
801  pIn1->setLumiData(lsdata.lumivalue, lsdata.lumierror, lsdata.lumiquality);
802  pIn1->setDeadCount(lsdata.deadcount);
803  if (!lsdata.l1data.empty()) {
804  //std::cout<<"bitzerocount "<<lsdata.bitzerocount<<std::endl;
805  //std::cout<<"bitzeroprescale "<<lsdata.bitzeroprescale<<std::endl;
806  //std::cout<<"product "<<lsdata.bitzerocount*lsdata.bitzeroprescale<<std::endl;
807  pIn1->setBitZeroCount(lsdata.bitzerocount * lsdata.bitzeroprescale);
808  }
809  pIn1->setlsnumber(luminum);
810  pIn1->setOrbitData(lsdata.startorbit, lsdata.numorbit);
811  std::vector<LumiSummary::L1> l1temp;
812  for (std::vector<L1Data>::iterator it = lsdata.l1data.begin(); it != lsdata.l1data.end(); ++it) {
813  LumiSummary::L1 trgtmp;
814  trgtmp.triggernameidx = m_runcache.TRGBitNameToIndex[it->bitname];
815  trgtmp.prescale = it->prescale;
816  l1temp.push_back(trgtmp);
817  }
818  std::vector<LumiSummary::HLT> hlttemp;
819  for (std::vector<HLTData>::iterator it = lsdata.hltdata.begin(); it != lsdata.hltdata.end(); ++it) {
820  LumiSummary::HLT hlttmp;
821  hlttmp.pathnameidx = m_runcache.HLTPathNameToIndex[it->pathname];
822  ;
823  hlttmp.prescale = it->prescale;
824  hlttemp.push_back(hlttmp);
825  }
826  pIn1->swapL1Data(l1temp);
827  pIn1->swapHLTData(hlttemp);
828  pIn1->setLumiVersion(m_lumiversion);
829  pIn2->fillBeamIntensities(lsdata.beam1intensity, lsdata.beam2intensity);
830  for (unsigned int i = 0; i < lsdata.bunchlumivalue.size(); ++i) {
831  std::string algoname = lsdata.bunchlumivalue[i].first;
832  if (algoname == "OCC1") {
833  pIn2->fill(LumiDetails::kOCC1,
834  lsdata.bunchlumivalue[i].second,
835  lsdata.bunchlumierror[i].second,
836  lsdata.bunchlumiquality[i].second);
837  } else if (algoname == "OCC2") {
838  pIn2->fill(LumiDetails::kOCC2,
839  lsdata.bunchlumivalue[i].second,
840  lsdata.bunchlumierror[i].second,
841  lsdata.bunchlumiquality[i].second);
842  } else if (algoname == "ET") {
843  pIn2->fill(LumiDetails::kET,
844  lsdata.bunchlumivalue[i].second,
845  lsdata.bunchlumierror[i].second,
846  lsdata.bunchlumiquality[i].second);
847  } else if (algoname == "PLT") {
848  pIn2->fill(LumiDetails::kPLT,
849  lsdata.bunchlumivalue[i].second,
850  lsdata.bunchlumierror[i].second,
851  lsdata.bunchlumiquality[i].second);
852  }
853  }
854  pIn2->setLumiVersion(m_lumiversion);
855  iLBlock.put(std::move(pIn1));
856  iLBlock.put(std::move(pIn2));
857 }
LumiProducer::PerRunData::HLTPathNameToIndex
std::map< std::string, unsigned int > HLTPathNameToIndex
Definition: LumiProducer.cc:97
LumiProducer::PerLSData::lumierror
float lumierror
Definition: LumiProducer.cc:103
LumiProducer::PerLSData::hltdata
std::vector< HLTData > hltdata
Definition: LumiProducer.cc:110
LumiProducer::PerLSData::bunchlumivalue
std::vector< std::pair< std::string, std::vector< float > > > bunchlumivalue
Definition: LumiProducer.cc:112
lumi::LumiNames::lstrgTableName
static const std::string lstrgTableName()
Definition: LumiNames.cc:12
LumiDetails::kET
Definition: LumiDetails.h:26
LumiSummary::L1::prescale
unsigned int prescale
Definition: LumiSummary.h:26
LumiProducer::m_cachedlumidataid
unsigned long long m_cachedlumidataid
Definition: LumiProducer.cc:149
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:355
EDProducer.h
LumiProducer::m_cachedrun
unsigned int m_cachedrun
Definition: LumiProducer.cc:148
input
static const std::string input
Definition: EdmProvDump.cc:48
MessageLogger.h
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
funct::false
false
Definition: Factorize.h:34
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
LumiProducer::getLumiDataId
unsigned long long getLumiDataId(const coral::ISchema &schema, unsigned int runnumber)
Definition: LumiProducer.cc:289
LumiProducer::produce
void produce(edm::Event &, const edm::EventSetup &) final
Definition: LumiProducer.cc:288
LumiProducer::m_cachedhltdataid
unsigned long long m_cachedhltdataid
Definition: LumiProducer.cc:151
LumiProducer::s2x
XMLCh * s2x(const std::string &input) const
Definition: LumiProducer.cc:167
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
LumiProducer::PerLSData::lumivalue
float lumivalue
Definition: LumiProducer.cc:102
edm::Run
Definition: Run.h:45
LumiProducer::L1Data::ratecount
unsigned int ratecount
Definition: LumiProducer.cc:92
LumiProducer::PerLSData::startorbit
unsigned int startorbit
Definition: LumiProducer.cc:107
LuminosityBlock.h
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
LumiProducer::HLTData::prescale
unsigned int prescale
Definition: LumiProducer.cc:85
LumiProducer::m_isNullRun
bool m_isNullRun
Definition: LumiProducer.cc:154
writedatasetfile.parser
parser
Definition: writedatasetfile.py:7
LumiNames.h
LumiDetails::kOCC1
Definition: LumiDetails.h:26
edm::one::EDProducer
Definition: EDProducer.h:30
LumiDetails::kPLT
Definition: LumiDetails.h:26
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LuminosityBlockBase::run
RunNumber_t run() const
Definition: LuminosityBlockBase.h:42
LumiProducer::LumiProducer
LumiProducer(const edm::ParameterSet &)
LumiSummary::L1
Definition: LumiSummary.h:22
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
LumiProducer::m_siteconfpath
std::string m_siteconfpath
Definition: LumiProducer.cc:147
LumiProducer::PerLSData::numorbit
unsigned int numorbit
Definition: LumiProducer.cc:106
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
training_settings.idx
idx
Definition: training_settings.py:16
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
LumiSummary::HLT::prescale
unsigned int prescale
Definition: LumiSummary.h:32
LuminosityBlockID.h
lumi::LumiNames::hltdataTableName
static const std::string hltdataTableName()
Definition: LumiNames.cc:15
LumiProducer::L1Data::prescale
unsigned int prescale
Definition: LumiProducer.cc:91
LumiProducer::fillRunCache
void fillRunCache(const coral::ISchema &schema, unsigned int runnumber)
Definition: LumiProducer.cc:451
LumiProducer::PerRunData::HLTPathNames
std::vector< std::string > HLTPathNames
Definition: LumiProducer.cc:99
LumiProducer::PerLSData::beam1intensity
std::vector< float > beam1intensity
Definition: LumiProducer.cc:115
LumiProducer::~LumiProducer
~LumiProducer() override
Definition: LumiProducer.cc:283
LumiProducer::getHltDataId
unsigned long long getHltDataId(const coral::ISchema &schema, unsigned int runnumber)
Definition: LumiProducer.cc:340
LumiProducer::m_cachesize
unsigned int m_cachesize
Definition: LumiProducer.cc:155
MakerMacros.h
LumiProducer::servletTranslation
const std::string servletTranslation(const std::string &servlet) const
Definition: LumiProducer.cc:196
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
lumi::LumiNames::trgdataTableName
static const std::string trgdataTableName()
Definition: LumiNames.cc:11
DBService.h
Service.h
edm::LuminosityBlockBase::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: LuminosityBlockBase.h:40
LumiSummary::L1::triggernameidx
int triggernameidx
Definition: LumiSummary.h:25
LumiProducer::PerLSData::bunchlumierror
std::vector< std::pair< std::string, std::vector< float > > > bunchlumierror
Definition: LumiProducer.cc:113
Run.h
LumiProducer::PerLSData::bitzeroprescale
unsigned int bitzeroprescale
Definition: LumiProducer.cc:109
LumiProducer
Definition: LumiProducer.cc:80
LumiProducer::endRunProduce
void endRunProduce(edm::Run &, edm::EventSetup const &) final
Definition: LumiProducer.cc:443
LumiProducer::m_connectStr
std::string m_connectStr
Definition: LumiProducer.cc:145
lumi::LumiNames::tagsTableName
static const std::string tagsTableName()
Definition: LumiNames.cc:18
LumiProducer::m_runcache
PerRunData m_runcache
Definition: LumiProducer.cc:152
LumiProducer::HLTData::pathname
std::string pathname
Definition: LumiProducer.cc:84
LumiProducer::PerLSData::lumiquality
short lumiquality
Definition: LumiProducer.cc:104
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
LumiProducer::endRun
void endRun(edm::Run const &, edm::EventSetup const &) final
Definition: LumiProducer.cc:442
LumiProducer::PerRunData
Definition: LumiProducer.cc:94
LumiProducer::writeProductsForEntry
void writeProductsForEntry(edm::LuminosityBlock &iLBlock, unsigned int runnumber, unsigned int luminum)
Definition: LumiProducer.cc:789
LumiProducer::PerLSData::l1data
std::vector< L1Data > l1data
Definition: LumiProducer.cc:111
LumiProducer::PerRunData::TRGBitNameToIndex
std::map< std::string, unsigned int > TRGBitNameToIndex
Definition: LumiProducer.cc:96
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
LumiDetails.h
LumiProducer::x2s
std::string x2s(const XMLCh *input) const
Definition: LumiProducer.cc:162
hltrates_dqm_sourceclient-live_cfg.prescales
prescales
Definition: hltrates_dqm_sourceclient-live_cfg.py:86
cond::runnumber
Definition: Time.h:19
edm::Service
Definition: Service.h:30
createfilelist.int
int
Definition: createfilelist.py:10
LumiProducer::PerLSData::bitzerocount
unsigned int bitzerocount
Definition: LumiProducer.cc:108
Xerces.h
BranchType.h
LumiProducer::HLTData::l1passcount
unsigned int l1passcount
Definition: LumiProducer.cc:86
LumiProducer::L1Data
Definition: LumiProducer.cc:89
edm::EventSetup
Definition: EventSetup.h:57
LumiProducer::PerLSData::deadcount
unsigned long long deadcount
Definition: LumiProducer.cc:105
LumiProducer::PerLSData
Definition: LumiProducer.cc:101
edm::LuminosityBlock::put
void put(std::unique_ptr< PROD > product)
Put a new product.
Definition: LuminosityBlock.h:115
createPayload.tagname
tagname
Definition: createPayload.py:183
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
LumiProducer::PerRunData::TRGBitNames
std::vector< std::string > TRGBitNames
Definition: LumiProducer.cc:98
LumiProducer::getCurrentDataTag
std::string getCurrentDataTag(const coral::ISchema &schema)
Definition: LumiProducer.cc:366
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
writedatasetfile.run
run
Definition: writedatasetfile.py:27
LumiProducer::m_lumiversion
std::string m_lumiversion
Definition: LumiProducer.cc:146
LumiProducer::getTrgDataId
unsigned long long getTrgDataId(const coral::ISchema &schema, unsigned int runnumber)
Definition: LumiProducer.cc:315
LumiProducer::PerLSData::bunchlumiquality
std::vector< std::pair< std::string, std::vector< short > > > bunchlumiquality
Definition: LumiProducer.cc:114
lumi::LumiNames::lumisummaryv2TableName
static const std::string lumisummaryv2TableName()
Definition: LumiNames.cc:6
Exception
Definition: hltDiff.cc:246
LumiProducer::PerLSData::beam2intensity
std::vector< float > beam2intensity
Definition: LumiProducer.cc:116
LumiProducer::HLTData::acceptcount
unsigned int acceptcount
Definition: LumiProducer.cc:87
LumiSummary.h
LumiProducer::HLTData
Definition: LumiProducer.cc:83
LumiProducer::beginLuminosityBlockProduce
void beginLuminosityBlockProduce(edm::LuminosityBlock &iLBlock, edm::EventSetup const &iSetup) final
Definition: LumiProducer.cc:425
EventSetup.h
LumiProducer::PerRunData::bitzeroname
std::string bitzeroname
Definition: LumiProducer.cc:95
Exception.h
LumiSummary::HLT
Definition: LumiSummary.h:28
LumiProducer::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) final
Definition: LumiProducer.cc:396
LumiDetails::kOCC2
Definition: LumiDetails.h:26
LumiSummary::HLT::pathnameidx
int pathnameidx
Definition: LumiSummary.h:31
mps_fire.result
result
Definition: mps_fire.py:303
LumiSummaryRunHeader.h
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
EventSetup
LumiProducer::L1Data::bitname
std::string bitname
Definition: LumiProducer.cc:90
ParameterSet.h
LumiProducer::fillLumi
bool fillLumi(edm::LuminosityBlock &iLBlock)
LumiProducer::toParentString
std::string toParentString(const xercesc::DOMNode &nodeToConvert) const
Definition: LumiProducer.cc:172
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
LumiProducer::fillLSCache
void fillLSCache(unsigned int luminum)
Definition: LumiProducer.cc:519
edm::Event
Definition: Event.h:73
child
Definition: simpleInheritance.h:11
lumi::LumiNames::lshltTableName
static const std::string lshltTableName()
Definition: LumiNames.cc:16
lumi::LumiNames::lumidataTableName
static const std::string lumidataTableName()
Definition: LumiNames.cc:3
cms::concurrency::xercesInitialize
void xercesInitialize()
Definition: Xerces.cc:18
ConstantDef.h
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
LumiProducer::m_cachedtrgdataid
unsigned long long m_cachedtrgdataid
Definition: LumiProducer.cc:150
lumi::service::DBService::connectReadOnly
ISessionProxyPtr connectReadOnly(const std::string &connectstring)
Definition: DBService.cc:19
LumiProducer::m_lscache
std::map< unsigned int, PerLSData > m_lscache
Definition: LumiProducer.cc:153