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
 
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 final
 
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 final
 
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 167 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:147
RunAuxiliary const & aux_
Definition: Run.h:184
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:185
PrincipalGetAdapter provRecorder_
Definition: Run.h:182

◆ ~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 26 of file Run.cc.

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

26 { return runPrincipal().cacheIdentifier(); }
CacheIdentifier_t cacheIdentifier() const
Definition: Principal.h:179
RunPrincipal const & runPrincipal() const
Definition: Run.cc:30

◆ commit_()

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

Definition at line 85 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().

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

◆ emplace() [1/2]

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

puts a new product

Definition at line 245 of file Run.h.

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

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

245  {
246  if (UNLIKELY(token.isUninitialized())) {
248  }
249  emplaceImpl<PROD>(token.index(), std::forward<Args>(args)...);
250  }
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 253 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.

253  {
254  if (UNLIKELY(token.isUninitialized())) {
256  }
257  if (UNLIKELY(provRecorder_.getTypeIDForPutTokenIndex(token.index()) != TypeID{typeid(PROD)})) {
260  }
261 
262  emplaceImpl(token.index(), std::forward<Args>(args)...);
263  }
void throwOnPutOfUninitializedToken(char const *principalType, std::type_info const &productType)
void emplaceImpl(EDPutToken::value_type token, Args &&... args)
Definition: Run.h:266
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:182

◆ emplaceImpl()

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

Definition at line 266 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().

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

◆ get()

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

Definition at line 352 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(), edmtest::ThingAnalyzer::globalBeginRun(), CompareGeneratorResultsAnalyzer::globalEndRun(), edmtest::ThingAnalyzer::globalEndRun(), rrapi.RRApi::report(), rrapi.RRApi::reports(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), and rrapi.RRApi::workspaces().

352  {
355  }
356  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
357  return *convert_handle<PROD>(std::move(bh));
358  }
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:185
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:182

◆ getAllStableProvenance()

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

Definition at line 38 of file Run.cc.

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

Referenced by GlobalHitsProdHistStripper::beginRun().

38  {
39  runPrincipal().getAllStableProvenance(provenances);
40  }
void getAllStableProvenance(std::vector< StableProvenance const *> &provenances) const
Definition: Principal.cc:813
RunPrincipal const & runPrincipal() const
Definition: Run.cc:30

◆ 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 285 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().

285  {
287  principal_get_adapter_detail::throwOnPrematureRead("Run", TypeID(typeid(PROD)), label, productInstanceName);
288  }
289  result.clear();
290  BasicHandle bh = provRecorder_.getByLabel_(
291  TypeID(typeid(PROD)), label, productInstanceName, emptyString_, moduleCallingContext_);
292  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
293  if (result.failedToGet()) {
294  return false;
295  }
296  return true;
297  }
static const std::string emptyString_
Definition: Run.h:189
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:185
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:182

◆ 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 301 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().

301  {
303  principal_get_adapter_detail::throwOnPrematureRead("Run", TypeID(typeid(PROD)), tag.label(), tag.instance());
304  }
305  result.clear();
306  BasicHandle bh = provRecorder_.getByLabel_(TypeID(typeid(PROD)), tag, moduleCallingContext_);
307  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
308  if (result.failedToGet()) {
309  return false;
310  }
311  return true;
312  }
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:185
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:182

◆ getByLabelImpl()

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

Implements edm::RunBase.

Definition at line 117 of file Run.cc.

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

119  {
120  BasicHandle h = provRecorder_.getByLabel_(TypeID(iProductType), iTag, moduleCallingContext_);
121  return h;
122  }
BasicHandle getByLabel_(TypeID const &tid, InputTag const &tag, ModuleCallingContext const *mcc) const
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:185
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:182

◆ getByToken() [1/2]

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

Definition at line 315 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(), HcalDigiSortedTableProducer::beginRun(), RunHistogramManager::beginRun(), LheWeightValidation::dqmEndRun(), EDMtoMEConverter::Tokens< T >::getData(), GenXSecAnalyzer::globalEndRun(), and L1GtUtils::retrieveL1GtTriggerMenuLite().

315  {
318  }
319  result.clear();
320  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
321  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
322  if (result.failedToGet()) {
323  return false;
324  }
325  return true;
326  }
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:185
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:182

◆ getByToken() [2/2]

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

Definition at line 329 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.

329  {
332  }
333  result.clear();
334  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
335  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
336  if (result.failedToGet()) {
337  return false;
338  }
339  return true;
340  }
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:185
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:182

◆ getHandle()

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

Definition at line 343 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(), ExternalLHEAsciiDumper::endRun(), and edmtest::ThingAnalyzer::globalBeginRun().

343  {
346  }
347  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
348  return convert_handle<PROD>(std::move(bh));
349  }
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:185
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:182

◆ getProvenance()

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

Definition at line 32 of file Run.cc.

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

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

◆ getStableProvenance()

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

Definition at line 34 of file Run.cc.

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

34  {
35  return runPrincipal().getStableProvenance(bid);
36  }
StableProvenance const & getStableProvenance(BranchID const &bid) const
Definition: Principal.cc:784
RunPrincipal const & runPrincipal() const
Definition: Run.cc:30

◆ index()

RunIndex Run::index ( ) const

◆ labelsForToken()

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

Definition at line 149 of file Run.h.

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

149  {
150  provRecorder_.labelsForToken(iToken, oLabels);
151  }
void labelsForToken(EDGetToken const &iToken, ProductLabels &oLabels) const
PrincipalGetAdapter provRecorder_
Definition: Run.h:182

◆ moduleCallingContext()

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

Definition at line 147 of file Run.h.

References moduleCallingContext_.

147 { return moduleCallingContext_; }
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:185

◆ processHistory()

ProcessHistory const & Run::processHistory ( ) const

◆ processHistoryID()

ProcessHistoryID const & Run::processHistoryID ( ) const

Definition at line 113 of file Run.cc.

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

113 { return runPrincipal().processHistoryID(); }
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:136
RunPrincipal const & runPrincipal() const
Definition: Run.cc:30

◆ 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 206 of file Run.h.

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

206  {
207  if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
208  TypeID typeID(typeid(PROD));
209  principal_get_adapter_detail::throwOnPutOfNullProduct("Run", typeID, productInstanceName);
210  }
211  auto index = provRecorder_.getPutTokenIndex(TypeID(*product), productInstanceName);
212  putImpl(index, std::move(product));
213  }
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:193
RunIndex index() const
Definition: Run.cc:28
#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:182

◆ put() [3/4]

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

Definition at line 228 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.

228  {
229  if (UNLIKELY(product.get() == 0)) { // null pointer is illegal
230  TypeID typeID(typeid(PROD));
232  }
233  if (UNLIKELY(token.isUninitialized())) {
235  }
236  if (UNLIKELY(provRecorder_.getTypeIDForPutTokenIndex(token.index()) != TypeID{typeid(PROD)})) {
239  }
240 
241  putImpl(token.index(), std::move(product));
242  }
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:193
#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:182

◆ put() [4/4]

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

Definition at line 216 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.

216  {
217  if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
218  TypeID typeID(typeid(PROD));
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)
Definition: Run.h:193
#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:182

◆ putImpl()

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

Definition at line 193 of file Run.h.

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

Referenced by put().

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

◆ putProducts() [1/2]

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

Definition at line 168 of file Run.h.

References putProducts_.

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

168 { return putProducts_; }
ProductPtrVec putProducts_
Definition: Run.h:183

◆ putProducts() [2/2]

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

Definition at line 169 of file Run.h.

References putProducts_.

169 { return putProducts_; }
ProductPtrVec putProducts_
Definition: Run.h:183

◆ runAuxiliary()

RunAuxiliary const & Run::runAuxiliary ( ) const
finalvirtual

◆ runPrincipal()

RunPrincipal const & Run::runPrincipal ( ) const
private

Definition at line 30 of file Run.cc.

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

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

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

◆ 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:182

◆ setProducer()

void Run::setProducer ( ProducerBase const *  iProducer)

Definition at line 79 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().

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

◆ 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:182

Friends And Related Function Documentation

◆ ProducerBase

friend class ProducerBase
friend

Definition at line 176 of file Run.h.

◆ RawInputSource

friend class RawInputSource
friend

Definition at line 175 of file Run.h.

◆ stream::ProducingModuleAdaptorBase

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

Definition at line 178 of file Run.h.

Member Data Documentation

◆ aux_

RunAuxiliary const& edm::Run::aux_
private

Definition at line 184 of file Run.h.

Referenced by runAuxiliary().

◆ emptyString_

std::string const Run::emptyString_
staticprivate

Definition at line 189 of file Run.h.

Referenced by getByLabel().

◆ moduleCallingContext_

ModuleCallingContext const* edm::Run::moduleCallingContext_
private

Definition at line 185 of file Run.h.

Referenced by getByLabel(), getByLabelImpl(), getByToken(), getHandle(), and moduleCallingContext().

◆ provRecorder_

PrincipalGetAdapter edm::Run::provRecorder_
private

◆ putProducts_

ProductPtrVec edm::Run::putProducts_
private

Definition at line 183 of file Run.h.

Referenced by putProducts(), and setProducer().

◆ sharedResourcesAcquirer_

SharedResourcesAcquirer* edm::Run::sharedResourcesAcquirer_
private

Definition at line 187 of file Run.h.