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 | 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::ConstGroupPtr ConstGroupPtr
 
- Public Types inherited from edm::Principal
typedef std::vector< BasicHandleBasicHandleVec
 
typedef boost::filter_iterator
< FilledGroupPtr,
GroupCollection::const_iterator > 
const_iterator
 
typedef Group const * ConstGroupPtr
 
typedef std::vector
< boost::shared_ptr< Group > > 
GroupCollection
 
typedef std::string ProcessName
 
typedef
ProcessHistory::const_iterator 
ProcessNameConstIterator
 
typedef boost::shared_ptr< GroupSharedGroupPtr
 
typedef GroupCollection::size_type size_type
 

Public Member Functions

EventAuxiliary const & aux () const
 
ProductID branchIDToProductID (BranchID const &bid) const
 
BranchListIndexes const & branchListIndexes () const
 
boost::shared_ptr< BranchMapperbranchMapperPtr () const
 
int bunchCrossing () const
 
void clearEventPrincipal ()
 
 EventPrincipal (boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender=0)
 
EventSelectionIDVector const & eventSelectionIDs () const
 
EventAuxiliary::ExperimentType ExperimentType () const
 
void fillEventPrincipal (EventAuxiliary const &aux, boost::shared_ptr< LuminosityBlockPrincipal > lbp, boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs=boost::shared_ptr< EventSelectionIDVector >(), boost::shared_ptr< BranchListIndexes > branchListIndexes=boost::shared_ptr< BranchListIndexes >(), boost::shared_ptr< BranchMapper > mapper=boost::shared_ptr< BranchMapper >(new BranchMapper), DelayedReader *reader=0)
 
BasicHandle getByProductID (ProductID const &oid) const
 
WrapperHolder getIt (ProductID const &pid) const
 
Provenance getProvenance (ProductID const &pid) const
 
EventID const & id () const
 
bool isReal () const
 
LuminosityBlockNumber_t luminosityBlock () const
 
LuminosityBlockPrincipal const & luminosityBlockPrincipal () const
 
LuminosityBlockPrincipalluminosityBlockPrincipal ()
 
bool luminosityBlockPrincipalPtrValid ()
 
void mergeMappers (EventPrincipal const &other)
 
void put (ConstBranchDescription const &bd, WrapperOwningHolder const &edp, ProductProvenance const &productProvenance)
 
void putOnRead (ConstBranchDescription const &bd, void const *product, ProductProvenance const &productProvenance)
 
RunNumber_t run () const
 
RunPrincipal const & runPrincipal () const
 
RunPrincipalrunPrincipal ()
 
void setLuminosityBlockPrincipal (boost::shared_ptr< LuminosityBlockPrincipal > const &lbp)
 
void setUnscheduledHandler (boost::shared_ptr< UnscheduledHandler > iHandler)
 
int storeNumber () const
 
Timestamp const & time () const
 
boost::shared_ptr
< UnscheduledHandler
unscheduledHandler () const
 
 ~EventPrincipal ()
 
- Public Member Functions inherited from edm::Principal
void addGroupInput (boost::shared_ptr< ConstBranchDescription > bd)
 
void addGroupScheduled (boost::shared_ptr< ConstBranchDescription > bd)
 
void addGroupSource (boost::shared_ptr< ConstBranchDescription > bd)
 
void addOnDemandGroup (boost::shared_ptr< ConstBranchDescription > bd)
 
void adjustIndexesAfterProductRegistryAddition ()
 
bool adjustToNewProductRegistry (ProductRegistry const &reg)
 
const_iterator begin () const
 
BranchType const & branchType () const
 
void clearPrincipal ()
 
void deleteProduct (BranchID const &id)
 
const_iterator end () const
 
void fillPrincipal (ProcessHistoryID const &hist, DelayedReader *reader)
 
ProductData const * findGroupByTag (TypeID const &typeID, InputTag const &tag) const
 
void getAllProvenance (std::vector< Provenance const * > &provenances) const
 
BasicHandle getByLabel (TypeID const &tid, std::string const &label, std::string const &productInstanceName, std::string const &processName, size_t &cachedOffset, int &fillCount) const
 
BasicHandle getBySelector (TypeID const &tid, SelectorBase const &s) const
 
BasicHandle getByType (TypeID const &tid) const
 
OutputHandle getForOutput (BranchID const &bid, bool getProd) const
 
ConstGroupPtr getGroup (BranchID const &oid, bool resolveProd, bool fillOnDemand) const
 
void getMany (TypeID const &tid, SelectorBase const &, BasicHandleVec &results) const
 
void getManyByType (TypeID const &tid, BasicHandleVec &results) const
 
size_t getMatchingSequence (TypeID const &typeID, SelectorBase const &selector, BasicHandle &result) const
 
Provenance getProvenance (BranchID const &bid) const
 
void maybeFlushCache (TypeID const &tid, InputTag const &tag) const
 
 Principal (boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, BranchType bt, HistoryAppender *historyAppender)
 
ProcessConfiguration const & processConfiguration () const
 
ProcessHistory const & processHistory () const
 
ProcessHistoryID const & processHistoryID () const
 
EDProductGetter const * prodGetter () const
 
ProductRegistry const & productRegistry () const
 
DelayedReaderreader () const
 
void recombine (Principal &other, std::vector< BranchID > const &bids)
 
size_t size () const
 
virtual ~Principal ()
 
- Public Member Functions inherited from edm::EDProductGetter
 EDProductGetter ()
 
virtual ~EDProductGetter ()
 

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 resolveProduct_ (Group const &g, bool fillOnDemand) const
 
virtual bool unscheduledFill (std::string const &moduleLabel) const
 

Private Attributes

EventAuxiliary aux_
 
boost::shared_ptr
< BranchListIndexes
branchListIndexes_
 
std::map< BranchListIndex,
ProcessIndex
branchListIndexToProcessIndex_
 
boost::shared_ptr< BranchMapperbranchMapperPtr_
 
boost::shared_ptr
< EventSelectionIDVector
eventSelectionIDs_
 
boost::shared_ptr
< LuminosityBlockPrincipal
luminosityBlockPrincipal_
 
std::vector< std::string > moduleLabelsRunning_
 
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 addGroup_ (std::auto_ptr< Group > g)
 
void addGroupOrThrow (std::auto_ptr< Group > g)
 
void checkUniquenessAndType (WrapperOwningHolder const &prod, Group const *group) const
 
GroupgetExistingGroup (BranchID const &branchID)
 
GroupgetExistingGroup (Group const &g)
 
ConstGroupPtr getGroupByIndex (ProductTransientIndex const &oid, bool resolveProd, bool fillOnDemand) const
 
void putOrMerge (WrapperOwningHolder const &prod, Group const *group) const
 
void putOrMerge (WrapperOwningHolder const &prod, ProductProvenance &prov, Group *group)
 
void resolveProduct (Group const &g, bool fillOnDemand) const
 

Detailed Description

Definition at line 40 of file EventPrincipal.h.

Member Typedef Documentation

Definition at line 42 of file EventPrincipal.h.

Definition at line 43 of file EventPrincipal.h.

Definition at line 45 of file EventPrincipal.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file EventPrincipal.cc.

24  :
25  Base(reg, pc, InEvent, historyAppender),
26  aux_(),
boost::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
EventAuxiliary aux_
std::vector< EventSelectionID > EventSelectionIDVector
boost::shared_ptr< BranchMapper > branchMapperPtr_
std::vector< BranchListIndex > BranchListIndexes
boost::shared_ptr< UnscheduledHandler > unscheduledHandler_
boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs_
boost::shared_ptr< BranchListIndexes > branchListIndexes_
std::vector< std::string > moduleLabelsRunning_
edm::EventPrincipal::~EventPrincipal ( )
inline

Definition at line 52 of file EventPrincipal.h.

52 {}

Member Function Documentation

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

Definition at line 175 of file EventPrincipal.cc.

References branchListIndexToProcessIndex_, edm::hlt::Exception, edm::detail::ThreadSafeIndexedRegistry< T, E >::extra(), i, edm::detail::ThreadSafeIndexedRegistry< T, E >::instance(), edm::BranchID::isValid(), and edm::errors::NotFound.

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

175  {
176  if(!bid.isValid()) {
177  throw Exception(errors::NotFound, "InvalidID")
178  << "branchIDToProductID: invalid BranchID supplied\n";
179  }
180  typedef BranchIDListHelper::BranchIDToIndexMap BIDToIndexMap;
181  typedef BIDToIndexMap::const_iterator Iter;
182  typedef std::pair<Iter, Iter> IndexRange;
183 
184  BIDToIndexMap const& branchIDToIndexMap = BranchIDListRegistry::instance()->extra().branchIDToIndexMap();
185  IndexRange range = branchIDToIndexMap.equal_range(bid);
186  for(Iter it = range.first; it != range.second; ++it) {
187  BranchListIndex blix = it->second.first;
188  std::map<BranchListIndex, ProcessIndex>::const_iterator i = branchListIndexToProcessIndex_.find(blix);
189  if(i != branchListIndexToProcessIndex_.end()) {
190  ProductIndex productIndex = it->second.second;
191  ProcessIndex processIndex = i->second;
192  return ProductID(processIndex+1, productIndex+1);
193  }
194  }
195  // cannot throw, because some products may legitimately not have product ID's (e.g. pile-up).
196  return ProductID();
197  }
int i
Definition: DBlmapReader.cc:9
unsigned short BranchListIndex
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
std::multimap< BranchID, IndexPair > BranchIDToIndexMap
static ThreadSafeIndexedRegistry * instance()
unsigned short ProcessIndex
Definition: ProductID.h:25
unsigned short ProductIndex
Definition: ProductID.h:26
BranchListIndexes const & edm::EventPrincipal::branchListIndexes ( ) const

Definition at line 263 of file EventPrincipal.cc.

References branchListIndexes_.

Referenced by fillEventPrincipal(), edm::StreamSerializer::serializeEvent(), edm::SubProcess::write(), and edm::RootOutputFile::writeOne().

263  {
264  return *branchListIndexes_;
265  }
boost::shared_ptr< BranchListIndexes > branchListIndexes_
boost::shared_ptr<BranchMapper> edm::EventPrincipal::branchMapperPtr ( ) const
inline
int edm::EventPrincipal::bunchCrossing ( ) const
inline

Definition at line 93 of file EventPrincipal.h.

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

93  {
94  return aux().bunchCrossing();
95  }
int bunchCrossing() const
EventAuxiliary const & aux() const
void edm::EventPrincipal::clearEventPrincipal ( )

Definition at line 36 of file EventPrincipal.cc.

References aux_, branchListIndexes_, branchListIndexToProcessIndex_, branchMapperPtr_, edm::Principal::clearPrincipal(), eventSelectionIDs_, luminosityBlockPrincipal_, moduleLabelsRunning_, and unscheduledHandler_.

Referenced by edm::RootFile::clearAndReadCurrentEvent(), and edm::EventProcessor::readAndProcessEvent().

36  {
38  aux_ = EventAuxiliary();
40  branchMapperPtr_.reset();
41  unscheduledHandler_.reset();
42  moduleLabelsRunning_.clear();
43  eventSelectionIDs_->clear();
44  branchListIndexes_->clear();
46  }
void clearPrincipal()
Definition: Principal.cc:206
boost::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
EventAuxiliary aux_
boost::shared_ptr< BranchMapper > branchMapperPtr_
boost::shared_ptr< UnscheduledHandler > unscheduledHandler_
boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs_
boost::shared_ptr< BranchListIndexes > branchListIndexes_
std::vector< std::string > moduleLabelsRunning_
EventSelectionIDVector const & edm::EventPrincipal::eventSelectionIDs ( ) const

Definition at line 258 of file EventPrincipal.cc.

References eventSelectionIDs_.

Referenced by edm::Event::eventSelectionIDs(), fillEventPrincipal(), edm::StreamSerializer::serializeEvent(), edm::SubProcess::write(), and edm::RootOutputFile::writeOne().

258  {
259  return *eventSelectionIDs_;
260  }
boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs_
EventAuxiliary::ExperimentType edm::EventPrincipal::ExperimentType ( ) const
inline

Definition at line 89 of file EventPrincipal.h.

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

89  {
90  return aux().experimentType();
91  }
ExperimentType experimentType() const
EventAuxiliary const & aux() const
void edm::EventPrincipal::fillEventPrincipal ( EventAuxiliary const &  aux,
boost::shared_ptr< LuminosityBlockPrincipal lbp,
boost::shared_ptr< EventSelectionIDVector eventSelectionIDs = boost::shared_ptr<EventSelectionIDVector>(),
boost::shared_ptr< BranchListIndexes branchListIndexes = boost::shared_ptr<BranchListIndexes>(),
boost::shared_ptr< BranchMapper mapper = boost::shared_ptr<BranchMapper>(new BranchMapper),
DelayedReader reader = 0 
)

Definition at line 49 of file EventPrincipal.cc.

References aux(), aux_, edm::Principal::begin(), branchIDToProductID(), branchListIndexes(), branchListIndexes_, branchListIndexToProcessIndex_, branchMapperPtr(), branchMapperPtr_, edm::Principal::end(), eventSelectionIDs(), eventSelectionIDs_, edm::Principal::fillPrincipal(), edm::InEvent, luminosityBlockPrincipal_, edm::EventAuxiliary::processHistoryID(), edm::Principal::processHistoryID(), edm::Principal::productRegistry(), and edm::Principal::reader().

Referenced by edm::StreamerInputSource::deserializeEvent(), edm::DaqSource::getNextItemType(), edm::RawInputSource::makeEvent(), edm::RootFile::readCurrentEvent(), edm::ConfigurableInputSource::reallyReadEvent(), and edm::SubProcess::write().

54  {
56  aux_ = aux;
58  if(eventSelectionIDs) {
60  }
61  aux_.setProcessHistoryID(processHistoryID());
62 
63  branchMapperPtr_ = mapper;
64 
65  if(branchListIndexes) {
67  }
68 
69  if(productRegistry().productProduced(InEvent)) {
70  // Add index into BranchIDListRegistry for products produced this process
71  branchListIndexes_->push_back(productRegistry().producedBranchListIndex());
72  }
73 
74  // Fill in helper map for Branch to ProductID mapping
75  for(BranchListIndexes::const_iterator
76  it = branchListIndexes_->begin(),
77  itEnd = branchListIndexes_->end();
78  it != itEnd; ++it) {
79  ProcessIndex pix = it - branchListIndexes_->begin();
80  branchListIndexToProcessIndex_.insert(std::make_pair(*it, pix));
81  }
82 
83  // Fill in the product ID's in the groups.
84  for(const_iterator it = this->begin(), itEnd = this->end(); it != itEnd; ++it) {
85  (*it)->setProvenance(branchMapperPtr(), processHistoryID(), branchIDToProductID((*it)->branchDescription().branchID()));
86  }
87  }
ProductRegistry const & productRegistry() const
Definition: Principal.h:132
EventSelectionIDVector const & eventSelectionIDs() const
boost::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
const_iterator end() const
Definition: Principal.h:141
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
EventAuxiliary aux_
BranchListIndexes const & branchListIndexes() const
ProductID branchIDToProductID(BranchID const &bid) const
boost::shared_ptr< BranchMapper > branchMapperPtr_
boost::shared_ptr< BranchMapper > branchMapperPtr() const
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:126
boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs_
unsigned short ProcessIndex
Definition: ProductID.h:25
DelayedReader * reader() const
Definition: Principal.h:149
boost::shared_ptr< BranchListIndexes > branchListIndexes_
const_iterator begin() const
Definition: Principal.h:140
ProcessHistoryID const & processHistoryID() const
boost::filter_iterator< FilledGroupPtr, GroupCollection::const_iterator > const_iterator
Definition: Principal.h:55
void fillPrincipal(ProcessHistoryID const &hist, DelayedReader *reader)
Definition: Principal.cc:229
EventAuxiliary const & aux() const
BasicHandle edm::EventPrincipal::getByProductID ( ProductID const &  oid) const

Definition at line 210 of file EventPrincipal.cc.

References edm::hlt::Exception, g, edm::Principal::getGroup(), pidToBid(), edm::errors::ProductNotFound, and edm::throwProductDeletedException().

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

210  {
211  BranchID bid = pidToBid(pid);
212  ConstGroupPtr const g = getGroup(bid, true, true);
213  if(g == 0) {
214  boost::shared_ptr<cms::Exception> whyFailed(new Exception(errors::ProductNotFound, "InvalidID"));
215  *whyFailed
216  << "get by product ID: no product with given id: " << pid << "\n";
217  return BasicHandle(whyFailed);
218  }
219 
220  // Was this already deleted?
221  if(g->productWasDeleted()) {
223  }
224  // Check for case where we tried on demand production and
225  // it failed to produce the object
226  if(g->onDemand()) {
227  boost::shared_ptr<cms::Exception> whyFailed(new Exception(errors::ProductNotFound, "InvalidID"));
228  *whyFailed
229  << "get by product ID: no product with given id: " << pid << "\n"
230  << "onDemand production failed to produce it.\n";
231  return BasicHandle(whyFailed);
232  }
233  return BasicHandle(g->productData());
234  }
Base::ConstGroupPtr ConstGroupPtr
BranchID pidToBid(ProductID const &pid) const
ConstGroupPtr getGroup(BranchID const &oid, bool resolveProd, bool fillOnDemand) const
Definition: Principal.cc:313
static void throwProductDeletedException(ProductID const &pid, edm::EventPrincipal::ConstGroupPtr const g)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
WrapperHolder edm::EventPrincipal::getIt ( ProductID const &  pid) const
virtual

Reimplemented from edm::Principal.

Definition at line 237 of file EventPrincipal.cc.

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

237  {
238  return getByProductID(pid).wrapperHolder();
239  }
BasicHandle getByProductID(ProductID const &oid) const
WrapperHolder wrapperHolder() const
Definition: BasicHandle.h:106
Provenance edm::EventPrincipal::getProvenance ( ProductID const &  pid) const

Definition at line 242 of file EventPrincipal.cc.

References pidToBid().

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

242  {
243  BranchID bid = pidToBid(pid);
244  return getProvenance(bid);
245  }
BranchID pidToBid(ProductID const &pid) const
Provenance getProvenance(ProductID const &pid) const
EventID const& edm::EventPrincipal::id ( void  ) const
inline
bool edm::EventPrincipal::isReal ( ) const
inline

Definition at line 85 of file EventPrincipal.h.

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

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

Definition at line 105 of file EventPrincipal.h.

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

Referenced by Types.EventID::cppID(), Types.LuminosityBlockID::cppID(), edm::InputSource::readEvent(), edm::PoolSource::readEvent_(), and edm::StreamerOutputModuleBase::serializeEvent().

105  {
106  return id().luminosityBlock();
107  }
EventID const & id() const
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
LuminosityBlockPrincipal const& edm::EventPrincipal::luminosityBlockPrincipal ( ) const
inline

Definition at line 63 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

Referenced by runPrincipal().

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

Definition at line 67 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

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

Definition at line 71 of file EventPrincipal.h.

References luminosityBlockPrincipal_.

Referenced by edm::InputSource::readEvent().

71  {
72  return (luminosityBlockPrincipal_) ? true : false;
73  }
boost::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
void edm::EventPrincipal::mergeMappers ( EventPrincipal const &  other)
inline

Definition at line 146 of file EventPrincipal.h.

References branchMapperPtr(), and branchMapperPtr_.

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

146  {
147  branchMapperPtr_->mergeMappers(other.branchMapperPtr());
148  }
boost::shared_ptr< BranchMapper > branchMapperPtr_
BranchID edm::EventPrincipal::pidToBid ( ProductID const &  pid) const
private

Definition at line 166 of file EventPrincipal.cc.

References branchListIndexes_, data, edm::hlt::Exception, edm::detail::ThreadSafeIndexedRegistry< T, E >::instance(), edm::ProductID::isValid(), edm::productIDToBranchID(), and edm::errors::ProductNotFound.

Referenced by getByProductID(), and getProvenance().

166  {
167  if(!pid.isValid()) {
168  throw Exception(errors::ProductNotFound, "InvalidID")
169  << "get by product ID: invalid ProductID supplied\n";
170  }
172  }
BranchID productIDToBranchID(ProductID const &pid, BranchIDLists const &lists, BranchListIndexes const &indexes)
static ThreadSafeIndexedRegistry * instance()
boost::shared_ptr< BranchListIndexes > branchListIndexes_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void edm::EventPrincipal::put ( ConstBranchDescription const &  bd,
WrapperOwningHolder const &  edp,
ProductProvenance const &  productProvenance 
)

Definition at line 105 of file EventPrincipal.cc.

References edm::ConstBranchDescription::branchID(), branchMapperPtr(), edm::Principal::checkUniquenessAndType(), edm::hlt::Exception, g, edm::Principal::getExistingGroup(), edm::errors::InsertFailure, edm::WrapperHolder::isValid(), and edm::Group::putProduct().

Referenced by edm::Event::commit_aux(), and edm::DaqSource::getNextItemType().

108  {
109 
110  // assert commented out for DaqSource. When DaqSource no longer uses put(), the assert can be restored.
111  //assert(produced());
112  if(!edp.isValid()) {
113  throw Exception(errors::InsertFailure, "Null Pointer")
114  << "put: Cannot put because ptr to product is null."
115  << "\n";
116  }
117  branchMapperPtr()->insertIntoSet(productProvenance);
118  Group* g = getExistingGroup(bd.branchID());
119  assert(g);
120  checkUniquenessAndType(edp, g);
121  // Group assumes ownership
122  g->putProduct(edp, productProvenance);
123  }
Group * getExistingGroup(BranchID const &branchID)
Definition: Principal.cc:267
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
boost::shared_ptr< BranchMapper > branchMapperPtr() const
void checkUniquenessAndType(WrapperOwningHolder const &prod, Group const *group) const
Definition: Principal.cc:744
void edm::EventPrincipal::putOnRead ( ConstBranchDescription const &  bd,
void const *  product,
ProductProvenance const &  productProvenance 
)

Definition at line 126 of file EventPrincipal.cc.

References edm::ConstBranchDescription::branchID(), branchMapperPtr(), edm::Principal::checkUniquenessAndType(), g, edm::Principal::getExistingGroup(), edm::ProductData::getInterface(), edm::ConstBranchDescription::produced(), edm::Group::productData(), and edm::Group::putProduct().

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

129  {
130 
131  assert(!bd.produced());
132  branchMapperPtr()->insertIntoSet(productProvenance);
133  Group* g = getExistingGroup(bd.branchID());
134  assert(g);
135  WrapperOwningHolder const edp(product, g->productData().getInterface());
136  checkUniquenessAndType(edp, g);
137  // Group assumes ownership
138  g->putProduct(edp, productProvenance);
139  }
Group * getExistingGroup(BranchID const &branchID)
Definition: Principal.cc:267
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
boost::shared_ptr< BranchMapper > branchMapperPtr() const
void checkUniquenessAndType(WrapperOwningHolder const &prod, Group const *group) const
Definition: Principal.cc:744
void edm::EventPrincipal::resolveProduct_ ( Group const &  g,
bool  fillOnDemand 
) const
privatevirtual

Reimplemented from edm::Principal.

Definition at line 142 of file EventPrincipal.cc.

References edm::Group::branchDescription(), edm::Principal::checkUniquenessAndType(), edm::ProductData::getInterface(), edm::getProduct(), edm::ConstBranchDescription::moduleLabel(), edm::Group::onDemand(), edm::ConstBranchDescription::produced(), edm::Group::product(), edm::Group::productData(), edm::Group::productUnavailable(), edm::Group::putProduct(), edm::Principal::reader(), and unscheduledFill().

142  {
143  // Try unscheduled production.
144  if(g.onDemand()) {
145  if(fillOnDemand) {
146  unscheduledFill(g.branchDescription().moduleLabel());
147  }
148  return;
149  }
150 
151  if(g.branchDescription().produced()) return; // nothing to do.
152  if(g.product()) return; // nothing to do.
153  if(g.productUnavailable()) return; // nothing to do.
154  if(!reader()) return; // nothing to do.
155 
156  // must attempt to load from persistent store
157  BranchKey const bk = BranchKey(g.branchDescription());
158  WrapperOwningHolder edp(reader()->getProduct(bk, g.productData().getInterface(), this));
159 
160  // Now fix up the Group
161  checkUniquenessAndType(edp, &g);
162  g.putProduct(edp);
163  }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
T const * getProduct(RefCore const &ref)
Definition: RefCoreGet.h:33
DelayedReader * reader() const
Definition: Principal.h:149
virtual bool unscheduledFill(std::string const &moduleLabel) const
void checkUniquenessAndType(WrapperOwningHolder const &prod, Group const *group) const
Definition: Principal.cc:744
RunNumber_t edm::EventPrincipal::run ( void  ) const
inline

Definition at line 109 of file EventPrincipal.h.

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

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

109  {
110  return id().run();
111  }
RunNumber_t run() const
Definition: EventID.h:42
EventID const & id() const
RunPrincipal const & edm::EventPrincipal::runPrincipal ( ) const

Definition at line 95 of file EventPrincipal.cc.

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

95  {
97  }
RunPrincipal const & runPrincipal() const
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
RunPrincipal & edm::EventPrincipal::runPrincipal ( )

Definition at line 100 of file EventPrincipal.cc.

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

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

Definition at line 90 of file EventPrincipal.cc.

References luminosityBlockPrincipal_.

Referenced by edm::RawInputSource::readEvent_(), edm::DaqSource::readEvent_(), and edm::StreamerInputSource::readEvent_().

90  {
92  }
boost::shared_ptr< LuminosityBlockPrincipal > luminosityBlockPrincipal_
void edm::EventPrincipal::setUnscheduledHandler ( boost::shared_ptr< UnscheduledHandler iHandler)

Definition at line 248 of file EventPrincipal.cc.

References unscheduledHandler_.

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

248  {
249  unscheduledHandler_ = iHandler;
250  }
boost::shared_ptr< UnscheduledHandler > unscheduledHandler_
int edm::EventPrincipal::storeNumber ( ) const
inline

Definition at line 97 of file EventPrincipal.h.

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

97  {
98  return aux().storeNumber();
99  }
int storeNumber() const
EventAuxiliary const & aux() const
Timestamp const& edm::EventPrincipal::time ( ) const
inline
bool edm::EventPrincipal::unscheduledFill ( std::string const &  moduleLabel) const
privatevirtual

Implements edm::Principal.

Definition at line 268 of file EventPrincipal.cc.

References edm::hlt::Exception, edm::find_in_all(), i, edm::errors::LogicError, moduleLabelsRunning_, and unscheduledHandler_.

Referenced by resolveProduct_().

268  {
269 
270  // If it is a module already currently running in unscheduled
271  // mode, then there is a circular dependency related to which
272  // EDProducts modules require and produce. There is no safe way
273  // to recover from this. Here we check for this problem and throw
274  // an exception.
275  std::vector<std::string>::const_iterator i =
276  find_in_all(moduleLabelsRunning_, moduleLabel);
277 
278  if(i != moduleLabelsRunning_.end()) {
280  << "Hit circular dependency while trying to run an unscheduled module.\n"
281  << "Current implementation of unscheduled execution cannot always determine\n"
282  << "the proper order for module execution. It is also possible the modules\n"
283  << "have a built in circular dependence that will not work with any order.\n"
284  << "In the first case, scheduling some or all required modules in paths will help.\n"
285  << "In the second case, the modules themselves will have to be fixed.\n";
286  }
287 
288  moduleLabelsRunning_.push_back(moduleLabel);
289 
290  if(unscheduledHandler_) {
291  unscheduledHandler_->tryToFill(moduleLabel, *const_cast<EventPrincipal*>(this));
292  }
293  moduleLabelsRunning_.pop_back();
294  return true;
295  }
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
std::vector< std::string > moduleLabelsRunning_
boost::shared_ptr< UnscheduledHandler > edm::EventPrincipal::unscheduledHandler ( ) const

Definition at line 253 of file EventPrincipal.cc.

References unscheduledHandler_.

Referenced by edm::WorkerT< T >::implDoBegin().

253  {
254  return unscheduledHandler_;
255  }
boost::shared_ptr< UnscheduledHandler > unscheduledHandler_

Member Data Documentation

EventAuxiliary edm::EventPrincipal::aux_
private

Definition at line 162 of file EventPrincipal.h.

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

boost::shared_ptr<BranchListIndexes> edm::EventPrincipal::branchListIndexes_
private
std::map<BranchListIndex, ProcessIndex> edm::EventPrincipal::branchListIndexToProcessIndex_
private

Definition at line 178 of file EventPrincipal.h.

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

boost::shared_ptr<BranchMapper> edm::EventPrincipal::branchMapperPtr_
private
boost::shared_ptr<EventSelectionIDVector> edm::EventPrincipal::eventSelectionIDs_
private

Definition at line 174 of file EventPrincipal.h.

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

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

Definition at line 46 of file EventPrincipal.h.

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

Definition at line 47 of file EventPrincipal.h.

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

Definition at line 172 of file EventPrincipal.h.

Referenced by clearEventPrincipal(), and unscheduledFill().

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