CMS 3D CMS Logo

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