CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
LumiProducer Class Reference

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

Inheritance diagram for LumiProducer:
edm::one::EDProducer< edm::one::WatchRuns, edm::BeginLuminosityBlockProducer, edm::EndRunProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  HLTData
 
struct  L1Data
 
struct  PerLSData
 
struct  PerRunData
 

Public Member Functions

 LumiProducer (const edm::ParameterSet &)
 
 ~LumiProducer () override
 
- Public Member Functions inherited from edm::one::EDProducer< edm::one::WatchRuns, edm::BeginLuminosityBlockProducer, edm::EndRunProducer >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginLuminosityBlockProduce (edm::LuminosityBlock &iLBlock, edm::EventSetup const &iSetup) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &, edm::EventSetup const &) final
 
void fillLSCache (unsigned int luminum)
 
bool fillLumi (edm::LuminosityBlock &iLBlock)
 
void fillRunCache (const coral::ISchema &schema, unsigned int runnumber)
 
std::string getCurrentDataTag (const coral::ISchema &schema)
 
unsigned long long getHltDataId (const coral::ISchema &schema, unsigned int runnumber)
 
unsigned long long getLumiDataId (const coral::ISchema &schema, unsigned int runnumber)
 
unsigned long long getTrgDataId (const coral::ISchema &schema, unsigned int runnumber)
 
void produce (edm::Event &, const edm::EventSetup &) final
 
XMLCh * s2x (const std::string &input) const
 
const std::string servletTranslation (const std::string &servlet) const
 
std::string toParentString (const xercesc::DOMNode &nodeToConvert) const
 
void writeProductsForEntry (edm::LuminosityBlock &iLBlock, unsigned int runnumber, unsigned int luminum)
 
std::string x2s (const XMLCh *input) const
 

Private Attributes

unsigned long long m_cachedhltdataid
 
unsigned long long m_cachedlumidataid
 
unsigned int m_cachedrun
 
unsigned long long m_cachedtrgdataid
 
unsigned int m_cachesize
 
std::string m_connectStr
 
bool m_isNullRun
 
std::map< unsigned int, PerLSDatam_lscache
 
std::string m_lumiversion
 
PerRunData m_runcache
 
std::string m_siteconfpath
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: This class would load the luminosity object into a Luminosity Block

Implementation: The are two main steps, the first one retrieve the record of the luminosity data from the DB and the second loads the Luminosity Obj into the Lumi Block. (Actually in the initial implementation it is retrieving from the ParameterSet from the configuration file, the DB is not implemented yet)

Definition at line 80 of file LumiProducer.cc.

Constructor & Destructor Documentation

◆ LumiProducer()

LumiProducer::LumiProducer ( const edm::ParameterSet )
explicit

◆ ~LumiProducer()

LumiProducer::~LumiProducer ( )
override

Definition at line 283 of file LumiProducer.cc.

283 {}

Member Function Documentation

◆ beginLuminosityBlockProduce()

void LumiProducer::beginLuminosityBlockProduce ( edm::LuminosityBlock iLBlock,
edm::EventSetup const &  iSetup 
)
finalprivate

Definition at line 425 of file LumiProducer.cc.

425  {
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 }

References fillLSCache(), edm::LuminosityBlockBase::luminosityBlock(), m_isNullRun, m_lscache, edm::LuminosityBlock::put(), edm::LuminosityBlockBase::run(), cond::runnumber, and writeProductsForEntry().

◆ beginRun()

void LumiProducer::beginRun ( edm::Run const &  run,
edm::EventSetup const &  iSetup 
)
finalprivate

Definition at line 396 of file LumiProducer.cc.

396  {
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 }

References lumi::service::DBService::connectReadOnly(), Exception, fillRunCache(), getHltDataId(), getLumiDataId(), getTrgDataId(), edm::Service< T >::isAvailable(), m_cachedhltdataid, m_cachedlumidataid, m_cachedrun, m_cachedtrgdataid, m_connectStr, m_isNullRun, writedatasetfile::run, and cond::runnumber.

◆ endRun()

void LumiProducer::endRun ( edm::Run const &  run,
edm::EventSetup const &  iSetup 
)
finalprivate

Definition at line 442 of file LumiProducer.cc.

442 {}

◆ endRunProduce()

void LumiProducer::endRunProduce ( edm::Run run,
edm::EventSetup const &  iSetup 
)
finalprivate

Definition at line 443 of file LumiProducer.cc.

443  {
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 }

References LumiProducer::PerRunData::HLTPathNames, LumiProducer::PerRunData::HLTPathNameToIndex, m_runcache, eostools::move(), writedatasetfile::run, LumiProducer::PerRunData::TRGBitNames, and LumiProducer::PerRunData::TRGBitNameToIndex.

◆ fillLSCache()

void LumiProducer::fillLSCache ( unsigned int  luminum)
private

Definition at line 519 of file LumiProducer.cc.

519  {
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 }

References LumiProducer::HLTData::acceptcount, LumiProducer::L1Data::bitname, lumi::service::DBService::connectReadOnly(), Exception, dqmMemoryStats::float, LumiProducer::PerRunData::HLTPathNames, mps_fire::i, charmTagsComputerCvsB_cfi::idx, createfilelist::int, edm::Service< T >::isAvailable(), cmsLHEtoEOSManager::l, LumiProducer::HLTData::l1passcount, lumi::LumiNames::lshltTableName(), lumi::LumiNames::lstrgTableName(), lumi::LumiNames::lumisummaryv2TableName(), m_cachedhltdataid, m_cachedlumidataid, m_cachedtrgdataid, m_cachesize, m_connectStr, m_isNullRun, m_lscache, m_runcache, dqmiodumpmetadata::n, LumiProducer::HLTData::pathname, LumiProducer::HLTData::prescale, LumiProducer::L1Data::prescale, hltrates_dqm_sourceclient-live_cfg::prescales, LumiProducer::L1Data::ratecount, AlCaHLTBitMon_QueryRunRegistry::string, and LumiProducer::PerRunData::TRGBitNames.

Referenced by beginLuminosityBlockProduce().

◆ fillLumi()

bool LumiProducer::fillLumi ( edm::LuminosityBlock iLBlock)
private

◆ fillRunCache()

void LumiProducer::fillRunCache ( const coral::ISchema &  schema,
unsigned int  runnumber 
)
private

Definition at line 451 of file LumiProducer.cc.

451  {
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 }

References LumiProducer::PerRunData::bitzeroname, gather_cfg::cout, getCurrentDataTag(), lumi::LumiNames::hltdataTableName(), LumiProducer::PerRunData::HLTPathNames, LumiProducer::PerRunData::HLTPathNameToIndex, mps_fire::i, m_cachedhltdataid, m_cachedtrgdataid, m_lumiversion, m_runcache, AlCaHLTBitMon_QueryRunRegistry::string, LumiProducer::PerRunData::TRGBitNames, LumiProducer::PerRunData::TRGBitNameToIndex, and lumi::LumiNames::trgdataTableName().

Referenced by beginRun().

◆ getCurrentDataTag()

std::string LumiProducer::getCurrentDataTag ( const coral::ISchema &  schema)
private

Definition at line 366 of file LumiProducer.cc.

366  {
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 }

References mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, createPayload::tagname, and lumi::LumiNames::tagsTableName().

Referenced by fillRunCache().

◆ getHltDataId()

unsigned long long LumiProducer::getHltDataId ( const coral::ISchema &  schema,
unsigned int  runnumber 
)
private

Definition at line 340 of file LumiProducer.cc.

340  {
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 }

References lumi::LumiNames::hltdataTableName(), and cond::runnumber.

Referenced by beginRun().

◆ getLumiDataId()

unsigned long long LumiProducer::getLumiDataId ( const coral::ISchema &  schema,
unsigned int  runnumber 
)
private

Definition at line 289 of file LumiProducer.cc.

289  {
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 }

References lumi::LumiNames::lumidataTableName(), and cond::runnumber.

Referenced by beginRun().

◆ getTrgDataId()

unsigned long long LumiProducer::getTrgDataId ( const coral::ISchema &  schema,
unsigned int  runnumber 
)
private

Definition at line 315 of file LumiProducer.cc.

315  {
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 }

References cond::runnumber, and lumi::LumiNames::trgdataTableName().

Referenced by beginRun().

◆ produce()

void LumiProducer::produce ( edm::Event e,
const edm::EventSetup iSetup 
)
finalprivatevirtual

Implements edm::one::EDProducerBase.

Definition at line 288 of file LumiProducer.cc.

288 {}

◆ s2x()

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

Definition at line 167 of file LumiProducer.cc.

167  {
168  XMLCh* buff = xercesc::XMLString::transcode(temp.c_str());
169  return buff;
170 }

References groupFilesInBlocks::temp.

Referenced by servletTranslation().

◆ servletTranslation()

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

Definition at line 196 of file LumiProducer.cc.

196  {
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 }

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

◆ toParentString()

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

Definition at line 172 of file LumiProducer.cc.

172  {
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 }

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

Referenced by servletTranslation().

◆ writeProductsForEntry()

void LumiProducer::writeProductsForEntry ( edm::LuminosityBlock iLBlock,
unsigned int  runnumber,
unsigned int  luminum 
)
private

Definition at line 789 of file LumiProducer.cc.

789  {
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 }

References LumiProducer::PerLSData::beam1intensity, LumiProducer::PerLSData::beam2intensity, LumiProducer::PerLSData::bitzerocount, LumiProducer::PerLSData::bitzeroprescale, LumiProducer::PerLSData::bunchlumierror, LumiProducer::PerLSData::bunchlumiquality, LumiProducer::PerLSData::bunchlumivalue, LumiProducer::PerLSData::deadcount, LumiProducer::PerLSData::hltdata, LumiProducer::PerRunData::HLTPathNameToIndex, mps_fire::i, LumiDetails::kET, LumiDetails::kOCC1, LumiDetails::kOCC2, LumiDetails::kPLT, LumiProducer::PerLSData::l1data, LumiProducer::PerLSData::lumierror, LumiProducer::PerLSData::lumiquality, LumiProducer::PerLSData::lumivalue, m_isNullRun, m_lscache, m_lumiversion, m_runcache, eostools::move(), LumiProducer::PerLSData::numorbit, LumiSummary::HLT::pathnameidx, LumiSummary::L1::prescale, LumiSummary::HLT::prescale, edm::LuminosityBlock::put(), LumiProducer::PerLSData::startorbit, AlCaHLTBitMon_QueryRunRegistry::string, LumiProducer::PerRunData::TRGBitNameToIndex, and LumiSummary::L1::triggernameidx.

Referenced by beginLuminosityBlockProduce().

◆ x2s()

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

Definition at line 162 of file LumiProducer.cc.

162  {
163  std::string tmp(xercesc::XMLString::transcode(toTranscode));
164  return tmp;
165 }

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

Referenced by toParentString().

Member Data Documentation

◆ m_cachedhltdataid

unsigned long long LumiProducer::m_cachedhltdataid
private

Definition at line 151 of file LumiProducer.cc.

Referenced by beginRun(), fillLSCache(), and fillRunCache().

◆ m_cachedlumidataid

unsigned long long LumiProducer::m_cachedlumidataid
private

Definition at line 149 of file LumiProducer.cc.

Referenced by beginRun(), and fillLSCache().

◆ m_cachedrun

unsigned int LumiProducer::m_cachedrun
private

Definition at line 148 of file LumiProducer.cc.

Referenced by beginRun().

◆ m_cachedtrgdataid

unsigned long long LumiProducer::m_cachedtrgdataid
private

Definition at line 150 of file LumiProducer.cc.

Referenced by beginRun(), fillLSCache(), and fillRunCache().

◆ m_cachesize

unsigned int LumiProducer::m_cachesize
private

Definition at line 155 of file LumiProducer.cc.

Referenced by fillLSCache().

◆ m_connectStr

std::string LumiProducer::m_connectStr
private

Definition at line 145 of file LumiProducer.cc.

Referenced by beginRun(), and fillLSCache().

◆ m_isNullRun

bool LumiProducer::m_isNullRun
private

◆ m_lscache

std::map<unsigned int, PerLSData> LumiProducer::m_lscache
private

◆ m_lumiversion

std::string LumiProducer::m_lumiversion
private

Definition at line 146 of file LumiProducer.cc.

Referenced by fillRunCache(), and writeProductsForEntry().

◆ m_runcache

PerRunData LumiProducer::m_runcache
private

Definition at line 152 of file LumiProducer.cc.

Referenced by endRunProduce(), fillLSCache(), fillRunCache(), and writeProductsForEntry().

◆ m_siteconfpath

std::string LumiProducer::m_siteconfpath
private

Definition at line 147 of file LumiProducer.cc.

Referenced by servletTranslation().

LumiProducer::PerRunData::HLTPathNameToIndex
std::map< std::string, unsigned int > HLTPathNameToIndex
Definition: LumiProducer.cc:97
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
mps_fire.i
i
Definition: mps_fire.py:355
LumiProducer::m_cachedrun
unsigned int m_cachedrun
Definition: LumiProducer.cc:148
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
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::m_cachedhltdataid
unsigned long long m_cachedhltdataid
Definition: LumiProducer.cc:151
LumiProducer::s2x
XMLCh * s2x(const std::string &input) const
Definition: LumiProducer.cc:167
gather_cfg.cout
cout
Definition: gather_cfg.py:144
LumiProducer::m_isNullRun
bool m_isNullRun
Definition: LumiProducer.cc:154
charmTagsComputerCvsB_cfi.idx
idx
Definition: charmTagsComputerCvsB_cfi.py:108
writedatasetfile.parser
parser
Definition: writedatasetfile.py:7
LumiDetails::kOCC1
Definition: LumiDetails.h:26
LumiDetails::kPLT
Definition: LumiDetails.h:26
edm::LuminosityBlockBase::run
RunNumber_t run() const
Definition: LuminosityBlockBase.h:42
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
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
LumiSummary::HLT::prescale
unsigned int prescale
Definition: LumiSummary.h:32
lumi::LumiNames::hltdataTableName
static const std::string hltdataTableName()
Definition: LumiNames.cc:15
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::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
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
lumi::LumiNames::trgdataTableName
static const std::string trgdataTableName()
Definition: LumiNames.cc:11
edm::LuminosityBlockBase::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: LuminosityBlockBase.h:40
LumiSummary::L1::triggernameidx
int triggernameidx
Definition: LumiSummary.h:25
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
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
LumiProducer::writeProductsForEntry
void writeProductsForEntry(edm::LuminosityBlock &iLBlock, unsigned int runnumber, unsigned int luminum)
Definition: LumiProducer.cc:789
LumiProducer::PerRunData::TRGBitNameToIndex
std::map< std::string, unsigned int > TRGBitNameToIndex
Definition: LumiProducer.cc:96
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:90
cond::runnumber
Definition: Time.h:19
edm::Service
Definition: Service.h:30
createfilelist.int
int
Definition: createfilelist.py:10
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
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
lumi::LumiNames::lumisummaryv2TableName
static const std::string lumisummaryv2TableName()
Definition: LumiNames.cc:6
Exception
Definition: hltDiff.cc:246
LumiProducer::PerRunData::bitzeroname
std::string bitzeroname
Definition: LumiProducer.cc:95
LumiSummary::HLT
Definition: LumiSummary.h:28
LumiDetails::kOCC2
Definition: LumiDetails.h:26
LumiSummary::HLT::pathnameidx
int pathnameidx
Definition: LumiSummary.h:31
mps_fire.result
result
Definition: mps_fire.py:303
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
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
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