CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< ProductResolverBase
SharedProductPtr
 
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)
 
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
 
StableProvenance const & getStableProvenance (ProductID const &pid) 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

Definition at line 50 of file EventPrincipal.h.

Definition at line 51 of file EventPrincipal.h.

Definition at line 53 of file EventPrincipal.h.

Constructor & Destructor Documentation

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(), 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)
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
std::vector< ProcessIndex > branchListIndexToProcessIndex_
ProcessBlockHelperBase const * processBlockHelper_
edm::EventPrincipal::~EventPrincipal ( )
inlineoverride

Definition at line 64 of file EventPrincipal.h.

64 {}

Member Function Documentation

EventAuxiliary const& edm::EventPrincipal::aux ( ) const
inline
ProductID edm::EventPrincipal::branchIDToProductID ( BranchID const &  bid) const

Definition at line 236 of file EventPrincipal.cc.

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

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

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

Definition at line 104 of file EventPrincipal.h.

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

104 { return aux().bunchCrossing(); }
int bunchCrossing() const
EventAuxiliary const & aux() const
void edm::EventPrincipal::changedIndexes_ ( )
finalprivatevirtual

Reimplemented from edm::Principal.

Definition at line 266 of file EventPrincipal.cc.

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

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

Definition at line 61 of file EventPrincipal.cc.

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

Referenced by edm::VectorInputSource::clearEventPrincipal(), and edm::SubProcess::processAsync().

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_
void edm::EventPrincipal::commonFillEventPrincipal ( EventAuxiliary const &  aux,
ProcessHistory const *  processHistory,
DelayedReader reader 
)
private

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

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

Definition at line 378 of file EventPrincipal.cc.

References eventToProcessBlockIndexes_.

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

378  {
380  }
EventToProcessBlockIndexes eventToProcessBlockIndexes_
EventAuxiliary::ExperimentType edm::EventPrincipal::ExperimentType ( ) const
inline

Definition at line 102 of file EventPrincipal.h.

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

102 { return aux().experimentType(); }
ExperimentType experimentType() const
EventAuxiliary const & aux() const
void edm::EventPrincipal::fillEventPrincipal ( EventAuxiliary const &  aux,
ProcessHistory const *  processHistory,
DelayedReader reader = nullptr 
)

Definition at line 110 of file EventPrincipal.cc.

References branchIDListHelper_, branchListIndexes_, commonFillEventPrincipal(), eostools::move(), and updateBranchListIndexes().

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

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

Definition at line 94 of file EventPrincipal.cc.

References branchIDListHelper_, commonFillEventPrincipal(), eventSelectionIDs_, eostools::move(), updateBranchListIndexes(), and wasBranchListIndexesChangedFromInput().

97  {
99 
101  if (branchIDListHelper_->hasProducedProducts()) {
102  // Add index into BranchIDListRegistry for products produced this process
103  branchListIndexes.push_back(branchIDListHelper_->producedBranchListIndex());
104  }
106  }
108  }
void commonFillEventPrincipal(EventAuxiliary const &aux, ProcessHistory const *processHistory, DelayedReader *reader)
EventSelectionIDVector const & eventSelectionIDs() const
EventSelectionIDVector eventSelectionIDs_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
BranchListIndexes const & branchListIndexes() const
ProcessHistory const & processHistory() const
Definition: Principal.h:140
def move
Definition: eostools.py:511
void updateBranchListIndexes(BranchListIndexes &&)
bool wasBranchListIndexesChangedFromInput(BranchListIndexes const &) const
EventAuxiliary const & aux() const
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 branchIDListHelper_, commonFillEventPrincipal(), eventSelectionIDs_, eventToProcessBlockIndexes(), eventToProcessBlockIndexes_, eostools::move(), provRetrieverPtr_, 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)
EventToProcessBlockIndexes const & eventToProcessBlockIndexes() const
EventSelectionIDVector const & eventSelectionIDs() const
EventToProcessBlockIndexes eventToProcessBlockIndexes_
EventSelectionIDVector eventSelectionIDs_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
BranchListIndexes const & branchListIndexes() const
ProcessHistory const & processHistory() const
Definition: Principal.h:140
def move
Definition: eostools.py:511
void updateBranchListIndexes(BranchListIndexes &&)
DelayedReader * reader() const
Definition: Principal.h:187
bool wasBranchListIndexesChangedFromInput(BranchListIndexes const &) const
EventAuxiliary const & aux() const
BasicHandle edm::EventPrincipal::getByProductID ( ProductID const &  oid) const

Definition at line 278 of file EventPrincipal.cc.

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

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

278  {
279  BranchID bid = pidToBid(pid);
281  if (phb == nullptr) {
282  return BasicHandle(makeHandleExceptionFactory([pid]() -> std::shared_ptr<cms::Exception> {
283  std::shared_ptr<cms::Exception> whyFailed(std::make_shared<Exception>(errors::ProductNotFound, "InvalidID"));
284  *whyFailed << "get by product ID: no product with given id: " << pid << "\n";
285  return whyFailed;
286  }));
287  }
288 
289  // Was this already deleted?
290  if (phb->productWasDeleted()) {
292  }
293  // Check for case where we tried on demand production and
294  // it failed to produce the object
295  if (phb->unscheduledWasNotRun()) {
296  return BasicHandle(makeHandleExceptionFactory([pid]() -> std::shared_ptr<cms::Exception> {
297  std::shared_ptr<cms::Exception> whyFailed(std::make_shared<Exception>(errors::ProductNotFound, "InvalidID"));
298  *whyFailed << "get by ProductID: could not get product with id: " << pid << "\n"
299  << "Unscheduled execution not allowed to get via ProductID.\n";
300  return whyFailed;
301  }));
302  }
303  auto resolution = phb->resolveProduct(*this, false, nullptr, nullptr);
304 
305  auto data = resolution.data();
306  if (data) {
307  return BasicHandle(data->wrapper(), &(data->provenance()));
308  }
309  return BasicHandle(nullptr, nullptr);
310  }
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
WrapperBase const * edm::EventPrincipal::getIt ( ProductID const &  pid) const
overridevirtual

Implements edm::EDProductGetter.

Definition at line 312 of file EventPrincipal.cc.

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

Referenced by getThinnedProduct(), and getThinnedProducts().

312 { return getByProductID(pid).wrapper(); }
BasicHandle getByProductID(ProductID const &oid) const
WrapperBase const * wrapper() const noexcept(true)
Definition: BasicHandle.h:73
Provenance const & edm::EventPrincipal::getProvenance ( ProductID const &  pid) const

Definition at line 364 of file EventPrincipal.cc.

References pidToBid().

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

364  {
365  BranchID bid = pidToBid(pid);
366  return getProvenance(bid);
367  }
BranchID pidToBid(ProductID const &pid) const
Provenance const & getProvenance(ProductID const &pid) const
StableProvenance const & edm::EventPrincipal::getStableProvenance ( ProductID const &  pid) const

Definition at line 369 of file EventPrincipal.cc.

References pidToBid().

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

369  {
370  BranchID bid = pidToBid(pid);
371  return getStableProvenance(bid);
372  }
BranchID pidToBid(ProductID const &pid) const
StableProvenance const & getStableProvenance(ProductID const &pid) const
edm::ThinnedAssociation const * edm::EventPrincipal::getThinnedAssociation ( edm::BranchID const &  branchID) const
private

Definition at line 382 of file EventPrincipal.cc.

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

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

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

Implements edm::EDProductGetter.

Definition at line 338 of file EventPrincipal.cc.

References cms::Exception::addContext(), cms::cuda::func, getThinnedAssociation(), edm::detail::getThinnedKeyFrom_implementation(), SpecificationBuilder_cfi::parent(), pidToBid(), runTheMatrix::ret, and thinnedAssociationsHelper_.

340  {
341  BranchID parent = pidToBid(parentID);
342  BranchID thinned = pidToBid(thinnedID);
343 
344  try {
346  parentID, parent, key, thinnedID, thinned, *thinnedAssociationsHelper_, [this](BranchID const& branchID) {
347  return getThinnedAssociation(branchID);
348  });
349  if (auto factory = std::get_if<detail::GetThinnedKeyFromExceptionFactory>(&ret)) {
350  return [func = *factory]() {
351  auto ex = func();
352  ex.addContext("Calling EventPrincipal::getThinnedKeyFrom()");
353  return ex;
354  };
355  } else {
356  return ret;
357  }
358  } catch (Exception& ex) {
359  ex.addContext("Calling EventPrincipal::getThinnedKeyFrom()");
360  throw ex;
361  }
362  }
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
tuple ret
prodAgent to be discontinued
BranchID pidToBid(ProductID const &pid) 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)
edm::ThinnedAssociation const * getThinnedAssociation(edm::BranchID const &branchID) const
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t Func __host__ __device__ V int Func func
tuple key
prepare the HTCondor submission files and eventually submit them
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 314 of file EventPrincipal.cc.

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

315  {
317  pid,
318  key,
320  [this](ProductID const& p) { return pidToBid(p); },
321  [this](BranchID const& b) { return getThinnedAssociation(b); },
322  [this](ProductID const& p) { return getIt(p); });
323  }
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
BranchID pidToBid(ProductID const &pid) 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)
edm::ThinnedAssociation const * getThinnedAssociation(edm::BranchID const &branchID) const
tuple key
prepare the HTCondor submission files and eventually submit them
WrapperBase const * getIt(ProductID const &pid) const override
double b
Definition: hdecay.h:118
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 325 of file EventPrincipal.cc.

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

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

Definition at line 96 of file EventPrincipal.h.

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

Referenced by edm::DataMixingEMWorker::addEMPileups(), edm::DataMixingEMDigiWorker::addEMPileups(), edm::DataMixingGeneralTrackWorker::addGeneralTrackPileups(), edm::DataMixingHcalWorker::addHcalPileups(), edm::DataMixingHcalDigiWorker::addHcalPileups(), edm::DataMixingHcalDigiWorkerProd::addHcalPileups(), edm::DataMixingMuonWorker::addMuonPileups(), sistrip::SpyEventMatcher::addNextEventToMap(), edm::PreMixingPileupCopy::addPileupInfo(), edm::DataMixingPileupCopy::addPileupInfo(), PreMixingTrackingParticleWorker::addPileups(), PreMixingEcalWorker::addPileups(), PreMixingSiPixelWorker::addPileups(), PreMixingSiStripWorker::addPileups(), edm::DataMixingSiPixelWorker::addSiPixelPileups(), edm::DataMixingSiStripWorker::addSiStripPileups(), edm::DataMixingSiStripRawWorker::addSiStripPileups(), edm::EDLooperBase::doDuringLoop(), edm::StreamSchedule::finishedPaths(), edm::SecSourceAnalyzer::getBranches(), luminosityBlock(), edm::RecordEventID< T >::operator()(), edm::MixingModule::pileAllWorkers(), edm::DataMixingModule::pileWorker(), edm::PreMixingModule::pileWorker(), edm::InputSource::readEvent(), edm::PoolSource::readEvent_(), edm::StreamSchedule::reportSkipped(), run(), edm::OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >::setStreamContext(), and edm::Path::workerFinished().

96 { return aux().id(); }
EventID const & id() const
EventAuxiliary const & aux() const
bool edm::EventPrincipal::isReal ( ) const
inline

Definition at line 100 of file EventPrincipal.h.

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

100 { return aux().isRealData(); }
bool isRealData() const
EventAuxiliary const & aux() const
LuminosityBlockNumber_t edm::EventPrincipal::luminosityBlock ( ) const
inline

Definition at line 112 of file EventPrincipal.h.

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

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

112 { return id().luminosityBlock(); }
EventID const & id() const
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
LuminosityBlockPrincipal const& edm::EventPrincipal::luminosityBlockPrincipal ( ) const
inline

Definition at line 85 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

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

85 { return *luminosityBlockPrincipal_; }
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_
LuminosityBlockPrincipal& edm::EventPrincipal::luminosityBlockPrincipal ( )
inline

Definition at line 87 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

87 { return *luminosityBlockPrincipal_; }
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_
bool edm::EventPrincipal::luminosityBlockPrincipalPtrValid ( ) const
inline

Definition at line 89 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

89 { return luminosityBlockPrincipal_ != nullptr; }
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_
void edm::EventPrincipal::mergeProvenanceRetrievers ( EventPrincipal other)
inline

Definition at line 153 of file EventPrincipal.h.

References provRetrieverPtr(), and provRetrieverPtr_.

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

153  {
154  provRetrieverPtr_->mergeProvenanceRetrievers(other.provRetrieverPtr());
155  }
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
BranchID edm::EventPrincipal::pidToBid ( ProductID const &  pid) const
private

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

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

Reimplemented from edm::Principal.

Definition at line 260 of file EventPrincipal.cc.

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

260  {
262  }
EventToProcessBlockIndexes eventToProcessBlockIndexes_
virtual unsigned int processBlockIndex(std::string const &processName, EventToProcessBlockIndexes const &) const =0
ProcessBlockHelperBase const * processBlockHelper_
ProductProvenanceRetriever const* edm::EventPrincipal::productProvenanceRetrieverPtr ( ) const
inline

Definition at line 118 of file EventPrincipal.h.

References provRetrieverPtr_.

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

118 { return provRetrieverPtr_.get(); }
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
std::shared_ptr<ProductProvenanceRetriever const> edm::EventPrincipal::provRetrieverPtr ( ) const
inlineprivate

Definition at line 170 of file EventPrincipal.h.

References edm::get_underlying_safe(), and provRetrieverPtr_.

Referenced by mergeProvenanceRetrievers().

170  {
172  }
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
std::shared_ptr<ProductProvenanceRetriever>& edm::EventPrincipal::provRetrieverPtr ( )
inlineprivate

Definition at line 173 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_
void edm::EventPrincipal::put ( BranchDescription const &  bd,
std::unique_ptr< WrapperBase edp,
ProductProvenance const &  productProvenance 
) const

Definition at line 185 of file EventPrincipal.cc.

References cms::cuda::assert(), edm::BranchDescription::branchID(), 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_().

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

Definition at line 201 of file EventPrincipal.cc.

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

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

Definition at line 216 of file EventPrincipal.cc.

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

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

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

Definition at line 114 of file EventPrincipal.h.

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

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

114 { return id().run(); }
RunNumber_t run() const
Definition: EventID.h:38
EventID const & id() const
RunPrincipal const & edm::EventPrincipal::runPrincipal ( ) const

Definition at line 183 of file EventPrincipal.cc.

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

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

RunPrincipal const & runPrincipal() const
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
void edm::EventPrincipal::setLuminosityBlockPrincipal ( LuminosityBlockPrincipal lbp)

Definition at line 174 of file EventPrincipal.cc.

References luminosityBlockPrincipal_.

Referenced by edm::SubProcess::processAsync().

174 { luminosityBlockPrincipal_ = lbp; }
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_
void edm::EventPrincipal::setRunAndLumiNumber ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 176 of file EventPrincipal.cc.

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

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

176  {
178  assert(lumi == luminosityBlockPrincipal_->luminosityBlock());
179  EventNumber_t event = aux_.id().event();
180  aux_.id() = EventID(run, lumi, event);
181  }
EventNumber_t event() const
Definition: EventID.h:40
RunNumber_t run() const
unsigned long long EventNumber_t
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_
EventAuxiliary aux_
assert(be >=bs)
list lumi
Definition: dqmdumpme.py:53
EventID const & id() const
int edm::EventPrincipal::storeNumber ( ) const
inline

Definition at line 106 of file EventPrincipal.h.

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

106 { return aux().storeNumber(); }
int storeNumber() const
EventAuxiliary const & aux() const
StreamID edm::EventPrincipal::streamID ( ) const
inline
Timestamp const& edm::EventPrincipal::time ( ) const
inline
unsigned int edm::EventPrincipal::transitionIndex_ ( ) const
overrideprivatevirtual

Implements edm::EDProductGetter.

Definition at line 264 of file EventPrincipal.cc.

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

264 { return streamID_.value(); }
unsigned int value() const
Definition: StreamID.h:43
void edm::EventPrincipal::updateBranchListIndexes ( BranchListIndexes &&  branchListIndexes)
private

Definition at line 146 of file EventPrincipal.cc.

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

Referenced by fillEventPrincipal().

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

Definition at line 136 of file EventPrincipal.cc.

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

Referenced by fillEventPrincipal().

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

Member Data Documentation

EventAuxiliary edm::EventPrincipal::aux_
private
std::shared_ptr<BranchIDListHelper const> edm::EventPrincipal::branchIDListHelper_
private
BranchListIndexes edm::EventPrincipal::branchListIndexes_
private
std::vector<ProcessIndex> edm::EventPrincipal::branchListIndexToProcessIndex_
private

Definition at line 199 of file EventPrincipal.h.

Referenced by branchIDToProductID(), and updateBranchListIndexes().

EventSelectionIDVector edm::EventPrincipal::eventSelectionIDs_
private

Definition at line 189 of file EventPrincipal.h.

Referenced by eventSelectionIDs(), and fillEventPrincipal().

EventToProcessBlockIndexes edm::EventPrincipal::eventToProcessBlockIndexes_
private
int const edm::EventPrincipal::invalidBunchXing = EventAuxiliary::invalidBunchXing
static

Definition at line 54 of file EventPrincipal.h.

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

Definition at line 55 of file EventPrincipal.h.

edm::propagate_const<LuminosityBlockPrincipal*> edm::EventPrincipal::luminosityBlockPrincipal_
private
ProcessBlockHelperBase const* edm::EventPrincipal::processBlockHelper_
private

Definition at line 192 of file EventPrincipal.h.

Referenced by processBlockIndex().

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

Definition at line 201 of file EventPrincipal.h.

Referenced by streamID(), and transitionIndex_().

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