|
|
Go to the documentation of this file.
33 std::shared_ptr<BranchIDListHelper const> branchIDListHelper,
34 std::shared_ptr<ThinnedAssociationsHelper const> thinnedAssociationsHelper,
37 unsigned int streamIndex,
38 bool isForPrimaryProcess)
39 :
Base(reg, reg->productLookup(
InEvent), pc,
InEvent, historyAppender, isForPrimaryProcess),
41 luminosityBlockPrincipal_(nullptr),
44 branchIDListHelper_(branchIDListHelper),
45 thinnedAssociationsHelper_(thinnedAssociationsHelper),
47 branchListIndexToProcessIndex_(),
48 streamID_(streamIndex) {
51 for (
auto&
prod : *
this) {
52 if (
prod->singleProduct()) {
72 bool deepCopyRetriever) {
74 if (deepCopyRetriever) {
123 "EventAuxiliary, It is illegal for the event number to be 0\n";
156 for (
auto&
prod : *
this) {
157 if (
prod->singleProduct()) {
163 auto const&
bd =
prod->branchDescription();
181 std::unique_ptr<WrapperBase> edp,
185 if (edp.get() ==
nullptr) {
193 dynamic_cast<ProductPutterBase const*>(phb)->putProduct(
std::move(edp));
197 if (edp.get() ==
nullptr) {
208 dynamic_cast<ProductPutterBase const*>(phb)->putProduct(
std::move(edp));
212 std::unique_ptr<WrapperBase> edp,
213 std::optional<ProductProvenance> productProvenance)
const {
215 if (productProvenance) {
221 dynamic_cast<ProductPutterBase const*>(phb)->putProduct(
std::move(edp));
236 typedef BIDToIndexMap::const_iterator Iter;
237 typedef std::pair<Iter, Iter> IndexRange;
240 for (Iter it =
range.first; it !=
range.second; ++it) {
247 return ProductID(processIndex + 1, productIndex + 1);
262 exception <<
"get by product ID: The product with given id: " << pid <<
"\ntype: " << phb->productType()
263 <<
"\nproduct instance name: " << phb->productInstanceName() <<
"\nprocess name: " << phb->processName()
264 <<
"\nwas already deleted. This is a configuration error. Please change the configuration of the module "
265 "which caused this exception to state it reads this data.";
272 if (phb ==
nullptr) {
275 *whyFailed <<
"get by product ID: no product with given id: " << pid <<
"\n";
281 if (phb->productWasDeleted()) {
286 if (phb->unscheduledWasNotRun()) {
289 *whyFailed <<
"get by ProductID: could not get product with id: " << pid <<
"\n"
290 <<
"Unscheduled execution not allowed to get via ProductID.\n";
294 auto resolution = phb->resolveProduct(*
this,
false,
nullptr,
nullptr);
317 std::vector<WrapperBase const*>& foundContainers,
318 std::vector<unsigned int>&
keys)
const {
340 if (
auto factory = std::get_if<detail::GetThinnedKeyFromExceptionFactory>(&
ret)) {
341 return [
func = *factory]() {
343 ex.addContext(
"Calling EventPrincipal::getThinnedKeyFrom()");
350 ex.
addContext(
"Calling EventPrincipal::getThinnedKeyFrom()");
372 if (phb ==
nullptr) {
374 <<
"EventPrincipal::getThinnedAssociation, ThinnedAssociation ProductResolver cannot be found\n"
375 <<
"This should never happen. Contact a Framework developer";
377 ProductData const* productData = (phb->resolveProduct(*
this,
false,
nullptr,
nullptr)).
data();
378 if (productData ==
nullptr) {
384 <<
"EventPrincipal::getThinnedProduct, product has wrong type, not a ThinnedAssociation.\n";
std::optional< std::tuple< WrapperBase const *, unsigned int > > getThinnedProduct(ProductID const &pid, unsigned int key, ThinnedAssociationsHelper const &thinnedAssociationsHelper, F1 pidToBid, F2 getThinnedAssociation, F3 getByProductID)
ret
prodAgent to be discontinued
EventNumber_t event() const
std::shared_ptr< BranchIDListHelper const > branchIDListHelper_
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_
RunPrincipal const & runPrincipal() const
EventAuxiliary const & aux() const
unsigned int ProductResolverIndex
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
void addContext(std::string const &context)
WrapperBase const * wrapper() const
WrapperBase const * getIt(ProductID const &pid) const override
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
std::optional< std::tuple< WrapperBase const *, unsigned int > > getThinnedProduct(ProductID const &pid, unsigned int key) const override
std::vector< BranchListIndex > BranchListIndexes
unsigned short ProcessIndex
unsigned int value() const
static HepMC::HEPEVT_Wrapper wrapper
ProcessHistory const & processHistory() const
unsigned int LuminosityBlockNumber_t
unsigned short ProductIndex
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
void setRunAndLumiNumber(RunNumber_t run, LuminosityBlockNumber_t lumi)
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
BranchListIndexes const & branchListIndexes() const
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)
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
void insertIntoSet(ProductProvenance provenanceProduct) const
void changedIndexes_() final
Base::ConstProductResolverPtr ConstProductResolverPtr
edm::ThinnedAssociation const * getThinnedAssociation(edm::BranchID const &branchID) const
ProcessHistoryID const & processHistoryID() const
const EventNumber_t invalidEventNumber
DelayedReader * reader() const
EventID const & id() const
ConstProductResolverPtr getProductResolver(BranchID const &oid) const
std::multimap< BranchID, IndexPair > BranchIDToIndexMap
unsigned short BranchListIndex
unsigned long long EventNumber_t
const_iterator end() const
void put(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance) const
WrapperBase const * wrapper() const noexcept(true)
ProductRegistry const & productRegistry() const
std::type_info const & dynamicTypeInfo() const
OptionalThinnedKey getThinnedKeyFrom(ProductID const &parent, unsigned int key, ProductID const &thinned) const override
Provenance const & getProvenance(ProductID const &pid) const
void fillPrincipal(DelayedReader *reader)
std::vector< ProcessIndex > branchListIndexToProcessIndex_
void setLuminosityBlockPrincipal(LuminosityBlockPrincipal *lbp)
EventNumber_t event() const
void commonFillEventPrincipal(EventAuxiliary const &aux, ProcessHistory const *processHistory, DelayedReader *reader)
void putOnRead(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp, std::optional< ProductProvenance > productProvenance) const
EventSelectionIDVector const & eventSelectionIDs() const
ProductResolverBase * getExistingProduct(BranchID const &branchID)
void updateBranchListIndexes(BranchListIndexes &&)
EventSelectionIDVector eventSelectionIDs_
BasicHandle getByProductID(ProductID const &oid) const
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistory const *processHistory, DelayedReader *reader=nullptr)
std::variant< unsigned int, detail::GetThinnedKeyFromExceptionFactory, std::monostate > OptionalThinnedKey
void getThinnedProducts(ProductID const &pid, std::vector< WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys) const override
StableProvenance const & getStableProvenance(ProductID const &pid) const
static void throwProductDeletedException(ProductID const &pid, edm::EventPrincipal::ConstProductResolverPtr const phb)
void clearEventPrincipal()
ProcessHistoryID const & processHistoryID() const
ProductID branchIDToProductID(BranchID const &bid) const
char data[epos_bytes_allocation]
BranchID productIDToBranchID(ProductID const &pid, BranchIDLists const &lists, BranchListIndexes const &indexes)
unsigned int transitionIndex_() const override
BranchID pidToBid(ProductID const &pid) const
void getThinnedProducts(ProductID const &pid, ThinnedAssociationsHelper const &thinnedAssociationsHelper, F1 pidToBid, F2 getThinnedAssociation, F3 getByProductID, std::vector< WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys)
std::vector< EventSelectionID > EventSelectionIDVector
bool equal(const T &first, const T &second)
RunPrincipal const & runPrincipal() const
void setProcessHistoryID(ProcessHistoryID const &phid)
BranchListIndexes branchListIndexes_
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)
bool wasBranchListIndexesChangedFromInput(BranchListIndexes const &) const