CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Public Attributes | 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::ConstProductHolderPtr ConstProductHolderPtr
 
- Public Types inherited from edm::Principal
typedef std::vector< BasicHandleBasicHandleVec
 
typedef unsigned long CacheIdentifier_t
 
typedef boost::filter_iterator
< FilledProductPtr,
ProductHolderCollection::const_iterator > 
const_iterator
 
typedef ProductHolderBase const * ConstProductHolderPtr
 
typedef boost::filter_iterator
< FilledProductPtr,
ProductHolderCollection::iterator > 
iterator
 
typedef std::string ProcessName
 
typedef
ProcessHistory::const_iterator 
ProcessNameConstIterator
 
typedef std::vector
< propagate_const
< std::shared_ptr
< ProductHolderBase > > > 
ProductHolderCollection
 
typedef std::shared_ptr
< ProductHolderBase
SharedProductPtr
 
typedef
ProductHolderCollection::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)
 
EventSelectionIDVector const & eventSelectionIDs () const
 
EventAuxiliary::ExperimentType ExperimentType () const
 
void fillEventPrincipal (EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
 
void fillEventPrincipal (EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, EventSelectionIDVector &&eventSelectionIDs, BranchListIndexes &&branchListIndexes)
 
void fillEventPrincipal (EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, EventSelectionIDVector &&eventSelectionIDs, BranchListIndexes &&branchListIndexes, ProductProvenanceRetriever const &provRetriever, DelayedReader *reader=0)
 
BasicHandle getByProductID (ProductID const &oid) const
 
virtual WrapperBase const * getIt (ProductID const &pid) const override
 
Provenance getProvenance (ProductID const &pid, ModuleCallingContext const *mcc) const
 
virtual WrapperBase const * getThinnedProduct (ProductID const &pid, unsigned int &key) const override
 
virtual 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)
 
ProductProvenanceRetriever const * productProvenanceRetrieverPtr () const
 
void put (BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance) const
 
void putOnRead (BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance) const
 
RunNumber_t run () const
 
RunPrincipal const & runPrincipal () const
 
void setLuminosityBlockPrincipal (std::shared_ptr< LuminosityBlockPrincipal > const &lbp)
 
void setRunAndLumiNumber (RunNumber_t run, LuminosityBlockNumber_t lumi)
 
void setUnscheduledHandler (std::shared_ptr< UnscheduledHandler > iHandler)
 
int storeNumber () const
 
StreamID streamID () const
 
Timestamp const & time () const
 
std::shared_ptr< const
UnscheduledHandler
unscheduledHandler () const
 
 ~EventPrincipal ()
 
- Public Member Functions inherited from edm::Principal
void addAliasedProduct (std::shared_ptr< BranchDescription const > bd)
 
void addInputProduct (std::shared_ptr< BranchDescription const > bd)
 
void addScheduledProduct (std::shared_ptr< BranchDescription const > bd)
 
void addSourceProduct (std::shared_ptr< BranchDescription const > bd)
 
void addUnscheduledProduct (std::shared_ptr< BranchDescription const > bd)
 
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 (ProcessHistoryID const &hist, ProcessHistoryRegistry const &phr, DelayedReader *reader)
 
ProductData const * findProductByTag (TypeID const &typeID, InputTag const &tag, ModuleCallingContext const *mcc) const
 
void getAllProvenance (std::vector< Provenance 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, ProductHolderIndex index, bool skipCurrentProcess, bool &ambiguous, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
OutputHandle getForOutput (BranchID const &bid, bool getProd, ModuleCallingContext const *mcc) const
 
void getManyByType (TypeID const &typeID, BasicHandleVec &results, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
ProductHolderBasegetModifiableProductHolder (BranchID const &oid)
 
ConstProductHolderPtr getProductHolder (BranchID const &oid) const
 
ConstProductHolderPtr getProductHolderByIndex (ProductHolderIndex const &oid) const
 
Provenance getProvenance (BranchID const &bid, ModuleCallingContext const *mcc) const
 
bool isComplete () const
 
std::vector< unsigned int > const & lookupProcessOrder () const
 
void prefetch (ProductHolderIndex index, bool skipCurrentProcess, ModuleCallingContext const *mcc) const
 
 Principal (std::shared_ptr< ProductRegistry const > reg, std::shared_ptr< ProductHolderIndexHelper const > productLookup, ProcessConfiguration const &pc, BranchType bt, HistoryAppender *historyAppender)
 
ProcessConfiguration const & processConfiguration () const
 
ProcessHistory const & processHistory () const
 
ProcessHistoryID const & processHistoryID () const
 
EDProductGetter const * prodGetter () const
 
ProductHolderIndexHelper const & productLookup () const
 
ProductRegistry const & productRegistry () const
 
void readAllFromSourceAndMergeImmediately ()
 
DelayedReaderreader () const
 
void readFromSource (ProductHolderBase const &phb, ModuleCallingContext const *mcc) const
 
void recombine (Principal &other, std::vector< BranchID > const &bids)
 
size_t size () const
 
virtual ~Principal ()
 
- Public Member Functions inherited from edm::EDProductGetter
 EDProductGetter ()
 
 EDProductGetter (EDProductGetter const &)=delete
 
EDProductGetter const & operator= (EDProductGetter const &)=delete
 
unsigned int transitionIndex () const
 
virtual ~EDProductGetter ()
 

Public Attributes

signalslot::Signal< void(StreamContext
const &, ModuleCallingContext
const &)> 
postModuleDelayedGetSignal_
 
signalslot::Signal< void(StreamContext
const &, ModuleCallingContext
const &)> 
preModuleDelayedGetSignal_
 

Static Public Attributes

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

Private Member Functions

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 ()
 
virtual void readFromSource_ (ProductHolderBase const &phb, ModuleCallingContext const *mcc) const override
 
virtual unsigned int transitionIndex_ () const override
 
virtual bool unscheduledFill (std::string const &moduleLabel, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
 

Private Attributes

EventAuxiliary aux_
 
std::shared_ptr
< BranchIDListHelper const > 
branchIDListHelper_
 
BranchListIndexes branchListIndexes_
 
std::map< BranchListIndex,
ProcessIndex
branchListIndexToProcessIndex_
 
EventSelectionIDVector eventSelectionIDs_
 
edm::propagate_const
< std::shared_ptr
< LuminosityBlockPrincipal > > 
luminosityBlockPrincipal_
 
edm::propagate_const
< std::shared_ptr
< ProductProvenanceRetriever > > 
provRetrieverPtr_
 
StreamID streamID_
 
std::shared_ptr
< ThinnedAssociationsHelper
const > 
thinnedAssociationsHelper_
 
std::shared_ptr
< UnscheduledHandler const > 
unscheduledHandler_
 

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< ProductHolderBase > phb)
 
void addProductOrThrow (std::unique_ptr< ProductHolderBase > phb)
 
void checkUniquenessAndType (WrapperBase const *prod, ProductHolderBase const *productHolder) const
 
ProductHolderBasegetExistingProduct (BranchID const &branchID)
 
ProductHolderBase const * getExistingProduct (BranchID const &branchID) const
 
ProductHolderBase const * getExistingProduct (ProductHolderBase const &phb) const
 
void putOrMerge (BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
 

Detailed Description

Definition at line 47 of file EventPrincipal.h.

Member Typedef Documentation

Definition at line 49 of file EventPrincipal.h.

Definition at line 50 of file EventPrincipal.h.

Definition at line 52 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 
)

Definition at line 31 of file EventPrincipal.cc.

References assert(), and thinnedAssociationsHelper_.

37  :
38  Base(reg, reg->productLookup(InEvent), pc, InEvent, historyAppender),
39  aux_(),
41  provRetrieverPtr_(new ProductProvenanceRetriever(streamIndex)),
44  branchIDListHelper_(branchIDListHelper),
45  thinnedAssociationsHelper_(thinnedAssociationsHelper),
48  streamID_(streamIndex) {
50  }
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
EventSelectionIDVector eventSelectionIDs_
BranchListIndexes branchListIndexes_
assert(m_qm.get())
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
EventAuxiliary aux_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > luminosityBlockPrincipal_
std::shared_ptr< UnscheduledHandler const > unscheduledHandler_
edm::EventPrincipal::~EventPrincipal ( )
inline

Definition at line 62 of file EventPrincipal.h.

62 {}

Member Function Documentation

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

Definition at line 225 of file EventPrincipal.cc.

References branchIDListHelper_, branchListIndexToProcessIndex_, Exception, i, edm::BranchID::isValid(), and edm::errors::NotFound.

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

225  {
226  if(!bid.isValid()) {
227  throw Exception(errors::NotFound, "InvalidID")
228  << "branchIDToProductID: invalid BranchID supplied\n";
229  }
230  typedef BranchIDListHelper::BranchIDToIndexMap BIDToIndexMap;
231  typedef BIDToIndexMap::const_iterator Iter;
232  typedef std::pair<Iter, Iter> IndexRange;
233 
234  IndexRange range = branchIDListHelper_->branchIDToIndexMap().equal_range(bid);
235  for(Iter it = range.first; it != range.second; ++it) {
236  BranchListIndex blix = it->second.first;
237  std::map<BranchListIndex, ProcessIndex>::const_iterator i = branchListIndexToProcessIndex_.find(blix);
238  if(i != branchListIndexToProcessIndex_.end()) {
239  ProductIndex productIndex = it->second.second;
240  ProcessIndex processIndex = i->second;
241  return ProductID(processIndex+1, productIndex+1);
242  }
243  }
244  // cannot throw, because some products may legitimately not have product ID's (e.g. pile-up).
245  return ProductID();
246  }
int i
Definition: DBlmapReader.cc:9
unsigned short BranchListIndex
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
std::multimap< BranchID, IndexPair > BranchIDToIndexMap
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 114 of file EventPrincipal.h.

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

114  {
115  return aux().bunchCrossing();
116  }
int bunchCrossing() const
EventAuxiliary const & aux() const
void edm::EventPrincipal::clearEventPrincipal ( )

Definition at line 53 of file EventPrincipal.cc.

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

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

53  {
55  aux_ = EventAuxiliary();
56  luminosityBlockPrincipal_ = nullptr; // propagate_const<T> has no reset() function
57  provRetrieverPtr_->reset();
58  unscheduledHandler_.reset();
60  }
void clearPrincipal()
Definition: Principal.cc:321
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
EventAuxiliary aux_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > luminosityBlockPrincipal_
std::shared_ptr< UnscheduledHandler const > unscheduledHandler_
EventSelectionIDVector const & edm::EventPrincipal::eventSelectionIDs ( ) const
EventAuxiliary::ExperimentType edm::EventPrincipal::ExperimentType ( ) const
inline

Definition at line 110 of file EventPrincipal.h.

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

110  {
111  return aux().experimentType();
112  }
ExperimentType experimentType() const
EventAuxiliary const & aux() const
void edm::EventPrincipal::fillEventPrincipal ( EventAuxiliary const &  aux,
ProcessHistoryRegistry const &  processHistoryRegistry,
DelayedReader reader = 0 
)

Definition at line 94 of file EventPrincipal.cc.

References aux(), aux_, branchIDListHelper_, branchIDToProductID(), branchListIndexes_, branchListIndexToProcessIndex_, edm::EventAuxiliary::event(), Exception, edm::Principal::fillPrincipal(), edm::invalidEventNumber, edm::errors::LogicError, edm::Principal::processHistory(), edm::EventAuxiliary::processHistoryID(), edm::Principal::processHistoryID(), parseEventContent::prod, productProvenanceRetrieverPtr(), edm::Principal::reader(), and edm::EventAuxiliary::setProcessHistoryID().

Referenced by fillEventPrincipal(), edm::RawInputSource::makeEvent(), edm::SubProcess::process(), edm::StreamerInputSource::read(), edm::RootFile::readCurrentEvent(), LHESource::readEvent_(), and edm::ProducerSourceBase::readEvent_().

96  {
97  if(aux.event() == invalidEventNumber) {
99  << "EventPrincipal::fillEventPrincipal, Invalid event number provided in EventAuxiliary, It is illegal for the event number to be 0\n";
100  }
101 
102  fillPrincipal(aux.processHistoryID(), processHistoryRegistry, reader);
103  aux_ = aux;
105 
106  if(branchListIndexes_.empty() and branchIDListHelper_->hasProducedProducts()) {
107  // Add index into BranchIDListRegistry for products produced this process
108  // if it hasn't already been filled in by the other fillEventPrincipal or by an earlier call to this function
109  branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex());
110  }
111 
112  // Fill in helper map for Branch to ProductID mapping
113  ProcessIndex pix = 0;
114  for(auto const& blindex : branchListIndexes_) {
115  branchListIndexToProcessIndex_.insert(std::make_pair(blindex, pix));
116  ++pix;
117  }
118 
119  // Fill in the product ID's in the product holders.
120  for(auto& prod : *this) {
121  if (prod->singleProduct()) {
122  // If an alias is in the same process as the original then isAlias will be true.
123  // Under that condition, we want the ProductID to be the same as the original.
124  // If not, then we've internally changed the original BranchID to the alias BranchID
125  // in the ProductID lookup so we need the alias BranchID.
126  auto const & bd =prod->branchDescription();
127  prod->setProvenance(productProvenanceRetrieverPtr(),
128  processHistory(),
129  branchIDToProductID(bd.isAlias()?bd.originalBranchID(): bd.branchID()));
130  }
131  }
132  }
BranchListIndexes branchListIndexes_
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
EventAuxiliary aux_
ProcessHistory const & processHistory() const
Definition: Principal.h:144
ProductID branchIDToProductID(BranchID const &bid) const
EventNumber_t const invalidEventNumber
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:148
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
unsigned short ProcessIndex
Definition: ProductID.h:25
DelayedReader * reader() const
Definition: Principal.h:185
void setProcessHistoryID(ProcessHistoryID const &phid)
ProcessHistoryID const & processHistoryID() const
void fillPrincipal(ProcessHistoryID const &hist, ProcessHistoryRegistry const &phr, DelayedReader *reader)
Definition: Principal.cc:344
EventAuxiliary const & aux() const
EventNumber_t event() const
void edm::EventPrincipal::fillEventPrincipal ( EventAuxiliary const &  aux,
ProcessHistoryRegistry const &  processHistoryRegistry,
EventSelectionIDVector &&  eventSelectionIDs,
BranchListIndexes &&  branchListIndexes 
)

Definition at line 80 of file EventPrincipal.cc.

References branchIDListHelper_, branchListIndexes(), branchListIndexes_, eventSelectionIDs(), eventSelectionIDs_, and fillEventPrincipal().

83  {
86  if(branchIDListHelper_->hasProducedProducts()) {
87  // Add index into BranchIDListRegistry for products produced this process
88  branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex());
89  }
90  fillEventPrincipal(aux,processHistoryRegistry,nullptr);
91  }
EventSelectionIDVector const & eventSelectionIDs() const
EventSelectionIDVector eventSelectionIDs_
BranchListIndexes branchListIndexes_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
BranchListIndexes const & branchListIndexes() const
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
EventAuxiliary const & aux() const
void edm::EventPrincipal::fillEventPrincipal ( EventAuxiliary const &  aux,
ProcessHistoryRegistry const &  processHistoryRegistry,
EventSelectionIDVector &&  eventSelectionIDs,
BranchListIndexes &&  branchListIndexes,
ProductProvenanceRetriever const &  provRetriever,
DelayedReader reader = 0 
)

Definition at line 63 of file EventPrincipal.cc.

References branchIDListHelper_, branchListIndexes(), branchListIndexes_, eventSelectionIDs(), eventSelectionIDs_, fillEventPrincipal(), and provRetrieverPtr_.

68  {
70  provRetrieverPtr_->deepCopy(provRetriever);
72  if(branchIDListHelper_->hasProducedProducts()) {
73  // Add index into BranchIDListRegistry for products produced this process
74  branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex());
75  }
76  fillEventPrincipal(aux,processHistoryRegistry,reader);
77  }
EventSelectionIDVector const & eventSelectionIDs() const
EventSelectionIDVector eventSelectionIDs_
BranchListIndexes branchListIndexes_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
BranchListIndexes const & branchListIndexes() const
DelayedReader * reader() const
Definition: Principal.h:185
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
EventAuxiliary const & aux() const
BasicHandle edm::EventPrincipal::getByProductID ( ProductID const &  oid) const

Definition at line 264 of file EventPrincipal.cc.

References edm::Principal::getProductHolder(), edm::makeHandleExceptionFactory(), pidToBid(), edm::errors::ProductNotFound, mps_update::status, and edm::throwProductDeletedException().

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

264  {
265  BranchID bid = pidToBid(pid);
266  ConstProductHolderPtr const phb = getProductHolder(bid);
267  if(phb == nullptr) {
268  return BasicHandle(makeHandleExceptionFactory([pid]()->std::shared_ptr<cms::Exception> {
269  std::shared_ptr<cms::Exception> whyFailed(std::make_shared<Exception>(errors::ProductNotFound, "InvalidID"));
270  *whyFailed
271  << "get by product ID: no product with given id: " << pid << "\n";
272  return whyFailed;
273  }));
274  }
275 
276  // Was this already deleted?
277  if(phb->productWasDeleted()) {
279  }
280  // Check for case where we tried on demand production and
281  // it failed to produce the object
282  if(phb->onDemand()) {
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
286  << "get by ProductID: could not get product with id: " << pid << "\n"
287  << "Unscheduled execution not allowed to get via ProductID.\n";
288  return whyFailed;
289  }));
290  }
292  phb->resolveProduct(status,*this,false,nullptr,nullptr);
293 
294  return BasicHandle(phb->productData());
295  }
ConstProductHolderPtr getProductHolder(BranchID const &oid) const
Definition: Principal.cc:460
BranchID pidToBid(ProductID const &pid) const
static void throwProductDeletedException(ProductID const &pid, edm::EventPrincipal::ConstProductHolderPtr const phb)
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
tuple pid
Definition: sysUtil.py:22
Base::ConstProductHolderPtr ConstProductHolderPtr
tuple status
Definition: mps_update.py:57
WrapperBase const * edm::EventPrincipal::getIt ( ProductID const &  pid) const
overridevirtual

Reimplemented from edm::Principal.

Definition at line 298 of file EventPrincipal.cc.

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

298  {
299  return getByProductID(pid).wrapper();
300  }
BasicHandle getByProductID(ProductID const &oid) const
WrapperBase const * wrapper() const
Definition: BasicHandle.h:98
tuple pid
Definition: sysUtil.py:22
Provenance edm::EventPrincipal::getProvenance ( ProductID const &  pid,
ModuleCallingContext const *  mcc 
) const

Definition at line 409 of file EventPrincipal.cc.

References pidToBid().

Referenced by edm::Event::getProvenance(), and edm::RootOutputFile::insertAncestors().

409  {
410  BranchID bid = pidToBid(pid);
411  return getProvenance(bid, mcc);
412  }
BranchID pidToBid(ProductID const &pid) const
Provenance getProvenance(ProductID const &pid, ModuleCallingContext const *mcc) const
tuple pid
Definition: sysUtil.py:22
edm::ThinnedAssociation const * edm::EventPrincipal::getThinnedAssociation ( edm::BranchID const &  branchID) const
private

Definition at line 435 of file EventPrincipal.cc.

References compareJSON::const, edm::WrapperBase::dynamicTypeInfo(), Exception, edm::Principal::getProductHolder(), edm::errors::LogicError, edm::Wrapper< T >::product(), mps_update::status, edm::ProductData::wrapper(), and wrapper.

Referenced by getThinnedProduct(), and getThinnedProducts().

435  {
436 
437  ConstProductHolderPtr const phb = getProductHolder(branchID);
438 
439  if(phb == nullptr) {
441  << "EventPrincipal::getThinnedAssociation, ThinnedAssociation ProductHolder cannot be found\n"
442  << "This should never happen. Contact a Framework developer";
443  }
445  ProductData const* productData = phb->resolveProduct(status,*this,false,nullptr,nullptr);
446  if (productData == nullptr) {
447  return nullptr;
448  }
449  WrapperBase const* product = productData->wrapper();
450  if(!(typeid(edm::ThinnedAssociation) == product->dynamicTypeInfo())) {
452  << "EventPrincipal::getThinnedProduct, product has wrong type, not a ThinnedAssociation.\n";
453  }
454  Wrapper<ThinnedAssociation> const* wrapper = static_cast<Wrapper<ThinnedAssociation> const*>(product);
455  return wrapper->product();
456  }
ConstProductHolderPtr getProductHolder(BranchID const &oid) const
Definition: Principal.cc:460
string const
Definition: compareJSON.py:14
Base::ConstProductHolderPtr ConstProductHolderPtr
tuple status
Definition: mps_update.py:57
static HepMC::HEPEVT_Wrapper wrapper
WrapperBase const * edm::EventPrincipal::getThinnedProduct ( ProductID const &  pid,
unsigned int &  key 
) const
overridevirtual

Reimplemented from edm::Principal.

Definition at line 303 of file EventPrincipal.cc.

References getByProductID(), getThinnedAssociation(), edm::ThinnedAssociation::hasParentIndex(), edm::BasicHandle::isValid(), edm::ThinnedAssociation::parentCollectionID(), pidToBid(), thinnedAssociationsHelper_, edm::ThinnedAssociation::thinnedCollectionID(), and edm::BasicHandle::wrapper().

303  {
304 
305  BranchID parent = pidToBid(pid);
306 
307  // Loop over thinned containers which were made by selecting elements from the parent container
308  for(auto associatedBranches = thinnedAssociationsHelper_->parentBegin(parent),
309  iEnd = thinnedAssociationsHelper_->parentEnd(parent);
310  associatedBranches != iEnd; ++associatedBranches) {
311 
312  ThinnedAssociation const* thinnedAssociation =
313  getThinnedAssociation(associatedBranches->association());
314  if(thinnedAssociation == nullptr) continue;
315 
316  if(associatedBranches->parent() != pidToBid(thinnedAssociation->parentCollectionID())) {
317  continue;
318  }
319 
320  unsigned int thinnedIndex = 0;
321  // Does this thinned container have the element referenced by key?
322  // If yes, thinnedIndex is set to point to it in the thinned container
323  if(!thinnedAssociation->hasParentIndex(key, thinnedIndex)) {
324  continue;
325  }
326  // Get the thinned container and return a pointer if we can find it
327  ProductID const& thinnedCollectionPID = thinnedAssociation->thinnedCollectionID();
328  BasicHandle bhThinned = getByProductID(thinnedCollectionPID);
329  if(!bhThinned.isValid()) {
330  // Thinned container is not found, try looking recursively in thinned containers
331  // which were made by selecting elements from this thinned container.
332  WrapperBase const* wrapperBase = getThinnedProduct(thinnedCollectionPID, thinnedIndex);
333  if(wrapperBase != nullptr) {
334  key = thinnedIndex;
335  return wrapperBase;
336  } else {
337  continue;
338  }
339  }
340  key = thinnedIndex;
341  return bhThinned.wrapper();
342  }
343  return nullptr;
344  }
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
BasicHandle getByProductID(ProductID const &oid) const
BranchID pidToBid(ProductID const &pid) const
edm::ThinnedAssociation const * getThinnedAssociation(edm::BranchID const &branchID) const
virtual WrapperBase const * getThinnedProduct(ProductID const &pid, unsigned int &key) const override
ProductID const & thinnedCollectionID() const
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
tuple pid
Definition: sysUtil.py:22
void edm::EventPrincipal::getThinnedProducts ( ProductID const &  pid,
std::vector< WrapperBase const * > &  foundContainers,
std::vector< unsigned int > &  keys 
) const
overridevirtual

Reimplemented from edm::Principal.

Definition at line 347 of file EventPrincipal.cc.

References getByProductID(), getThinnedAssociation(), edm::ThinnedAssociation::hasParentIndex(), edm::BasicHandle::isValid(), relval_2017::k, bookConverter::max, edm::ThinnedAssociation::parentCollectionID(), pidToBid(), thinnedAssociationsHelper_, edm::ThinnedAssociation::thinnedCollectionID(), and edm::BasicHandle::wrapper().

349  {
350 
351  BranchID parent = pidToBid(pid);
352 
353  // Loop over thinned containers which were made by selecting elements from the parent container
354  for(auto associatedBranches = thinnedAssociationsHelper_->parentBegin(parent),
355  iEnd = thinnedAssociationsHelper_->parentEnd(parent);
356  associatedBranches != iEnd; ++associatedBranches) {
357 
358  ThinnedAssociation const* thinnedAssociation =
359  getThinnedAssociation(associatedBranches->association());
360  if(thinnedAssociation == nullptr) continue;
361 
362  if(associatedBranches->parent() != pidToBid(thinnedAssociation->parentCollectionID())) {
363  continue;
364  }
365 
366  unsigned nKeys = keys.size();
367  unsigned int doNotLookForThisIndex = std::numeric_limits<unsigned int>::max();
368  std::vector<unsigned int> thinnedIndexes(nKeys, doNotLookForThisIndex);
369  bool hasAny = false;
370  for(unsigned k = 0; k < nKeys; ++k) {
371  // Already found this one
372  if(foundContainers[k] != nullptr) continue;
373  // Already know this one is not in this thinned container
374  if(keys[k] == doNotLookForThisIndex) continue;
375  // Does the thinned container hold the entry of interest?
376  // Modifies thinnedIndexes[k] only if it returns true and
377  // sets it to the index in the thinned collection.
378  if(thinnedAssociation->hasParentIndex(keys[k], thinnedIndexes[k])) {
379  hasAny = true;
380  }
381  }
382  if(!hasAny) {
383  continue;
384  }
385  // Get the thinned container and set the pointers and indexes into
386  // it (if we can find it)
387  ProductID thinnedCollectionPID = thinnedAssociation->thinnedCollectionID();
388  BasicHandle bhThinned = getByProductID(thinnedCollectionPID);
389  if(!bhThinned.isValid()) {
390  // Thinned container is not found, try looking recursively in thinned containers
391  // which were made by selecting elements from this thinned container.
392  getThinnedProducts(thinnedCollectionPID, foundContainers, thinnedIndexes);
393  for(unsigned k = 0; k < nKeys; ++k) {
394  if(foundContainers[k] == nullptr) continue;
395  if(thinnedIndexes[k] == doNotLookForThisIndex) continue;
396  keys[k] = thinnedIndexes[k];
397  }
398  } else {
399  for(unsigned k = 0; k < nKeys; ++k) {
400  if(thinnedIndexes[k] == doNotLookForThisIndex) continue;
401  keys[k] = thinnedIndexes[k];
402  foundContainers[k] = bhThinned.wrapper();
403  }
404  }
405  }
406  }
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
BasicHandle getByProductID(ProductID const &oid) const
BranchID pidToBid(ProductID const &pid) const
edm::ThinnedAssociation const * getThinnedAssociation(edm::BranchID const &branchID) const
tuple pid
Definition: sysUtil.py:22
virtual void getThinnedProducts(ProductID const &pid, std::vector< WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys) const override
EventID const& edm::EventPrincipal::id ( void  ) const
inline

Definition at line 98 of file EventPrincipal.h.

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

Referenced by edm::DataMixingEcalDigiWorkerProd::addEcalPileups(), edm::DataMixingEMWorker::addEMPileups(), edm::DataMixingEMDigiWorker::addEMPileups(), edm::DataMixingGeneralTrackWorker::addGeneralTrackPileups(), edm::DataMixingHcalWorker::addHcalPileups(), edm::DataMixingHcalDigiWorkerProd::addHcalPileups(), edm::DataMixingHcalDigiWorker::addHcalPileups(), edm::DataMixingMuonWorker::addMuonPileups(), sistrip::SpyEventMatcher::addNextEventToMap(), edm::DataMixingPileupCopy::addPileupInfo(), edm::DataMixingSiPixelWorker::addSiPixelPileups(), edm::DataMixingSiPixelMCDigiWorker::addSiPixelPileups(), edm::DataMixingSiStripWorker::addSiStripPileups(), edm::DataMixingSiStripRawWorker::addSiStripPileups(), edm::DataMixingSiStripMCDigiWorker::addSiStripPileups(), edm::DataMixingTrackingParticleWorker::addTrackingParticlePileups(), edm::EDLooperBase::doDuringLoop(), edm::SecSourceAnalyzer::getBranches(), luminosityBlock(), edm::RecordEventID< T >::operator()(), edm::MixingModule::pileAllWorkers(), edm::DataMixingModule::pileWorker(), edm::InputSource::readEvent(), edm::PoolSource::readEvent_(), edm::StreamSchedule::reportSkipped(), run(), edm::StreamerOutputModuleBase::serializeEvent(), edm::StreamSerializer::serializeEvent(), edm::OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >::setStreamContext(), edm::AsciiOutputModule::write(), edm::GetProductCheckerOutputModule::write(), edm::PoolOutputModule::write(), and edm::RootOutputFile::writeOne().

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

Definition at line 106 of file EventPrincipal.h.

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

106  {
107  return aux().isRealData();
108  }
bool isRealData() const
EventAuxiliary const & aux() const
LuminosityBlockNumber_t edm::EventPrincipal::luminosityBlock ( ) const
inline
LuminosityBlockPrincipal const& edm::EventPrincipal::luminosityBlockPrincipal ( ) const
inline

Definition at line 82 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

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

82  {
84  }
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > luminosityBlockPrincipal_
LuminosityBlockPrincipal& edm::EventPrincipal::luminosityBlockPrincipal ( )
inline

Definition at line 86 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

86  {
88  }
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > luminosityBlockPrincipal_
bool edm::EventPrincipal::luminosityBlockPrincipalPtrValid ( ) const
inline

Definition at line 90 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

90  {
91  return (luminosityBlockPrincipal_) ? true : false;
92  }
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > luminosityBlockPrincipal_
void edm::EventPrincipal::mergeProvenanceRetrievers ( EventPrincipal other)
inline

Definition at line 171 of file EventPrincipal.h.

References provRetrieverPtr(), and provRetrieverPtr_.

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

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

Definition at line 216 of file EventPrincipal.cc.

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

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

216  {
217  if(!pid.isValid()) {
218  throw Exception(errors::ProductNotFound, "InvalidID")
219  << "get by product ID: invalid ProductID supplied\n";
220  }
222  }
BranchListIndexes branchListIndexes_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
BranchID productIDToBranchID(ProductID const &pid, BranchIDLists const &lists, BranchListIndexes const &indexes)
tuple pid
Definition: sysUtil.py:22
ProductProvenanceRetriever const* edm::EventPrincipal::productProvenanceRetrieverPtr ( ) const
inline

Definition at line 138 of file EventPrincipal.h.

References provRetrieverPtr_.

Referenced by fillEventPrincipal(), edm::RootOutputFile::insertAncestors(), edm::SubProcess::process(), put(), putOnRead(), and edm::ProvenanceCheckerOutputModule::write().

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

Definition at line 195 of file EventPrincipal.h.

References edm::get_underlying_safe(), and provRetrieverPtr_.

Referenced by mergeProvenanceRetrievers().

edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::shared_ptr<ProductProvenanceRetriever>& edm::EventPrincipal::provRetrieverPtr ( )
inlineprivate

Definition at line 196 of file EventPrincipal.h.

References edm::get_underlying_safe(), and provRetrieverPtr_.

edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
void edm::EventPrincipal::put ( BranchDescription const &  bd,
std::unique_ptr< WrapperBase edp,
ProductProvenance const &  productProvenance 
) const

Definition at line 153 of file EventPrincipal.cc.

References assert(), edm::BranchDescription::branchID(), edm::Principal::checkUniquenessAndType(), Exception, edm::Principal::getExistingProduct(), edm::errors::InsertFailure, edm::ProductProvenanceRetriever::insertIntoSet(), eostools::move(), and productProvenanceRetrieverPtr().

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

156  {
157 
158  // assert commented out for DaqSource. When DaqSource no longer uses put(), the assert can be restored.
159  //assert(produced());
160  if(edp.get() == nullptr) {
161  throw Exception(errors::InsertFailure, "Null Pointer")
162  << "put: Cannot put because ptr to product is null."
163  << "\n";
164  }
165  productProvenanceRetrieverPtr()->insertIntoSet(productProvenance);
166  auto phb = getExistingProduct(bd.branchID());
167  assert(phb);
168  checkUniquenessAndType(edp.get(), phb);
169  // ProductHolder assumes ownership
170  phb->putProduct(std::move(edp), productProvenance);
171  }
assert(m_qm.get())
void checkUniquenessAndType(WrapperBase const *prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:843
def move
Definition: eostools.py:510
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
ProductHolderBase * getExistingProduct(BranchID const &branchID)
Definition: Principal.cc:400
void insertIntoSet(ProductProvenance const &provenanceProduct) const
void edm::EventPrincipal::putOnRead ( BranchDescription const &  bd,
std::unique_ptr< WrapperBase edp,
ProductProvenance const &  productProvenance 
) const

Definition at line 174 of file EventPrincipal.cc.

References assert(), edm::BranchDescription::branchID(), edm::Principal::checkUniquenessAndType(), edm::Principal::getExistingProduct(), edm::ProductProvenanceRetriever::insertIntoSet(), eostools::move(), edm::BranchDescription::produced(), and productProvenanceRetrieverPtr().

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

177  {
178 
179  assert(!bd.produced());
180  productProvenanceRetrieverPtr()->insertIntoSet(productProvenance);
181  auto phb = getExistingProduct(bd.branchID());
182  assert(phb);
183  checkUniquenessAndType(edp.get(), phb);
184  // ProductHolder assumes ownership
185  phb->putProduct(std::move(edp), productProvenance);
186  }
assert(m_qm.get())
void checkUniquenessAndType(WrapperBase const *prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:843
def move
Definition: eostools.py:510
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
ProductHolderBase * getExistingProduct(BranchID const &branchID)
Definition: Principal.cc:400
void insertIntoSet(ProductProvenance const &provenanceProduct) const
void edm::EventPrincipal::readFromSource_ ( ProductHolderBase const &  phb,
ModuleCallingContext const *  mcc 
) const
overrideprivatevirtual

Reimplemented from edm::Principal.

Definition at line 189 of file EventPrincipal.cc.

References edm::ProductHolderBase::branchDescription(), edm::Principal::checkUniquenessAndType(), edm::signalslot::Signal< T >::emit(), edm::getProduct(), edm::ModuleCallingContext::getStreamContext(), eostools::move(), postModuleDelayedGetSignal_, preModuleDelayedGetSignal_, edm::BranchDescription::produced(), edm::ProductHolderBase::product(), edm::ProductHolderBase::productUnavailable(), edm::ProductHolderBase::putProduct(), and edm::Principal::reader().

189  {
190  if(phb.branchDescription().produced()) return; // nothing to do.
191  if(phb.product()) return; // nothing to do.
192  if(phb.productUnavailable()) return; // nothing to do.
193  if(!reader()) return; // nothing to do.
194 
195  // must attempt to load from persistent store
196  BranchKey const bk = BranchKey(phb.branchDescription());
197  {
198  if(mcc) {
199  preModuleDelayedGetSignal_.emit(*(mcc->getStreamContext()),*mcc);
200  }
201  std::shared_ptr<void> guard(nullptr,[this,mcc](const void*){
202  if(mcc) {
203  postModuleDelayedGetSignal_.emit(*(mcc->getStreamContext()),*mcc);
204  }
205  });
206 
207  std::unique_ptr<WrapperBase> edp(reader()->getProduct(bk, this));
208 
209  // Now fix up the ProductHolder
210  checkUniquenessAndType(edp.get(), &phb);
211  phb.putProduct(std::move(edp));
212  }
213  }
T const * getProduct(RefCore const &ref)
Definition: RefCoreGet.h:41
void checkUniquenessAndType(WrapperBase const *prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:843
def move
Definition: eostools.py:510
DelayedReader * reader() const
Definition: Principal.h:185
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> preModuleDelayedGetSignal_
void emit(Args &&...args) const
Definition: Signal.h:47
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> postModuleDelayedGetSignal_
RunNumber_t edm::EventPrincipal::run ( void  ) const
inline

Definition at line 132 of file EventPrincipal.h.

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

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

132  {
133  return id().run();
134  }
RunNumber_t run() const
Definition: EventID.h:39
EventID const & id() const
RunPrincipal const & edm::EventPrincipal::runPrincipal ( ) const

Definition at line 148 of file EventPrincipal.cc.

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

148  {
150  }
RunPrincipal const & runPrincipal() const
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
void edm::EventPrincipal::setLuminosityBlockPrincipal ( std::shared_ptr< LuminosityBlockPrincipal > const &  lbp)

Definition at line 135 of file EventPrincipal.cc.

References luminosityBlockPrincipal_.

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

135  {
137  }
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > luminosityBlockPrincipal_
void edm::EventPrincipal::setRunAndLumiNumber ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 140 of file EventPrincipal.cc.

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

140  {
142  assert(lumi == luminosityBlockPrincipal_->luminosityBlock());
143  EventNumber_t event = aux_.id().event();
144  aux_.id() = EventID(run, lumi, event);
145  }
EventNumber_t event() const
Definition: EventID.h:41
RunNumber_t run() const
tuple lumi
Definition: fjr2json.py:35
assert(m_qm.get())
unsigned long long EventNumber_t
EventAuxiliary aux_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > luminosityBlockPrincipal_
EventID const & id() const
void edm::EventPrincipal::setUnscheduledHandler ( std::shared_ptr< UnscheduledHandler iHandler)

Definition at line 415 of file EventPrincipal.cc.

References unscheduledHandler_.

Referenced by edm::WorkerManager::setupOnDemandSystem().

415  {
416  unscheduledHandler_ = iHandler;
417  }
std::shared_ptr< UnscheduledHandler const > unscheduledHandler_
int edm::EventPrincipal::storeNumber ( ) const
inline

Definition at line 118 of file EventPrincipal.h.

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

118  {
119  return aux().storeNumber();
120  }
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 249 of file EventPrincipal.cc.

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

249  {
250  return streamID_.value();
251  }
unsigned int value() const
Definition: StreamID.h:46
bool edm::EventPrincipal::unscheduledFill ( std::string const &  moduleLabel,
SharedResourcesAcquirer sra,
ModuleCallingContext const *  mcc 
) const
overrideprivatevirtual

Implements edm::Principal.

Definition at line 459 of file EventPrincipal.cc.

References edm::signalslot::Signal< T >::emit(), Exception, edm::ModuleCallingContext::getStreamContext(), edm::errors::LogicError, postModuleDelayedGetSignal_, preModuleDelayedGetSignal_, edm::SharedResourcesAcquirer::temporaryUnlock(), and unscheduledHandler_.

461  {
462  if(unscheduledHandler_) {
463  if(mcc == nullptr) {
465  << "EventPrincipal::unscheduledFill, Attempting to run unscheduled production\n"
466  << "with a null pointer to the ModuleCalling Context. This should never happen.\n"
467  << "Contact a Framework developer";
468  }
469  preModuleDelayedGetSignal_.emit(*(mcc->getStreamContext()),*mcc);
470  std::shared_ptr<void> guard(nullptr,[this,mcc](const void*){
471  postModuleDelayedGetSignal_.emit(*(mcc->getStreamContext()),*mcc);
472  });
473  auto handlerCall = [this,&moduleLabel,&mcc]() {
474  unscheduledHandler_->tryToFill(moduleLabel, *this, mcc);
475  };
476  if (sra) {
477  sra->temporaryUnlock(handlerCall);
478  } else {
479  handlerCall();
480  }
481  }
482  return true;
483  }
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> preModuleDelayedGetSignal_
void emit(Args &&...args) const
Definition: Signal.h:47
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> postModuleDelayedGetSignal_
std::shared_ptr< UnscheduledHandler const > unscheduledHandler_
std::shared_ptr< const UnscheduledHandler > edm::EventPrincipal::unscheduledHandler ( ) const

Definition at line 420 of file EventPrincipal.cc.

References unscheduledHandler_.

Referenced by edm::getUnscheduledHandler().

420  {
421  return unscheduledHandler_;
422  }
std::shared_ptr< UnscheduledHandler const > unscheduledHandler_

Member Data Documentation

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

Definition at line 212 of file EventPrincipal.h.

Referenced by branchIDToProductID(), fillEventPrincipal(), and pidToBid().

BranchListIndexes edm::EventPrincipal::branchListIndexes_
private

Definition at line 215 of file EventPrincipal.h.

Referenced by branchListIndexes(), fillEventPrincipal(), and pidToBid().

std::map<BranchListIndex, ProcessIndex> edm::EventPrincipal::branchListIndexToProcessIndex_
private

Definition at line 217 of file EventPrincipal.h.

Referenced by branchIDToProductID(), clearEventPrincipal(), and fillEventPrincipal().

EventSelectionIDVector edm::EventPrincipal::eventSelectionIDs_
private

Definition at line 210 of file EventPrincipal.h.

Referenced by eventSelectionIDs(), and fillEventPrincipal().

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

Definition at line 53 of file EventPrincipal.h.

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

Definition at line 54 of file EventPrincipal.h.

edm::propagate_const<std::shared_ptr<LuminosityBlockPrincipal> > edm::EventPrincipal::luminosityBlockPrincipal_
private
signalslot::Signal<void(StreamContext const&, ModuleCallingContext const&)> edm::EventPrincipal::postModuleDelayedGetSignal_

Definition at line 178 of file EventPrincipal.h.

Referenced by readFromSource_(), and unscheduledFill().

signalslot::Signal<void(StreamContext const&, ModuleCallingContext const&)> edm::EventPrincipal::preModuleDelayedGetSignal_

Definition at line 177 of file EventPrincipal.h.

Referenced by readFromSource_(), and unscheduledFill().

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

Definition at line 219 of file EventPrincipal.h.

Referenced by streamID(), and transitionIndex_().

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

Definition at line 213 of file EventPrincipal.h.

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

std::shared_ptr<UnscheduledHandler const> edm::EventPrincipal::unscheduledHandler_
private