34 std::shared_ptr<BranchIDListHelper const> branchIDListHelper,
35 std::shared_ptr<ThinnedAssociationsHelper const> thinnedAssociationsHelper,
38 unsigned int streamIndex,
39 bool isForPrimaryProcess,
41 :
Base(reg, reg->productLookup(
InEvent), pc,
InEvent, historyAppender, isForPrimaryProcess),
43 luminosityBlockPrincipal_(nullptr),
46 branchIDListHelper_(branchIDListHelper),
47 processBlockHelper_(processBlockHelper),
48 thinnedAssociationsHelper_(thinnedAssociationsHelper),
50 branchListIndexToProcessIndex_(),
51 streamID_(streamIndex) {
54 for (
auto&
prod : *
this) {
55 if (
prod->singleProduct()) {
76 bool deepCopyRetriever) {
78 if (deepCopyRetriever) {
129 "EventAuxiliary, It is illegal for the event number to be 0\n";
162 for (
auto&
prod : *
this) {
163 if (
prod->singleProduct()) {
169 auto const&
bd =
prod->branchDescription();
187 std::unique_ptr<WrapperBase> edp,
191 if (edp.get() ==
nullptr) {
203 if (edp.get() ==
nullptr) {
218 std::unique_ptr<WrapperBase> edp,
219 std::optional<ProductProvenance> productProvenance)
const {
221 if (productProvenance) {
242 typedef BIDToIndexMap::const_iterator Iter;
243 typedef std::pair<Iter, Iter> IndexRange;
246 for (Iter it =
range.first; it !=
range.second; ++it) {
253 return ProductID(processIndex + 1, productIndex + 1);
272 exception <<
"get by product ID: The product with given id: " << pid <<
"\ntype: " << phb->productType()
273 <<
"\nproduct instance name: " << phb->productInstanceName() <<
"\nprocess name: " << phb->processName()
274 <<
"\nwas already deleted. This is a configuration error. Please change the configuration of the module " 275 "which caused this exception to state it reads this data.";
282 if (phb ==
nullptr) {
285 *whyFailed <<
"get by product ID: no product with given id: " << pid <<
"\n";
291 if (phb->productWasDeleted()) {
296 if (phb->unscheduledWasNotRun()) {
299 *whyFailed <<
"get by ProductID: could not get product with id: " << pid <<
"\n" 300 <<
"Unscheduled execution not allowed to get via ProductID.\n";
304 auto resolution = phb->resolveProduct(*
this,
false,
nullptr,
nullptr);
327 std::vector<WrapperBase const*>& foundContainers,
328 std::vector<unsigned int>&
keys)
const {
350 if (
auto factory = std::get_if<detail::GetThinnedKeyFromExceptionFactory>(&
ret)) {
351 return [
func = *factory]() {
353 ex.addContext(
"Calling EventPrincipal::getThinnedKeyFrom()");
360 ex.
addContext(
"Calling EventPrincipal::getThinnedKeyFrom()");
386 if (phb ==
nullptr) {
388 <<
"EventPrincipal::getThinnedAssociation, ThinnedAssociation ProductResolver cannot be found\n" 389 <<
"This should never happen. Contact a Framework developer";
391 ProductData const* productData = (phb->resolveProduct(*
this,
false,
nullptr,
nullptr)).
data();
392 if (productData ==
nullptr) {
398 <<
"EventPrincipal::getThinnedProduct, product has wrong type, not a ThinnedAssociation.\n";
void fillPrincipal(DelayedReader *reader)
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
std::optional< std::tuple< WrapperBase const *, unsigned int > > getThinnedProduct(ProductID const &pid, unsigned int key) const override
void setLuminosityBlockPrincipal(LuminosityBlockPrincipal *lbp)
void commonFillEventPrincipal(EventAuxiliary const &aux, ProcessHistory const *processHistory, DelayedReader *reader)
unsigned short BranchListIndex
unsigned int ProductResolverIndex
EventNumber_t event() const
EventAuxiliary const & aux() const
std::variant< unsigned int, detail::GetThinnedKeyFromExceptionFactory, std::monostate > OptionalThinnedKey
EventToProcessBlockIndexes eventToProcessBlockIndexes_
ProductRegistry const & productRegistry() const
EventSelectionIDVector eventSelectionIDs_
ret
prodAgent to be discontinued
unsigned int processBlockIndex(std::string const &processName) const override
edm::ThinnedAssociation const * getThinnedAssociation(edm::BranchID const &branchID) const
RunPrincipal const & runPrincipal() const
std::optional< std::tuple< WrapperBase const *, unsigned int > > getThinnedProduct(ProductID const &pid, unsigned int key, ThinnedAssociationsHelper const &thinnedAssociationsHelper, F1 pidToBid, F2 getThinnedAssociation, F3 getByProductID)
std::variant< unsigned int, GetThinnedKeyFromExceptionFactory, std::monostate > getThinnedKeyFrom_implementation(ProductID const &parentID, BranchID const &parent, unsigned int key, ProductID const &thinnedID, BranchID thinned, ThinnedAssociationsHelper const &thinnedAssociationsHelper, F &&getThinnedAssociation)
BranchListIndexes branchListIndexes_
ProductResolverBase * getExistingProduct(BranchID const &branchID)
unsigned long long EventNumber_t
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_
void changedIndexes_() final
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
Provenance const & getProvenance(ProductID const &pid) const
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
OptionalThinnedKey getThinnedKeyFrom(ProductID const &parent, unsigned int key, ProductID const &thinned) const override
WrapperBase const * wrapper() const
unsigned int LuminosityBlockNumber_t
BasicHandle getByProductID(ProductID const &oid) const
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, ProcessBlockHelperBase const *processBlockHelper=nullptr)
BranchID pidToBid(ProductID const &pid) const
bool equal(const T &first, const T &second)
std::vector< EventSelectionID > EventSelectionIDVector
EventToProcessBlockIndexes const & eventToProcessBlockIndexes() const
static void throwProductDeletedException(ProductID const &pid, edm::EventPrincipal::ConstProductResolverPtr const phb)
void getThinnedProducts(ProductID const &pid, ThinnedAssociationsHelper const &thinnedAssociationsHelper, F1 pidToBid, F2 getThinnedAssociation, F3 getByProductID, std::vector< WrapperBase const *> &foundContainers, std::vector< unsigned int > &keys)
EventID const & id() const
ProductID branchIDToProductID(BranchID const &bid) const
EventNumber_t const invalidEventNumber
std::vector< BranchListIndex > BranchListIndexes
void put(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance) const
BranchID productIDToBranchID(ProductID const &pid, BranchIDLists const &lists, BranchListIndexes const &indexes)
std::type_info const & dynamicTypeInfo() const
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
Base::ConstProductResolverPtr ConstProductResolverPtr
void getThinnedProducts(ProductID const &pid, std::vector< WrapperBase const *> &foundContainers, std::vector< unsigned int > &keys) const override
void updateBranchListIndexes(BranchListIndexes &&)
std::multimap< BranchID, IndexPair > BranchIDToIndexMap
virtual unsigned int processBlockIndex(std::string const &processName, EventToProcessBlockIndexes const &) const =0
ProcessHistoryID const & processHistoryID() const
RunPrincipal const & runPrincipal() const
std::vector< ProcessIndex > branchListIndexToProcessIndex_
unsigned short ProcessIndex
WrapperBase const * getIt(ProductID const &pid) const override
WrapperBase const * wrapper() const noexcept(true)
unsigned int transitionIndex_() const override
void putOnRead(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, std::optional< ProductProvenance > productProvenance) const
ProcessHistory const & processHistory() const
void clearEventPrincipal()
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
void addContext(std::string const &context)
void setProcessHistoryID(ProcessHistoryID const &phid)
bool wasBranchListIndexesChangedFromInput(BranchListIndexes const &) const
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistory const *processHistory, DelayedReader *reader=nullptr)
ProcessBlockHelperBase const * processBlockHelper_
char data[epos_bytes_allocation]
StableProvenance const & getStableProvenance(ProductID const &pid) const
ProcessHistoryID const & processHistoryID() const
EventSelectionIDVector const & eventSelectionIDs() const
unsigned short ProductIndex
unsigned int value() const
void setRunAndLumiNumber(RunNumber_t run, LuminosityBlockNumber_t lumi)
BranchListIndexes const & branchListIndexes() const
const_iterator end() const
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
EventNumber_t event() const
DelayedReader * reader() const
void insertIntoSet(ProductProvenance provenanceProduct) const
static HepMC::HEPEVT_Wrapper wrapper
ConstProductResolverPtr getProductResolver(BranchID const &oid) const