File indexing completed on 2024-05-31 04:19:24
0001 #ifndef Streamer_StreamedProducts_h
0002 #define Streamer_StreamedProducts_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <vector>
0016 #include "DataFormats/Provenance/interface/BranchDescription.h"
0017 #include "DataFormats/Provenance/interface/BranchID.h"
0018 #include "DataFormats/Provenance/interface/EventAuxiliary.h"
0019 #include "DataFormats/Provenance/interface/ParameterSetID.h"
0020 #include "DataFormats/Provenance/interface/ParameterSetBlob.h"
0021 #include "DataFormats/Provenance/interface/EventSelectionID.h"
0022 #include "DataFormats/Provenance/interface/BranchListIndex.h"
0023 #include "DataFormats/Provenance/interface/ProcessHistory.h"
0024 #include "DataFormats/Provenance/interface/BranchIDList.h"
0025 #include "DataFormats/Provenance/interface/ThinnedAssociationsHelper.h"
0026
0027 namespace edm {
0028
0029
0030
0031 class WrapperBase;
0032 class StreamedProduct {
0033 public:
0034 StreamedProduct() : prod_(nullptr), desc_(nullptr), present_(false), parents_(nullptr) {}
0035 explicit StreamedProduct(BranchDescription const& desc)
0036 : prod_(nullptr), desc_(&desc), present_(false), parents_(nullptr) {}
0037
0038 StreamedProduct(WrapperBase const* prod,
0039 BranchDescription const& desc,
0040 bool present,
0041 std::vector<BranchID> const* parents);
0042
0043 BranchDescription const* desc() const { return desc_; }
0044 BranchID branchID() const { return desc_->branchID(); }
0045 bool present() const { return present_; }
0046 std::vector<BranchID> const* parents() const { return parents_; }
0047 WrapperBase const* prod() { return prod_; }
0048
0049 void clear() {
0050 prod_ = nullptr;
0051 delete desc_;
0052 desc_ = nullptr;
0053 present_ = false;
0054 delete parents_;
0055 parents_ = nullptr;
0056 }
0057
0058 private:
0059 WrapperBase const* prod_;
0060 BranchDescription const* desc_;
0061 bool present_;
0062 std::vector<BranchID> const* parents_;
0063 };
0064
0065
0066
0067 typedef std::vector<StreamedProduct> SendProds;
0068
0069
0070
0071
0072
0073
0074 class SendEvent {
0075 public:
0076 SendEvent() {}
0077 SendEvent(EventAuxiliary const& aux,
0078 ProcessHistory const& processHistory,
0079 EventSelectionIDVector const& eventSelectionIDs,
0080 BranchListIndexes const& branchListIndexes,
0081 BranchIDLists const& branchIDLists,
0082 ThinnedAssociationsHelper const& thinnedAssociationsHelper,
0083 uint32_t metaDataChecksum)
0084 : aux_(aux),
0085 processHistory_(processHistory),
0086 eventSelectionIDs_(eventSelectionIDs),
0087 branchListIndexes_(branchListIndexes),
0088 branchIDLists_(branchIDLists),
0089 thinnedAssociationsHelper_(thinnedAssociationsHelper),
0090 products_(),
0091 metaDataChecksum_(metaDataChecksum) {}
0092 EventAuxiliary const& aux() const { return aux_; }
0093 SendProds const& products() const { return products_; }
0094 ProcessHistory const& processHistory() const { return processHistory_; }
0095 EventSelectionIDVector const& eventSelectionIDs() const { return eventSelectionIDs_; }
0096 BranchListIndexes const& branchListIndexes() const { return branchListIndexes_; }
0097
0098 BranchIDLists const& branchIDLists() const { return branchIDLists_; }
0099
0100 ThinnedAssociationsHelper const& thinnedAssociationsHelper() const { return thinnedAssociationsHelper_; }
0101
0102 uint32_t metaDataChecksum() const { return metaDataChecksum_; }
0103 SendProds& products() { return products_; }
0104
0105 private:
0106 EventAuxiliary aux_;
0107 ProcessHistory processHistory_;
0108 EventSelectionIDVector eventSelectionIDs_;
0109 BranchListIndexes branchListIndexes_;
0110 BranchIDLists branchIDLists_;
0111 ThinnedAssociationsHelper thinnedAssociationsHelper_;
0112 SendProds products_;
0113 uint32_t metaDataChecksum_;
0114
0115
0116 };
0117
0118 typedef std::vector<BranchDescription> SendDescs;
0119
0120 class SendJobHeader {
0121 public:
0122 typedef std::map<ParameterSetID, ParameterSetBlob> ParameterSetMap;
0123 SendJobHeader() {}
0124 SendDescs const& descs() const { return descs_; }
0125 ParameterSetMap const& processParameterSet() const { return processParameterSet_; }
0126 void push_back(BranchDescription const& bd) { descs_.push_back(bd); }
0127 void setParameterSetMap(ParameterSetMap const& psetMap) { processParameterSet_ = psetMap; }
0128 void initializeTransients();
0129
0130 private:
0131 SendDescs descs_;
0132 ParameterSetMap processParameterSet_;
0133 };
0134
0135 }
0136 #endif