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
< boost::shared_ptr
< ProductHolderBase > > 
ProductHolderCollection
 
typedef boost::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 (boost::shared_ptr< ProductRegistry const > reg, boost::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
 
WrapperHolder 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)
 
boost::shared_ptr
< ProductProvenanceRetriever
productProvenanceRetrieverPtr () const
 
void put (BranchDescription const &bd, WrapperOwningHolder const &edp, ProductProvenance const &productProvenance)
 
void putOnRead (BranchDescription const &bd, void const *product, ProductProvenance const &productProvenance)
 
RunNumber_t run () const
 
RunPrincipal const & runPrincipal () const
 
void setLuminosityBlockPrincipal (boost::shared_ptr< LuminosityBlockPrincipal > const &lbp)
 
void setRunAndLumiNumber (RunNumber_t run, LuminosityBlockNumber_t lumi)
 
void setUnscheduledHandler (boost::shared_ptr< UnscheduledHandler > iHandler)
 
int storeNumber () const
 
StreamID streamID () const
 
Timestamp const & time () const
 
boost::shared_ptr
< UnscheduledHandler
unscheduledHandler () const
 
 ~EventPrincipal ()
 
- Public Member Functions inherited from edm::Principal
void addAliasedProduct (boost::shared_ptr< BranchDescription const > bd)
 
void addInputProduct (boost::shared_ptr< BranchDescription const > bd)
 
void addScheduledProduct (boost::shared_ptr< BranchDescription const > bd)
 
void addSourceProduct (boost::shared_ptr< BranchDescription const > bd)
 
void addUnscheduledProduct (boost::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 (boost::shared_ptr< ProductRegistry const > reg, boost::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_
 
boost::shared_ptr
< BranchIDListHelper const > 
branchIDListHelper_
 
BranchListIndexes branchListIndexes_
 
std::map< BranchListIndex,
ProcessIndex
branchListIndexToProcessIndex_
 
EventSelectionIDVector eventSelectionIDs_
 
boost::shared_ptr
< LuminosityBlockPrincipal
luminosityBlockPrincipal_
 
std::vector< std::string > moduleLabelsRunning_
 
boost::shared_ptr
< ProductProvenanceRetriever
provRetrieverPtr_
 
StreamID streamID_
 
boost::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 (WrapperOwningHolder const &prod, ProductHolderBase const *productHolder) const
 
ProductHolderBasegetExistingProduct (BranchID const &branchID)
 
ProductHolderBasegetExistingProduct (ProductHolderBase const &phb)
 
void putOrMerge (WrapperOwningHolder const &prod, ProductHolderBase const *productHolder) const
 
void putOrMerge (WrapperOwningHolder const &prod, ProductProvenance &prov, ProductHolderBase *productHolder)
 

Detailed Description

Definition at line 45 of file EventPrincipal.h.

Member Typedef Documentation

Definition at line 47 of file EventPrincipal.h.

Definition at line 48 of file EventPrincipal.h.

Definition at line 50 of file EventPrincipal.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file EventPrincipal.cc.

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

Definition at line 59 of file EventPrincipal.h.

59 {}

Member Function Documentation

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

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

205  {
206  if(!bid.isValid()) {
207  throw Exception(errors::NotFound, "InvalidID")
208  << "branchIDToProductID: invalid BranchID supplied\n";
209  }
210  typedef BranchIDListHelper::BranchIDToIndexMap BIDToIndexMap;
211  typedef BIDToIndexMap::const_iterator Iter;
212  typedef std::pair<Iter, Iter> IndexRange;
213 
214  IndexRange range = branchIDListHelper_->branchIDToIndexMap().equal_range(bid);
215  for(Iter it = range.first; it != range.second; ++it) {
216  BranchListIndex blix = it->second.first;
217  std::map<BranchListIndex, ProcessIndex>::const_iterator i = branchListIndexToProcessIndex_.find(blix);
218  if(i != branchListIndexToProcessIndex_.end()) {
219  ProductIndex productIndex = it->second.second;
220  ProcessIndex processIndex = i->second;
221  return ProductID(processIndex+1, productIndex+1);
222  }
223  }
224  // cannot throw, because some products may legitimately not have product ID's (e.g. pile-up).
225  return ProductID();
226  }
int i
Definition: DBlmapReader.cc:9
unsigned short BranchListIndex
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
std::multimap< BranchID, IndexPair > BranchIDToIndexMap
unsigned short ProcessIndex
Definition: ProductID.h:25
boost::shared_ptr< BranchIDListHelper const > branchIDListHelper_
unsigned short ProductIndex
Definition: ProductID.h:26
BranchListIndexes const & edm::EventPrincipal::branchListIndexes ( ) const
int edm::EventPrincipal::bunchCrossing ( ) const
inline

Definition at line 111 of file EventPrincipal.h.

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

111  {
112  return aux().bunchCrossing();
113  }
int bunchCrossing() const
EventAuxiliary const & aux() const
void edm::EventPrincipal::clearEventPrincipal ( )

Definition at line 43 of file EventPrincipal.cc.

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

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

43  {
45  aux_ = EventAuxiliary();
47  provRetrieverPtr_->reset();
48  unscheduledHandler_.reset();
49  moduleLabelsRunning_.clear();
51  }
void clearPrincipal()
Definition: Principal.cc:304
boost::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
EventAuxiliary aux_
boost::shared_ptr< UnscheduledHandler > unscheduledHandler_
boost::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 107 of file EventPrincipal.h.

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

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

Definition at line 85 of file EventPrincipal.cc.

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

87  {
88  fillPrincipal(aux.processHistoryID(), processHistoryRegistry, reader);
89  aux_ = aux;
91 
92  if(branchListIndexes_.empty() and branchIDListHelper_->hasProducedProducts()) {
93  // Add index into BranchIDListRegistry for products produced this process
94  // if it hasn't already been filled in by the other fillEventPrincipal or by an earlier call to this function
95  branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex());
96  }
97 
98  // Fill in helper map for Branch to ProductID mapping
99  ProcessIndex pix = 0;
100  for(auto const& blindex : branchListIndexes_) {
101  branchListIndexToProcessIndex_.insert(std::make_pair(blindex, pix));
102  ++pix;
103  }
104 
105  // Fill in the product ID's in the product holders.
106  for(auto const& prod : *this) {
107  if (prod->singleProduct()) {
108  prod->setProvenance(productProvenanceRetrieverPtr(), processHistory(), branchIDToProductID(prod->branchDescription().branchID()));
109  }
110  }
111  }
BranchListIndexes branchListIndexes_
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
EventAuxiliary aux_
ProcessHistory const & processHistory() const
Definition: Principal.h:139
ProductID branchIDToProductID(BranchID const &bid) const
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:143
unsigned short ProcessIndex
Definition: ProductID.h:25
DelayedReader * reader() const
Definition: Principal.h:173
boost::shared_ptr< ProductProvenanceRetriever > productProvenanceRetrieverPtr() const
void setProcessHistoryID(ProcessHistoryID const &phid)
boost::shared_ptr< BranchIDListHelper const > branchIDListHelper_
ProcessHistoryID const & processHistoryID() const
void fillPrincipal(ProcessHistoryID const &hist, ProcessHistoryRegistry const &phr, DelayedReader *reader)
Definition: Principal.cc:327
EventAuxiliary const & aux() const
void edm::EventPrincipal::fillEventPrincipal ( EventAuxiliary const &  aux,
ProcessHistoryRegistry const &  processHistoryRegistry,
EventSelectionIDVector &&  eventSelectionIDs,
BranchListIndexes &&  branchListIndexes 
)

Definition at line 71 of file EventPrincipal.cc.

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

74  {
77  if(branchIDListHelper_->hasProducedProducts()) {
78  // Add index into BranchIDListRegistry for products produced this process
79  branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex());
80  }
81  fillEventPrincipal(aux,processHistoryRegistry,nullptr);
82  }
EventSelectionIDVector const & eventSelectionIDs() const
EventSelectionIDVector eventSelectionIDs_
BranchListIndexes branchListIndexes_
BranchListIndexes const & branchListIndexes() const
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=nullptr)
boost::shared_ptr< BranchIDListHelper const > branchIDListHelper_
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 54 of file EventPrincipal.cc.

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

59  {
61  provRetrieverPtr_->deepSwap(provRetriever);
63  if(branchIDListHelper_->hasProducedProducts()) {
64  // Add index into BranchIDListRegistry for products produced this process
65  branchListIndexes_.push_back(branchIDListHelper_->producedBranchListIndex());
66  }
67  fillEventPrincipal(aux,processHistoryRegistry,reader);
68  }
EventSelectionIDVector const & eventSelectionIDs() const
EventSelectionIDVector eventSelectionIDs_
BranchListIndexes branchListIndexes_
BranchListIndexes const & branchListIndexes() const
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=nullptr)
DelayedReader * reader() const
Definition: Principal.h:173
boost::shared_ptr< BranchIDListHelper const > branchIDListHelper_
boost::shared_ptr< ProductProvenanceRetriever > provRetrieverPtr_
EventAuxiliary const & aux() const
BasicHandle edm::EventPrincipal::getByProductID ( ProductID const &  oid) const

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

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

Reimplemented from edm::Principal.

Definition at line 278 of file EventPrincipal.cc.

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

278  {
279  return getByProductID(pid).wrapperHolder();
280  }
BasicHandle getByProductID(ProductID const &oid) const
tuple pid
Definition: sysUtil.py:22
WrapperHolder wrapperHolder() const
Definition: BasicHandle.h:114
Provenance edm::EventPrincipal::getProvenance ( ProductID const &  pid,
ModuleCallingContext const *  mcc 
) const

Definition at line 283 of file EventPrincipal.cc.

References pidToBid().

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

283  {
284  BranchID bid = pidToBid(pid);
285  return getProvenance(bid, mcc);
286  }
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 95 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::DataMixingHcalDigiWorker::addHcalPileups(), edm::DataMixingHcalDigiWorkerProd::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::OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >::preScheduleSignal(), 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().

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

Definition at line 103 of file EventPrincipal.h.

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

103  {
104  return aux().isRealData();
105  }
bool isRealData() const
EventAuxiliary const & aux() const
LuminosityBlockNumber_t edm::EventPrincipal::luminosityBlock ( ) const
inline
LuminosityBlockPrincipal const& edm::EventPrincipal::luminosityBlockPrincipal ( ) const
inline

Definition at line 79 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

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

79  {
81  }
boost::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
LuminosityBlockPrincipal& edm::EventPrincipal::luminosityBlockPrincipal ( )
inline

Definition at line 83 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

83  {
85  }
boost::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
bool edm::EventPrincipal::luminosityBlockPrincipalPtrValid ( )
inline

Definition at line 87 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

87  {
88  return (luminosityBlockPrincipal_) ? true : false;
89  }
boost::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
void edm::EventPrincipal::mergeProvenanceRetrievers ( EventPrincipal const &  other)
inline

Definition at line 164 of file EventPrincipal.h.

References productProvenanceRetrieverPtr(), and provRetrieverPtr_.

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

164  {
165  provRetrieverPtr_->mergeProvenanceRetrievers(other.productProvenanceRetrieverPtr());
166  }
boost::shared_ptr< ProductProvenanceRetriever > provRetrieverPtr_
BranchID edm::EventPrincipal::pidToBid ( ProductID const &  pid) const
private

Definition at line 196 of file EventPrincipal.cc.

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

Referenced by getByProductID(), and getProvenance().

196  {
197  if(!pid.isValid()) {
198  throw Exception(errors::ProductNotFound, "InvalidID")
199  << "get by product ID: invalid ProductID supplied\n";
200  }
202  }
BranchListIndexes branchListIndexes_
BranchID productIDToBranchID(ProductID const &pid, BranchIDLists const &lists, BranchListIndexes const &indexes)
tuple pid
Definition: sysUtil.py:22
boost::shared_ptr< BranchIDListHelper const > branchIDListHelper_
boost::shared_ptr<ProductProvenanceRetriever> edm::EventPrincipal::productProvenanceRetrieverPtr ( ) const
inline
void edm::EventPrincipal::put ( BranchDescription const &  bd,
WrapperOwningHolder const &  edp,
ProductProvenance const &  productProvenance 
)

Definition at line 132 of file EventPrincipal.cc.

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

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

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

Definition at line 153 of file EventPrincipal.cc.

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

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

156  {
157 
158  assert(!bd.produced());
159  productProvenanceRetrieverPtr()->insertIntoSet(productProvenance);
160  ProductHolderBase* phb = getExistingProduct(bd.branchID());
161  assert(phb);
162  WrapperOwningHolder const edp(product, phb->productData().getInterface());
163  checkUniquenessAndType(edp, phb);
164  // ProductHolder assumes ownership
165  phb->putProduct(edp, productProvenance);
166  }
void checkUniquenessAndType(WrapperOwningHolder const &prod, ProductHolderBase const *productHolder) const
Definition: Principal.cc:792
boost::shared_ptr< ProductProvenanceRetriever > productProvenanceRetrieverPtr() const
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 169 of file EventPrincipal.cc.

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

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

129  {
130  return id().run();
131  }
RunNumber_t run() const
Definition: EventID.h:42
EventID const & id() const
RunPrincipal const & edm::EventPrincipal::runPrincipal ( ) const

Definition at line 127 of file EventPrincipal.cc.

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

127  {
129  }
RunPrincipal const & runPrincipal() const
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
void edm::EventPrincipal::setLuminosityBlockPrincipal ( boost::shared_ptr< LuminosityBlockPrincipal > const &  lbp)

Definition at line 114 of file EventPrincipal.cc.

References luminosityBlockPrincipal_.

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

114  {
116  }
boost::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
void edm::EventPrincipal::setRunAndLumiNumber ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 119 of file EventPrincipal.cc.

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

119  {
120  assert(run == luminosityBlockPrincipal_->run());
121  assert(lumi == luminosityBlockPrincipal_->luminosityBlock());
122  EventNumber_t event = aux_.id().event();
123  aux_.id() = EventID(run, lumi, event);
124  }
EventNumber_t event() const
Definition: EventID.h:44
boost::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
RunNumber_t run() const
unsigned int EventNumber_t
Definition: EventID.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 ( boost::shared_ptr< UnscheduledHandler iHandler)

Definition at line 289 of file EventPrincipal.cc.

References unscheduledHandler_.

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

289  {
290  unscheduledHandler_ = iHandler;
291  }
boost::shared_ptr< UnscheduledHandler > unscheduledHandler_
int edm::EventPrincipal::storeNumber ( ) const
inline

Definition at line 115 of file EventPrincipal.h.

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

115  {
116  return aux().storeNumber();
117  }
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 229 of file EventPrincipal.cc.

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

229  {
230  return streamID_.value();
231  }
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 309 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_.

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

Definition at line 294 of file EventPrincipal.cc.

References unscheduledHandler_.

Referenced by edm::getUnscheduledHandler().

294  {
295  return unscheduledHandler_;
296  }
boost::shared_ptr< UnscheduledHandler > unscheduledHandler_

Member Data Documentation

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

Definition at line 214 of file EventPrincipal.h.

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

BranchListIndexes edm::EventPrincipal::branchListIndexes_
private

Definition at line 216 of file EventPrincipal.h.

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

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

Definition at line 218 of file EventPrincipal.h.

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

EventSelectionIDVector edm::EventPrincipal::eventSelectionIDs_
private

Definition at line 212 of file EventPrincipal.h.

Referenced by eventSelectionIDs(), and fillEventPrincipal().

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

Definition at line 51 of file EventPrincipal.h.

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

Definition at line 52 of file EventPrincipal.h.

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

Definition at line 210 of file EventPrincipal.h.

Referenced by clearEventPrincipal(), and unscheduledFill().

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

Definition at line 171 of file EventPrincipal.h.

Referenced by readFromSource_(), and unscheduledFill().

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

Definition at line 170 of file EventPrincipal.h.

Referenced by readFromSource_(), and unscheduledFill().

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

Definition at line 220 of file EventPrincipal.h.

Referenced by streamID(), and transitionIndex_().

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