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 244 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().

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

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

References writedatasetfile::args, cms::cuda::assert(), edm::detail::do_post_insert_if_available(), index(), eostools::move(), putProducts(), findQualityFiles::size, and l1tPFClustersFromHGC3DClusters_cfi::wp.

Referenced by emplace().

265  {
266  assert(index < putProducts().size());
267 
268  std::unique_ptr<Wrapper<PROD>> wp(new Wrapper<PROD>(WrapperBase::Emplace{}, std::forward<Args>(args)...));
269 
270  // The following will call post_insert if T has such a function,
271  // and do nothing if T has no such function.
272  detail::do_post_insert_if_available(wp->bareProduct());
273 
275  }
size
Write out results.
assert(be >=bs)
ProductPtrVec & putProducts()
Definition: Run.h:168
void do_post_insert_if_available(T &iProduct)
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 350 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().

350  {
353  }
354  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
355  return *convert_handle<PROD>(std::move(bh));
356  }
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:817
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 283 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().

283  {
285  principal_get_adapter_detail::throwOnPrematureRead("Run", TypeID(typeid(PROD)), label, productInstanceName);
286  }
287  result.clear();
288  BasicHandle bh = provRecorder_.getByLabel_(
289  TypeID(typeid(PROD)), label, productInstanceName, emptyString_, moduleCallingContext_);
290  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
291  if (result.failedToGet()) {
292  return false;
293  }
294  return true;
295  }
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 299 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().

299  {
301  principal_get_adapter_detail::throwOnPrematureRead("Run", TypeID(typeid(PROD)), tag.label(), tag.instance());
302  }
303  result.clear();
304  BasicHandle bh = provRecorder_.getByLabel_(TypeID(typeid(PROD)), tag, moduleCallingContext_);
305  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
306  if (result.failedToGet()) {
307  return false;
308  }
309  return true;
310  }
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 313 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().

313  {
316  }
317  result.clear();
318  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
319  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
320  if (result.failedToGet()) {
321  return false;
322  }
323  return true;
324  }
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 327 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.

327  {
330  }
331  result.clear();
332  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
333  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
334  if (result.failedToGet()) {
335  return false;
336  }
337  return true;
338  }
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 341 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().

341  {
344  }
345  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
346  return convert_handle<PROD>(std::move(bh));
347  }
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:775
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:788
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 205 of file Run.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("Run", 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)
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 227 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.

227  {
228  if (UNLIKELY(product.get() == 0)) { // null pointer is illegal
229  TypeID typeID(typeid(PROD));
231  }
232  if (UNLIKELY(token.isUninitialized())) {
234  }
235  if (UNLIKELY(provRecorder_.getTypeIDForPutTokenIndex(token.index()) != TypeID{typeid(PROD)})) {
238  }
239 
240  putImpl(token.index(), std::move(product));
241  }
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 215 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.

215  {
216  if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
217  TypeID typeID(typeid(PROD));
219  }
220  if (UNLIKELY(token.isUninitialized())) {
222  }
223  putImpl(token.index(), std::move(product));
224  }
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(), edm::detail::do_post_insert_if_available(), index(), eostools::move(), putProducts(), findQualityFiles::size, and l1tPFClustersFromHGC3DClusters_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  detail::do_post_insert_if_available(*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()
Definition: Run.h:168
void do_post_insert_if_available(T &iProduct)
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.