CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends
edm::LuminosityBlock Class Reference

#include <LuminosityBlock.h>

Inheritance diagram for edm::LuminosityBlock:
edm::LuminosityBlockBase

Public Types

typedef unsigned long CacheIdentifier_t
 

Public Member Functions

CacheIdentifier_t cacheIdentifier () const
 
template<typename PROD , typename... Args>
void emplace (EDPutTokenT< PROD > token, Args &&... args)
 puts a new product More...
 
template<typename PROD , typename... Args>
void emplace (EDPutToken token, Args &&... args)
 
template<typename PROD >
PROD const & get (EDGetTokenT< PROD > token) const noexcept(false)
 
void getAllStableProvenance (std::vector< StableProvenance const *> &provenances) const
 
template<typename PROD >
bool getByLabel (std::string const &label, Handle< PROD > &result) const
 
template<typename PROD >
bool getByLabel (std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
 
template<typename PROD >
bool getByLabel (InputTag const &tag, Handle< PROD > &result) const
 same as above, but using the InputTag class More...
 
template<typename PROD >
bool getByToken (EDGetToken token, Handle< PROD > &result) const
 
template<typename PROD >
bool getByToken (EDGetTokenT< PROD > token, Handle< PROD > &result) const
 
template<typename PROD >
Handle< PRODgetHandle (EDGetTokenT< PROD > token) const
 
Provenance const & getProvenance (BranchID const &theID) const
 
Run const & getRun () const
 
StableProvenance const & getStableProvenance (BranchID const &theID) const
 
LuminosityBlockIndex index () const
 
void labelsForToken (EDGetToken const &iToken, ProductLabels &oLabels) const
 
 LuminosityBlock (LumiTransitionInfo const &, ModuleDescription const &, ModuleCallingContext const *, bool isAtEnd)
 
 LuminosityBlock (LuminosityBlockPrincipal const &, ModuleDescription const &, ModuleCallingContext const *, bool isAtEnd)
 
LuminosityBlockAuxiliary const & luminosityBlockAuxiliary () const final
 
ModuleCallingContext const * moduleCallingContext () const
 
ProcessHistory const & processHistory () const
 
ProcessHistoryID const & processHistoryID () const
 
template<typename PROD >
void put (std::unique_ptr< PROD > product)
 Put a new product. More...
 
template<typename PROD >
void put (std::unique_ptr< PROD > product, std::string const &productInstanceName)
 Put a new product with a 'product instance name'. More...
 
template<typename PROD >
void put (EDPutToken token, std::unique_ptr< PROD > product)
 
template<typename PROD >
void put (EDPutTokenT< PROD > token, std::unique_ptr< PROD > product)
 
void setConsumer (EDConsumerBase const *iConsumer)
 
void setProducer (ProducerBase const *iProducer)
 
void setSharedResourcesAcquirer (SharedResourcesAcquirer *iResourceAcquirer)
 
 ~LuminosityBlock () override
 
- Public Member Functions inherited from edm::LuminosityBlockBase
Timestamp const & beginTime () const
 
Timestamp const & endTime () const
 
template<typename PROD >
bool getByLabel (InputTag const &tag, Handle< PROD > &result) const
 same as above, but using the InputTag class More...
 
template<class T >
bool getByLabel (const InputTag &tag, Handle< T > &result) const
 
LuminosityBlockID id () const
 
LuminosityBlockNumber_t luminosityBlock () const
 
 LuminosityBlockBase ()
 
RunNumber_t run () const
 
virtual ~LuminosityBlockBase ()
 

Private Types

typedef std::vector< edm::propagate_const< std::unique_ptr< WrapperBase > > > ProductPtrVec
 

Private Member Functions

void commit_ (std::vector< edm::ProductResolverIndex > const &iShouldPut)
 
template<typename PROD , typename... Args>
void emplaceImpl (EDPutToken::value_type token, Args &&... args)
 
void fillRun () const
 
BasicHandle getByLabelImpl (std::type_info const &iWrapperType, std::type_info const &iProductType, InputTag const &iTag) const final
 
LuminosityBlockPrincipal const & luminosityBlockPrincipal () const
 
template<typename PROD >
void putImpl (EDPutToken::value_type token, std::unique_ptr< PROD > product)
 
ProductPtrVecputProducts ()
 
ProductPtrVec const & putProducts () const
 

Private Attributes

LuminosityBlockAuxiliary const & aux_
 
ModuleCallingContext const * moduleCallingContext_
 
PrincipalGetAdapter provRecorder_
 
ProductPtrVec putProducts_
 
std::optional< Runrun_
 

Static Private Attributes

static const std::string emptyString_
 

Friends

class ProducerBase
 
class RawInputSource
 
template<typename T >
class stream::ProducingModuleAdaptorBase
 

Detailed Description

Definition at line 50 of file LuminosityBlock.h.

Member Typedef Documentation

◆ CacheIdentifier_t

If you are caching data from the LuminosityBlock, you should also keep this number. If this number changes then you know that the data you have cached is invalid. The value of '0' will never be returned so you can use that to denote that you have not yet checked the value.

Definition at line 72 of file LuminosityBlock.h.

◆ ProductPtrVec

typedef std::vector<edm::propagate_const<std::unique_ptr<WrapperBase> > > edm::LuminosityBlock::ProductPtrVec
private

Definition at line 164 of file LuminosityBlock.h.

Constructor & Destructor Documentation

◆ LuminosityBlock() [1/2]

LuminosityBlock::LuminosityBlock ( LumiTransitionInfo const &  info,
ModuleDescription const &  md,
ModuleCallingContext const *  mcc,
bool  isAtEnd 
)

Definition at line 14 of file LuminosityBlock.cc.

18  : LuminosityBlock(info.principal(), md, mcc, isAtEnd) {}
static const TGPicture * info(bool iBackgroundIsBlack)
LuminosityBlock(LumiTransitionInfo const &, ModuleDescription const &, ModuleCallingContext const *, bool isAtEnd)

◆ LuminosityBlock() [2/2]

LuminosityBlock::LuminosityBlock ( LuminosityBlockPrincipal const &  lbp,
ModuleDescription const &  md,
ModuleCallingContext const *  moduleCallingContext,
bool  isAtEnd 
)

Definition at line 20 of file LuminosityBlock.cc.

24  : provRecorder_(lbp, md, isAtEnd), aux_(lbp.aux()), run_(), moduleCallingContext_(moduleCallingContext) {}
LuminosityBlockAuxiliary const & aux_
ModuleCallingContext const * moduleCallingContext() const
ModuleCallingContext const * moduleCallingContext_
PrincipalGetAdapter provRecorder_
std::optional< Run > run_

◆ ~LuminosityBlock()

LuminosityBlock::~LuminosityBlock ( )
override

Definition at line 26 of file LuminosityBlock.cc.

26 {}

Member Function Documentation

◆ cacheIdentifier()

LuminosityBlock::CacheIdentifier_t LuminosityBlock::cacheIdentifier ( ) const

Definition at line 32 of file LuminosityBlock.cc.

References edm::Principal::cacheIdentifier(), and luminosityBlockPrincipal().

32  {
34  }
CacheIdentifier_t cacheIdentifier() const
Definition: Principal.h:179
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const

◆ commit_()

void LuminosityBlock::commit_ ( std::vector< edm::ProductResolverIndex > const &  iShouldPut)
private

Definition at line 79 of file LuminosityBlock.cc.

References runTheMatrix::const, edm::get_underlying_safe(), mps_fire::i, index(), edm::isEndTransition(), luminosityBlockPrincipal(), eostools::move(), AlCaHLTBitMon_ParallelJobs::p, edm::PrincipalGetAdapter::principal(), provRecorder_, edm::LuminosityBlockPrincipal::put(), putProducts(), edm::PrincipalGetAdapter::putTokenIndexToProductResolverIndex(), and edm::PrincipalGetAdapter::transition().

Referenced by edm::stream::ProducingModuleAdaptorBase< EDProducerBase >::commit().

79  {
80  LuminosityBlockPrincipal const& lbp = luminosityBlockPrincipal();
81  size_t nPut = 0;
82  for (size_t i = 0; i < putProducts().size(); ++i) {
83  auto& p = get_underlying_safe(putProducts()[i]);
84  if (p) {
86  ++nPut;
87  }
88  }
89 
90  auto sz = iShouldPut.size();
91  if (sz != 0 and sz != nPut) {
92  //some were missed
93  auto& p = provRecorder_.principal();
94  for (auto index : iShouldPut) {
95  auto resolver = p.getProductResolverByIndex(index);
96  if (not resolver->productResolved() and isEndTransition(provRecorder_.transition()) ==
97  resolver->branchDescription().availableOnlyAtEndTransition()) {
98  dynamic_cast<ProductPutterBase const*>(resolver)->putProduct(std::unique_ptr<WrapperBase>());
99  }
100  }
101  }
102 
103  // the cleanup is all or none
104  putProducts().clear();
105  }
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
constexpr bool isEndTransition(Transition iValue)
Definition: Transition.h:37
Principal const & principal() const
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex() const
ProductPtrVec & putProducts()
LuminosityBlockIndex index() const
PrincipalGetAdapter provRecorder_
def move(src, dest)
Definition: eostools.py:511

◆ emplace() [1/2]

template<typename PROD , typename... Args>
void LuminosityBlock::emplace ( EDPutTokenT< PROD token,
Args &&...  args 
)

puts a new product

Definition at line 246 of file LuminosityBlock.h.

References writedatasetfile::args, PROD, edm::principal_get_adapter_detail::throwOnPutOfUninitializedToken(), unpackBuffers-CaloStage2::token, and UNLIKELY.

Referenced by edmtest::RandomIntProducer::beginLuminosityBlockProduce(), AlcaPCCProducer::endLuminosityBlockProduce(), edmtest::ThingProducer::globalBeginLuminosityBlockProduce(), TestInterProcessRandomProd::globalBeginLuminosityBlockProduce(), TestInterProcessProd::globalBeginLuminosityBlockProduce(), ExternalGeneratorFilter::globalBeginLuminosityBlockProduce(), edmtest::ThingProducer::globalEndLuminosityBlockProduce(), RawPCCProducer::globalEndLuminosityBlockProduce(), AlcaPCCIntegrator::globalEndLuminosityBlockProduce(), TestInterProcessProd::globalEndLuminosityBlockProduce(), and ExternalGeneratorFilter::globalEndLuminosityBlockProduce().

246  {
247  if (UNLIKELY(token.isUninitialized())) {
249  }
250  emplaceImpl<PROD>(token.index(), std::forward<Args>(args)...);
251  }
void throwOnPutOfUninitializedToken(char const *principalType, std::type_info const &productType)
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21

◆ emplace() [2/2]

template<typename PROD , typename... Args>
void LuminosityBlock::emplace ( EDPutToken  token,
Args &&...  args 
)

Definition at line 254 of file LuminosityBlock.h.

References writedatasetfile::args, emplaceImpl(), edm::PrincipalGetAdapter::getTypeIDForPutTokenIndex(), PROD, provRecorder_, edm::principal_get_adapter_detail::throwOnPutOfUninitializedToken(), edm::principal_get_adapter_detail::throwOnPutOfWrongType(), unpackBuffers-CaloStage2::token, and UNLIKELY.

254  {
255  if (UNLIKELY(token.isUninitialized())) {
257  }
258  if (UNLIKELY(provRecorder_.getTypeIDForPutTokenIndex(token.index()) != TypeID{typeid(PROD)})) {
261  }
262 
263  emplaceImpl(token.index(), std::forward<Args>(args)...);
264  }
void throwOnPutOfUninitializedToken(char const *principalType, std::type_info const &productType)
void throwOnPutOfWrongType(std::type_info const &wrongType, TypeID const &rightType)
void emplaceImpl(EDPutToken::value_type token, Args &&... args)
PrincipalGetAdapter provRecorder_
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21
TypeID const & getTypeIDForPutTokenIndex(EDPutToken::value_type index) const

◆ emplaceImpl()

template<typename PROD , typename... Args>
void LuminosityBlock::emplaceImpl ( EDPutToken::value_type  token,
Args &&...  args 
)
private

Definition at line 267 of file LuminosityBlock.h.

References writedatasetfile::args, cms::cuda::assert(), index(), eostools::move(), putProducts(), findQualityFiles::size, relativeConstraints::value, and pfClustersFromHGC3DClusters_cfi::wp.

Referenced by emplace().

267  {
268  assert(index < putProducts().size());
269 
270  std::unique_ptr<Wrapper<PROD>> wp(new Wrapper<PROD>(WrapperBase::Emplace{}, std::forward<Args>(args)...));
271 
272  // The following will call post_insert if T has such a function,
273  // and do nothing if T has no such function.
274  std::conditional_t<detail::has_postinsert<PROD>::value, DoPostInsert<PROD>, DoNotPostInsert<PROD>> maybe_inserter;
275  maybe_inserter(&(wp->bareProduct()));
276 
278  }
size
Write out results.
assert(be >=bs)
ProductPtrVec & putProducts()
LuminosityBlockIndex index() const
def move(src, dest)
Definition: eostools.py:511

◆ fillRun()

void LuminosityBlock::fillRun ( ) const
private

Definition at line 50 of file LuminosityBlock.cc.

References edm::PrincipalGetAdapter::getConsumer(), edm::PrincipalGetAdapter::getSharedResourcesAcquirer(), luminosityBlockPrincipal(), moduleCallingContext_, edm::PrincipalGetAdapter::moduleDescription(), provRecorder_, and run_.

Referenced by getRun().

50  {
51  run_.emplace(
53  run_->setSharedResourcesAcquirer(provRecorder_.getSharedResourcesAcquirer());
54  run_->setConsumer(provRecorder_.getConsumer());
55  }
SharedResourcesAcquirer * getSharedResourcesAcquirer() const
EDConsumerBase const * getConsumer() const
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
ModuleCallingContext const * moduleCallingContext_
PrincipalGetAdapter provRecorder_
std::optional< Run > run_
ModuleDescription const & moduleDescription() const

◆ get()

template<typename PROD >
PROD const & LuminosityBlock::get ( EDGetTokenT< PROD token) const
noexcept

Definition at line 355 of file LuminosityBlock.h.

References eostools::move(), PROD, edm::PRODUCT_TYPE, edm::principal_get_adapter_detail::throwOnPrematureRead(), unpackBuffers-CaloStage2::token, and UNLIKELY.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), rrapi.RRApi::columns(), rrapi.RRApi::count(), rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), CompareGeneratorResultsAnalyzer::globalBeginLuminosityBlock(), edmtest::ThingAnalyzer::globalBeginLuminosityBlock(), CompareGeneratorResultsAnalyzer::globalEndLuminosityBlock(), edmtest::ThingAnalyzer::globalEndLuminosityBlock(), rrapi.RRApi::report(), rrapi.RRApi::reports(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), and rrapi.RRApi::workspaces().

355  {
358  }
359  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
360  return *convert_handle<PROD>(std::move(bh));
361  }
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
ModuleCallingContext const * moduleCallingContext_
PrincipalGetAdapter provRecorder_
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
#define UNLIKELY(x)
Definition: Likely.h:21
def move(src, dest)
Definition: eostools.py:511

◆ getAllStableProvenance()

void LuminosityBlock::getAllStableProvenance ( std::vector< StableProvenance const *> &  provenances) const

Definition at line 75 of file LuminosityBlock.cc.

References edm::Principal::getAllStableProvenance(), and luminosityBlockPrincipal().

75  {
77  }
void getAllStableProvenance(std::vector< StableProvenance const *> &provenances) const
Definition: Principal.cc:813
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const

◆ getByLabel() [1/3]

template<typename PROD >
bool LuminosityBlock::getByLabel ( std::string const &  label,
Handle< PROD > &  result 
) const

Definition at line 281 of file LuminosityBlock.h.

References emptyString_, label, and mps_fire::result.

Referenced by edmtest::ThingWithMergeProducer::beginLuminosityBlock(), pat::PATTriggerProducer::beginLuminosityBlock(), edmtest::ThingWithMergeProducer::endLuminosityBlock(), and LumiCalculator::endLuminosityBlock().

281  {
283  }
static const std::string emptyString_
char const * label
bool getByLabel(std::string const &label, Handle< PROD > &result) const

◆ getByLabel() [2/3]

template<typename PROD >
bool LuminosityBlock::getByLabel ( std::string const &  label,
std::string const &  productInstanceName,
Handle< PROD > &  result 
) const

Definition at line 286 of file LuminosityBlock.h.

References edm::PrincipalGetAdapter::checkIfComplete(), emptyString_, edm::PrincipalGetAdapter::getByLabel_(), label, moduleCallingContext_, eostools::move(), PROD, provRecorder_, mps_fire::result, and edm::principal_get_adapter_detail::throwOnPrematureRead().

288  {
290  principal_get_adapter_detail::throwOnPrematureRead("Lumi", TypeID(typeid(PROD)), label, productInstanceName);
291  }
292  result.clear();
293  BasicHandle bh = provRecorder_.getByLabel_(
294  TypeID(typeid(PROD)), label, productInstanceName, emptyString_, moduleCallingContext_);
295  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
296  if (result.failedToGet()) {
297  return false;
298  }
299  return true;
300  }
BasicHandle getByLabel_(TypeID const &tid, InputTag const &tag, ModuleCallingContext const *mcc) const
static const std::string emptyString_
char const * label
ModuleCallingContext const * moduleCallingContext_
PrincipalGetAdapter provRecorder_
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
def move(src, dest)
Definition: eostools.py:511

◆ getByLabel() [3/3]

template<typename PROD >
bool LuminosityBlock::getByLabel ( InputTag const &  tag,
Handle< PROD > &  result 
) const

same as above, but using the InputTag class

Definition at line 304 of file LuminosityBlock.h.

References edm::PrincipalGetAdapter::checkIfComplete(), edm::PrincipalGetAdapter::getByLabel_(), moduleCallingContext_, eostools::move(), PROD, provRecorder_, mps_fire::result, makeGlobalPositionRcd_cfg::tag, and edm::principal_get_adapter_detail::throwOnPrematureRead().

304  {
306  principal_get_adapter_detail::throwOnPrematureRead("Lumi", TypeID(typeid(PROD)), tag.label(), tag.instance());
307  }
308  result.clear();
309  BasicHandle bh = provRecorder_.getByLabel_(TypeID(typeid(PROD)), tag, moduleCallingContext_);
310  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
311  if (result.failedToGet()) {
312  return false;
313  }
314  return true;
315  }
BasicHandle getByLabel_(TypeID const &tid, InputTag const &tag, ModuleCallingContext const *mcc) const
ModuleCallingContext const * moduleCallingContext_
PrincipalGetAdapter provRecorder_
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
def move(src, dest)
Definition: eostools.py:511

◆ getByLabelImpl()

BasicHandle LuminosityBlock::getByLabelImpl ( std::type_info const &  iWrapperType,
std::type_info const &  iProductType,
InputTag const &  iTag 
) const
finalprivatevirtual

Implements edm::LuminosityBlockBase.

Definition at line 113 of file LuminosityBlock.cc.

References edm::PrincipalGetAdapter::getByLabel_(), h, moduleCallingContext_, and provRecorder_.

115  {
116  BasicHandle h = provRecorder_.getByLabel_(TypeID(iProductType), iTag, moduleCallingContext_);
117  return h;
118  }
BasicHandle getByLabel_(TypeID const &tid, InputTag const &tag, ModuleCallingContext const *mcc) const
ModuleCallingContext const * moduleCallingContext_
PrincipalGetAdapter provRecorder_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ getByToken() [1/2]

template<typename PROD >
bool LuminosityBlock::getByToken ( EDGetToken  token,
Handle< PROD > &  result 
) const

Definition at line 318 of file LuminosityBlock.h.

References edm::PrincipalGetAdapter::checkIfComplete(), edm::PrincipalGetAdapter::getByToken_(), moduleCallingContext_, eostools::move(), PROD, edm::PRODUCT_TYPE, provRecorder_, mps_fire::result, edm::principal_get_adapter_detail::throwOnPrematureRead(), and unpackBuffers-CaloStage2::token.

Referenced by EventHeader::analyze(), L1GtAnalyzer::analyzeConditionsInLumiBlock(), HLTPrescaleRecorder::beginLuminosityBlock(), pat::PATTriggerEventProducer::beginLuminosityBlock(), BrilClient::dqmEndLuminosityBlock(), MillePedeFileExtractor::endLuminosityBlock(), DQMLumiMonitor::endLuminosityBlock(), edmtest::TestFindProduct::endLuminosityBlock(), CorrPCCProducer::endLuminosityBlock(), EDMtoMEConverter::Tokens< T >::getData(), GetLumi::getRawValue(), GenFilterEfficiencyAnalyzer::globalEndLuminosityBlock(), GenXSecAnalyzer::globalEndLuminosityBlock(), AlcaBeamSpotManager::readLumi(), SiPixelStatusManager::readLumi(), and GenWeightsTableProducer::streamBeginLuminosityBlock().

318  {
321  }
322  result.clear();
323  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
324  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
325  if (result.failedToGet()) {
326  return false;
327  }
328  return true;
329  }
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
ModuleCallingContext const * moduleCallingContext_
PrincipalGetAdapter provRecorder_
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
def move(src, dest)
Definition: eostools.py:511

◆ getByToken() [2/2]

template<typename PROD >
bool LuminosityBlock::getByToken ( EDGetTokenT< PROD token,
Handle< PROD > &  result 
) const

Definition at line 332 of file LuminosityBlock.h.

References edm::PrincipalGetAdapter::checkIfComplete(), edm::PrincipalGetAdapter::getByToken_(), moduleCallingContext_, eostools::move(), PROD, edm::PRODUCT_TYPE, provRecorder_, mps_fire::result, edm::principal_get_adapter_detail::throwOnPrematureRead(), and unpackBuffers-CaloStage2::token.

332  {
335  }
336  result.clear();
337  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
338  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
339  if (result.failedToGet()) {
340  return false;
341  }
342  return true;
343  }
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
ModuleCallingContext const * moduleCallingContext_
PrincipalGetAdapter provRecorder_
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
def move(src, dest)
Definition: eostools.py:511

◆ getHandle()

template<typename PROD >
Handle< PROD > LuminosityBlock::getHandle ( EDGetTokenT< PROD token) const

Definition at line 346 of file LuminosityBlock.h.

References edm::PrincipalGetAdapter::checkIfComplete(), edm::PrincipalGetAdapter::getByToken_(), moduleCallingContext_, eostools::move(), PROD, edm::PRODUCT_TYPE, provRecorder_, edm::principal_get_adapter_detail::throwOnPrematureRead(), unpackBuffers-CaloStage2::token, and UNLIKELY.

Referenced by edmtest::ThingAnalyzer::globalBeginLuminosityBlock(), and RawPCCProducer::globalEndLuminosityBlockProduce().

346  {
349  }
350  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
351  return convert_handle<PROD>(std::move(bh));
352  }
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
ModuleCallingContext const * moduleCallingContext_
PrincipalGetAdapter provRecorder_
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
#define UNLIKELY(x)
Definition: Likely.h:21
def move(src, dest)
Definition: eostools.py:511

◆ getProvenance()

Provenance const & LuminosityBlock::getProvenance ( BranchID const &  theID) const

Definition at line 67 of file LuminosityBlock.cc.

References edm::Principal::getProvenance(), and luminosityBlockPrincipal().

67  {
69  }
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
Provenance const & getProvenance(BranchID const &bid) const
Definition: Principal.cc:771

◆ getRun()

Run const& edm::LuminosityBlock::getRun ( ) const
inline

◆ getStableProvenance()

StableProvenance const & LuminosityBlock::getStableProvenance ( BranchID const &  theID) const

Definition at line 71 of file LuminosityBlock.cc.

References edm::Principal::getStableProvenance(), and luminosityBlockPrincipal().

71  {
73  }
StableProvenance const & getStableProvenance(BranchID const &bid) const
Definition: Principal.cc:784
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const

◆ index()

LuminosityBlockIndex LuminosityBlock::index ( ) const
Returns
Reusable index which can be used to separate data for different simultaneous LuminosityBlocks.

Definition at line 30 of file LuminosityBlock.cc.

References edm::LuminosityBlockPrincipal::index(), and luminosityBlockPrincipal().

Referenced by EcalDQMonitorTask::analyze(), edmtest::RandomIntProducer::beginLuminosityBlockProduce(), commit_(), emplaceImpl(), AlcaPCCProducer::endLuminosityBlockProduce(), TestInterProcessRandomProd::globalBeginLuminosityBlock(), ExternalGeneratorFilter::globalBeginLuminosityBlock(), RandomEngineStateProducer::globalBeginLuminosityBlockProduce(), TestInterProcessRandomProd::globalBeginLuminosityBlockProduce(), TestInterProcessProd::globalBeginLuminosityBlockProduce(), ExternalGeneratorFilter::globalBeginLuminosityBlockProduce(), PedestalTask::globalEndLuminosityBlock(), HcalGPUComparisonTask::globalEndLuminosityBlock(), TPTask::globalEndLuminosityBlock(), RawTask::globalEndLuminosityBlock(), RecHitTask::globalEndLuminosityBlock(), DigiTask::globalEndLuminosityBlock(), CTPPSCommonDQMSource::globalEndLuminosityBlock(), LaserTask::globalEndLuminosityBlock(), HcalMLTask::globalEndLuminosityBlock(), SiStripMonitorDigi::globalEndLuminosityBlock(), SiPixelDigiSource::globalEndLuminosityBlock(), OnlineBeamMonitor::globalEndLuminosityBlock(), AlcaBeamMonitor::globalEndLuminosityBlock(), DiamondSampicDQMSource::globalEndLuminosityBlock(), TotemTimingDQMSource::globalEndLuminosityBlock(), CTPPSDiamondDQMSource::globalEndLuminosityBlock(), GenFilterEfficiencyProducer::globalEndLuminosityBlockProduce(), TestInterProcessProd::globalEndLuminosityBlockProduce(), edm::global::impl::LuminosityBlockSummaryCacheHolder< T, S >::maybeClearCache(), edm::limited::impl::LuminosityBlockSummaryCacheHolder< T, S >::maybeClearCache(), put(), putImpl(), edm::PileUp::setRandomEngine(), TestInterProcessRandomProd::streamBeginLuminosityBlock(), ExternalGeneratorFilter::streamBeginLuminosityBlock(), TestInterProcessRandomProd::streamEndLuminosityBlock(), TestInterProcessProd::streamEndLuminosityBlock(), and ExternalGeneratorFilter::streamEndLuminosityBlockSummary().

30 { return luminosityBlockPrincipal().index(); }
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
LuminosityBlockIndex index() const

◆ labelsForToken()

void edm::LuminosityBlock::labelsForToken ( EDGetToken const &  iToken,
ProductLabels oLabels 
) const
inline

Definition at line 146 of file LuminosityBlock.h.

References edm::PrincipalGetAdapter::labelsForToken(), and provRecorder_.

146  {
147  provRecorder_.labelsForToken(iToken, oLabels);
148  }
void labelsForToken(EDGetToken const &iToken, ProductLabels &oLabels) const
PrincipalGetAdapter provRecorder_

◆ luminosityBlockAuxiliary()

LuminosityBlockAuxiliary const & LuminosityBlock::luminosityBlockAuxiliary ( ) const
finalvirtual

◆ luminosityBlockPrincipal()

LuminosityBlockPrincipal const & LuminosityBlock::luminosityBlockPrincipal ( ) const
private

Definition at line 63 of file LuminosityBlock.cc.

References runTheMatrix::const, edm::PrincipalGetAdapter::principal(), and provRecorder_.

Referenced by cacheIdentifier(), commit_(), fillRun(), getAllStableProvenance(), getProvenance(), getStableProvenance(), index(), and processHistoryID().

63  {
64  return dynamic_cast<LuminosityBlockPrincipal const&>(provRecorder_.principal());
65  }
Principal const & principal() const
PrincipalGetAdapter provRecorder_

◆ moduleCallingContext()

ModuleCallingContext const* edm::LuminosityBlock::moduleCallingContext ( ) const
inline

Definition at line 144 of file LuminosityBlock.h.

References moduleCallingContext_.

144 { return moduleCallingContext_; }
ModuleCallingContext const * moduleCallingContext_

◆ processHistory()

ProcessHistory const & LuminosityBlock::processHistory ( ) const

Definition at line 111 of file LuminosityBlock.cc.

References edm::PrincipalGetAdapter::processHistory(), and provRecorder_.

111 { return provRecorder_.processHistory(); }
ProcessHistory const & processHistory() const
PrincipalGetAdapter provRecorder_

◆ processHistoryID()

ProcessHistoryID const & LuminosityBlock::processHistoryID ( ) const

Definition at line 107 of file LuminosityBlock.cc.

References luminosityBlockPrincipal(), and edm::Principal::processHistoryID().

107  {
109  }
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:136

◆ put() [1/4]

template<typename PROD >
void edm::LuminosityBlock::put ( std::unique_ptr< PROD product)
inline

Put a new product.

Definition at line 113 of file LuminosityBlock.h.

References eostools::move(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmservices::DQMProtobufReader::beginLuminosityBlock(), edmtest::ThingExtSource::beginLuminosityBlock(), edmtest::ThingSource::beginLuminosityBlock(), edmtest::ThingWithMergeProducer::beginLuminosityBlockProduce(), LumiProducer::beginLuminosityBlockProduce(), edmtest::ThingExtSource::endLuminosityBlock(), edmtest::ThingSource::endLuminosityBlock(), AlcaBeamSpotFromDB::endLuminosityBlockProduce(), AlcaBeamSpotProducer::endLuminosityBlockProduce(), MillePedeFileConverter::endLuminosityBlockProduce(), EventCountProducer::endLuminosityBlockProduce(), edmtest::ThingWithMergeProducer::endLuminosityBlockProduce(), HLTPrescaleRecorder::endLuminosityBlockProduce(), EDMtoMEConverter::endLuminosityBlockProduce(), RandomEngineStateProducer::globalBeginLuminosityBlockProduce(), LHCInfoProducer::globalBeginLuminosityBlockProduce(), GenFilterEfficiencyProducer::globalEndLuminosityBlockProduce(), SiPixelStatusProducer::globalEndLuminosityBlockProduce(), edmtest::ProducerHelperUsingCollector::putBeginLumiProducts(), edmtest::ProducerHelperUsingCollector::putEndLumiProducts(), ExpressLumiProducer::writeEmptyProductForEntry(), ExpressLumiProducer::writeProductsForEntry(), and LumiProducer::writeProductsForEntry().

113  {
114  put<PROD>(std::move(product), std::string());
115  }
def move(src, dest)
Definition: eostools.py:511

◆ put() [2/4]

template<typename PROD >
void LuminosityBlock::put ( std::unique_ptr< PROD product,
std::string const &  productInstanceName 
)

Put a new product with a 'product instance name'.

Definition at line 205 of file LuminosityBlock.h.

References edm::PrincipalGetAdapter::getPutTokenIndex(), index(), eostools::move(), PROD, provRecorder_, putImpl(), edm::principal_get_adapter_detail::throwOnPutOfNullProduct(), and UNLIKELY.

205  {
206  if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
207  TypeID typeID(typeid(PROD));
208  principal_get_adapter_detail::throwOnPutOfNullProduct("LuminosityBlock", typeID, productInstanceName);
209  }
210  auto index = provRecorder_.getPutTokenIndex(TypeID(*product), productInstanceName);
211  putImpl(index, std::move(product));
212  }
EDPutToken::value_type getPutTokenIndex(TypeID const &type, std::string const &productInstanceName) const
void putImpl(EDPutToken::value_type token, std::unique_ptr< PROD > product)
LuminosityBlockIndex index() const
PrincipalGetAdapter provRecorder_
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21
void throwOnPutOfNullProduct(char const *principalType, TypeID const &productType, std::string const &productInstanceName)
def move(src, dest)
Definition: eostools.py:511

◆ put() [3/4]

template<typename PROD >
void LuminosityBlock::put ( EDPutToken  token,
std::unique_ptr< PROD product 
)

Definition at line 228 of file LuminosityBlock.h.

References edm::PrincipalGetAdapter::getTypeIDForPutTokenIndex(), eostools::move(), PROD, edm::PrincipalGetAdapter::productInstanceLabel(), provRecorder_, putImpl(), edm::principal_get_adapter_detail::throwOnPutOfNullProduct(), edm::principal_get_adapter_detail::throwOnPutOfUninitializedToken(), edm::principal_get_adapter_detail::throwOnPutOfWrongType(), unpackBuffers-CaloStage2::token, and UNLIKELY.

228  {
229  if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
230  TypeID typeID(typeid(PROD));
232  "LuminosityBlock", typeID, provRecorder_.productInstanceLabel(token));
233  }
234  if (UNLIKELY(token.isUninitialized())) {
236  }
237  if (UNLIKELY(provRecorder_.getTypeIDForPutTokenIndex(token.index()) != TypeID{typeid(PROD)})) {
240  }
241 
242  putImpl(token.index(), std::move(product));
243  }
void throwOnPutOfUninitializedToken(char const *principalType, std::type_info const &productType)
std::string const & productInstanceLabel(EDPutToken) const
void putImpl(EDPutToken::value_type token, std::unique_ptr< PROD > product)
void throwOnPutOfWrongType(std::type_info const &wrongType, TypeID const &rightType)
PrincipalGetAdapter provRecorder_
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21
void throwOnPutOfNullProduct(char const *principalType, TypeID const &productType, std::string const &productInstanceName)
def move(src, dest)
Definition: eostools.py:511
TypeID const & getTypeIDForPutTokenIndex(EDPutToken::value_type index) const

◆ put() [4/4]

template<typename PROD >
void LuminosityBlock::put ( EDPutTokenT< PROD token,
std::unique_ptr< PROD product 
)

Definition at line 215 of file LuminosityBlock.h.

References eostools::move(), PROD, edm::PrincipalGetAdapter::productInstanceLabel(), provRecorder_, putImpl(), edm::principal_get_adapter_detail::throwOnPutOfNullProduct(), edm::principal_get_adapter_detail::throwOnPutOfUninitializedToken(), unpackBuffers-CaloStage2::token, and UNLIKELY.

215  {
216  if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
217  TypeID typeID(typeid(PROD));
219  "LuminosityBlock", typeID, provRecorder_.productInstanceLabel(token));
220  }
221  if (UNLIKELY(token.isUninitialized())) {
223  }
224  putImpl(token.index(), std::move(product));
225  }
void throwOnPutOfUninitializedToken(char const *principalType, std::type_info const &productType)
std::string const & productInstanceLabel(EDPutToken) const
void putImpl(EDPutToken::value_type token, std::unique_ptr< PROD > product)
PrincipalGetAdapter provRecorder_
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21
void throwOnPutOfNullProduct(char const *principalType, TypeID const &productType, std::string const &productInstanceName)
def move(src, dest)
Definition: eostools.py:511

◆ putImpl()

template<typename PROD >
void LuminosityBlock::putImpl ( EDPutToken::value_type  token,
std::unique_ptr< PROD product 
)
private

Definition at line 192 of file LuminosityBlock.h.

References cms::cuda::assert(), index(), eostools::move(), putProducts(), findQualityFiles::size, relativeConstraints::value, and pfClustersFromHGC3DClusters_cfi::wp.

Referenced by put().

192  {
193  // The following will call post_insert if T has such a function,
194  // and do nothing if T has no such function.
195  std::conditional_t<detail::has_postinsert<PROD>::value, DoPostInsert<PROD>, DoNotPostInsert<PROD>> maybe_inserter;
196  maybe_inserter(product.get());
197 
198  assert(index < putProducts().size());
199 
200  std::unique_ptr<Wrapper<PROD>> wp(new Wrapper<PROD>(std::move(product)));
202  }
size
Write out results.
assert(be >=bs)
ProductPtrVec & putProducts()
LuminosityBlockIndex index() const
def move(src, dest)
Definition: eostools.py:511

◆ putProducts() [1/2]

ProductPtrVec& edm::LuminosityBlock::putProducts ( )
inlineprivate

Definition at line 165 of file LuminosityBlock.h.

References putProducts_.

Referenced by commit_(), emplaceImpl(), and putImpl().

165 { return putProducts_; }
ProductPtrVec putProducts_

◆ putProducts() [2/2]

ProductPtrVec const& edm::LuminosityBlock::putProducts ( ) const
inlineprivate

Definition at line 166 of file LuminosityBlock.h.

References putProducts_.

166 { return putProducts_; }
ProductPtrVec putProducts_

◆ setConsumer()

void LuminosityBlock::setConsumer ( EDConsumerBase const *  iConsumer)

Definition at line 36 of file LuminosityBlock.cc.

References provRecorder_, run_, and edm::PrincipalGetAdapter::setConsumer().

Referenced by edm::one::EDAnalyzerBase::doBeginLuminosityBlock(), edm::EDLooperBase::doBeginLuminosityBlock(), edm::global::EDAnalyzerBase::doBeginLuminosityBlock(), edm::one::EDProducerBase::doBeginLuminosityBlock(), edm::one::EDFilterBase::doBeginLuminosityBlock(), edm::limited::EDAnalyzerBase::doBeginLuminosityBlock(), edm::global::EDProducerBase::doBeginLuminosityBlock(), edm::limited::EDProducerBase::doBeginLuminosityBlock(), edm::global::EDFilterBase::doBeginLuminosityBlock(), edm::limited::EDFilterBase::doBeginLuminosityBlock(), edm::stream::EDAnalyzerAdaptor< T >::doBeginLuminosityBlock(), edm::stream::ProducingModuleAdaptor< T, M, B >::doBeginLuminosityBlock(), edm::one::EDAnalyzerBase::doEndLuminosityBlock(), edm::EDLooperBase::doEndLuminosityBlock(), edm::global::EDAnalyzerBase::doEndLuminosityBlock(), edm::one::EDProducerBase::doEndLuminosityBlock(), edm::one::EDFilterBase::doEndLuminosityBlock(), edm::limited::EDAnalyzerBase::doEndLuminosityBlock(), edm::limited::EDProducerBase::doEndLuminosityBlock(), edm::global::EDProducerBase::doEndLuminosityBlock(), edm::global::EDFilterBase::doEndLuminosityBlock(), edm::limited::EDFilterBase::doEndLuminosityBlock(), edm::stream::EDAnalyzerAdaptor< T >::doEndLuminosityBlock(), edm::stream::ProducingModuleAdaptor< T, M, B >::doEndLuminosityBlock(), edm::global::EDAnalyzerBase::doStreamBeginLuminosityBlock(), edm::limited::EDAnalyzerBase::doStreamBeginLuminosityBlock(), edm::global::EDProducerBase::doStreamBeginLuminosityBlock(), edm::limited::EDProducerBase::doStreamBeginLuminosityBlock(), edm::global::EDFilterBase::doStreamBeginLuminosityBlock(), edm::limited::EDFilterBase::doStreamBeginLuminosityBlock(), edm::global::EDAnalyzerBase::doStreamEndLuminosityBlock(), edm::limited::EDAnalyzerBase::doStreamEndLuminosityBlock(), edm::limited::EDProducerBase::doStreamEndLuminosityBlock(), edm::global::EDProducerBase::doStreamEndLuminosityBlock(), edm::global::EDFilterBase::doStreamEndLuminosityBlock(), edm::limited::EDFilterBase::doStreamEndLuminosityBlock(), edm::stream::EDAnalyzerAdaptorBase::doStreamEndLuminosityBlock(), and edm::stream::ProducingModuleAdaptorBase< EDProducerBase >::doStreamEndLuminosityBlock().

36  {
37  provRecorder_.setConsumer(iConsumer);
38  if (run_) {
39  run_->setConsumer(iConsumer);
40  }
41  }
void setConsumer(EDConsumerBase const *iConsumer)
PrincipalGetAdapter provRecorder_
std::optional< Run > run_

◆ setProducer()

void LuminosityBlock::setProducer ( ProducerBase const *  iProducer)

Definition at line 57 of file LuminosityBlock.cc.

References provRecorder_, putProducts_, edm::PrincipalGetAdapter::putTokenIndexToProductResolverIndex(), and edm::PrincipalGetAdapter::setProducer().

Referenced by edm::PuttableSourceBase::doBeginLumi(), edm::one::EDFilterBase::doBeginLuminosityBlock(), edm::one::EDProducerBase::doBeginLuminosityBlock(), edm::global::EDProducerBase::doBeginLuminosityBlock(), edm::limited::EDProducerBase::doBeginLuminosityBlock(), edm::global::EDFilterBase::doBeginLuminosityBlock(), edm::limited::EDFilterBase::doBeginLuminosityBlock(), edm::stream::ProducingModuleAdaptor< T, M, B >::doBeginLuminosityBlock(), edm::one::EDFilterBase::doEndLuminosityBlock(), edm::one::EDProducerBase::doEndLuminosityBlock(), edm::limited::EDProducerBase::doEndLuminosityBlock(), edm::global::EDProducerBase::doEndLuminosityBlock(), edm::global::EDFilterBase::doEndLuminosityBlock(), edm::limited::EDFilterBase::doEndLuminosityBlock(), and edm::stream::ProducingModuleAdaptor< T, M, B >::doEndLuminosityBlock().

57  {
58  provRecorder_.setProducer(iProducer);
59  //set appropriate size
61  }
ProductPtrVec putProducts_
void setProducer(ProducerBase const *iProd)
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex() const
PrincipalGetAdapter provRecorder_

◆ setSharedResourcesAcquirer()

void LuminosityBlock::setSharedResourcesAcquirer ( SharedResourcesAcquirer iResourceAcquirer)

Definition at line 43 of file LuminosityBlock.cc.

References provRecorder_, run_, and edm::PrincipalGetAdapter::setSharedResourcesAcquirer().

43  {
44  provRecorder_.setSharedResourcesAcquirer(iResourceAcquirer);
45  if (run_) {
46  run_->setSharedResourcesAcquirer(iResourceAcquirer);
47  }
48  }
void setSharedResourcesAcquirer(SharedResourcesAcquirer *iSra)
PrincipalGetAdapter provRecorder_
std::optional< Run > run_

Friends And Related Function Documentation

◆ ProducerBase

friend class ProducerBase
friend

Definition at line 175 of file LuminosityBlock.h.

◆ RawInputSource

friend class RawInputSource
friend

Definition at line 174 of file LuminosityBlock.h.

◆ stream::ProducingModuleAdaptorBase

template<typename T >
friend class stream::ProducingModuleAdaptorBase
friend

Definition at line 177 of file LuminosityBlock.h.

Member Data Documentation

◆ aux_

LuminosityBlockAuxiliary const& edm::LuminosityBlock::aux_
private

Definition at line 183 of file LuminosityBlock.h.

Referenced by luminosityBlockAuxiliary().

◆ emptyString_

std::string const LuminosityBlock::emptyString_
staticprivate

Definition at line 188 of file LuminosityBlock.h.

Referenced by getByLabel().

◆ moduleCallingContext_

ModuleCallingContext const* edm::LuminosityBlock::moduleCallingContext_
private

◆ provRecorder_

PrincipalGetAdapter edm::LuminosityBlock::provRecorder_
private

◆ putProducts_

ProductPtrVec edm::LuminosityBlock::putProducts_
private

Definition at line 182 of file LuminosityBlock.h.

Referenced by putProducts(), and setProducer().

◆ run_

std::optional<Run> edm::LuminosityBlock::run_
mutableprivate

Definition at line 185 of file LuminosityBlock.h.

Referenced by fillRun(), getRun(), setConsumer(), and setSharedResourcesAcquirer().