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 (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 getProvenance (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 (RunPrincipal const &rp, ModuleDescription const &md, 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

Definition at line 59 of file Run.h.

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

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::Run ( RunPrincipal const &  rp,
ModuleDescription const &  md,
ModuleCallingContext const *  moduleCallingContext,
bool  isAtEnd 
)

Definition at line 11 of file Run.cc.

15  : provRecorder_(rp, md, isAtEnd), aux_(rp.aux()), moduleCallingContext_(moduleCallingContext) {}
RunAuxiliary const & aux_
Definition: Run.h:184
ModuleCallingContext const * moduleCallingContext() const
Definition: Run.h:147
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:185
PrincipalGetAdapter provRecorder_
Definition: Run.h:182
Run::~Run ( )
override

Definition at line 17 of file Run.cc.

17 {}

Member Function Documentation

Run::CacheIdentifier_t Run::cacheIdentifier ( ) const

Definition at line 19 of file Run.cc.

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

19 { return runPrincipal().cacheIdentifier(); }
CacheIdentifier_t cacheIdentifier() const
Definition: Principal.h:184
RunPrincipal const & runPrincipal() const
Definition: Run.cc:23
void Run::commit_ ( std::vector< edm::ProductResolverIndex > const &  iShouldPut)
private

Definition at line 76 of file Run.cc.

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

76  {
77  RunPrincipal const& rp = runPrincipal();
78  size_t nPut = 0;
79  for (size_t i = 0; i < putProducts().size(); ++i) {
80  auto& p = get_underlying_safe(putProducts()[i]);
81  if (p) {
83  ++nPut;
84  }
85  }
86 
87  auto sz = iShouldPut.size();
88  if (sz != 0 and sz != nPut) {
89  //some were missed
90  auto& p = provRecorder_.principal();
91  for (auto index : iShouldPut) {
92  auto resolver = p.getProductResolverByIndex(index);
93  if (not resolver->productResolved() and isEndTransition(provRecorder_.transition()) ==
94  resolver->branchDescription().availableOnlyAtEndTransition()) {
95  resolver->putProduct(std::unique_ptr<WrapperBase>());
96  }
97  }
98  }
99 
100  // the cleanup is all or none
101  putProducts().clear();
102  }
Transition transition() const
Principal const & principal() const
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex() const
constexpr bool isEndTransition(Transition iValue)
Definition: Transition.h:25
RunIndex index() const
Definition: Run.cc:21
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
RunPrincipal const & runPrincipal() const
Definition: Run.cc:23
ProductPtrVec & putProducts()
Definition: Run.h:168
def move(src, dest)
Definition: eostools.py:511
PrincipalGetAdapter provRecorder_
Definition: Run.h:182
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, edm::EDPutTokenT< T >::index(), edm::EDPutTokenT< T >::isUninitialized(), PROD, edm::principal_get_adapter_detail::throwOnPutOfUninitializedToken(), and UNLIKELY.

Referenced by one::dqmimplementation::DQMRunEDProducer< edm::one::WatchLuminosityBlocks >::endRunProduce(), ConditionDumperInEdm::endRunProduce(), 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
template<typename PROD , typename... Args>
void Run::emplace ( EDPutToken  token,
Args &&...  args 
)

Definition at line 253 of file Run.h.

References writedatasetfile::args, edm::EDPutToken::index(), edm::EDPutToken::isUninitialized(), PROD, edm::principal_get_adapter_detail::throwOnPutOfUninitializedToken(), edm::principal_get_adapter_detail::throwOnPutOfWrongType(), 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)
TypeID const & getTypeIDForPutTokenIndex(EDPutToken::value_type index) const
void throwOnPutOfWrongType(std::type_info const &wrongType, TypeID const &rightType)
#define PROD(A, B)
void emplaceImpl(EDPutToken::value_type token, Args &&...args)
Definition: Run.h:266
#define UNLIKELY(x)
Definition: Likely.h:21
PrincipalGetAdapter provRecorder_
Definition: Run.h:182
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, eostools::move(), findQualityFiles::size, and relativeConstraints::value.

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 
276  putProducts()[index] = std::move(wp);
277  }
size
Write out results.
RunIndex index() const
Definition: Run.cc:21
ProductPtrVec & putProducts()
Definition: Run.h:168
def move(src, dest)
Definition: eostools.py:511
template<typename PROD >
PROD const & Run::get ( EDGetTokenT< PROD token) const

Definition at line 352 of file Run.h.

References eostools::move(), edm::PRODUCT_TYPE, and edm::principal_get_adapter_detail::throwOnPrematureRead().

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

352  {
354  principal_get_adapter_detail::throwOnPrematureRead("Run", TypeID(typeid(PROD)), token);
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
void Run::getAllStableProvenance ( std::vector< StableProvenance const * > &  provenances) const

Definition at line 29 of file Run.cc.

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

Referenced by GlobalHitsProdHistStripper::beginRun().

29  {
30  runPrincipal().getAllStableProvenance(provenances);
31  }
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
Definition: Principal.cc:830
RunPrincipal const & runPrincipal() const
Definition: Run.cc:23
template<typename PROD >
bool Run::getByLabel ( std::string const &  label,
Handle< PROD > &  result 
) const
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::HandleBase::clear(), edm::HandleBase::failedToGet(), eostools::move(), 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
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::HandleBase::clear(), edm::HandleBase::failedToGet(), edm::InputTag::instance(), edm::InputTag::label(), eostools::move(), 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
BasicHandle Run::getByLabelImpl ( std::type_info const &  iWrapperType,
std::type_info const &  iProductType,
InputTag const &  iTag 
) const
overrideprivatevirtual

Implements edm::RunBase.

Definition at line 108 of file Run.cc.

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

110  {
111  BasicHandle h = provRecorder_.getByLabel_(TypeID(iProductType), iTag, moduleCallingContext_);
112  return h;
113  }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
BasicHandle getByLabel_(TypeID const &tid, InputTag const &tag, ModuleCallingContext const *mcc) const
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:185
PrincipalGetAdapter provRecorder_
Definition: Run.h:182
template<typename PROD >
bool Run::getByToken ( EDGetToken  token,
Handle< PROD > &  result 
) const

Definition at line 315 of file Run.h.

References edm::HandleBase::clear(), edm::HandleBase::failedToGet(), eostools::move(), edm::PRODUCT_TYPE, and edm::principal_get_adapter_detail::throwOnPrematureRead().

Referenced by L1GtAnalyzer::analyzeConditionsInRunBlock(), L1GtAnalyzer::analyzeL1GtTriggerMenuLite(), HLTPrescaleRecorder::beginRun(), pat::PATTriggerEventProducer::beginRun(), RunHistogramManager::beginRun(), LHEWriter::endRun(), ExternalLHEAsciiDumper::endRun(), GenXSecAnalyzer::endRun(), EDMtoMEConverter::Tokens< T >::getData(), AlignmentProducerAsAnalyzer::getTkFittedLasBeamCollection(), AlignmentProducerAsAnalyzer::getTsosVectorCollection(), PrescaleWeightProvider::initRun(), and L1GtUtils::retrieveL1GtTriggerMenuLite().

315  {
317  principal_get_adapter_detail::throwOnPrematureRead("Run", TypeID(typeid(PROD)), token);
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
template<typename PROD >
bool Run::getByToken ( EDGetTokenT< PROD token,
Handle< PROD > &  result 
) const

Definition at line 329 of file Run.h.

References edm::HandleBase::clear(), edm::HandleBase::failedToGet(), eostools::move(), edm::PRODUCT_TYPE, and edm::principal_get_adapter_detail::throwOnPrematureRead().

329  {
331  principal_get_adapter_detail::throwOnPrematureRead("Run", TypeID(typeid(PROD)), token);
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
template<typename PROD >
Handle< PROD > Run::getHandle ( EDGetTokenT< PROD token) const

Definition at line 343 of file Run.h.

References eostools::move(), edm::PRODUCT_TYPE, and edm::principal_get_adapter_detail::throwOnPrematureRead().

Referenced by edm::GetterOfProducts< trigger::HLTPrescaleTable >::fillHandles().

343  {
345  principal_get_adapter_detail::throwOnPrematureRead("Run", TypeID(typeid(PROD)), token);
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
template<typename PROD >
void Run::getManyByType ( std::vector< Handle< PROD >> &  results) const

Definition at line 361 of file Run.h.

References edm::principal_get_adapter_detail::throwOnPrematureRead().

Referenced by GlobalHitsProdHistStripper::endRun().

361  {
364  }
366  }
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:185
PrincipalGetAdapter provRecorder_
Definition: Run.h:182
Provenance Run::getProvenance ( BranchID const &  theID) const

Definition at line 25 of file Run.cc.

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

25  {
27  }
Provenance getProvenance(BranchID const &bid, ModuleCallingContext const *mcc) const
Definition: Principal.cc:796
RunPrincipal const & runPrincipal() const
Definition: Run.cc:23
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:185
RunIndex Run::index ( ) const
Returns
Reusable index which can be used to separate data for different simultaneous Runs.

Definition at line 21 of file Run.cc.

References edm::RunPrincipal::index(), and runPrincipal().

Referenced by DQMGlobalEDAnalyzer< H, Args >::analyze(), HLTriggerJSONMonitoring::analyze(), commit_(), ConditionDumperInEdm::endRunProduce(), LogErrorEventFilter::filter(), BeamConditionsMonitor::globalBeginLuminosityBlock(), LogErrorEventFilter::globalBeginLuminosityBlock(), HLTriggerJSONMonitoring::globalBeginLuminosityBlockSummary(), LogErrorEventFilter::globalEndLuminosityBlock(), L1TriggerJSONMonitoring::globalEndLuminosityBlockSummary(), HLTriggerJSONMonitoring::globalEndLuminosityBlockSummary(), LogErrorEventFilter::globalEndRun(), edm::ConcurrentHadronizerFilter< HAD, DEC >::globalEndRunProduce(), edm::ConcurrentGeneratorFilter< HAD, DEC >::globalEndRunProduce(), ExternalGeneratorFilter::globalEndRunProduce(), BeautifulSoup.PageElement::insert(), GEMDigiToRawModule::produce(), GEMRawToDigiModule::produce(), ConditionDumperInEdm::produce(), GenParticleProducer::produce(), GenPUProtonProducer::produce(), GenWeightsTableProducer::produce(), HLTriggerJSONMonitoring::streamBeginLuminosityBlock(), HLTriggerJSONMonitoring::streamEndLuminosityBlockSummary(), edm::ConcurrentHadronizerFilter< HAD, DEC >::streamEndRun(), edm::ConcurrentGeneratorFilter< HAD, DEC >::streamEndRun(), and ExternalGeneratorFilter::streamEndRun().

21 { return runPrincipal().index(); }
RunPrincipal const & runPrincipal() const
Definition: Run.cc:23
RunIndex index() const
Definition: RunPrincipal.h:56
void edm::Run::labelsForToken ( EDGetToken const &  iToken,
ProductLabels oLabels 
) const
inline

Definition at line 149 of file Run.h.

References writedatasetfile::args, and PROD.

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

Definition at line 147 of file Run.h.

Referenced by edm::PileUp::beginRun(), and edm::PileUp::endRun().

147 { return moduleCallingContext_; }
ModuleCallingContext const * moduleCallingContext_
Definition: Run.h:185
ProcessHistory const & Run::processHistory ( ) const
ProcessHistoryID const & Run::processHistoryID ( ) const

Definition at line 104 of file Run.cc.

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

104 { return runPrincipal().processHistoryID(); }
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:142
RunPrincipal const & runPrincipal() const
Definition: Run.cc:23
template<typename PROD >
void edm::Run::put ( std::unique_ptr< PROD product)
inline
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 eostools::move(), PROD, 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  }
RunIndex index() const
Definition: Run.cc:21
void putImpl(EDPutToken::value_type token, std::unique_ptr< PROD > product)
Definition: Run.h:193
EDPutToken::value_type getPutTokenIndex(TypeID const &type, std::string const &productInstanceName) const
#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
template<typename PROD >
void Run::put ( EDPutToken  token,
std::unique_ptr< PROD product 
)

Definition at line 228 of file Run.h.

References edm::EDPutToken::index(), edm::EDPutToken::isUninitialized(), eostools::move(), PROD, edm::principal_get_adapter_detail::throwOnPutOfNullProduct(), edm::principal_get_adapter_detail::throwOnPutOfUninitializedToken(), edm::principal_get_adapter_detail::throwOnPutOfWrongType(), 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)
TypeID const & getTypeIDForPutTokenIndex(EDPutToken::value_type index) 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
std::string const & productInstanceLabel(EDPutToken) const
#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
template<typename PROD >
void Run::put ( EDPutTokenT< PROD token,
std::unique_ptr< PROD product 
)

Definition at line 216 of file Run.h.

References edm::EDPutTokenT< T >::index(), edm::EDPutTokenT< T >::isUninitialized(), eostools::move(), PROD, edm::principal_get_adapter_detail::throwOnPutOfNullProduct(), edm::principal_get_adapter_detail::throwOnPutOfUninitializedToken(), and UNLIKELY.

216  {
217  if (UNLIKELY(product.get() == 0)) { // 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)
void putImpl(EDPutToken::value_type token, std::unique_ptr< PROD > product)
Definition: Run.h:193
std::string const & productInstanceLabel(EDPutToken) const
#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
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 eostools::move(), findQualityFiles::size, and relativeConstraints::value.

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)));
202  putProducts()[index] = std::move(wp);
203  }
size
Write out results.
RunIndex index() const
Definition: Run.cc:21
ProductPtrVec & putProducts()
Definition: Run.h:168
def move(src, dest)
Definition: eostools.py:511
ProductPtrVec& edm::Run::putProducts ( )
inlineprivate

Definition at line 168 of file Run.h.

Referenced by commit_().

168 { return putProducts_; }
ProductPtrVec putProducts_
Definition: Run.h:183
ProductPtrVec const& edm::Run::putProducts ( ) const
inlineprivate

Definition at line 169 of file Run.h.

169 { return putProducts_; }
ProductPtrVec putProducts_
Definition: Run.h:183
RunAuxiliary const& edm::Run::runAuxiliary ( ) const
inlineoverridevirtual
RunPrincipal const & Run::runPrincipal ( ) const
private

Definition at line 23 of file Run.cc.

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

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

23 { return dynamic_cast<RunPrincipal const&>(provRecorder_.principal()); }
Principal const & principal() const
PrincipalGetAdapter provRecorder_
Definition: Run.h:182
void edm::Run::setConsumer ( EDConsumerBase const *  iConsumer)
inline

Definition at line 51 of file Run.h.

Referenced by edm::EDAnalyzer::doBeginRun(), edm::EDProducer::doBeginRun(), edm::EDFilter::doBeginRun(), edm::one::EDProducerBase::doBeginRun(), edm::one::EDFilterBase::doBeginRun(), edm::one::EDAnalyzerBase::doBeginRun(), edm::global::EDAnalyzerBase::doBeginRun(), edm::limited::EDProducerBase::doBeginRun(), edm::global::EDProducerBase::doBeginRun(), edm::limited::EDFilterBase::doBeginRun(), edm::global::EDFilterBase::doBeginRun(), edm::limited::EDAnalyzerBase::doBeginRun(), edm::stream::ProducingModuleAdaptor< T, M, B >::doBeginRun(), edm::stream::EDAnalyzerAdaptor< T >::doBeginRun(), edm::EDAnalyzer::doEndRun(), edm::EDProducer::doEndRun(), edm::EDFilter::doEndRun(), edm::one::EDProducerBase::doEndRun(), edm::one::EDFilterBase::doEndRun(), edm::one::EDAnalyzerBase::doEndRun(), edm::global::EDAnalyzerBase::doEndRun(), edm::limited::EDProducerBase::doEndRun(), edm::global::EDProducerBase::doEndRun(), edm::limited::EDFilterBase::doEndRun(), edm::global::EDFilterBase::doEndRun(), edm::limited::EDAnalyzerBase::doEndRun(), edm::stream::EDAnalyzerAdaptor< T >::doEndRun(), edm::stream::ProducingModuleAdaptor< T, M, B >::doEndRun(), edm::global::EDAnalyzerBase::doStreamBeginRun(), edm::limited::EDProducerBase::doStreamBeginRun(), edm::global::EDProducerBase::doStreamBeginRun(), edm::limited::EDFilterBase::doStreamBeginRun(), edm::global::EDFilterBase::doStreamBeginRun(), edm::limited::EDAnalyzerBase::doStreamBeginRun(), edm::global::EDAnalyzerBase::doStreamEndRun(), edm::limited::EDProducerBase::doStreamEndRun(), edm::global::EDProducerBase::doStreamEndRun(), edm::limited::EDFilterBase::doStreamEndRun(), edm::global::EDFilterBase::doStreamEndRun(), edm::limited::EDAnalyzerBase::doStreamEndRun(), edm::stream::EDAnalyzerAdaptorBase::doStreamEndRun(), and edm::stream::ProducingModuleAdaptorBase< T >::doStreamEndRun().

51 { provRecorder_.setConsumer(iConsumer); }
void setConsumer(EDConsumerBase const *iConsumer)
PrincipalGetAdapter provRecorder_
Definition: Run.h:182
void Run::setProducer ( ProducerBase const *  iProducer)
void edm::Run::setSharedResourcesAcquirer ( SharedResourcesAcquirer iResourceAcquirer)
inline

Definition at line 53 of file Run.h.

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

Friends And Related Function Documentation

friend class ProducerBase
friend

Definition at line 176 of file Run.h.

friend class RawInputSource
friend

Definition at line 175 of file Run.h.

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

Definition at line 178 of file Run.h.

Member Data Documentation

RunAuxiliary const& edm::Run::aux_
private

Definition at line 184 of file Run.h.

std::string const Run::emptyString_
staticprivate

Definition at line 189 of file Run.h.

ModuleCallingContext const* edm::Run::moduleCallingContext_
private

Definition at line 185 of file Run.h.

Referenced by getByLabelImpl(), and getProvenance().

PrincipalGetAdapter edm::Run::provRecorder_
private

Definition at line 182 of file Run.h.

Referenced by commit_(), getByLabelImpl(), processHistory(), runPrincipal(), and setProducer().

ProductPtrVec edm::Run::putProducts_
private

Definition at line 183 of file Run.h.

Referenced by setProducer().

SharedResourcesAcquirer* edm::Run::sharedResourcesAcquirer_
private

Definition at line 187 of file Run.h.