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 
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,
34  InputSourceDescription const& desc);
35  virtual ~StreamerInputSource();
37 
38  std::auto_ptr<SendJobHeader> deserializeRegistry(InitMsgView const& initView);
39 
40  void deserializeAndMergeWithRegistry(InitMsgView const& initView, bool subsequent = false);
41 
42  void deserializeEvent(EventMsgView const& eventView);
43 
44  static
45  void mergeIntoRegistry(SendJobHeader const& header,
49  bool subsequent);
50 
59  static unsigned int uncompressBuffer(unsigned char* inputBuffer,
60  unsigned int inputSize,
61  std::vector<unsigned char>& outputBuffer,
62  unsigned int expectedFullSize);
63  protected:
64  static void declareStreamers(SendDescs const& descs);
65  static void buildClassCache(SendDescs const& descs);
66  void resetAfterEndRun();
67 
68  private:
69 
71  public:
73  virtual ~EventPrincipalHolder();
74 
75  virtual WrapperBase const* getIt(ProductID const& id) const override;
76  virtual WrapperBase const* getThinnedProduct(ProductID const&, unsigned int&) const override;
77  virtual void getThinnedProducts(ProductID const& pid,
78  std::vector<WrapperBase const*>& wrappers,
79  std::vector<unsigned int>& keys) const override;
80 
81 
82  virtual unsigned int transitionIndex_() const override;
83 
85 
86  private:
87  // We don't own the principal. The lifetime must be managed externally.
89  };
90 
91  virtual void read(EventPrincipal& eventPrincipal);
92 
93  virtual void setRun(RunNumber_t r);
94 
95  virtual std::unique_ptr<FileBlock> readFile_();
96 
97  TClass* tc_;
98  std::vector<unsigned char> dest_;
99  TBufferFile xbuf_;
100  std::unique_ptr<SendEvent> sendEvent_;
101  std::unique_ptr<EventPrincipalHolder> eventPrincipalHolder_;
102  std::vector<std::unique_ptr<EventPrincipalHolder>> streamToEventPrincipalHolders_;
104 
106  unsigned int protocolVersion_;
107  }; //end-of-class-def
108 } // end of namespace-edm
109 
110 #endif
static void fillDescription(ParameterSetDescription &description)
static void mergeIntoRegistry(SendJobHeader const &header, ProductRegistry &, BranchIDListHelper &, ThinnedAssociationsHelper &, bool subsequent)
std::vector< BranchDescription > SendDescs
StreamerInputSource(ParameterSet const &pset, InputSourceDescription const &desc)
std::unique_ptr< EventPrincipalHolder > eventPrincipalHolder_
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)
std::unique_ptr< SendEvent > sendEvent_
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
virtual void getThinnedProducts(ProductID const &pid, std::vector< WrapperBase const * > &wrappers, std::vector< unsigned int > &keys) const override
std::auto_ptr< SendJobHeader > deserializeRegistry(InitMsgView const &initView)
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)
std::vector< std::unique_ptr< EventPrincipalHolder > > streamToEventPrincipalHolders_
virtual std::unique_ptr< FileBlock > readFile_()
std::vector< unsigned char > dest_