|
|
Go to the documentation of this file.
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) {
128 "EventAuxiliary, It is illegal for the event number to be 0\n";
161 for (
auto&
prod : *
this) {
162 if (
prod->singleProduct()) {
168 auto const&
bd =
prod->branchDescription();
186 std::unique_ptr<WrapperBase> edp,
190 if (edp.get() ==
nullptr) {
198 dynamic_cast<ProductPutterBase const*>(phb)->putProduct(
std::move(edp));
202 if (edp.get() ==
nullptr) {
213 dynamic_cast<ProductPutterBase const*>(phb)->putProduct(
std::move(edp));
217 std::unique_ptr<WrapperBase> edp,
218 std::optional<ProductProvenance> productProvenance)
const {
220 if (productProvenance) {
226 dynamic_cast<ProductPutterBase const*>(phb)->putProduct(
std::move(edp));
241 typedef BIDToIndexMap::const_iterator Iter;
242 typedef std::pair<Iter, Iter> IndexRange;
245 for (Iter it =
range.first; it !=
range.second; ++it) {
252 return ProductID(processIndex + 1, productIndex + 1);
271 exception <<
"get by product ID: The product with given id: " << pid <<
"\ntype: " << phb->productType()
272 <<
"\nproduct instance name: " << phb->productInstanceName() <<
"\nprocess name: " << phb->processName()
273 <<
"\nwas already deleted. This is a configuration error. Please change the configuration of the module "
274 "which caused this exception to state it reads this data.";
281 if (phb ==
nullptr) {
284 *whyFailed <<
"get by product ID: no product with given id: " << pid <<
"\n";
290 if (phb->productWasDeleted()) {
295 if (phb->unscheduledWasNotRun()) {
298 *whyFailed <<
"get by ProductID: could not get product with id: " << pid <<
"\n"
299 <<
"Unscheduled execution not allowed to get via ProductID.\n";
303 auto resolution = phb->resolveProduct(*
this,
false,
nullptr,
nullptr);
326 std::vector<WrapperBase const*>& foundContainers,
327 std::vector<unsigned int>&
keys)
const {
349 if (
auto factory = std::get_if<detail::GetThinnedKeyFromExceptionFactory>(&
ret)) {
350 return [
func = *factory]() {
352 ex.addContext(
"Calling EventPrincipal::getThinnedKeyFrom()");
359 ex.
addContext(
"Calling EventPrincipal::getThinnedKeyFrom()");
385 if (phb ==
nullptr) {
387 <<
"EventPrincipal::getThinnedAssociation, ThinnedAssociation ProductResolver cannot be found\n"
388 <<
"This should never happen. Contact a Framework developer";
390 ProductData const* productData = (phb->resolveProduct(*
this,
false,
nullptr,
nullptr)).
data();
391 if (productData ==
nullptr) {
397 <<
"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
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)
unsigned short ProcessIndex
unsigned int value() const
static HepMC::HEPEVT_Wrapper wrapper
ProcessHistory const & processHistory() const
unsigned int LuminosityBlockNumber_t
ProcessBlockHelperBase const * processBlockHelper_
unsigned short ProductIndex
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
void setRunAndLumiNumber(RunNumber_t run, LuminosityBlockNumber_t lumi)
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
void insertIntoSet(ProductProvenance provenanceProduct) const
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
BranchListIndexes const & branchListIndexes() const
EventToProcessBlockIndexes eventToProcessBlockIndexes_
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 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
virtual unsigned int processBlockIndex(std::string const &processName, EventToProcessBlockIndexes const &) const =0
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
unsigned int processBlockIndex(std::string const &processName) const override
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)
EventToProcessBlockIndexes const & eventToProcessBlockIndexes() const
BranchListIndexes branchListIndexes_
bool wasBranchListIndexesChangedFromInput(BranchListIndexes const &) const