31 std::shared_ptr<ProductRegistry const> reg,
32 std::shared_ptr<BranchIDListHelper const> branchIDListHelper,
33 std::shared_ptr<ThinnedAssociationsHelper const> thinnedAssociationsHelper,
36 unsigned int streamIndex,
37 bool isForPrimaryProcess) :
38 Base(reg, reg->productLookup(
InEvent), pc,
InEvent, historyAppender,isForPrimaryProcess),
40 luminosityBlockPrincipal_(),
43 branchIDListHelper_(branchIDListHelper),
44 thinnedAssociationsHelper_(thinnedAssociationsHelper),
46 branchListIndexToProcessIndex_(),
47 streamID_(streamIndex) {
67 bool deepCopyRetriever) {
69 if (deepCopyRetriever) {
102 <<
"EventPrincipal::fillEventPrincipal, Invalid event number provided in EventAuxiliary, It is illegal for the event number to be 0\n";
123 for(
auto&
prod : *
this) {
124 if (
prod->singleProduct()) {
129 auto const & bd =
prod->branchDescription();
158 std::unique_ptr<WrapperBase> edp,
163 if(edp.get() ==
nullptr) {
165 <<
"put: Cannot put because ptr to product is null." 178 std::unique_ptr<WrapperBase> edp,
180 if(edp.get() ==
nullptr) {
182 <<
"put: Cannot put because ptr to product is null." 198 std::unique_ptr<WrapperBase> edp,
202 if (productProvenance) {
215 <<
"get by product ID: invalid ProductID supplied\n";
224 <<
"branchIDToProductID: invalid BranchID supplied\n";
227 typedef BIDToIndexMap::const_iterator Iter;
228 typedef std::pair<Iter, Iter> IndexRange;
231 for(Iter it = range.first; it != range.second; ++it) {
237 return ProductID(processIndex+1, productIndex+1);
251 exception<<
"get by product ID: The product with given id: "<<pid
252 <<
"\ntype: "<<phb->productType()
253 <<
"\nproduct instance name: "<<phb->productInstanceName()
254 <<
"\nprocess name: "<<phb->processName()
255 <<
"\nwas already deleted. This is a configuration error. Please change the configuration of the module which caused this exception to state it reads this data.";
267 <<
"get by product ID: no product with given id: " << pid <<
"\n";
273 if(phb->productWasDeleted()) {
278 if(phb->unscheduledWasNotRun()) {
282 <<
"get by ProductID: could not get product with id: " << pid <<
"\n" 283 <<
"Unscheduled execution not allowed to get via ProductID.\n";
287 auto resolution = phb->resolveProduct(*
this,
false,
nullptr,
nullptr);
309 associatedBranches != iEnd; ++associatedBranches) {
313 if(thinnedAssociation ==
nullptr)
continue;
319 unsigned int thinnedIndex = 0;
332 if(wrapperBase !=
nullptr) {
347 std::vector<WrapperBase const*>& foundContainers,
348 std::vector<unsigned int>&
keys)
const {
355 associatedBranches != iEnd; ++associatedBranches) {
359 if(thinnedAssociation ==
nullptr)
continue;
365 unsigned nKeys = keys.size();
367 std::vector<unsigned int> thinnedIndexes(nKeys, doNotLookForThisIndex);
369 for(
unsigned k = 0;
k < nKeys; ++
k) {
371 if(foundContainers[
k] !=
nullptr)
continue;
373 if(keys[
k] == doNotLookForThisIndex)
continue;
392 for(
unsigned k = 0;
k < nKeys; ++
k) {
393 if(foundContainers[
k] ==
nullptr)
continue;
394 if(thinnedIndexes[
k] == doNotLookForThisIndex)
continue;
395 keys[
k] = thinnedIndexes[
k];
398 for(
unsigned k = 0;
k < nKeys; ++
k) {
399 if(thinnedIndexes[
k] == doNotLookForThisIndex)
continue;
400 keys[
k] = thinnedIndexes[
k];
401 foundContainers[
k] = bhThinned.
wrapper();
430 <<
"EventPrincipal::getThinnedAssociation, ThinnedAssociation ProductResolver cannot be found\n" 431 <<
"This should never happen. Contact a Framework developer";
433 ProductData const* productData = (phb->resolveProduct(*
this,
false,
nullptr,
nullptr)).
data();
434 if (productData ==
nullptr) {
440 <<
"EventPrincipal::getThinnedProduct, product has wrong type, not a ThinnedAssociation.\n";
RunPrincipal const & runPrincipal() const
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
EventNumber_t event() const
unsigned short BranchListIndex
void setLuminosityBlockPrincipal(std::shared_ptr< LuminosityBlockPrincipal > const &lbp)
EventSelectionIDVector const & eventSelectionIDs() const
WrapperBase const * getThinnedProduct(ProductID const &pid, unsigned int &key) const override
unsigned int ProductResolverIndex
std::type_info const & dynamicTypeInfo() const
BasicHandle getByProductID(ProductID const &oid) const
EventSelectionIDVector eventSelectionIDs_
BranchID pidToBid(ProductID const &pid) const
BranchListIndexes branchListIndexes_
edm::ThinnedAssociation const * getThinnedAssociation(edm::BranchID const &branchID) const
ProductResolverBase * getExistingProduct(BranchID const &branchID)
EventPrincipal(std::shared_ptr< ProductRegistry const > reg, std::shared_ptr< BranchIDListHelper const > branchIDListHelper, std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper, ProcessConfiguration const &pc, HistoryAppender *historyAppender, unsigned int streamIndex=0, bool isForPrimaryProcess=true)
Provenance getProvenance(ProductID const &pid, ModuleCallingContext const *mcc) const
std::map< BranchListIndex, ProcessIndex > branchListIndexToProcessIndex_
unsigned long long EventNumber_t
WrapperBase const * wrapper() const
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
BranchListIndexes const & branchListIndexes() const
unsigned int LuminosityBlockNumber_t
ProcessHistory const & processHistory() const
ProductID branchIDToProductID(BranchID const &bid) const
RunPrincipal const & runPrincipal() const
std::vector< EventSelectionID > EventSelectionIDVector
void getThinnedProducts(ProductID const &pid, std::vector< WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys) const override
static void throwProductDeletedException(ProductID const &pid, edm::EventPrincipal::ConstProductResolverPtr const phb)
EventNumber_t const invalidEventNumber
std::vector< BranchListIndex > BranchListIndexes
BranchID productIDToBranchID(ProductID const &pid, BranchIDLists const &lists, BranchListIndexes const &indexes)
ProcessHistoryID const & processHistoryID() const
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
Base::ConstProductResolverPtr ConstProductResolverPtr
WrapperBase const * wrapper() const
BranchID const & branchID() const
void put(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance) const
ProductID const & thinnedCollectionID() const
std::multimap< BranchID, IndexPair > BranchIDToIndexMap
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
unsigned short ProcessIndex
DelayedReader * reader() const
unsigned int value() const
void insertIntoSet(ProductProvenance provenanceProduct) const
T const * product() const
void clearEventPrincipal()
void putOnRead(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, ProductProvenance const *productProvenance) const
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > luminosityBlockPrincipal_
void setProcessHistoryID(ProcessHistoryID const &phid)
ProcessHistoryID const & processHistoryID() const
EventID const & id() const
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
char data[epos_bytes_allocation]
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
ConstProductResolverPtr getProductResolver(BranchID const &oid) const
unsigned int transitionIndex_() const override
unsigned short ProductIndex
ProductID const & parentCollectionID() const
bool hasParentIndex(unsigned int parentIndex, unsigned int &thinnedIndex) const
void setRunAndLumiNumber(RunNumber_t run, LuminosityBlockNumber_t lumi)
void fillPrincipal(ProcessHistoryID const &hist, ProcessHistoryRegistry const &phr, DelayedReader *reader)
EventAuxiliary const & aux() const
EventNumber_t event() const
WrapperBase const * getIt(ProductID const &pid) const override
static HepMC::HEPEVT_Wrapper wrapper