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::Run Class Reference

#include <Run.h>

Inheritance diagram for edm::Run:
edm::RunBase

Public Types

typedef PrincipalGetAdapter Base
 
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
 
template<typename PROD >
void getManyByType (std::vector< Handle< PROD >> &results) const
 
Provenance const & getProvenance (BranchID const &theID) const
 
StableProvenance const & getStableProvenance (BranchID const &theID) const
 
RunIndex index () const
 
void labelsForToken (EDGetToken const &iToken, ProductLabels &oLabels) const
 
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)
 
 Run (RunTransitionInfo const &, ModuleDescription const &, ModuleCallingContext const *, bool isAtEnd)
 
 Run (RunPrincipal const &, ModuleDescription const &, ModuleCallingContext const *, bool isAtEnd)
 
RunAuxiliary const & runAuxiliary () const override
 
void setConsumer (EDConsumerBase const *iConsumer)
 
void setProducer (ProducerBase const *iProducer)
 
void setSharedResourcesAcquirer (SharedResourcesAcquirer *iResourceAcquirer)
 
 ~Run () override
 
- Public Member Functions inherited from edm::RunBase
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<typename T >
bool getByLabel (InputTag const &tag, Handle< T > &result) const
 
RunID const & id () const
 
RunNumber_t run () const
 
 RunBase ()
 
virtual ~RunBase ()
 

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)
 
BasicHandle getByLabelImpl (std::type_info const &iWrapperType, std::type_info const &iProductType, InputTag const &iTag) const override
 
template<typename PROD >
void putImpl (EDPutToken::value_type token, std::unique_ptr< PROD > product)
 
ProductPtrVecputProducts ()
 
ProductPtrVec const & putProducts () const
 
RunPrincipal const & runPrincipal () const
 

Private Attributes

RunAuxiliary const & aux_
 
ModuleCallingContext const * moduleCallingContext_
 
PrincipalGetAdapter provRecorder_
 
ProductPtrVec putProducts_
 
SharedResourcesAcquirersharedResourcesAcquirer_
 

Static Private Attributes

static const std::string emptyString_
 

Friends

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

Detailed Description

Definition at line 45 of file Run.h.

Member Typedef Documentation

◆ Base

Definition at line 60 of file Run.h.

◆ CacheIdentifier_t

typedef unsigned long edm::Run::CacheIdentifier_t

If you are caching data from the Run, 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 79 of file Run.h.

◆ ProductPtrVec

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

Definition at line 170 of file Run.h.

Constructor & Destructor Documentation

◆ Run() [1/2]

Run::Run ( RunTransitionInfo const &  info,
ModuleDescription const &  md,
ModuleCallingContext const *  mcc,
bool  isAtEnd 
)

Definition at line 13 of file Run.cc.

14  : Run(info.principal(), md, mcc, isAtEnd) {}
static const TGPicture * info(bool iBackgroundIsBlack)
Run(RunTransitionInfo const &, ModuleDescription const &, ModuleCallingContext const *, bool isAtEnd)
Definition: Run.cc:13

◆ Run() [2/2]

Run::Run ( RunPrincipal const &  rp,
ModuleDescription const &  md,
ModuleCallingContext const *  moduleCallingContext,
bool  isAtEnd 
)

Definition at line 16 of file Run.cc.

20  : provRecorder_(rp, md, isAtEnd), aux_(rp.aux()), moduleCallingContext_(moduleCallingContext) {}
ModuleCallingContext const * moduleCallingContext() const
Definition: Run.h:150
RunAuxiliary const & aux_
Definition: Run.h:187
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:188
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ ~Run()

Run::~Run ( )
override

Definition at line 22 of file Run.cc.

22 {}

Member Function Documentation

◆ cacheIdentifier()

Run::CacheIdentifier_t Run::cacheIdentifier ( ) const

Definition at line 24 of file Run.cc.

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

24 { return runPrincipal().cacheIdentifier(); }
CacheIdentifier_t cacheIdentifier() const
Definition: Principal.h:185
RunPrincipal const & runPrincipal() const
Definition: Run.cc:28

◆ commit_()

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

Definition at line 83 of file Run.cc.

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

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

83  {
84  RunPrincipal const& rp = runPrincipal();
85  size_t nPut = 0;
86  for (size_t i = 0; i < putProducts().size(); ++i) {
87  auto& p = get_underlying_safe(putProducts()[i]);
88  if (p) {
90  ++nPut;
91  }
92  }
93 
94  auto sz = iShouldPut.size();
95  if (sz != 0 and sz != nPut) {
96  //some were missed
97  auto& p = provRecorder_.principal();
98  for (auto index : iShouldPut) {
99  auto resolver = p.getProductResolverByIndex(index);
100  if (not resolver->productResolved() and isEndTransition(provRecorder_.transition()) ==
101  resolver->branchDescription().availableOnlyAtEndTransition()) {
102  dynamic_cast<ProductPutterBase const*>(resolver)->putProduct(std::unique_ptr<WrapperBase>());
103  }
104  }
105  }
106 
107  // the cleanup is all or none
108  putProducts().clear();
109  }
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
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex() const
ProductPtrVec & putProducts()
Definition: Run.h:171
RunIndex index() const
Definition: Run.cc:26
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:185
RunPrincipal const & runPrincipal() const
Definition: Run.cc:28

◆ emplace() [1/2]

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

puts a new product

Definition at line 248 of file Run.h.

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

Referenced by ParameterSetBlobProducer::globalBeginRunProduce(), and ExternalGeneratorFilter::globalEndRunProduce().

248  {
249  if (UNLIKELY(token.isUninitialized())) {
251  }
252  emplaceImpl<PROD>(token.index(), std::forward<Args>(args)...);
253  }
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 Run::emplace ( EDPutToken  token,
Args &&...  args 
)

Definition at line 256 of file Run.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.

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

◆ emplaceImpl()

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

Definition at line 269 of file Run.h.

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

Referenced by emplace().

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

◆ get()

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

Definition at line 355 of file Run.h.

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

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::globalEndRun(), 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
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:188
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ getAllStableProvenance()

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

Definition at line 36 of file Run.cc.

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

Referenced by GlobalHitsProdHistStripper::beginRun().

36  {
37  runPrincipal().getAllStableProvenance(provenances);
38  }
void getAllStableProvenance(std::vector< StableProvenance const *> &provenances) const
Definition: Principal.cc:879
RunPrincipal const & runPrincipal() const
Definition: Run.cc:28

◆ getByLabel() [1/3]

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

◆ getByLabel() [2/3]

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

Definition at line 288 of file Run.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("Run", 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  }
static const std::string emptyString_
Definition: Run.h:192
BasicHandle getByLabel_(TypeID const &tid, InputTag const &tag, ModuleCallingContext const *mcc) const
char const * label
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:188
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ getByLabel() [3/3]

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

same as above, but using the InputTag class

Definition at line 304 of file Run.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("Run", 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
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:188
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ getByLabelImpl()

BasicHandle Run::getByLabelImpl ( std::type_info const &  iWrapperType,
std::type_info const &  iProductType,
InputTag const &  iTag 
) const
overrideprivatevirtual

Implements edm::RunBase.

Definition at line 115 of file Run.cc.

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

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

◆ getByToken() [1/2]

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

Definition at line 318 of file Run.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 L1GtAnalyzer::analyzeConditionsInRunBlock(), L1GtAnalyzer::analyzeL1GtTriggerMenuLite(), GenParticles2HepMCConverter::beginRun(), HLTPrescaleRecorder::beginRun(), pat::PATTriggerEventProducer::beginRun(), RunHistogramManager::beginRun(), LheWeightValidation::dqmEndRun(), EDMtoMEConverter::Tokens< T >::getData(), GenXSecAnalyzer::globalEndRun(), and L1GtUtils::retrieveL1GtTriggerMenuLite().

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
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:188
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ getByToken() [2/2]

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

Definition at line 332 of file Run.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
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:188
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ getHandle()

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

Definition at line 346 of file Run.h.

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

Referenced by LHE2HepMCConverter::beginRun(), and ExternalLHEAsciiDumper::endRun().

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
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:188
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ getManyByType()

template<typename PROD >
void Run::getManyByType ( std::vector< Handle< PROD >> &  results) const

Definition at line 364 of file Run.h.

References edm::PrincipalGetAdapter::checkIfComplete(), edm::PrincipalGetAdapter::getManyByType(), moduleCallingContext_, PROD, provRecorder_, bookConverter::results, and edm::principal_get_adapter_detail::throwOnPrematureRead().

Referenced by GlobalHitsProdHistStripper::endRun().

364  {
367  }
369  }
void getManyByType(std::vector< Handle< PROD > > &results, ModuleCallingContext const *mcc) const
#define PROD(A, B)
void throwOnPrematureRead(char const *principalType, TypeID const &productType, std::string const &moduleLabel, std::string const &productInstanceName)
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:188
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ getProvenance()

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

Definition at line 30 of file Run.cc.

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

30 { return runPrincipal().getProvenance(bid); }
Provenance const & getProvenance(BranchID const &bid) const
Definition: Principal.cc:837
RunPrincipal const & runPrincipal() const
Definition: Run.cc:28

◆ getStableProvenance()

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

Definition at line 32 of file Run.cc.

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

32  {
33  return runPrincipal().getStableProvenance(bid);
34  }
StableProvenance const & getStableProvenance(BranchID const &bid) const
Definition: Principal.cc:850
RunPrincipal const & runPrincipal() const
Definition: Run.cc:28

◆ index()

RunIndex Run::index ( ) const

◆ labelsForToken()

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

Definition at line 152 of file Run.h.

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

152  {
153  provRecorder_.labelsForToken(iToken, oLabels);
154  }
void labelsForToken(EDGetToken const &iToken, ProductLabels &oLabels) const
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ moduleCallingContext()

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

Definition at line 150 of file Run.h.

References moduleCallingContext_.

150 { return moduleCallingContext_; }
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:188

◆ processHistory()

ProcessHistory const & Run::processHistory ( ) const

◆ processHistoryID()

ProcessHistoryID const & Run::processHistoryID ( ) const

Definition at line 111 of file Run.cc.

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

111 { return runPrincipal().processHistoryID(); }
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:142
RunPrincipal const & runPrincipal() const
Definition: Run.cc:28

◆ put() [1/4]

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

◆ put() [2/4]

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

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

Definition at line 209 of file Run.h.

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

209  {
210  if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
211  TypeID typeID(typeid(PROD));
212  principal_get_adapter_detail::throwOnPutOfNullProduct("Run", typeID, productInstanceName);
213  }
214  auto index = provRecorder_.getPutTokenIndex(TypeID(*product), productInstanceName);
215  putImpl(index, std::move(product));
216  }
EDPutToken::value_type getPutTokenIndex(TypeID const &type, std::string const &productInstanceName) const
void putImpl(EDPutToken::value_type token, std::unique_ptr< PROD > product)
Definition: Run.h:196
RunIndex index() const
Definition: Run.cc:26
#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
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ put() [3/4]

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

Definition at line 231 of file Run.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.

231  {
232  if (UNLIKELY(product.get() == 0)) { // null pointer is illegal
233  TypeID typeID(typeid(PROD));
235  }
236  if (UNLIKELY(token.isUninitialized())) {
238  }
239  if (UNLIKELY(provRecorder_.getTypeIDForPutTokenIndex(token.index()) != TypeID{typeid(PROD)})) {
242  }
243 
244  putImpl(token.index(), std::move(product));
245  }
void throwOnPutOfUninitializedToken(char const *principalType, std::type_info const &productType)
std::string const & productInstanceLabel(EDPutToken) const
void throwOnPutOfWrongType(std::type_info const &wrongType, TypeID const &rightType)
void putImpl(EDPutToken::value_type token, std::unique_ptr< PROD > product)
Definition: Run.h:196
#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
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ put() [4/4]

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

Definition at line 219 of file Run.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.

219  {
220  if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
221  TypeID typeID(typeid(PROD));
223  }
224  if (UNLIKELY(token.isUninitialized())) {
226  }
227  putImpl(token.index(), std::move(product));
228  }
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)
Definition: Run.h:196
#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
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ putImpl()

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

Definition at line 196 of file Run.h.

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

Referenced by put().

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

◆ putProducts() [1/2]

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

Definition at line 171 of file Run.h.

References putProducts_.

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

171 { return putProducts_; }
ProductPtrVec putProducts_
Definition: Run.h:186

◆ putProducts() [2/2]

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

Definition at line 172 of file Run.h.

References putProducts_.

172 { return putProducts_; }
ProductPtrVec putProducts_
Definition: Run.h:186

◆ runAuxiliary()

RunAuxiliary const& edm::Run::runAuxiliary ( ) const
inlineoverridevirtual

Implements edm::RunBase.

Definition at line 62 of file Run.h.

References aux_.

Referenced by L1GtUtils::getL1GtRunCache(), EcalSignalGenerator< EEDigitizerTraits >::initializeEvent(), and L1GtUtils::retrieveL1GtTriggerMenuLite().

62 { return aux_; }
RunAuxiliary const & aux_
Definition: Run.h:187

◆ runPrincipal()

RunPrincipal const & Run::runPrincipal ( ) const
private

Definition at line 28 of file Run.cc.

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

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

28 { return dynamic_cast<RunPrincipal const&>(provRecorder_.principal()); }
Principal const & principal() const
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ setConsumer()

void edm::Run::setConsumer ( EDConsumerBase const *  iConsumer)
inline

Definition at line 52 of file Run.h.

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

52 { provRecorder_.setConsumer(iConsumer); }
void setConsumer(EDConsumerBase const *iConsumer)
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ setProducer()

void Run::setProducer ( ProducerBase const *  iProducer)

Definition at line 77 of file Run.cc.

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

Referenced by edm::stream::ProducingModuleAdaptor< T, M, B >::doBeginRun(), and edm::stream::ProducingModuleAdaptor< T, M, B >::doEndRun().

77  {
78  provRecorder_.setProducer(iProducer);
79  //set appropriate size
81  }
ProductPtrVec putProducts_
Definition: Run.h:186
void setProducer(ProducerBase const *iProd)
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex() const
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

◆ setSharedResourcesAcquirer()

void edm::Run::setSharedResourcesAcquirer ( SharedResourcesAcquirer iResourceAcquirer)
inline

Definition at line 54 of file Run.h.

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

54  {
55  provRecorder_.setSharedResourcesAcquirer(iResourceAcquirer);
56  }
void setSharedResourcesAcquirer(SharedResourcesAcquirer *iSra)
PrincipalGetAdapter provRecorder_
Definition: Run.h:185

Friends And Related Function Documentation

◆ ProducerBase

friend class ProducerBase
friend

Definition at line 179 of file Run.h.

◆ RawInputSource

friend class RawInputSource
friend

Definition at line 178 of file Run.h.

◆ stream::ProducingModuleAdaptorBase

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

Definition at line 181 of file Run.h.

Member Data Documentation

◆ aux_

RunAuxiliary const& edm::Run::aux_
private

Definition at line 187 of file Run.h.

Referenced by runAuxiliary().

◆ emptyString_

std::string const Run::emptyString_
staticprivate

Definition at line 192 of file Run.h.

Referenced by getByLabel().

◆ moduleCallingContext_

ModuleCallingContext const* edm::Run::moduleCallingContext_
private

◆ provRecorder_

PrincipalGetAdapter edm::Run::provRecorder_
private

◆ putProducts_

ProductPtrVec edm::Run::putProducts_
private

Definition at line 186 of file Run.h.

Referenced by putProducts(), and setProducer().

◆ sharedResourcesAcquirer_

SharedResourcesAcquirer* edm::Run::sharedResourcesAcquirer_
private

Definition at line 190 of file Run.h.