CMS 3D CMS Logo

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

#include <EventPrincipal.h>

Inheritance diagram for edm::EventPrincipal:
edm::Principal edm::EDProductGetter

Public Types

typedef EventAuxiliary Auxiliary
 
typedef Principal Base
 
typedef Base::ConstProductResolverPtr ConstProductResolverPtr
 
- Public Types inherited from edm::Principal
typedef std::vector< BasicHandleBasicHandleVec
 
typedef unsigned long CacheIdentifier_t
 
typedef boost::filter_iterator< FilledProductPtr, ProductResolverCollection::const_iterator > const_iterator
 
typedef ProductResolverBase const * ConstProductResolverPtr
 
typedef boost::filter_iterator< FilledProductPtr, ProductResolverCollection::iterator > iterator
 
typedef std::string ProcessName
 
typedef ProcessHistory::const_iterator ProcessNameConstIterator
 
typedef std::vector< propagate_const< std::shared_ptr< ProductResolverBase > > > ProductResolverCollection
 
typedef std::shared_ptr< ProductResolverBaseSharedProductPtr
 
typedef ProductResolverCollection::size_type size_type
 

Public Member Functions

EventAuxiliary const & aux () const
 
ProductID branchIDToProductID (BranchID const &bid) const
 
BranchListIndexes const & branchListIndexes () const
 
int bunchCrossing () const
 
void clearEventPrincipal ()
 
 EventPrincipal (std::shared_ptr< ProductRegistry const > reg, std::shared_ptr< BranchIDListHelper const > branchIDListHelper, std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper, ProcessConfiguration const &pc, HistoryAppender *historyAppender, unsigned int streamIndex=0, bool isForPrimaryProcess=true, ProcessBlockHelperBase const *processBlockHelper=nullptr)
 
EventSelectionIDVector const & eventSelectionIDs () const
 
EventToProcessBlockIndexes const & eventToProcessBlockIndexes () const
 
EventAuxiliary::ExperimentType ExperimentType () const
 
void fillEventPrincipal (EventAuxiliary const &aux, ProcessHistory const *processHistory, DelayedReader *reader=nullptr)
 
void fillEventPrincipal (EventAuxiliary const &aux, ProcessHistory const *processHistory, EventSelectionIDVector eventSelectionIDs, BranchListIndexes branchListIndexes, DelayedReader *reader=nullptr)
 
void fillEventPrincipal (EventAuxiliary const &aux, ProcessHistory const *processHistory, EventSelectionIDVector eventSelectionIDs, BranchListIndexes branchListIndexes, EventToProcessBlockIndexes const &, ProductProvenanceRetriever const &provRetriever, DelayedReader *reader=nullptr, bool deepCopyRetriever=true)
 
BasicHandle getByProductID (ProductID const &oid) const
 
WrapperBase const * getIt (ProductID const &pid) const override
 
Provenance const & getProvenance (ProductID const &pid) const
 
Provenance const & getProvenance (BranchID const &bid) const
 
StableProvenance const & getStableProvenance (ProductID const &pid) const
 
StableProvenance const & getStableProvenance (BranchID const &bid) const
 
OptionalThinnedKey getThinnedKeyFrom (ProductID const &parent, unsigned int key, ProductID const &thinned) const override
 
std::optional< std::tuple< WrapperBase const *, unsigned int > > getThinnedProduct (ProductID const &pid, unsigned int key) const override
 
void getThinnedProducts (ProductID const &pid, std::vector< WrapperBase const *> &foundContainers, std::vector< unsigned int > &keys) const override
 
EventID const & id () const
 
bool isReal () const
 
LuminosityBlockNumber_t luminosityBlock () const
 
LuminosityBlockPrincipal const & luminosityBlockPrincipal () const
 
LuminosityBlockPrincipalluminosityBlockPrincipal ()
 
bool luminosityBlockPrincipalPtrValid () const
 
void mergeProvenanceRetrievers (EventPrincipal &other)
 
unsigned int processBlockIndex (std::string const &processName) const override
 
ProductProvenanceRetriever const * productProvenanceRetrieverPtr () const
 
void put (BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance) const
 
void put (ProductResolverIndex index, std::unique_ptr< WrapperBase > edp, ParentageID productProvenance) const
 
void putOnRead (BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, std::optional< ProductProvenance > productProvenance) const
 
RunNumber_t run () const
 
RunPrincipal const & runPrincipal () const
 
void setLuminosityBlockPrincipal (LuminosityBlockPrincipal *lbp)
 
void setRunAndLumiNumber (RunNumber_t run, LuminosityBlockNumber_t lumi)
 
int storeNumber () const
 
StreamID streamID () const
 
Timestamp const & time () const
 
 ~EventPrincipal () override
 
- Public Member Functions inherited from edm::Principal
void adjustIndexesAfterProductRegistryAddition ()
 
bool adjustToNewProductRegistry (ProductRegistry const &reg)
 
const_iterator begin () const
 
iterator begin ()
 
BranchType const & branchType () const
 
CacheIdentifier_t cacheIdentifier () const
 
void clearPrincipal ()
 
void deleteProduct (BranchID const &id) const
 
const_iterator end () const
 
iterator end ()
 
void fillPrincipal (DelayedReader *reader)
 
void fillPrincipal (ProcessHistoryID const &hist, ProcessHistory const *phr, DelayedReader *reader)
 
void fillPrincipal (std::string const &processNameOfBlock, DelayedReader *reader)
 
ProductData const * findProductByTag (TypeID const &typeID, InputTag const &tag, ModuleCallingContext const *mcc) const
 
void getAllProvenance (std::vector< Provenance const *> &provenances) const
 
void getAllStableProvenance (std::vector< StableProvenance const *> &provenances) const
 
BasicHandle getByLabel (KindOfType kindOfType, TypeID const &typeID, InputTag const &inputTag, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
BasicHandle getByLabel (KindOfType kindOfType, TypeID const &typeID, std::string const &label, std::string const &instance, std::string const &process, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
BasicHandle getByToken (KindOfType kindOfType, TypeID const &typeID, ProductResolverIndex index, bool skipCurrentProcess, bool &ambiguous, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
void getManyByType (TypeID const &typeID, BasicHandleVec &results, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
ProductResolverBasegetModifiableProductResolver (BranchID const &oid)
 
ConstProductResolverPtr getProductResolver (BranchID const &oid) const
 
ConstProductResolverPtr getProductResolverByIndex (ProductResolverIndex const &oid) const
 
Provenance const & getProvenance (BranchID const &bid) const
 
StableProvenance const & getStableProvenance (BranchID const &bid) const
 
std::vector< unsigned int > const & lookupProcessOrder () const
 
void prefetchAsync (WaitingTaskHolder waitTask, ProductResolverIndex index, bool skipCurrentProcess, ServiceToken const &token, ModuleCallingContext const *mcc) const
 
 Principal (std::shared_ptr< ProductRegistry const > reg, std::shared_ptr< ProductResolverIndexHelper const > productLookup, ProcessConfiguration const &pc, BranchType bt, HistoryAppender *historyAppender, bool isForPrimaryProcess=true)
 
ProcessConfiguration const & processConfiguration () const
 
ProcessHistory const & processHistory () const
 
ProcessHistoryID const & processHistoryID () const
 
EDProductGetter const * prodGetter () const
 
ProductResolverIndexHelper const & productLookup () const
 
ProductRegistry const & productRegistry () const
 
void readAllFromSourceAndMergeImmediately (MergeableRunProductMetadata const *mergeableRunProductMetadata=nullptr)
 
DelayedReaderreader () const
 
void recombine (Principal &other, std::vector< BranchID > const &bids)
 
void setupUnscheduled (UnscheduledConfigurator const &)
 
size_t size () const
 
 ~Principal () override
 
- Public Member Functions inherited from edm::EDProductGetter
 EDProductGetter ()
 
 EDProductGetter (EDProductGetter const &)=delete
 
EDProductGetter const & operator= (EDProductGetter const &)=delete
 
unsigned int transitionIndex () const
 
virtual ~EDProductGetter ()
 

Static Public Attributes

static int const invalidBunchXing = EventAuxiliary::invalidBunchXing
 
static int const invalidStoreNumber = EventAuxiliary::invalidStoreNumber
 

Private Member Functions

void changedIndexes_ () final
 
void commonFillEventPrincipal (EventAuxiliary const &aux, ProcessHistory const *processHistory, DelayedReader *reader)
 
edm::ThinnedAssociation const * getThinnedAssociation (edm::BranchID const &branchID) const
 
BranchID pidToBid (ProductID const &pid) const
 
std::shared_ptr< ProductProvenanceRetriever const > provRetrieverPtr () const
 
std::shared_ptr< ProductProvenanceRetriever > & provRetrieverPtr ()
 
unsigned int transitionIndex_ () const override
 
void updateBranchListIndexes (BranchListIndexes &&)
 
bool wasBranchListIndexesChangedFromInput (BranchListIndexes const &) const
 

Private Attributes

EventAuxiliary aux_
 
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
 
BranchListIndexes branchListIndexes_
 
std::vector< ProcessIndexbranchListIndexToProcessIndex_
 
EventSelectionIDVector eventSelectionIDs_
 
EventToProcessBlockIndexes eventToProcessBlockIndexes_
 
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_
 
ProcessBlockHelperBase const * processBlockHelper_
 
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
 
StreamID streamID_
 
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDProductGetter
static void assignEDProductGetter (EDProductGetter const *&)
 
static EDProductGetter const * switchProductGetter (EDProductGetter const *)
 These can only be used internally by the framework. More...
 
- Protected Member Functions inherited from edm::Principal
void addProduct_ (std::unique_ptr< ProductResolverBase > phb)
 
void addProductOrThrow (std::unique_ptr< ProductResolverBase > phb)
 
template<typename F >
void applyToResolvers (F iFunc)
 
ProductResolverBasegetExistingProduct (BranchID const &branchID)
 
ProductResolverBase const * getExistingProduct (BranchID const &branchID) const
 
ProductResolverBase const * getExistingProduct (ProductResolverBase const &phb) const
 
void put_ (BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
 

Detailed Description

Definition at line 48 of file EventPrincipal.h.

Member Typedef Documentation

◆ Auxiliary

Definition at line 50 of file EventPrincipal.h.

◆ Base

Definition at line 51 of file EventPrincipal.h.

◆ ConstProductResolverPtr

Definition at line 53 of file EventPrincipal.h.

Constructor & Destructor Documentation

◆ EventPrincipal()

edm::EventPrincipal::EventPrincipal ( std::shared_ptr< ProductRegistry const >  reg,
std::shared_ptr< BranchIDListHelper const >  branchIDListHelper,
std::shared_ptr< ThinnedAssociationsHelper const >  thinnedAssociationsHelper,
ProcessConfiguration const &  pc,
HistoryAppender historyAppender,
unsigned int  streamIndex = 0,
bool  isForPrimaryProcess = true,
ProcessBlockHelperBase const *  processBlockHelper = nullptr 
)

Definition at line 33 of file EventPrincipal.cc.

References cms::cuda::assert(), dumpMFGeometry_cfg::prod, productProvenanceRetrieverPtr(), and thinnedAssociationsHelper_.

41  : Base(reg, reg->productLookup(InEvent), pc, InEvent, historyAppender, isForPrimaryProcess),
42  aux_(),
44  provRetrieverPtr_(new ProductProvenanceRetriever(streamIndex, *reg)),
46  branchIDListHelper_(branchIDListHelper),
47  processBlockHelper_(processBlockHelper),
48  thinnedAssociationsHelper_(thinnedAssociationsHelper),
51  streamID_(streamIndex) {
53 
54  for (auto& prod : *this) {
55  if (prod->singleProduct()) {
56  prod->setProductProvenanceRetriever(productProvenanceRetrieverPtr());
57  }
58  }
59  }
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
EventSelectionIDVector eventSelectionIDs_
BranchListIndexes branchListIndexes_
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
EventAuxiliary aux_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
assert(be >=bs)
std::vector< ProcessIndex > branchListIndexToProcessIndex_
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
ProcessBlockHelperBase const * processBlockHelper_

◆ ~EventPrincipal()

edm::EventPrincipal::~EventPrincipal ( )
inlineoverride

Definition at line 64 of file EventPrincipal.h.

64 {}

Member Function Documentation

◆ aux()

EventAuxiliary const& edm::EventPrincipal::aux ( ) const
inline

◆ branchIDToProductID()

ProductID edm::EventPrincipal::branchIDToProductID ( BranchID const &  bid) const

Definition at line 237 of file EventPrincipal.cc.

References branchIDListHelper_, branchListIndexToProcessIndex_, Exception, edm::BranchID::isValid(), SiStripPI::max, edm::errors::NotFound, FastTimerService_cff::range, and findQualityFiles::v.

Referenced by edm::RepeatingCachedRootSource::beginJob(), edm::Event::makeProductID(), and updateBranchListIndexes().

237  {
238  if (!bid.isValid()) {
239  throw Exception(errors::NotFound, "InvalidID") << "branchIDToProductID: invalid BranchID supplied\n";
240  }
241  typedef BranchIDListHelper::BranchIDToIndexMap BIDToIndexMap;
242  typedef BIDToIndexMap::const_iterator Iter;
243  typedef std::pair<Iter, Iter> IndexRange;
244 
245  IndexRange range = branchIDListHelper_->branchIDToIndexMap().equal_range(bid);
246  for (Iter it = range.first; it != range.second; ++it) {
247  BranchListIndex blix = it->second.first;
248  if (blix < branchListIndexToProcessIndex_.size()) {
249  auto v = branchListIndexToProcessIndex_[blix];
251  ProductIndex productIndex = it->second.second;
252  ProcessIndex processIndex = v;
253  return ProductID(processIndex + 1, productIndex + 1);
254  }
255  }
256  }
257  // cannot throw, because some products may legitimately not have product ID's (e.g. pile-up).
258  return ProductID();
259  }
unsigned short BranchListIndex
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
std::multimap< BranchID, IndexPair > BranchIDToIndexMap
std::vector< ProcessIndex > branchListIndexToProcessIndex_
unsigned short ProcessIndex
Definition: ProductID.h:25
unsigned short ProductIndex
Definition: ProductID.h:26

◆ branchListIndexes()

BranchListIndexes const & edm::EventPrincipal::branchListIndexes ( ) const

◆ bunchCrossing()

int edm::EventPrincipal::bunchCrossing ( ) const
inline

Definition at line 105 of file EventPrincipal.h.

References aux(), and edm::EventAuxiliary::bunchCrossing().

105 { return aux().bunchCrossing(); }
EventAuxiliary const & aux() const
int bunchCrossing() const

◆ changedIndexes_()

void edm::EventPrincipal::changedIndexes_ ( )
finalprivatevirtual

Reimplemented from edm::Principal.

Definition at line 267 of file EventPrincipal.cc.

References edm::Principal::productRegistry(), and provRetrieverPtr_.

267 { provRetrieverPtr_->update(productRegistry()); }
ProductRegistry const & productRegistry() const
Definition: Principal.h:146
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_

◆ clearEventPrincipal()

void edm::EventPrincipal::clearEventPrincipal ( )

Definition at line 61 of file EventPrincipal.cc.

References aux_, edm::Principal::clearPrincipal(), and provRetrieverPtr_.

61  {
63  aux_ = EventAuxiliary();
64  //do not clear luminosityBlockPrincipal_ since
65  // it is only connected at beginLumi transition
66  provRetrieverPtr_->reset();
67  }
void clearPrincipal()
Definition: Principal.cc:382
EventAuxiliary aux_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_

◆ commonFillEventPrincipal()

void edm::EventPrincipal::commonFillEventPrincipal ( EventAuxiliary const &  aux,
ProcessHistory const *  processHistory,
DelayedReader reader 
)
private

Definition at line 124 of file EventPrincipal.cc.

References aux(), aux_, edm::EventAuxiliary::event(), Exception, edm::Principal::fillPrincipal(), edm::invalidEventNumber, edm::errors::LogicError, edm::Principal::processHistory(), edm::EventAuxiliary::processHistoryID(), edm::Principal::processHistoryID(), edm::Principal::reader(), and edm::EventAuxiliary::setProcessHistoryID().

Referenced by fillEventPrincipal().

126  {
127  if (aux.event() == invalidEventNumber) {
128  throw Exception(errors::LogicError) << "EventPrincipal::fillEventPrincipal, Invalid event number provided in "
129  "EventAuxiliary, It is illegal for the event number to be 0\n";
130  }
131 
133  aux_ = aux;
135  }
void fillPrincipal(DelayedReader *reader)
Definition: Principal.cc:402
EventNumber_t event() const
EventAuxiliary const & aux() const
EventAuxiliary aux_
EventNumber_t const invalidEventNumber
ProcessHistoryID const & processHistoryID() const
ProcessHistory const & processHistory() const
Definition: Principal.h:140
void setProcessHistoryID(ProcessHistoryID const &phid)
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:142
DelayedReader * reader() const
Definition: Principal.h:187

◆ eventSelectionIDs()

EventSelectionIDVector const & edm::EventPrincipal::eventSelectionIDs ( ) const

◆ eventToProcessBlockIndexes()

EventToProcessBlockIndexes const & edm::EventPrincipal::eventToProcessBlockIndexes ( ) const

Definition at line 379 of file EventPrincipal.cc.

References eventToProcessBlockIndexes_.

Referenced by edm::EventForOutput::eventToProcessBlockIndexes(), fillEventPrincipal(), and edm::SubProcess::processAsync().

379  {
381  }
EventToProcessBlockIndexes eventToProcessBlockIndexes_

◆ ExperimentType()

EventAuxiliary::ExperimentType edm::EventPrincipal::ExperimentType ( ) const
inline

Definition at line 103 of file EventPrincipal.h.

References aux(), and edm::EventAuxiliary::experimentType().

103 { return aux().experimentType(); }
EventAuxiliary const & aux() const
ExperimentType experimentType() const

◆ fillEventPrincipal() [1/3]

void edm::EventPrincipal::fillEventPrincipal ( EventAuxiliary const &  aux,
ProcessHistory const *  processHistory,
DelayedReader reader = nullptr 
)

Definition at line 111 of file EventPrincipal.cc.

References aux(), branchIDListHelper_, branchListIndexes_, commonFillEventPrincipal(), eostools::move(), edm::Principal::processHistory(), edm::Principal::reader(), and updateBranchListIndexes().

Referenced by edm::IDGeneratorSourceBase< PuttableSourceBase >::doReadEvent(), edm::IDGeneratorSourceBase< PuttableSourceBase >::doReadEventWithDelayedReader(), edm::RawInputSource::makeEvent(), edm::StreamerInputSource::read(), edm::RootFile::readCurrentEvent(), edm::TestSource::readEvent_(), LH5Source::readEvent_(), LHESource::readEvent_(), and edm::RepeatingCachedRootSource::readEvent_().

113  {
114  if (branchListIndexes_.empty() and branchIDListHelper_->hasProducedProducts()) {
115  // Add index into BranchIDListRegistry for products produced this process
116  // if it hasn't already been filled in by the other fillEventPrincipal or by an earlier call to this function
117  BranchListIndexes indexes;
118  indexes.push_back(branchIDListHelper_->producedBranchListIndex());
120  }
122  }
void commonFillEventPrincipal(EventAuxiliary const &aux, ProcessHistory const *processHistory, DelayedReader *reader)
EventAuxiliary const & aux() const
BranchListIndexes branchListIndexes_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
std::vector< BranchListIndex > BranchListIndexes
void updateBranchListIndexes(BranchListIndexes &&)
ProcessHistory const & processHistory() const
Definition: Principal.h:140
def move(src, dest)
Definition: eostools.py:511
DelayedReader * reader() const
Definition: Principal.h:187

◆ fillEventPrincipal() [2/3]

void edm::EventPrincipal::fillEventPrincipal ( EventAuxiliary const &  aux,
ProcessHistory const *  processHistory,
EventSelectionIDVector  eventSelectionIDs,
BranchListIndexes  branchListIndexes,
DelayedReader reader = nullptr 
)

Definition at line 94 of file EventPrincipal.cc.

References aux(), branchIDListHelper_, branchListIndexes(), commonFillEventPrincipal(), eventSelectionIDs(), eventSelectionIDs_, eostools::move(), edm::Principal::processHistory(), edm::Principal::reader(), updateBranchListIndexes(), and wasBranchListIndexesChangedFromInput().

98  {
100 
102  if (branchIDListHelper_->hasProducedProducts()) {
103  // Add index into BranchIDListRegistry for products produced this process
104  branchListIndexes.push_back(branchIDListHelper_->producedBranchListIndex());
105  }
107  }
109  }
void commonFillEventPrincipal(EventAuxiliary const &aux, ProcessHistory const *processHistory, DelayedReader *reader)
EventAuxiliary const & aux() const
EventSelectionIDVector eventSelectionIDs_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
void updateBranchListIndexes(BranchListIndexes &&)
ProcessHistory const & processHistory() const
Definition: Principal.h:140
bool wasBranchListIndexesChangedFromInput(BranchListIndexes const &) const
EventSelectionIDVector const & eventSelectionIDs() const
BranchListIndexes const & branchListIndexes() const
def move(src, dest)
Definition: eostools.py:511
DelayedReader * reader() const
Definition: Principal.h:187

◆ fillEventPrincipal() [3/3]

void edm::EventPrincipal::fillEventPrincipal ( EventAuxiliary const &  aux,
ProcessHistory const *  processHistory,
EventSelectionIDVector  eventSelectionIDs,
BranchListIndexes  branchListIndexes,
EventToProcessBlockIndexes const &  eventToProcessBlockIndexes,
ProductProvenanceRetriever const &  provRetriever,
DelayedReader reader = nullptr,
bool  deepCopyRetriever = true 
)

Definition at line 69 of file EventPrincipal.cc.

References aux(), branchIDListHelper_, branchListIndexes(), commonFillEventPrincipal(), eventSelectionIDs(), eventSelectionIDs_, eventToProcessBlockIndexes(), eventToProcessBlockIndexes_, eostools::move(), edm::Principal::processHistory(), provRetrieverPtr_, edm::Principal::reader(), updateBranchListIndexes(), and wasBranchListIndexesChangedFromInput().

76  {
78  if (deepCopyRetriever) {
79  provRetrieverPtr_->deepCopy(provRetriever);
80  } else {
81  provRetrieverPtr_->mergeParentProcessRetriever(provRetriever);
82  }
84  if (branchIDListHelper_->hasProducedProducts()) {
85  // Add index into BranchIDListRegistry for products produced this process
86  branchListIndexes.push_back(branchIDListHelper_->producedBranchListIndex());
87  }
89  }
92  }
void commonFillEventPrincipal(EventAuxiliary const &aux, ProcessHistory const *processHistory, DelayedReader *reader)
EventAuxiliary const & aux() const
EventToProcessBlockIndexes eventToProcessBlockIndexes_
EventSelectionIDVector eventSelectionIDs_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
EventToProcessBlockIndexes const & eventToProcessBlockIndexes() const
void updateBranchListIndexes(BranchListIndexes &&)
ProcessHistory const & processHistory() const
Definition: Principal.h:140
bool wasBranchListIndexesChangedFromInput(BranchListIndexes const &) const
EventSelectionIDVector const & eventSelectionIDs() const
BranchListIndexes const & branchListIndexes() const
def move(src, dest)
Definition: eostools.py:511
DelayedReader * reader() const
Definition: Principal.h:187

◆ getByProductID()

BasicHandle edm::EventPrincipal::getByProductID ( ProductID const &  oid) const

Definition at line 279 of file EventPrincipal.cc.

References data, edm::Principal::getProductResolver(), edm::makeHandleExceptionFactory(), pidToBid(), edm::errors::ProductNotFound, L1TObjectsTimingClient_cff::resolution, and edm::throwProductDeletedException().

Referenced by edm::Event::getByProductID_(), and getIt().

279  {
280  BranchID bid = pidToBid(pid);
282  if (phb == nullptr) {
283  return BasicHandle(makeHandleExceptionFactory([pid]() -> std::shared_ptr<cms::Exception> {
284  std::shared_ptr<cms::Exception> whyFailed(std::make_shared<Exception>(errors::ProductNotFound, "InvalidID"));
285  *whyFailed << "get by product ID: no product with given id: " << pid << "\n";
286  return whyFailed;
287  }));
288  }
289 
290  // Was this already deleted?
291  if (phb->productWasDeleted()) {
293  }
294  // Check for case where we tried on demand production and
295  // it failed to produce the object
296  if (phb->unscheduledWasNotRun()) {
297  return BasicHandle(makeHandleExceptionFactory([pid]() -> std::shared_ptr<cms::Exception> {
298  std::shared_ptr<cms::Exception> whyFailed(std::make_shared<Exception>(errors::ProductNotFound, "InvalidID"));
299  *whyFailed << "get by ProductID: could not get product with id: " << pid << "\n"
300  << "Unscheduled execution not allowed to get via ProductID.\n";
301  return whyFailed;
302  }));
303  }
304  auto resolution = phb->resolveProduct(*this, false, nullptr, nullptr);
305 
306  auto data = resolution.data();
307  if (data) {
308  return BasicHandle(data->wrapper(), &(data->provenance()));
309  }
310  return BasicHandle(nullptr, nullptr);
311  }
BranchID pidToBid(ProductID const &pid) const
static void throwProductDeletedException(ProductID const &pid, edm::EventPrincipal::ConstProductResolverPtr const phb)
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
Base::ConstProductResolverPtr ConstProductResolverPtr
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
ConstProductResolverPtr getProductResolver(BranchID const &oid) const
Definition: Principal.cc:554

◆ getIt()

WrapperBase const * edm::EventPrincipal::getIt ( ProductID const &  pid) const
overridevirtual

Implements edm::EDProductGetter.

Definition at line 313 of file EventPrincipal.cc.

References getByProductID(), and edm::BasicHandle::wrapper().

Referenced by getThinnedProduct(), and getThinnedProducts().

313 { return getByProductID(pid).wrapper(); }
BasicHandle getByProductID(ProductID const &oid) const
WrapperBase const * wrapper() const noexcept(true)
Definition: BasicHandle.h:73

◆ getProvenance() [1/2]

Provenance const & edm::EventPrincipal::getProvenance ( ProductID const &  pid) const

Definition at line 365 of file EventPrincipal.cc.

References pidToBid().

Referenced by edm::Event::getProvenance().

365  {
366  BranchID bid = pidToBid(pid);
367  return getProvenance(bid);
368  }
Provenance const & getProvenance(ProductID const &pid) const
BranchID pidToBid(ProductID const &pid) const

◆ getProvenance() [2/2]

Provenance const & edm::Principal::getProvenance

Definition at line 837 of file Principal.cc.

837  {
839  if (phb == nullptr) {
841  }
842 
843  if (phb->unscheduledWasNotRun()) {
845  << "Requesting provenance from unrun EDProducer. The requested branch ID was: " << bid;
846  }
847  return *phb->provenance();
848  }
Base::ConstProductResolverPtr ConstProductResolverPtr
static void throwProductNotFoundException(char const *where, errors::ErrorCodes error, BranchID const &bid)
Definition: Principal.cc:48
ConstProductResolverPtr getProductResolver(BranchID const &oid) const
Definition: Principal.cc:554

◆ getStableProvenance() [1/2]

StableProvenance const & edm::EventPrincipal::getStableProvenance ( ProductID const &  pid) const

Definition at line 370 of file EventPrincipal.cc.

References pidToBid().

Referenced by edm::Event::getStableProvenance().

370  {
371  BranchID bid = pidToBid(pid);
372  return getStableProvenance(bid);
373  }
BranchID pidToBid(ProductID const &pid) const
StableProvenance const & getStableProvenance(ProductID const &pid) const

◆ getStableProvenance() [2/2]

StableProvenance const & edm::Principal::getStableProvenance

Definition at line 850 of file Principal.cc.

850  {
852  if (phb == nullptr) {
853  throwProductNotFoundException("getStableProvenance", errors::ProductNotFound, bid);
854  }
855  //NOTE: in all implementations, this never returns a nullptr
856  return *phb->stableProvenance();
857  }
Base::ConstProductResolverPtr ConstProductResolverPtr
static void throwProductNotFoundException(char const *where, errors::ErrorCodes error, BranchID const &bid)
Definition: Principal.cc:48
ConstProductResolverPtr getProductResolver(BranchID const &oid) const
Definition: Principal.cc:554

◆ getThinnedAssociation()

edm::ThinnedAssociation const * edm::EventPrincipal::getThinnedAssociation ( edm::BranchID const &  branchID) const
private

Definition at line 383 of file EventPrincipal.cc.

References runTheMatrix::const, data, edm::WrapperBase::dynamicTypeInfo(), Exception, edm::Principal::getProductResolver(), edm::errors::LogicError, edm::ProductData::wrapper(), and wrapper.

Referenced by getThinnedKeyFrom(), getThinnedProduct(), and getThinnedProducts().

383  {
384  ConstProductResolverPtr const phb = getProductResolver(branchID);
385 
386  if (phb == nullptr) {
388  << "EventPrincipal::getThinnedAssociation, ThinnedAssociation ProductResolver cannot be found\n"
389  << "This should never happen. Contact a Framework developer";
390  }
391  ProductData const* productData = (phb->resolveProduct(*this, false, nullptr, nullptr)).data();
392  if (productData == nullptr) {
393  return nullptr;
394  }
395  WrapperBase const* product = productData->wrapper();
396  if (!(typeid(edm::ThinnedAssociation) == product->dynamicTypeInfo())) {
398  << "EventPrincipal::getThinnedProduct, product has wrong type, not a ThinnedAssociation.\n";
399  }
400  Wrapper<ThinnedAssociation> const* wrapper = static_cast<Wrapper<ThinnedAssociation> const*>(product);
401  return wrapper->product();
402  }
Base::ConstProductResolverPtr ConstProductResolverPtr
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
static HepMC::HEPEVT_Wrapper wrapper
ConstProductResolverPtr getProductResolver(BranchID const &oid) const
Definition: Principal.cc:554

◆ getThinnedKeyFrom()

OptionalThinnedKey edm::EventPrincipal::getThinnedKeyFrom ( ProductID const &  parent,
unsigned int  key,
ProductID const &  thinned 
) const
overridevirtual

Implements edm::EDProductGetter.

Definition at line 339 of file EventPrincipal.cc.

References cms::Exception::addContext(), EcalMonitorTask_cff::func, getThinnedAssociation(), edm::detail::getThinnedKeyFrom_implementation(), crabWrapper::key, class-composition::parent, pidToBid(), runTheMatrix::ret, and thinnedAssociationsHelper_.

341  {
342  BranchID parent = pidToBid(parentID);
343  BranchID thinned = pidToBid(thinnedID);
344 
345  try {
347  parentID, parent, key, thinnedID, thinned, *thinnedAssociationsHelper_, [this](BranchID const& branchID) {
348  return getThinnedAssociation(branchID);
349  });
350  if (auto factory = std::get_if<detail::GetThinnedKeyFromExceptionFactory>(&ret)) {
351  return [func = *factory]() {
352  auto ex = func();
353  ex.addContext("Calling EventPrincipal::getThinnedKeyFrom()");
354  return ex;
355  };
356  } else {
357  return ret;
358  }
359  } catch (Exception& ex) {
360  ex.addContext("Calling EventPrincipal::getThinnedKeyFrom()");
361  throw ex;
362  }
363  }
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
ret
prodAgent to be discontinued
edm::ThinnedAssociation const * getThinnedAssociation(edm::BranchID const &branchID) const
std::variant< unsigned int, GetThinnedKeyFromExceptionFactory, std::monostate > getThinnedKeyFrom_implementation(ProductID const &parentID, BranchID const &parent, unsigned int key, ProductID const &thinnedID, BranchID thinned, ThinnedAssociationsHelper const &thinnedAssociationsHelper, F &&getThinnedAssociation)
BranchID pidToBid(ProductID const &pid) const

◆ getThinnedProduct()

std::optional< std::tuple< WrapperBase const *, unsigned int > > edm::EventPrincipal::getThinnedProduct ( ProductID const &  pid,
unsigned int  key 
) const
overridevirtual

Implements edm::EDProductGetter.

Definition at line 315 of file EventPrincipal.cc.

References b, getIt(), getThinnedAssociation(), edm::detail::getThinnedProduct(), crabWrapper::key, AlCaHLTBitMon_ParallelJobs::p, pidToBid(), and thinnedAssociationsHelper_.

316  {
318  pid,
319  key,
321  [this](ProductID const& p) { return pidToBid(p); },
322  [this](BranchID const& b) { return getThinnedAssociation(b); },
323  [this](ProductID const& p) { return getIt(p); });
324  }
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
edm::ThinnedAssociation const * getThinnedAssociation(edm::BranchID const &branchID) const
std::optional< std::tuple< WrapperBase const *, unsigned int > > getThinnedProduct(ProductID const &pid, unsigned int key, ThinnedAssociationsHelper const &thinnedAssociationsHelper, F1 pidToBid, F2 getThinnedAssociation, F3 getByProductID)
BranchID pidToBid(ProductID const &pid) const
WrapperBase const * getIt(ProductID const &pid) const override
double b
Definition: hdecay.h:118

◆ getThinnedProducts()

void edm::EventPrincipal::getThinnedProducts ( ProductID const &  pid,
std::vector< WrapperBase const *> &  foundContainers,
std::vector< unsigned int > &  keys 
) const
overridevirtual

Implements edm::EDProductGetter.

Definition at line 326 of file EventPrincipal.cc.

References b, getIt(), getThinnedAssociation(), edm::detail::getThinnedProducts(), relativeConstraints::keys, AlCaHLTBitMon_ParallelJobs::p, pidToBid(), and thinnedAssociationsHelper_.

328  {
330  pid,
332  [this](ProductID const& p) { return pidToBid(p); },
333  [this](BranchID const& b) { return getThinnedAssociation(b); },
334  [this](ProductID const& p) { return getIt(p); },
335  foundContainers,
336  keys);
337  }
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
edm::ThinnedAssociation const * getThinnedAssociation(edm::BranchID const &branchID) const
BranchID pidToBid(ProductID const &pid) const
void getThinnedProducts(ProductID const &pid, ThinnedAssociationsHelper const &thinnedAssociationsHelper, F1 pidToBid, F2 getThinnedAssociation, F3 getByProductID, std::vector< WrapperBase const *> &foundContainers, std::vector< unsigned int > &keys)
WrapperBase const * getIt(ProductID const &pid) const override
double b
Definition: hdecay.h:118

◆ id()

EventID const& edm::EventPrincipal::id ( void  ) const
inline

◆ isReal()

bool edm::EventPrincipal::isReal ( ) const
inline

Definition at line 101 of file EventPrincipal.h.

References aux(), and edm::EventAuxiliary::isRealData().

101 { return aux().isRealData(); }
EventAuxiliary const & aux() const
bool isRealData() const

◆ luminosityBlock()

LuminosityBlockNumber_t edm::EventPrincipal::luminosityBlock ( ) const
inline

Definition at line 113 of file EventPrincipal.h.

References id(), and edm::EventID::luminosityBlock().

Referenced by Types.EventID::cppID(), Types.LuminosityBlockID::cppID(), and edm::PoolSource::readEvent_().

113 { return id().luminosityBlock(); }
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
EventID const & id() const

◆ luminosityBlockPrincipal() [1/2]

LuminosityBlockPrincipal const& edm::EventPrincipal::luminosityBlockPrincipal ( ) const
inline

Definition at line 86 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

Referenced by edm::EDLooperBase::doDuringLoop(), edm::SubProcess::processAsync(), and runPrincipal().

86 { return *luminosityBlockPrincipal_; }
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_

◆ luminosityBlockPrincipal() [2/2]

LuminosityBlockPrincipal& edm::EventPrincipal::luminosityBlockPrincipal ( )
inline

Definition at line 88 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

88 { return *luminosityBlockPrincipal_; }
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_

◆ luminosityBlockPrincipalPtrValid()

bool edm::EventPrincipal::luminosityBlockPrincipalPtrValid ( ) const
inline

Definition at line 90 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

90 { return luminosityBlockPrincipal_ != nullptr; }
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_

◆ mergeProvenanceRetrievers()

void edm::EventPrincipal::mergeProvenanceRetrievers ( EventPrincipal other)
inline

Definition at line 154 of file EventPrincipal.h.

References trackingPlots::other, and provRetrieverPtr_.

Referenced by edm::PoolSource::readEvent_().

154  {
155  provRetrieverPtr_->mergeProvenanceRetrievers(other.provRetrieverPtr());
156  }
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_

◆ pidToBid()

BranchID edm::EventPrincipal::pidToBid ( ProductID const &  pid) const
private

Definition at line 230 of file EventPrincipal.cc.

References branchIDListHelper_, branchListIndexes_, Exception, edm::ProductID::isValid(), edm::productIDToBranchID(), and edm::errors::ProductNotFound.

Referenced by getByProductID(), getProvenance(), getStableProvenance(), getThinnedKeyFrom(), getThinnedProduct(), and getThinnedProducts().

230  {
231  if (!pid.isValid()) {
232  throw Exception(errors::ProductNotFound, "InvalidID") << "get by product ID: invalid ProductID supplied\n";
233  }
234  return productIDToBranchID(pid, branchIDListHelper_->branchIDLists(), branchListIndexes_);
235  }
BranchListIndexes branchListIndexes_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
BranchID productIDToBranchID(ProductID const &pid, BranchIDLists const &lists, BranchListIndexes const &indexes)

◆ processBlockIndex()

unsigned int edm::EventPrincipal::processBlockIndex ( std::string const &  processName) const
overridevirtual

Reimplemented from edm::Principal.

Definition at line 261 of file EventPrincipal.cc.

References eventToProcessBlockIndexes_, processBlockHelper_, edm::ProcessBlockHelperBase::processBlockIndex(), and SimL1EmulatorRepack_CalouGT_cff::processName.

261  {
263  }
EventToProcessBlockIndexes eventToProcessBlockIndexes_
virtual unsigned int processBlockIndex(std::string const &processName, EventToProcessBlockIndexes const &) const =0
ProcessBlockHelperBase const * processBlockHelper_

◆ productProvenanceRetrieverPtr()

ProductProvenanceRetriever const* edm::EventPrincipal::productProvenanceRetrieverPtr ( ) const
inline

Definition at line 119 of file EventPrincipal.h.

References provRetrieverPtr_.

Referenced by EventPrincipal(), edm::SubProcess::processAsync(), edm::EventForOutput::productProvenanceRetrieverPtr(), put(), and putOnRead().

119 { return provRetrieverPtr_.get(); }
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_

◆ provRetrieverPtr() [1/2]

std::shared_ptr<ProductProvenanceRetriever const> edm::EventPrincipal::provRetrieverPtr ( ) const
inlineprivate

Definition at line 171 of file EventPrincipal.h.

References edm::get_underlying_safe(), and provRetrieverPtr_.

171  {
173  }
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_

◆ provRetrieverPtr() [2/2]

std::shared_ptr<ProductProvenanceRetriever>& edm::EventPrincipal::provRetrieverPtr ( )
inlineprivate

Definition at line 174 of file EventPrincipal.h.

References edm::get_underlying_safe(), and provRetrieverPtr_.

constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_

◆ put() [1/2]

void edm::EventPrincipal::put ( BranchDescription const &  bd,
std::unique_ptr< WrapperBase edp,
ProductProvenance const &  productProvenance 
) const

Definition at line 186 of file EventPrincipal.cc.

References cms::cuda::assert(), runTheMatrix::const, Exception, edm::Principal::getExistingProduct(), edm::errors::InsertFailure, edm::ProductProvenanceLookup::insertIntoSet(), eostools::move(), and productProvenanceRetrieverPtr().

Referenced by FedRawDataInputSource::read(), LHESource::readEvent_(), and LH5Source::readEvent_().

188  {
189  // assert commented out for DaqSource. When DaqSource no longer uses put(), the assert can be restored.
190  //assert(produced());
191  if (edp.get() == nullptr) {
192  throw Exception(errors::InsertFailure, "Null Pointer") << "put: Cannot put because ptr to product is null."
193  << "\n";
194  }
195  productProvenanceRetrieverPtr()->insertIntoSet(productProvenance);
196  auto phb = getExistingProduct(bd.branchID());
197  assert(phb);
198  // ProductResolver assumes ownership
199  dynamic_cast<ProductPutterBase const*>(phb)->putProduct(std::move(edp));
200  }
ProductResolverBase * getExistingProduct(BranchID const &branchID)
Definition: Principal.cc:501
assert(be >=bs)
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
def move(src, dest)
Definition: eostools.py:511
void insertIntoSet(ProductProvenance provenanceProduct) const

◆ put() [2/2]

void edm::EventPrincipal::put ( ProductResolverIndex  index,
std::unique_ptr< WrapperBase edp,
ParentageID  productProvenance 
) const

Definition at line 202 of file EventPrincipal.cc.

References cms::cuda::assert(), runTheMatrix::const, Exception, edm::Principal::getProductResolverByIndex(), edm::errors::InsertFailure, edm::ProductProvenanceLookup::insertIntoSet(), eostools::move(), and productProvenanceRetrieverPtr().

202  {
203  if (edp.get() == nullptr) {
204  throw Exception(errors::InsertFailure, "Null Pointer") << "put: Cannot put because ptr to product is null."
205  << "\n";
206  }
207  auto phb = getProductResolverByIndex(index);
208 
210  ProductProvenance(phb->branchDescription().branchID(), std::move(parentage)));
211 
212  assert(phb);
213  // ProductResolver assumes ownership
214  dynamic_cast<ProductPutterBase const*>(phb)->putProduct(std::move(edp));
215  }
assert(be >=bs)
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
Definition: Principal.cc:562
def move(src, dest)
Definition: eostools.py:511
void insertIntoSet(ProductProvenance provenanceProduct) const

◆ putOnRead()

void edm::EventPrincipal::putOnRead ( BranchDescription const &  bd,
std::unique_ptr< WrapperBase edp,
std::optional< ProductProvenance productProvenance 
) const

Definition at line 217 of file EventPrincipal.cc.

References cms::cuda::assert(), runTheMatrix::const, edm::Principal::getExistingProduct(), edm::ProductProvenanceLookup::insertIntoSet(), eostools::move(), and productProvenanceRetrieverPtr().

Referenced by edm::StreamerInputSource::read().

219  {
220  assert(!bd.produced());
221  if (productProvenance) {
222  productProvenanceRetrieverPtr()->insertIntoSet(std::move(*productProvenance));
223  }
224  auto phb = getExistingProduct(bd.branchID());
225  assert(phb);
226  // ProductResolver assumes ownership
227  dynamic_cast<ProductPutterBase const*>(phb)->putProduct(std::move(edp));
228  }
ProductResolverBase * getExistingProduct(BranchID const &branchID)
Definition: Principal.cc:501
assert(be >=bs)
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
def move(src, dest)
Definition: eostools.py:511
void insertIntoSet(ProductProvenance provenanceProduct) const

◆ run()

RunNumber_t edm::EventPrincipal::run ( ) const
inline

Definition at line 115 of file EventPrincipal.h.

References id(), and edm::EventID::run().

Referenced by Types.EventID::cppID(), Types.LuminosityBlockID::cppID(), edm::OneLumiPoolSource::readEvent_(), edm::PoolSource::readEvent_(), and setRunAndLumiNumber().

115 { return id().run(); }
RunNumber_t run() const
Definition: EventID.h:38
EventID const & id() const

◆ runPrincipal()

RunPrincipal const & edm::EventPrincipal::runPrincipal ( ) const

Definition at line 184 of file EventPrincipal.cc.

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

Referenced by EcalSignalGenerator< EEDigitizerTraits >::initializeEvent().

RunPrincipal const & runPrincipal() const
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const

◆ setLuminosityBlockPrincipal()

void edm::EventPrincipal::setLuminosityBlockPrincipal ( LuminosityBlockPrincipal lbp)

Definition at line 175 of file EventPrincipal.cc.

References luminosityBlockPrincipal_.

175 { luminosityBlockPrincipal_ = lbp; }
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_

◆ setRunAndLumiNumber()

void edm::EventPrincipal::setRunAndLumiNumber ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 177 of file EventPrincipal.cc.

References cms::cuda::assert(), aux_, edm::EventID::event(), edm::EventAuxiliary::id(), luminosityBlockPrincipal_, and run().

Referenced by edm::OneLumiPoolSource::readEvent_().

177  {
179  assert(lumi == luminosityBlockPrincipal_->luminosityBlock());
180  EventNumber_t event = aux_.id().event();
181  aux_.id() = EventID(run, lumi, event);
182  }
RunNumber_t run() const
unsigned long long EventNumber_t
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_
EventAuxiliary aux_
assert(be >=bs)
EventID const & id() const
EventNumber_t event() const
Definition: EventID.h:40
Definition: event.py:1

◆ storeNumber()

int edm::EventPrincipal::storeNumber ( ) const
inline

Definition at line 107 of file EventPrincipal.h.

References aux(), and edm::EventAuxiliary::storeNumber().

107 { return aux().storeNumber(); }
EventAuxiliary const & aux() const
int storeNumber() const

◆ streamID()

StreamID edm::EventPrincipal::streamID ( ) const
inline

◆ time()

Timestamp const& edm::EventPrincipal::time ( ) const
inline

Definition at line 99 of file EventPrincipal.h.

References aux(), and edm::EventAuxiliary::time().

Referenced by edm::EDLooperBase::doDuringLoop(), and edm::OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >::setStreamContext().

99 { return aux().time(); }
EventAuxiliary const & aux() const
Timestamp const & time() const

◆ transitionIndex_()

unsigned int edm::EventPrincipal::transitionIndex_ ( ) const
overrideprivatevirtual

Implements edm::EDProductGetter.

Definition at line 265 of file EventPrincipal.cc.

References streamID_, and edm::StreamID::value().

265 { return streamID_.value(); }
unsigned int value() const
Definition: StreamID.h:43

◆ updateBranchListIndexes()

void edm::EventPrincipal::updateBranchListIndexes ( BranchListIndexes &&  branchListIndexes)
private

Definition at line 147 of file EventPrincipal.cc.

References branchIDToProductID(), branchListIndexes(), branchListIndexes_, branchListIndexToProcessIndex_, SiStripPI::max, eostools::move(), and dumpMFGeometry_cfg::prod.

Referenced by fillEventPrincipal().

147  {
150  // Fill in helper map for Branch to ProductID mapping
151  if (not branchListIndexes_.empty()) {
152  ProcessIndex pix = 0;
153  branchListIndexToProcessIndex_.resize(1 + *std::max_element(branchListIndexes_.begin(), branchListIndexes_.end()),
155  for (auto const& blindex : branchListIndexes_) {
156  branchListIndexToProcessIndex_[blindex] = pix;
157  ++pix;
158  }
159  }
160 
161  // Fill in the product ID's in the product holders.
162  for (auto& prod : *this) {
163  if (prod->singleProduct()) {
164  // If an alias is in the same process as the original then isAlias will be true.
165  // Under that condition, we want the ProductID to be the same as the original.
166  // If not, then we've internally changed the original BranchID to the alias BranchID
167  // in the ProductID lookup so we need the alias BranchID.
168 
169  auto const& bd = prod->branchDescription();
170  prod->setProductID(branchIDToProductID(bd.isAlias() ? bd.originalBranchID() : bd.branchID()));
171  }
172  }
173  }
BranchListIndexes branchListIndexes_
ProductID branchIDToProductID(BranchID const &bid) const
std::vector< ProcessIndex > branchListIndexToProcessIndex_
unsigned short ProcessIndex
Definition: ProductID.h:25
BranchListIndexes const & branchListIndexes() const
def move(src, dest)
Definition: eostools.py:511

◆ wasBranchListIndexesChangedFromInput()

bool edm::EventPrincipal::wasBranchListIndexesChangedFromInput ( BranchListIndexes const &  fromInput) const
private

Definition at line 137 of file EventPrincipal.cc.

References branchIDListHelper_, branchListIndexes_, edm::Principal::end(), and cond::serialization::equal().

Referenced by fillEventPrincipal().

137  {
138  //fromInput does not contain entries for what is being produced in this job.
139  auto end = branchListIndexes_.end();
140  if (end != branchListIndexes_.begin() and branchIDListHelper_->hasProducedProducts()) {
141  --end;
142  }
143 
144  return not std::equal(fromInput.begin(), fromInput.end(), branchListIndexes_.begin(), end);
145  }
BranchListIndexes branchListIndexes_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
bool equal(const T &first, const T &second)
Definition: Equal.h:32
const_iterator end() const
Definition: Principal.h:163

Member Data Documentation

◆ aux_

EventAuxiliary edm::EventPrincipal::aux_
private

◆ branchIDListHelper_

std::shared_ptr<BranchIDListHelper const> edm::EventPrincipal::branchIDListHelper_
private

◆ branchListIndexes_

BranchListIndexes edm::EventPrincipal::branchListIndexes_
private

◆ branchListIndexToProcessIndex_

std::vector<ProcessIndex> edm::EventPrincipal::branchListIndexToProcessIndex_
private

Definition at line 200 of file EventPrincipal.h.

Referenced by branchIDToProductID(), and updateBranchListIndexes().

◆ eventSelectionIDs_

EventSelectionIDVector edm::EventPrincipal::eventSelectionIDs_
private

Definition at line 190 of file EventPrincipal.h.

Referenced by eventSelectionIDs(), and fillEventPrincipal().

◆ eventToProcessBlockIndexes_

EventToProcessBlockIndexes edm::EventPrincipal::eventToProcessBlockIndexes_
private

◆ invalidBunchXing

int const edm::EventPrincipal::invalidBunchXing = EventAuxiliary::invalidBunchXing
static

Definition at line 54 of file EventPrincipal.h.

◆ invalidStoreNumber

int const edm::EventPrincipal::invalidStoreNumber = EventAuxiliary::invalidStoreNumber
static

Definition at line 55 of file EventPrincipal.h.

◆ luminosityBlockPrincipal_

edm::propagate_const<LuminosityBlockPrincipal*> edm::EventPrincipal::luminosityBlockPrincipal_
private

◆ processBlockHelper_

ProcessBlockHelperBase const* edm::EventPrincipal::processBlockHelper_
private

Definition at line 193 of file EventPrincipal.h.

Referenced by processBlockIndex().

◆ provRetrieverPtr_

edm::propagate_const<std::shared_ptr<ProductProvenanceRetriever> > edm::EventPrincipal::provRetrieverPtr_
private

◆ streamID_

StreamID edm::EventPrincipal::streamID_
private

Definition at line 202 of file EventPrincipal.h.

Referenced by streamID(), and transitionIndex_().

◆ thinnedAssociationsHelper_

std::shared_ptr<ThinnedAssociationsHelper const> edm::EventPrincipal::thinnedAssociationsHelper_
private