CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | 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

Classes

class  UnscheduledSentry
 

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 std::string ProcessName
 
typedef
ProcessHistory::const_iterator 
ProcessNameConstIterator
 
typedef std::vector
< 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, 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=nullptr)
 
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 &provRetriever, DelayedReader *reader=nullptr)
 
BasicHandle getByProductID (ProductID const &oid) const
 
WrapperBase const * getIt (ProductID const &pid) const
 
Provenance getProvenance (ProductID const &pid, ModuleCallingContext const *mcc) const
 
EventID const & id () const
 
bool isReal () const
 
LuminosityBlockNumber_t luminosityBlock () const
 
LuminosityBlockPrincipal const & luminosityBlockPrincipal () const
 
LuminosityBlockPrincipalluminosityBlockPrincipal ()
 
bool luminosityBlockPrincipalPtrValid ()
 
void mergeProvenanceRetrievers (EventPrincipal const &other)
 
std::shared_ptr
< ProductProvenanceRetriever
productProvenanceRetrieverPtr () const
 
void put (BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance)
 
void putOnRead (BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance)
 
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
< 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
 
BranchType const & branchType () const
 
CacheIdentifier_t cacheIdentifier () const
 
void clearPrincipal ()
 
void deleteProduct (BranchID const &id)
 
const_iterator end () const
 
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, 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, ModuleCallingContext const *mcc) const
 
BasicHandle getByToken (KindOfType kindOfType, TypeID const &typeID, ProductHolderIndex index, bool skipCurrentProcess, bool &ambiguous, 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, ModuleCallingContext const *mcc) const
 
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
 
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 ()
 
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

BranchID pidToBid (ProductID const &pid) const
 
virtual void readFromSource_ (ProductHolderBase const &phb, ModuleCallingContext const *mcc) const override
 
virtual unsigned int transitionIndex_ () const override
 
virtual bool unscheduledFill (std::string const &moduleLabel, ModuleCallingContext const *mcc) const override
 

Private Attributes

EventAuxiliary aux_
 
std::shared_ptr
< BranchIDListHelper const > 
branchIDListHelper_
 
BranchListIndexes branchListIndexes_
 
std::map< BranchListIndex,
ProcessIndex
branchListIndexToProcessIndex_
 
EventSelectionIDVector eventSelectionIDs_
 
std::shared_ptr
< LuminosityBlockPrincipal
luminosityBlockPrincipal_
 
std::vector< std::string > moduleLabelsRunning_
 
std::shared_ptr
< ProductProvenanceRetriever
provRetrieverPtr_
 
StreamID streamID_
 
std::shared_ptr
< UnscheduledHandler
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::auto_ptr< ProductHolderBase > phb)
 
void addProductOrThrow (std::auto_ptr< ProductHolderBase > phb)
 
void checkUniquenessAndType (WrapperBase const *prod, ProductHolderBase const *productHolder) const
 
ProductHolderBasegetExistingProduct (BranchID const &branchID)
 
ProductHolderBasegetExistingProduct (ProductHolderBase const &phb)
 
void putOrMerge (std::unique_ptr< WrapperBase > prod, ProductHolderBase const *productHolder) const
 
void putOrMerge (std::unique_ptr< WrapperBase > prod, ProductProvenance &prov, ProductHolderBase *productHolder)
 

Detailed Description

Definition at line 42 of file EventPrincipal.h.

Member Typedef Documentation

Definition at line 44 of file EventPrincipal.h.

Definition at line 45 of file EventPrincipal.h.

Definition at line 47 of file EventPrincipal.h.

Constructor & Destructor Documentation

edm::EventPrincipal::EventPrincipal ( std::shared_ptr< ProductRegistry const >  reg,
std::shared_ptr< BranchIDListHelper const >  branchIDListHelper,
ProcessConfiguration const &  pc,
HistoryAppender historyAppender,
unsigned int  streamIndex = 0 
)

Definition at line 25 of file EventPrincipal.cc.

30  :
31  Base(reg, reg->productLookup(InEvent), pc, InEvent, historyAppender),
32  aux_(),
34  provRetrieverPtr_(new ProductProvenanceRetriever(streamIndex)),
38  branchIDListHelper_(branchIDListHelper),
41  streamID_(streamIndex){}
std::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
std::shared_ptr< UnscheduledHandler > unscheduledHandler_
EventSelectionIDVector eventSelectionIDs_
BranchListIndexes branchListIndexes_
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
EventAuxiliary aux_
std::shared_ptr< ProductProvenanceRetriever > provRetrieverPtr_
std::vector< std::string > moduleLabelsRunning_
edm::EventPrincipal::~EventPrincipal ( )
inline

Definition at line 56 of file EventPrincipal.h.

56 {}

Member Function Documentation

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

Definition at line 210 of file EventPrincipal.cc.

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

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

210  {
211  if(!bid.isValid()) {
212  throw Exception(errors::NotFound, "InvalidID")
213  << "branchIDToProductID: invalid BranchID supplied\n";
214  }
215  typedef BranchIDListHelper::BranchIDToIndexMap BIDToIndexMap;
216  typedef BIDToIndexMap::const_iterator Iter;
217  typedef std::pair<Iter, Iter> IndexRange;
218 
219  IndexRange range = branchIDListHelper_->branchIDToIndexMap().equal_range(bid);
220  for(Iter it = range.first; it != range.second; ++it) {
221  BranchListIndex blix = it->second.first;
222  std::map<BranchListIndex, ProcessIndex>::const_iterator i = branchListIndexToProcessIndex_.find(blix);
223  if(i != branchListIndexToProcessIndex_.end()) {
224  ProductIndex productIndex = it->second.second;
225  ProcessIndex processIndex = i->second;
226  return ProductID(processIndex+1, productIndex+1);
227  }
228  }
229  // cannot throw, because some products may legitimately not have product ID's (e.g. pile-up).
230  return ProductID();
231  }
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 108 of file EventPrincipal.h.

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

108  {
109  return aux().bunchCrossing();
110  }
int bunchCrossing() const
EventAuxiliary const & aux() const
void edm::EventPrincipal::clearEventPrincipal ( )

Definition at line 44 of file EventPrincipal.cc.

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

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

44  {
46  aux_ = EventAuxiliary();
48  provRetrieverPtr_->reset();
49  unscheduledHandler_.reset();
50  moduleLabelsRunning_.clear();
52  }
void clearPrincipal()
Definition: Principal.cc:304
std::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
std::shared_ptr< UnscheduledHandler > unscheduledHandler_
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
EventAuxiliary aux_
std::shared_ptr< ProductProvenanceRetriever > provRetrieverPtr_
std::vector< std::string > moduleLabelsRunning_
EventSelectionIDVector const & edm::EventPrincipal::eventSelectionIDs ( ) const
EventAuxiliary::ExperimentType edm::EventPrincipal::ExperimentType ( ) const
inline

Definition at line 104 of file EventPrincipal.h.

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

104  {
105  return aux().experimentType();
106  }
ExperimentType experimentType() const
EventAuxiliary const & aux() const
void edm::EventPrincipal::fillEventPrincipal ( EventAuxiliary const &  aux,
ProcessHistoryRegistry const &  processHistoryRegistry,
DelayedReader reader = nullptr 
)

Definition at line 86 of file EventPrincipal.cc.

References aux(), aux_, branchIDListHelper_, branchIDToProductID(), branchListIndexes_, branchListIndexToProcessIndex_, edm::EventAuxiliary::event(), edm::hlt::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_().

88  {
89  if(aux.event() == invalidEventNumber) {
91  << "EventPrincipal::fillEventPrincipal, Invalid event number provided in EventAuxiliary, It is illegal for the event number to be 0\n";
92  }
93 
94  fillPrincipal(aux.processHistoryID(), processHistoryRegistry, reader);
95  aux_ = aux;
97 
98  if(branchListIndexes_.empty() and branchIDListHelper_->hasProducedProducts()) {
99  // Add index into BranchIDListRegistry for products produced this process
100  // if it hasn't already been filled in by the other fillEventPrincipal or by an earlier call to this function
101  branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex());
102  }
103 
104  // Fill in helper map for Branch to ProductID mapping
105  ProcessIndex pix = 0;
106  for(auto const& blindex : branchListIndexes_) {
107  branchListIndexToProcessIndex_.insert(std::make_pair(blindex, pix));
108  ++pix;
109  }
110 
111  // Fill in the product ID's in the product holders.
112  for(auto const& prod : *this) {
113  if (prod->singleProduct()) {
114  prod->setProvenance(productProvenanceRetrieverPtr(), processHistory(), branchIDToProductID(prod->branchDescription().branchID()));
115  }
116  }
117  }
BranchListIndexes branchListIndexes_
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
EventAuxiliary aux_
ProcessHistory const & processHistory() const
Definition: Principal.h:137
ProductID branchIDToProductID(BranchID const &bid) const
EventNumber_t const invalidEventNumber
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:141
std::shared_ptr< ProductProvenanceRetriever > productProvenanceRetrieverPtr() const
unsigned short ProcessIndex
Definition: ProductID.h:25
DelayedReader * reader() const
Definition: Principal.h:171
void setProcessHistoryID(ProcessHistoryID const &phid)
ProcessHistoryID const & processHistoryID() const
void fillPrincipal(ProcessHistoryID const &hist, ProcessHistoryRegistry const &phr, DelayedReader *reader)
Definition: Principal.cc:327
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 72 of file EventPrincipal.cc.

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

75  {
78  if(branchIDListHelper_->hasProducedProducts()) {
79  // Add index into BranchIDListRegistry for products produced this process
80  branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex());
81  }
82  fillEventPrincipal(aux,processHistoryRegistry,nullptr);
83  }
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=nullptr)
EventAuxiliary const & aux() const
void edm::EventPrincipal::fillEventPrincipal ( EventAuxiliary const &  aux,
ProcessHistoryRegistry const &  processHistoryRegistry,
EventSelectionIDVector &&  eventSelectionIDs,
BranchListIndexes &&  branchListIndexes,
ProductProvenanceRetriever provRetriever,
DelayedReader reader = nullptr 
)

Definition at line 55 of file EventPrincipal.cc.

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

60  {
62  provRetrieverPtr_->deepSwap(provRetriever);
64  if(branchIDListHelper_->hasProducedProducts()) {
65  // Add index into BranchIDListRegistry for products produced this process
66  branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex());
67  }
68  fillEventPrincipal(aux,processHistoryRegistry,reader);
69  }
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=nullptr)
DelayedReader * reader() const
Definition: Principal.h:171
std::shared_ptr< ProductProvenanceRetriever > provRetrieverPtr_
EventAuxiliary const & aux() const
BasicHandle edm::EventPrincipal::getByProductID ( ProductID const &  oid) const

Definition at line 249 of file EventPrincipal.cc.

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

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

249  {
250  BranchID bid = pidToBid(pid);
251  ConstProductHolderPtr const phb = getProductHolder(bid);
252  if(phb == nullptr) {
253  return BasicHandle(makeHandleExceptionFactory([pid]()->std::shared_ptr<cms::Exception> {
254  std::shared_ptr<cms::Exception> whyFailed(std::make_shared<Exception>(errors::ProductNotFound, "InvalidID"));
255  *whyFailed
256  << "get by product ID: no product with given id: " << pid << "\n";
257  return whyFailed;
258  }));
259  }
260 
261  // Was this already deleted?
262  if(phb->productWasDeleted()) {
264  }
265  // Check for case where we tried on demand production and
266  // it failed to produce the object
267  if(phb->onDemand()) {
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 ProductID: could not get product with id: " << pid << "\n"
272  << "Unscheduled execution not allowed to get via ProductID.\n";
273  return whyFailed;
274  }));
275  }
277  phb->resolveProduct(status,false,nullptr);
278 
279  return BasicHandle(phb->productData());
280  }
ConstProductHolderPtr getProductHolder(BranchID const &oid) const
Definition: Principal.cc:429
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: ntuplemaker.py:245
WrapperBase const * edm::EventPrincipal::getIt ( ProductID const &  pid) const
virtual

Reimplemented from edm::Principal.

Definition at line 283 of file EventPrincipal.cc.

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

283  {
284  return getByProductID(pid).wrapper();
285  }
BasicHandle getByProductID(ProductID const &oid) const
WrapperBase const * wrapper() const
Definition: BasicHandle.h:99
tuple pid
Definition: sysUtil.py:22
Provenance edm::EventPrincipal::getProvenance ( ProductID const &  pid,
ModuleCallingContext const *  mcc 
) const

Definition at line 288 of file EventPrincipal.cc.

References pidToBid().

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

288  {
289  BranchID bid = pidToBid(pid);
290  return getProvenance(bid, mcc);
291  }
BranchID pidToBid(ProductID const &pid) const
Provenance getProvenance(ProductID const &pid, ModuleCallingContext const *mcc) const
tuple pid
Definition: sysUtil.py:22
EventID const& edm::EventPrincipal::id ( void  ) const
inline

Definition at line 92 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(), edm::DataMixingPileupCopy::addPileupInfo(), edm::DataMixingSiPixelWorker::addSiPixelPileups(), edm::DataMixingSiStripWorker::addSiStripPileups(), edm::DataMixingSiStripRawWorker::addSiStripPileups(), edm::DataMixingSiStripMCDigiWorker::addSiStripPileups(), 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(), FRDEventOutputModule< Consumer >::write(), edm::GetProductCheckerOutputModule::write(), edm::PoolOutputModule::write(), and edm::RootOutputFile::writeOne().

92  {
93  return aux().id();
94  }
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  {
101  return aux().isRealData();
102  }
bool isRealData() const
EventAuxiliary const & aux() const
LuminosityBlockNumber_t edm::EventPrincipal::luminosityBlock ( ) const
inline
LuminosityBlockPrincipal const& edm::EventPrincipal::luminosityBlockPrincipal ( ) const
inline

Definition at line 76 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

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

76  {
78  }
std::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
LuminosityBlockPrincipal& edm::EventPrincipal::luminosityBlockPrincipal ( )
inline

Definition at line 80 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

80  {
82  }
std::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
bool edm::EventPrincipal::luminosityBlockPrincipalPtrValid ( )
inline

Definition at line 84 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

84  {
85  return (luminosityBlockPrincipal_) ? true : false;
86  }
std::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
void edm::EventPrincipal::mergeProvenanceRetrievers ( EventPrincipal const &  other)
inline

Definition at line 161 of file EventPrincipal.h.

References productProvenanceRetrieverPtr(), and provRetrieverPtr_.

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

161  {
162  provRetrieverPtr_->mergeProvenanceRetrievers(other.productProvenanceRetrieverPtr());
163  }
std::shared_ptr< ProductProvenanceRetriever > provRetrieverPtr_
BranchID edm::EventPrincipal::pidToBid ( ProductID const &  pid) const
private

Definition at line 201 of file EventPrincipal.cc.

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

Referenced by getByProductID(), and getProvenance().

201  {
202  if(!pid.isValid()) {
203  throw Exception(errors::ProductNotFound, "InvalidID")
204  << "get by product ID: invalid ProductID supplied\n";
205  }
207  }
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
std::shared_ptr<ProductProvenanceRetriever> edm::EventPrincipal::productProvenanceRetrieverPtr ( ) const
inline
void edm::EventPrincipal::put ( BranchDescription const &  bd,
std::unique_ptr< WrapperBase edp,
ProductProvenance const &  productProvenance 
)

Definition at line 138 of file EventPrincipal.cc.

References edm::BranchDescription::branchID(), edm::Principal::checkUniquenessAndType(), edm::hlt::Exception, edm::Principal::getExistingProduct(), edm::errors::InsertFailure, productProvenanceRetrieverPtr(), and edm::ProductHolderBase::putProduct().

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

141  {
142 
143  // assert commented out for DaqSource. When DaqSource no longer uses put(), the assert can be restored.
144  //assert(produced());
145  if(edp.get() == nullptr) {
146  throw Exception(errors::InsertFailure, "Null Pointer")
147  << "put: Cannot put because ptr to product is null."
148  << "\n";
149  }
150  productProvenanceRetrieverPtr()->insertIntoSet(productProvenance);
151  ProductHolderBase* phb = getExistingProduct(bd.branchID());
152  assert(phb);
153  checkUniquenessAndType(edp.get(), phb);
154  // ProductHolder assumes ownership
155  phb->putProduct(std::move(edp), productProvenance);
156  }
std::shared_ptr< ProductProvenanceRetriever > productProvenanceRetrieverPtr() const
void checkUniquenessAndType(WrapperBase const *prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:792
ProductHolderBase * getExistingProduct(BranchID const &branchID)
Definition: Principal.cc:383
void edm::EventPrincipal::putOnRead ( BranchDescription const &  bd,
std::unique_ptr< WrapperBase edp,
ProductProvenance const &  productProvenance 
)

Definition at line 159 of file EventPrincipal.cc.

References edm::BranchDescription::branchID(), edm::Principal::checkUniquenessAndType(), edm::Principal::getExistingProduct(), edm::BranchDescription::produced(), productProvenanceRetrieverPtr(), and edm::ProductHolderBase::putProduct().

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

162  {
163 
164  assert(!bd.produced());
165  productProvenanceRetrieverPtr()->insertIntoSet(productProvenance);
166  ProductHolderBase* phb = getExistingProduct(bd.branchID());
167  assert(phb);
168  checkUniquenessAndType(edp.get(), phb);
169  // ProductHolder assumes ownership
170  phb->putProduct(std::move(edp), productProvenance);
171  }
std::shared_ptr< ProductProvenanceRetriever > productProvenanceRetrieverPtr() const
void checkUniquenessAndType(WrapperBase const *prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:792
ProductHolderBase * getExistingProduct(BranchID const &branchID)
Definition: Principal.cc:383
void edm::EventPrincipal::readFromSource_ ( ProductHolderBase const &  phb,
ModuleCallingContext const *  mcc 
) const
overrideprivatevirtual

Reimplemented from edm::Principal.

Definition at line 174 of file EventPrincipal.cc.

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

174  {
175  if(phb.branchDescription().produced()) return; // nothing to do.
176  if(phb.product()) return; // nothing to do.
177  if(phb.productUnavailable()) return; // nothing to do.
178  if(!reader()) return; // nothing to do.
179 
180  // must attempt to load from persistent store
181  BranchKey const bk = BranchKey(phb.branchDescription());
182  {
183  if(mcc) {
184  preModuleDelayedGetSignal_.emit(*(mcc->getStreamContext()),*mcc);
185  }
186  std::shared_ptr<void> guard(nullptr,[this,mcc](const void*){
187  if(mcc) {
188  postModuleDelayedGetSignal_.emit(*(mcc->getStreamContext()),*mcc);
189  }
190  });
191 
192  std::unique_ptr<WrapperBase> edp(reader()->getProduct(bk, this));
193 
194  // Now fix up the ProductHolder
195  checkUniquenessAndType(edp.get(), &phb);
196  phb.putProduct(std::move(edp));
197  }
198  }
void checkUniquenessAndType(WrapperBase const *prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:792
T const * getProduct(RefCore const &ref)
Definition: RefCoreGet.h:36
DelayedReader * reader() const
Definition: Principal.h:171
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 126 of file EventPrincipal.h.

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

Referenced by Types.EventID::cppID(), Types.LuminosityBlockID::cppID(), edm::PoolSource::readEvent_(), and FRDEventOutputModule< Consumer >::write().

126  {
127  return id().run();
128  }
RunNumber_t run() const
Definition: EventID.h:39
EventID const & id() const
RunPrincipal const & edm::EventPrincipal::runPrincipal ( ) const

Definition at line 133 of file EventPrincipal.cc.

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

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

Definition at line 120 of file EventPrincipal.cc.

References luminosityBlockPrincipal_.

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

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

Definition at line 125 of file EventPrincipal.cc.

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

125  {
126  assert(run == luminosityBlockPrincipal_->run());
127  assert(lumi == luminosityBlockPrincipal_->luminosityBlock());
128  EventNumber_t event = aux_.id().event();
129  aux_.id() = EventID(run, lumi, event);
130  }
EventNumber_t event() const
Definition: EventID.h:41
std::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
RunNumber_t run() const
unsigned int EventNumber_t
Definition: EventRange.h:30
tuple lumi
Definition: fjr2json.py:35
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
EventID const & id() const
void edm::EventPrincipal::setUnscheduledHandler ( std::shared_ptr< UnscheduledHandler iHandler)

Definition at line 294 of file EventPrincipal.cc.

References unscheduledHandler_.

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

294  {
295  unscheduledHandler_ = iHandler;
296  }
std::shared_ptr< UnscheduledHandler > unscheduledHandler_
int edm::EventPrincipal::storeNumber ( ) const
inline

Definition at line 112 of file EventPrincipal.h.

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

112  {
113  return aux().storeNumber();
114  }
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 234 of file EventPrincipal.cc.

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

234  {
235  return streamID_.value();
236  }
unsigned int value() const
Definition: StreamID.h:46
bool edm::EventPrincipal::unscheduledFill ( std::string const &  moduleLabel,
ModuleCallingContext const *  mcc 
) const
overrideprivatevirtual

Implements edm::Principal.

Definition at line 314 of file EventPrincipal.cc.

References edm::signalslot::Signal< T >::emit(), edm::hlt::Exception, edm::find_in_all(), edm::ModuleCallingContext::getStreamContext(), i, edm::errors::LogicError, moduleLabelsRunning_, postModuleDelayedGetSignal_, preModuleDelayedGetSignal_, and unscheduledHandler_.

315  {
316 
317  // If it is a module already currently running in unscheduled
318  // mode, then there is a circular dependency related to which
319  // EDProducts modules require and produce. There is no safe way
320  // to recover from this. Here we check for this problem and throw
321  // an exception.
322  std::vector<std::string>::const_iterator i =
323  find_in_all(moduleLabelsRunning_, moduleLabel);
324 
325  if(i != moduleLabelsRunning_.end()) {
327  << "Hit circular dependency while trying to run an unscheduled module.\n"
328  << "The last module on the stack shown above requested data from the\n"
329  << "module with label: '" << moduleLabel << "'.\n"
330  << "This is illegal because this module is already running (it is in the\n"
331  << "stack shown above, it might or might not be asking for data from itself).\n"
332  << "More information related to resolving circular dependences can be found here:\n"
333  << "https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideUnscheduledExecution#Circular_Dependence_Errors.";
334  }
335 
336  UnscheduledSentry sentry(&moduleLabelsRunning_, moduleLabel);
337 
338  if(unscheduledHandler_) {
339  if(mcc == nullptr) {
341  << "EventPrincipal::unscheduledFill, Attempting to run unscheduled production\n"
342  << "with a null pointer to the ModuleCalling Context. This should never happen.\n"
343  << "Contact a Framework developer";
344  }
345  preModuleDelayedGetSignal_.emit(*(mcc->getStreamContext()),*mcc);
346  std::shared_ptr<void> guard(nullptr,[this,mcc](const void*){
347  postModuleDelayedGetSignal_.emit(*(mcc->getStreamContext()),*mcc);
348  });
349  unscheduledHandler_->tryToFill(moduleLabel, *const_cast<EventPrincipal*>(this), mcc);
350  }
351  return true;
352  }
int i
Definition: DBlmapReader.cc:9
std::shared_ptr< UnscheduledHandler > unscheduledHandler_
ForwardSequence::const_iterator find_in_all(ForwardSequence const &s, Datum const &d)
wrappers for std::find
Definition: Algorithms.h:32
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> preModuleDelayedGetSignal_
void emit(Args &&...args) const
Definition: Signal.h:47
std::vector< std::string > moduleLabelsRunning_
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> postModuleDelayedGetSignal_
std::shared_ptr< UnscheduledHandler > edm::EventPrincipal::unscheduledHandler ( ) const

Definition at line 299 of file EventPrincipal.cc.

References unscheduledHandler_.

Referenced by edm::getUnscheduledHandler().

299  {
300  return unscheduledHandler_;
301  }
std::shared_ptr< UnscheduledHandler > unscheduledHandler_

Member Data Documentation

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

Definition at line 211 of file EventPrincipal.h.

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

BranchListIndexes edm::EventPrincipal::branchListIndexes_
private

Definition at line 213 of file EventPrincipal.h.

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

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

Definition at line 215 of file EventPrincipal.h.

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

EventSelectionIDVector edm::EventPrincipal::eventSelectionIDs_
private

Definition at line 209 of file EventPrincipal.h.

Referenced by eventSelectionIDs(), and fillEventPrincipal().

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

Definition at line 48 of file EventPrincipal.h.

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

Definition at line 49 of file EventPrincipal.h.

std::shared_ptr<LuminosityBlockPrincipal> edm::EventPrincipal::luminosityBlockPrincipal_
private
std::vector<std::string> edm::EventPrincipal::moduleLabelsRunning_
mutableprivate

Definition at line 207 of file EventPrincipal.h.

Referenced by clearEventPrincipal(), and unscheduledFill().

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

Definition at line 168 of file EventPrincipal.h.

Referenced by readFromSource_(), and unscheduledFill().

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

Definition at line 167 of file EventPrincipal.h.

Referenced by readFromSource_(), and unscheduledFill().

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

Definition at line 217 of file EventPrincipal.h.

Referenced by streamID(), and transitionIndex_().

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