CMS 3D CMS Logo

StreamerInputSource.h
Go to the documentation of this file.
1 #ifndef IOPool_Streamer_StreamerInputSource_h
2 #define IOPool_Streamer_StreamerInputSource_h
3 
11 #include "TBufferFile.h"
12 
16 
19 
20 #include <memory>
21 #include <vector>
22 
23 class InitMsgView;
24 class EventMsgView;
25 
26 namespace edm {
27  class BranchIDListHelper;
29  class ThinnedAssociationsHelper;
30 
32  public:
33  explicit StreamerInputSource(ParameterSet const& pset, InputSourceDescription const& desc);
34  ~StreamerInputSource() override;
36 
37  std::unique_ptr<SendJobHeader> deserializeRegistry(InitMsgView const& initView);
38 
39  void deserializeAndMergeWithRegistry(InitMsgView const& initView, bool subsequent = false);
40 
41  void deserializeEvent(EventMsgView const& eventView);
42 
43  static void mergeIntoRegistry(SendJobHeader const& header,
47  bool subsequent);
48 
57  static unsigned int uncompressBuffer(unsigned char* inputBuffer,
58  unsigned int inputSize,
59  std::vector<unsigned char>& outputBuffer,
60  unsigned int expectedFullSize);
61 
62  protected:
63  static void declareStreamers(SendDescs const& descs);
64  static void buildClassCache(SendDescs const& descs);
65  void resetAfterEndRun();
66 
67  private:
69  public:
71  ~EventPrincipalHolder() override;
72 
73  WrapperBase const* getIt(ProductID const& id) const override;
74  WrapperBase const* getThinnedProduct(ProductID const&, unsigned int&) const override;
75  void getThinnedProducts(ProductID const& pid,
76  std::vector<WrapperBase const*>& wrappers,
77  std::vector<unsigned int>& keys) const override;
78 
79  unsigned int transitionIndex_() const override;
80 
82 
83  private:
84  // We don't own the principal. The lifetime must be managed externally.
86  };
87 
88  void read(EventPrincipal& eventPrincipal) override;
89 
90  void setRun(RunNumber_t r) override;
91 
92  std::unique_ptr<FileBlock> readFile_() override;
93 
95  std::vector<unsigned char> dest_;
96  TBufferFile xbuf_;
99  std::vector<edm::propagate_const<std::unique_ptr<EventPrincipalHolder>>> streamToEventPrincipalHolders_;
101 
103  unsigned int protocolVersion_;
104  }; //end-of-class-def
105 } // namespace edm
106 
107 #endif
void read(EventPrincipal &eventPrincipal) override
static void fillDescription(ParameterSetDescription &description)
static void mergeIntoRegistry(SendJobHeader const &header, ProductRegistry &, BranchIDListHelper &, ThinnedAssociationsHelper &, bool subsequent)
std::vector< BranchDescription > SendDescs
std::unique_ptr< SendJobHeader > deserializeRegistry(InitMsgView const &initView)
StreamerInputSource(ParameterSet const &pset, InputSourceDescription const &desc)
void setRun(RunNumber_t r) override
std::unique_ptr< FileBlock > readFile_() override
static void declareStreamers(SendDescs const &descs)
static void buildClassCache(SendDescs const &descs)
edm::propagate_const< std::unique_ptr< EventPrincipalHolder > > eventPrincipalHolder_
void deserializeEvent(EventMsgView const &eventView)
void getThinnedProducts(ProductID const &pid, std::vector< WrapperBase const * > &wrappers, std::vector< unsigned int > &keys) const override
edm::propagate_const< std::unique_ptr< SendEvent > > sendEvent_
WrapperBase const * getThinnedProduct(ProductID const &, unsigned int &) const override
WrapperBase const * getIt(ProductID const &id) const override
edm::propagate_const< TClass * > tc_
HLT enums.
std::vector< edm::propagate_const< std::unique_ptr< EventPrincipalHolder > > > streamToEventPrincipalHolders_
unsigned int RunNumber_t
void deserializeAndMergeWithRegistry(InitMsgView const &initView, bool subsequent=false)
static unsigned int uncompressBuffer(unsigned char *inputBuffer, unsigned int inputSize, std::vector< unsigned char > &outputBuffer, unsigned int expectedFullSize)
std::vector< unsigned char > dest_