test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StreamerInputSource.h
Go to the documentation of this file.
1 #ifndef IOPool_Streamer_StreamerInputSource_h
2 #define IOPool_Streamer_StreamerInputSource_h
3 
12 #include "TBufferFile.h"
13 
17 
20 
21 #include <memory>
22 #include <vector>
23 
24 class InitMsgView;
25 class EventMsgView;
26 
27 namespace edm {
28  class BranchIDListHelper;
30  class ThinnedAssociationsHelper;
31 
33  public:
34  explicit StreamerInputSource(ParameterSet const& pset,
35  InputSourceDescription const& desc);
36  virtual ~StreamerInputSource();
38 
39  std::unique_ptr<SendJobHeader> deserializeRegistry(InitMsgView const& initView);
40 
41  void deserializeAndMergeWithRegistry(InitMsgView const& initView, bool subsequent = false);
42 
43  void deserializeEvent(EventMsgView const& eventView);
44 
45  static
46  void mergeIntoRegistry(SendJobHeader const& header,
50  bool subsequent);
51 
60  static unsigned int uncompressBuffer(unsigned char* inputBuffer,
61  unsigned int inputSize,
62  std::vector<unsigned char>& outputBuffer,
63  unsigned int expectedFullSize);
64  protected:
65  static void declareStreamers(SendDescs const& descs);
66  static void buildClassCache(SendDescs const& descs);
67  void resetAfterEndRun();
68 
69  private:
70 
72  public:
74  virtual ~EventPrincipalHolder();
75 
76  virtual WrapperBase const* getIt(ProductID const& id) const override;
77  virtual WrapperBase const* getThinnedProduct(ProductID const&, unsigned int&) const override;
78  virtual void getThinnedProducts(ProductID const& pid,
79  std::vector<WrapperBase const*>& wrappers,
80  std::vector<unsigned int>& keys) const override;
81 
82 
83  virtual unsigned int transitionIndex_() const override;
84 
86 
87  private:
88  // We don't own the principal. The lifetime must be managed externally.
90  };
91 
92  virtual void read(EventPrincipal& eventPrincipal);
93 
94  virtual void setRun(RunNumber_t r);
95 
96  virtual std::unique_ptr<FileBlock> readFile_();
97 
99  std::vector<unsigned char> dest_;
100  TBufferFile xbuf_;
103  std::vector<edm::propagate_const<std::unique_ptr<EventPrincipalHolder>>> streamToEventPrincipalHolders_;
105 
107  unsigned int protocolVersion_;
108  }; //end-of-class-def
109 } // end of namespace-edm
110 
111 #endif
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)
virtual void setRun(RunNumber_t r)
static void declareStreamers(SendDescs const &descs)
virtual WrapperBase const * getIt(ProductID const &id) const override
static void buildClassCache(SendDescs const &descs)
edm::propagate_const< std::unique_ptr< EventPrincipalHolder > > eventPrincipalHolder_
void deserializeEvent(EventMsgView const &eventView)
virtual WrapperBase const * getThinnedProduct(ProductID const &, unsigned int &) const override
virtual unsigned int transitionIndex_() const override
tuple description
Definition: idDealer.py:66
tuple pid
Definition: sysUtil.py:22
edm::propagate_const< std::unique_ptr< SendEvent > > sendEvent_
edm::propagate_const< TClass * > tc_
virtual void getThinnedProducts(ProductID const &pid, std::vector< WrapperBase const * > &wrappers, std::vector< unsigned int > &keys) const override
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)
virtual void read(EventPrincipal &eventPrincipal)
virtual std::unique_ptr< FileBlock > readFile_()
std::vector< unsigned char > dest_