CMS 3D CMS Logo

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

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

Inheritance diagram for ExpressLumiProducer:
edm::one::EDProducer< edm::BeginLuminosityBlockProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  PerLSData
 

Public Member Functions

 ExpressLumiProducer (const edm::ParameterSet &)
 
 ~ExpressLumiProducer () override
 
- Public Member Functions inherited from edm::one::EDProducer< edm::BeginLuminosityBlockProducer >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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 fillLSCache (unsigned int runnum, unsigned int luminum)
 
bool fillLumi (edm::LuminosityBlock &iLBlock)
 
unsigned int maxavailableLSforRun (coral::ISchema &schema, const std::string &tablename, unsigned int runnumber)
 
void produce (edm::Event &, const edm::EventSetup &) final
 
void writeEmptyProductForEntry (edm::LuminosityBlock &iLBlock)
 
void writeProductsForEntry (edm::LuminosityBlock &iLBlock, unsigned int luminum)
 

Private Attributes

unsigned int m_cachedrun
 
unsigned int m_cachesize
 
std::string m_connectStr
 
bool m_isNullRun
 
std::map< unsigned int, PerLSDatam_lscache
 

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<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: A essource/esproducer for lumi values from DIP via runtime logger DB

Definition at line 61 of file ExpressLumiProducer.cc.

Constructor & Destructor Documentation

◆ ExpressLumiProducer()

ExpressLumiProducer::ExpressLumiProducer ( const edm::ParameterSet )
explicit

◆ ~ExpressLumiProducer()

ExpressLumiProducer::~ExpressLumiProducer ( )
override

Definition at line 106 of file ExpressLumiProducer.cc.

106 {}

Member Function Documentation

◆ beginLuminosityBlockProduce()

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

Definition at line 117 of file ExpressLumiProducer.cc.

References dqmiodumpmetadata::currentrun, fillLSCache(), edm::LuminosityBlockBase::luminosityBlock(), m_cachedrun, m_isNullRun, m_lscache, edm::LuminosityBlockBase::run(), findQualityFiles::v, writeEmptyProductForEntry(), and writeProductsForEntry().

117  {
118  unsigned int currentrun = iLBlock.run();
119  unsigned int currentls = iLBlock.luminosityBlock();
120  //if is null run, fill empty values and return
121  if (m_isNullRun) {
122  writeEmptyProductForEntry(iLBlock);
123  return;
124  }
125  if (m_cachedrun != currentrun) {
126  fillLSCache(currentrun, currentls);
127  } else {
128  if (m_lscache.find(currentls) == m_lscache.end()) {
129  //if runnumber is cached but LS is not, this is the first LS, fill LS cache to full capacity
130  fillLSCache(currentrun, currentls);
131  }
132  }
133  if (m_lscache.empty()) {
134  writeEmptyProductForEntry(iLBlock);
135  return;
136  }
137  unsigned int lstowriteout = 0;
138  if (m_lscache.find(currentls) == m_lscache.end()) { //if the currentls is not in the cache
139  std::vector<unsigned int> v;
140  for (std::map<unsigned int, ExpressLumiProducer::PerLSData>::iterator it = m_lscache.begin(); it != m_lscache.end();
141  ++it) {
142  v.push_back(it->first);
143  }
144  lstowriteout = v.back(); //last available
145  } else { //if the current ls is cached
146  lstowriteout = currentls;
147  }
148  //here the presence of ls is guaranteed
149  //std::cout<<"writing "<<runnumber<<" "<<luminum<<std::endl;
150  if (lstowriteout == 0) {
151  writeEmptyProductForEntry(iLBlock);
152  } else {
153  writeProductsForEntry(iLBlock, lstowriteout);
154  }
155 }
void fillLSCache(unsigned int runnum, unsigned int luminum)
void writeProductsForEntry(edm::LuminosityBlock &iLBlock, unsigned int luminum)
void writeEmptyProductForEntry(edm::LuminosityBlock &iLBlock)
LuminosityBlockNumber_t luminosityBlock() const
std::map< unsigned int, PerLSData > m_lscache

◆ fillLSCache()

void ExpressLumiProducer::fillLSCache ( unsigned int  runnum,
unsigned int  luminum 
)
private

Definition at line 184 of file ExpressLumiProducer.cc.

References ExpressLumiProducer::PerLSData::bitzerocount, ExpressLumiProducer::PerLSData::bunchlumivalue, lumi::service::DBService::connectReadOnly(), ExpressLumiProducer::PerLSData::deadcount, Exception, edm::Service< T >::isAvailable(), remoteMonitoring_LASER_era2018_cfg::lsmax, remoteMonitoring_LASER_era2018_cfg::lsmin, ExpressLumiProducer::PerLSData::lsnum, ExpressLumiProducer::PerLSData::lumivalue, m_cachedrun, m_cachesize, m_connectStr, m_isNullRun, m_lscache, maxavailableLSforRun(), dqmiodumpmetadata::n, ExpressLumiProducer::PerLSData::numorbit, cond::runnumber, ExpressLumiProducer::PerLSData::startorbit, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by beginLuminosityBlockProduce().

184  {
185  m_lscache.clear();
187  //
188  //queries once per cache refill
189  //
190  //select lumisection,instlumi,delivlumi,livelumi from cms_runtime_logger.lumi_sections where lumisection>=:lsmin and lumisection<:lsmax and runnumber=:runnumber;
191  //
193  if (!mydbservice.isAvailable()) {
194  throw cms::Exception("Non existing service lumi::service::DBService");
195  }
196  auto session = mydbservice->connectReadOnly(m_connectStr);
197  coral::ITypeConverter& tconverter = session->typeConverter();
198  tconverter.setCppTypeForSqlType(std::string("float"), std::string("FLOAT(63)"));
199  tconverter.setCppTypeForSqlType(std::string("unsigned int"), std::string("NUMBER(10)"));
200  tconverter.setCppTypeForSqlType(std::string("unsigned short"), std::string("NUMBER(1)"));
201  unsigned int lsmin = 1;
202  unsigned int lsmax = currentlsnum;
203  try {
204  session->transaction().start(true);
205  coral::ISchema& schema = session->nominalSchema();
206  unsigned int maxavailableLS = maxavailableLSforRun(schema, std::string("LUMI_SECTIONS"), m_cachedrun);
207  if (maxavailableLS != 0 && maxavailableLS < currentlsnum) {
208  lsmax = maxavailableLS;
209  } else if (maxavailableLS == 0) {
210  //this run not existing (yet)
211  session->transaction().commit();
212  return;
213  }
214  if (m_cachesize != 0) {
215  lsmin = (lsmax - m_cachesize) > 0 ? (lsmax - m_cachesize + 1) : 1;
216  }
217  for (unsigned int n = lsmin; n <= lsmax; ++n) {
218  m_lscache.insert(std::make_pair(
219  n, PerLSData{.bunchlumivalue = {3564, 0.0}, .bunchlumierror = {3564, 0.0}, .bunchlumiquality = {3564, 0}}));
220  }
221 
222  coral::AttributeList lumisummaryBindVariables;
223  lumisummaryBindVariables.extend("lsmin", typeid(unsigned int));
224  lumisummaryBindVariables.extend("runnumber", typeid(unsigned int));
225  lumisummaryBindVariables["runnumber"].data<unsigned int>() = m_cachedrun;
226  lumisummaryBindVariables["lsmin"].data<unsigned int>() = lsmin;
227  std::string conditionStr(" RUNNUMBER=:runnumber AND LUMISECTION>=:lsmin ");
228  coral::AttributeList lumisummaryOutput;
229  lumisummaryOutput.extend("LUMISECTION", typeid(unsigned int));
230  lumisummaryOutput.extend("INSTLUMI", typeid(float));
231  lumisummaryOutput.extend("DELIVLUMISECTION", typeid(float));
232  lumisummaryOutput.extend("LIVELUMISECTION", typeid(float));
233  lumisummaryOutput.extend("STARTORBIT", typeid(unsigned long long));
234  if (m_cachesize != 0) {
235  lumisummaryBindVariables.extend("lsmax", typeid(unsigned int));
236  conditionStr = conditionStr + "AND LUMISECTION<=:lsmax";
237  lumisummaryBindVariables["lsmax"].data<unsigned int>() = lsmax;
238  }
239  coral::IQuery* lumisummaryQuery = schema.newQuery();
240  lumisummaryQuery->addToTableList(std::string("LUMI_SECTIONS"));
241  lumisummaryQuery->addToOutputList("LUMISECTION");
242  lumisummaryQuery->addToOutputList("INSTLUMI");
243  lumisummaryQuery->addToOutputList("DELIVLUMISECTION");
244  lumisummaryQuery->addToOutputList("LIVELUMISECTION");
245  lumisummaryQuery->addToOutputList("STARTORBIT");
246  lumisummaryQuery->setCondition(conditionStr, lumisummaryBindVariables);
247  lumisummaryQuery->defineOutput(lumisummaryOutput);
248  coral::ICursor& lumisummarycursor = lumisummaryQuery->execute();
249  unsigned int rowcounter = 0;
250  while (lumisummarycursor.next()) {
251  const coral::AttributeList& row = lumisummarycursor.currentRow();
252  unsigned int lsnum = row["LUMISECTION"].data<unsigned int>();
253  float instlumi = 0.0;
254  if (!row["INSTLUMI"].isNull()) {
255  instlumi = row["INSTLUMI"].data<float>(); //Hz/ub
256  }
257  float deadfrac = 1.0;
258  float intgdellumi = 0.0;
259  float intgreclumi = 0.0;
260  unsigned long long startorbit = 0;
261  if (!row["DELIVLUMISECTION"].isNull()) {
262  intgdellumi = row["DELIVLUMISECTION"].data<float>() * 1000.0; //convert to /ub
263  }
264  if (!row["LIVELUMISECTION"].isNull()) {
265  intgreclumi = row["LIVELUMISECTION"].data<float>() * 1000.0; //convert to /ub
266  }
267  if (intgdellumi > 0) {
268  deadfrac = 1.0 - intgreclumi / intgdellumi;
269  }
270  if (!row["STARTORBIT"].isNull()) {
271  startorbit = row["STARTORBIT"].data<unsigned long long>(); //convert to /ub
272  }
273  unsigned long long deadcount = deadfrac * 10000.0;
274  unsigned long long bitzerocount = 10000.0;
275  PerLSData& lsdata = m_lscache[lsnum];
276  lsdata.lsnum = lsnum;
277  lsdata.lumivalue = instlumi;
278  lsdata.deadcount = deadcount;
279  lsdata.bitzerocount = bitzerocount;
280  lsdata.startorbit = startorbit;
281  lsdata.numorbit = 262144;
282  ++rowcounter;
283  }
284  if (rowcounter == 0) {
285  m_isNullRun = true;
286  }
287  delete lumisummaryQuery;
288  if (m_isNullRun)
289  return;
290  //
291  //queries once per cache refill
292  //
293  //select lumisection,bunch,bunchlumi from cms_runtime_logger.bunch_lumi_sections where lumisection>=:lsmin and lumisection<:lsmax and runnumber=:runnumber;
294  //
295  coral::AttributeList lumidetailBindVariables;
296  lumidetailBindVariables.extend("lsmin", typeid(unsigned int));
297  lumidetailBindVariables.extend("runnumber", typeid(unsigned int));
298  lumidetailBindVariables["runnumber"].data<unsigned int>() = m_cachedrun;
299  lumidetailBindVariables["lsmin"].data<unsigned int>() = lsmin;
300  std::string detailconditionStr(" RUNNUMBER=:runnumber AND LUMISECTION>=:lsmin AND BUNCHLUMI>0 ");
301  coral::AttributeList lumidetailOutput;
302  lumidetailOutput.extend("LUMISECTION", typeid(unsigned int));
303  lumidetailOutput.extend("BUNCH", typeid(unsigned int));
304  lumidetailOutput.extend("BUNCHLUMI", typeid(float));
305  if (m_cachesize != 0) {
306  lumidetailBindVariables.extend("lsmax", typeid(unsigned int));
307  detailconditionStr = detailconditionStr + "AND LUMISECTION<=:lsmax";
308  lumidetailBindVariables["lsmax"].data<unsigned int>() = lsmax;
309  }
310  coral::IQuery* lumidetailQuery = schema.newQuery();
311  lumidetailQuery->addToTableList(std::string("BUNCH_LUMI_SECTIONS"));
312  lumidetailQuery->addToOutputList("LUMISECTION");
313  lumidetailQuery->addToOutputList("BUNCH");
314  lumidetailQuery->addToOutputList("BUNCHLUMI");
315  lumidetailQuery->setCondition(detailconditionStr, lumidetailBindVariables);
316  lumidetailQuery->defineOutput(lumidetailOutput);
317  coral::ICursor& lumidetailcursor = lumidetailQuery->execute();
318  while (lumidetailcursor.next()) {
319  const coral::AttributeList& row = lumidetailcursor.currentRow();
320  unsigned int lsnum = row["LUMISECTION"].data<unsigned int>();
321  unsigned int bxidx = row["BUNCH"].data<unsigned int>();
322  float bxlumi = row["BUNCHLUMI"].data<float>(); //Hz/ub
323  m_lscache[lsnum].bunchlumivalue[bxidx] = bxlumi;
324  }
325  delete lumidetailQuery;
326  session->transaction().commit();
327  } catch (const coral::Exception& er) {
328  session->transaction().rollback();
329  throw cms::Exception("DatabaseError ") << er.what();
330  }
331 }
ISessionProxyPtr connectReadOnly(const std::string &connectstring)
Definition: DBService.cc:19
unsigned int maxavailableLSforRun(coral::ISchema &schema, const std::string &tablename, unsigned int runnumber)
bool isAvailable() const
Definition: Service.h:40
std::map< unsigned int, PerLSData > m_lscache

◆ fillLumi()

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

◆ maxavailableLSforRun()

unsigned int ExpressLumiProducer::maxavailableLSforRun ( coral::ISchema &  schema,
const std::string &  tablename,
unsigned int  runnumber 
)
private

select max(lumisection) as maxavailable from cms_runtime_logger.lumi_sections where runnumber=:runnumber;

Definition at line 157 of file ExpressLumiProducer.cc.

References inputsource_file_cfi::myQuery, mps_fire::result, cond::runnumber, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by fillLSCache().

159  {
163  unsigned int result = 0;
164  coral::AttributeList bindVariables;
165  bindVariables.extend("runnumber", typeid(unsigned int));
166  bindVariables["runnumber"].data<unsigned int>() = runnumber;
167  std::string conditionStr("RUNNUMBER=:runnumber");
168  coral::AttributeList MyOutput;
169  MyOutput.extend("maxavailablels", typeid(unsigned int));
170  coral::IQuery* myQuery = schema.newQuery();
171  myQuery->addToTableList(tablename);
172  myQuery->addToOutputList("max(LUMISECTION)", "maxavailablels");
173  myQuery->setCondition(conditionStr, bindVariables);
174  myQuery->defineOutput(MyOutput);
175  coral::ICursor& mycursor = myQuery->execute();
176  while (mycursor.next()) {
177  const coral::AttributeList& row = mycursor.currentRow();
178  if (!row["maxavailablels"].isNull()) {
179  result = row["maxavailablels"].data<unsigned int>();
180  }
181  }
182  return result;
183 }

◆ produce()

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

Implements edm::one::EDProducerBase.

Definition at line 111 of file ExpressLumiProducer.cc.

111 {}

◆ writeEmptyProductForEntry()

void ExpressLumiProducer::writeEmptyProductForEntry ( edm::LuminosityBlock iLBlock)
private

Definition at line 113 of file ExpressLumiProducer.cc.

References edm::LuminosityBlock::put().

Referenced by beginLuminosityBlockProduce().

113  {
114  iLBlock.put(std::make_unique<LumiSummary>());
115  iLBlock.put(std::make_unique<LumiDetails>());
116 }
void put(std::unique_ptr< PROD > product)
Put a new product.

◆ writeProductsForEntry()

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

Definition at line 332 of file ExpressLumiProducer.cc.

References ExpressLumiProducer::PerLSData::bitzerocount, ExpressLumiProducer::PerLSData::bunchlumierror, ExpressLumiProducer::PerLSData::bunchlumiquality, ExpressLumiProducer::PerLSData::bunchlumivalue, ExpressLumiProducer::PerLSData::deadcount, LumiDetails::kOCC1, ExpressLumiProducer::PerLSData::lsnum, ExpressLumiProducer::PerLSData::lumivalue, m_isNullRun, m_lscache, eostools::move(), ExpressLumiProducer::PerLSData::numorbit, edm::LuminosityBlock::put(), and ExpressLumiProducer::PerLSData::startorbit.

Referenced by beginLuminosityBlockProduce().

332  {
333  //std::cout<<"writing runnumber,luminum "<<runnumber<<" "<<luminum<<std::endl;
334  auto pIn1 = std::make_unique<LumiSummary>();
335  auto pIn2 = std::make_unique<LumiDetails>();
336  if (m_isNullRun) {
337  pIn1->setLumiVersion("DIP");
338  pIn2->setLumiVersion("DIP");
339  iLBlock.put(std::move(pIn1));
340  iLBlock.put(std::move(pIn2));
341  return;
342  }
343  PerLSData& lsdata = m_lscache[luminum];
344  pIn1->setLumiVersion("DIP");
345  pIn1->setLumiData(lsdata.lumivalue, 0.0, 0.0);
346  pIn1->setDeadCount(lsdata.deadcount);
347  pIn1->setBitZeroCount(lsdata.bitzerocount);
348  pIn1->setlsnumber(lsdata.lsnum);
349  pIn1->setOrbitData(lsdata.startorbit, lsdata.numorbit);
350 
351  pIn2->setLumiVersion("DIP");
352  pIn2->fill(LumiDetails::kOCC1, lsdata.bunchlumivalue, lsdata.bunchlumierror, lsdata.bunchlumiquality);
353  iLBlock.put(std::move(pIn1));
354  iLBlock.put(std::move(pIn2));
355 }
void put(std::unique_ptr< PROD > product)
Put a new product.
std::map< unsigned int, PerLSData > m_lscache
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ m_cachedrun

unsigned int ExpressLumiProducer::m_cachedrun
private

Definition at line 90 of file ExpressLumiProducer.cc.

Referenced by beginLuminosityBlockProduce(), and fillLSCache().

◆ m_cachesize

unsigned int ExpressLumiProducer::m_cachesize
private

Definition at line 92 of file ExpressLumiProducer.cc.

Referenced by fillLSCache().

◆ m_connectStr

std::string ExpressLumiProducer::m_connectStr
private

Definition at line 89 of file ExpressLumiProducer.cc.

Referenced by fillLSCache().

◆ m_isNullRun

bool ExpressLumiProducer::m_isNullRun
private

◆ m_lscache

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