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) {
65 bool deepCopyRetriever) {
67 if (deepCopyRetriever) {
98 "EventAuxiliary, It is illegal for the event number to be 0\n";
119 for (
auto&
prod : *
this) {
120 if (
prod->singleProduct()) {
125 auto const& bd =
prod->branchDescription();
145 std::unique_ptr<WrapperBase> edp,
149 if (edp.get() ==
nullptr) {
161 if (edp.get() ==
nullptr) {
176 std::unique_ptr<WrapperBase> edp,
179 if (productProvenance) {
200 typedef BIDToIndexMap::const_iterator Iter;
201 typedef std::pair<Iter, Iter> IndexRange;
204 for (Iter it = range.first; it != range.second; ++it) {
210 return ProductID(processIndex + 1, productIndex + 1);
222 exception <<
"get by product ID: The product with given id: " << pid <<
"\ntype: " << phb->productType()
223 <<
"\nproduct instance name: " << phb->productInstanceName() <<
"\nprocess name: " << phb->processName()
224 <<
"\nwas already deleted. This is a configuration error. Please change the configuration of the module " 225 "which caused this exception to state it reads this data.";
232 if (phb ==
nullptr) {
235 *whyFailed <<
"get by product ID: no product with given id: " << pid <<
"\n";
241 if (phb->productWasDeleted()) {
246 if (phb->unscheduledWasNotRun()) {
249 *whyFailed <<
"get by ProductID: could not get product with id: " << pid <<
"\n" 250 <<
"Unscheduled execution not allowed to get via ProductID.\n";
254 auto resolution = phb->resolveProduct(*
this,
false,
nullptr,
nullptr);
271 associatedBranches != iEnd;
272 ++associatedBranches) {
274 if (thinnedAssociation ==
nullptr)
281 unsigned int thinnedIndex = 0;
294 if (wrapperBase !=
nullptr) {
308 std::vector<WrapperBase const*>& foundContainers,
309 std::vector<unsigned int>&
keys)
const {
315 associatedBranches != iEnd;
316 ++associatedBranches) {
318 if (thinnedAssociation ==
nullptr)
325 unsigned nKeys = keys.size();
327 std::vector<unsigned int> thinnedIndexes(nKeys, doNotLookForThisIndex);
329 for (
unsigned k = 0;
k < nKeys; ++
k) {
331 if (foundContainers[
k] !=
nullptr)
334 if (keys[
k] == doNotLookForThisIndex)
354 for (
unsigned k = 0;
k < nKeys; ++
k) {
355 if (foundContainers[
k] ==
nullptr)
357 if (thinnedIndexes[
k] == doNotLookForThisIndex)
359 keys[
k] = thinnedIndexes[
k];
362 for (
unsigned k = 0;
k < nKeys; ++
k) {
363 if (thinnedIndexes[
k] == doNotLookForThisIndex)
365 keys[
k] = thinnedIndexes[
k];
366 foundContainers[
k] = bhThinned.
wrapper();
384 if (phb ==
nullptr) {
386 <<
"EventPrincipal::getThinnedAssociation, ThinnedAssociation ProductResolver cannot be found\n" 387 <<
"This should never happen. Contact a Framework developer";
389 ProductData const* productData = (phb->resolveProduct(*
this,
false,
nullptr,
nullptr)).
data();
390 if (productData ==
nullptr) {
396 <<
"EventPrincipal::getThinnedProduct, product has wrong type, not a ThinnedAssociation.\n";
RunPrincipal const & runPrincipal() const
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper_
void setLuminosityBlockPrincipal(LuminosityBlockPrincipal *lbp)
EventNumber_t event() const
unsigned short BranchListIndex
WrapperBase const * wrapper() const (true)
EventSelectionIDVector const & eventSelectionIDs() const
WrapperBase const * getThinnedProduct(ProductID const &pid, unsigned int &key) const override
unsigned int ProductResolverIndex
bool isValid() const (true)
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
edm::propagate_const< LuminosityBlockPrincipal * > luminosityBlockPrincipal_
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
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
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