|
|
Go to the documentation of this file.
31 std::shared_ptr<BranchIDListHelper const> branchIDListHelper,
32 std::shared_ptr<ThinnedAssociationsHelper const> thinnedAssociationsHelper,
35 unsigned int streamIndex,
36 bool isForPrimaryProcess)
37 :
Base(reg, reg->productLookup(
InEvent), pc,
InEvent, historyAppender, isForPrimaryProcess),
39 luminosityBlockPrincipal_(nullptr),
42 branchIDListHelper_(branchIDListHelper),
43 thinnedAssociationsHelper_(thinnedAssociationsHelper),
45 branchListIndexToProcessIndex_(),
46 streamID_(streamIndex) {
49 for (
auto&
prod : *
this) {
50 if (
prod->singleProduct()) {
70 bool deepCopyRetriever) {
72 if (deepCopyRetriever) {
121 "EventAuxiliary, It is illegal for the event number to be 0\n";
154 for (
auto&
prod : *
this) {
155 if (
prod->singleProduct()) {
161 auto const& bd =
prod->branchDescription();
179 std::unique_ptr<WrapperBase> edp,
183 if (edp.get() ==
nullptr) {
195 if (edp.get() ==
nullptr) {
210 std::unique_ptr<WrapperBase> edp,
211 std::optional<ProductProvenance> productProvenance)
const {
213 if (productProvenance) {
234 typedef BIDToIndexMap::const_iterator Iter;
235 typedef std::pair<Iter, Iter> IndexRange;
238 for (Iter it =
range.first; it !=
range.second; ++it) {
245 return ProductID(processIndex + 1, productIndex + 1);
260 exception <<
"get by product ID: The product with given id: " << pid <<
"\ntype: " << phb->productType()
261 <<
"\nproduct instance name: " << phb->productInstanceName() <<
"\nprocess name: " << phb->processName()
262 <<
"\nwas already deleted. This is a configuration error. Please change the configuration of the module "
263 "which caused this exception to state it reads this data.";
270 if (phb ==
nullptr) {
273 *whyFailed <<
"get by product ID: no product with given id: " << pid <<
"\n";
279 if (phb->productWasDeleted()) {
284 if (phb->unscheduledWasNotRun()) {
287 *whyFailed <<
"get by ProductID: could not get product with id: " << pid <<
"\n"
288 <<
"Unscheduled execution not allowed to get via ProductID.\n";
292 auto resolution = phb->resolveProduct(*
this,
false,
nullptr,
nullptr);
309 associatedBranches != iEnd;
310 ++associatedBranches) {
312 if (thinnedAssociation ==
nullptr)
319 unsigned int thinnedIndex = 0;
332 if (wrapperBase !=
nullptr) {
346 std::vector<WrapperBase const*>& foundContainers,
347 std::vector<unsigned int>&
keys)
const {
353 associatedBranches != iEnd;
354 ++associatedBranches) {
356 if (thinnedAssociation ==
nullptr)
363 unsigned nKeys =
keys.size();
365 std::vector<unsigned int> thinnedIndexes(nKeys, doNotLookForThisIndex);
367 for (
unsigned k = 0;
k < nKeys; ++
k) {
369 if (foundContainers[
k] !=
nullptr)
372 if (
keys[
k] == doNotLookForThisIndex)
392 for (
unsigned k = 0;
k < nKeys; ++
k) {
393 if (foundContainers[
k] ==
nullptr)
395 if (thinnedIndexes[
k] == doNotLookForThisIndex)
397 keys[
k] = thinnedIndexes[
k];
400 for (
unsigned k = 0;
k < nKeys; ++
k) {
401 if (thinnedIndexes[
k] == doNotLookForThisIndex)
403 keys[
k] = thinnedIndexes[
k];
404 foundContainers[
k] = bhThinned.
wrapper();
422 if (phb ==
nullptr) {
424 <<
"EventPrincipal::getThinnedAssociation, ThinnedAssociation ProductResolver cannot be found\n"
425 <<
"This should never happen. Contact a Framework developer";
427 ProductData const* productData = (phb->resolveProduct(*
this,
false,
nullptr,
nullptr)).
data();
428 if (productData ==
nullptr) {
434 <<
"EventPrincipal::getThinnedProduct, product has wrong type, not a ThinnedAssociation.\n";
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
WrapperBase const * wrapper() const
WrapperBase const * getIt(ProductID const &pid) const override
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
WrapperBase const * 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
Provenance getProvenance(ProductID const &pid, ModuleCallingContext const *mcc) const
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
void setRunAndLumiNumber(RunNumber_t run, LuminosityBlockNumber_t lumi)
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
void fillPrincipal(ProcessHistoryID const &hist, ProcessHistory const *phr, DelayedReader *reader)
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
BranchListIndexes const & branchListIndexes() const
edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > provRetrieverPtr_
void insertIntoSet(ProductProvenance provenanceProduct) const
void changedIndexes_() final
Base::ConstProductResolverPtr ConstProductResolverPtr
bool isValid() const noexcept(true)
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
ProductID const & thinnedCollectionID() const
std::type_info const & dynamicTypeInfo() const
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 &&)
bool hasParentIndex(unsigned int parentIndex, unsigned int &thinnedIndex) const
ProductID const & parentCollectionID() const
EventSelectionIDVector eventSelectionIDs_
BasicHandle getByProductID(ProductID const &oid) const
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistory const *processHistory, DelayedReader *reader=nullptr)
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)
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
std::vector< EventSelectionID > EventSelectionIDVector
bool equal(const T &first, const T &second)
BranchID const & branchID() const
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