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 
52  bool isBufferLZMA(unsigned char const* inputBuffer, unsigned int inputSize);
53 
57  bool isBufferZSTD(unsigned char const* inputBuffer, unsigned int inputSize);
58 
67  static unsigned int uncompressBuffer(unsigned char* inputBuffer,
68  unsigned int inputSize,
69  std::vector<unsigned char>& outputBuffer,
70  unsigned int expectedFullSize);
71 
72  static unsigned int uncompressBufferLZMA(unsigned char* inputBuffer,
73  unsigned int inputSize,
74  std::vector<unsigned char>& outputBuffer,
75  unsigned int expectedFullSize,
76  bool hasHeader = true);
77 
78  static unsigned int uncompressBufferZSTD(unsigned char* inputBuffer,
79  unsigned int inputSize,
80  std::vector<unsigned char>& outputBuffer,
81  unsigned int expectedFullSize,
82  bool hasHeader = true);
83 
84  protected:
85  static void declareStreamers(SendDescs const& descs);
86  static void buildClassCache(SendDescs const& descs);
87  void resetAfterEndRun();
88 
89  private:
91  public:
93  ~EventPrincipalHolder() override;
94 
95  WrapperBase const* getIt(ProductID const& id) const override;
96  WrapperBase const* getThinnedProduct(ProductID const&, unsigned int&) const override;
97  void getThinnedProducts(ProductID const& pid,
98  std::vector<WrapperBase const*>& wrappers,
99  std::vector<unsigned int>& keys) const override;
100 
101  unsigned int transitionIndex_() const override;
102 
104 
105  private:
106  // We don't own the principal. The lifetime must be managed externally.
108  };
109 
110  void read(EventPrincipal& eventPrincipal) override;
111 
112  void setRun(RunNumber_t r) override;
113 
115  std::vector<unsigned char> dest_;
116  TBufferFile xbuf_;
119  std::vector<edm::propagate_const<std::unique_ptr<EventPrincipalHolder>>> streamToEventPrincipalHolders_;
121 
123  unsigned int protocolVersion_;
124  }; //end-of-class-def
125 } // namespace edm
126 
127 #endif
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
edm::StreamerInputSource::deserializeRegistry
std::unique_ptr< SendJobHeader > deserializeRegistry(InitMsgView const &initView)
Definition: StreamerInputSource.cc:121
edm::StreamerInputSource::tc_
edm::propagate_const< TClass * > tc_
Definition: StreamerInputSource.h:114
propagate_const.h
edm::StreamerInputSource::deserializeEvent
void deserializeEvent(EventMsgView const &eventView)
Definition: StreamerInputSource.cc:185
StreamedProducts.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edmLumisInFiles.description
description
Definition: edmLumisInFiles.py:11
edm::StreamerInputSource::EventPrincipalHolder::getIt
WrapperBase const * getIt(ProductID const &id) const override
Definition: StreamerInputSource.cc:479
edm::StreamerInputSource
Definition: StreamerInputSource.h:31
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::StreamerInputSource::fillDescription
static void fillDescription(ParameterSetDescription &description)
Definition: StreamerInputSource.cc:502
edm::StreamerInputSource::declareStreamers
static void declareStreamers(SendDescs const &descs)
Definition: StreamerInputSource.cc:89
edm::InputSourceDescription
Definition: InputSourceDescription.h:20
edm::StreamerInputSource::uncompressBuffer
static unsigned int uncompressBuffer(unsigned char *inputBuffer, unsigned int inputSize, std::vector< unsigned char > &outputBuffer, unsigned int expectedFullSize)
Definition: StreamerInputSource.cc:354
edm::StreamerInputSource::~StreamerInputSource
~StreamerInputSource() override
Definition: StreamerInputSource.cc:56
edm::StreamerInputSource::sendEvent_
edm::propagate_const< std::unique_ptr< SendEvent > > sendEvent_
Definition: StreamerInputSource.h:117
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
edm::StreamerInputSource::isBufferLZMA
bool isBufferLZMA(unsigned char const *inputBuffer, unsigned int inputSize)
Definition: StreamerInputSource.cc:379
edm::StreamerInputSource::buildClassCache
static void buildClassCache(SendDescs const &descs)
Definition: StreamerInputSource.cc:108
edm::RawInputSource
Definition: RawInputSource.h:17
EventMsgView
Definition: EventMessage.h:72
edm::StreamerInputSource::xbuf_
TBufferFile xbuf_
Definition: StreamerInputSource.h:116
edm::StreamerInputSource::streamToEventPrincipalHolders_
std::vector< edm::propagate_const< std::unique_ptr< EventPrincipalHolder > > > streamToEventPrincipalHolders_
Definition: StreamerInputSource.h:119
edm::StreamerInputSource::deserializeAndMergeWithRegistry
void deserializeAndMergeWithRegistry(InitMsgView const &initView, bool subsequent=false)
Definition: StreamerInputSource.cc:167
edm::ProductRegistry
Definition: ProductRegistry.h:34
edm::StreamerInputSource::protocolVersion_
unsigned int protocolVersion_
Definition: StreamerInputSource.h:123
edm::EDProductGetter
Definition: EDProductGetter.h:32
RawInputSource.h
edm::propagate_const< TClass * >
edm::EventPrincipal
Definition: EventPrincipal.h:46
edm::StreamerInputSource::adjustEventToNewProductRegistry_
bool adjustEventToNewProductRegistry_
Definition: StreamerInputSource.h:120
edm::StreamerInputSource::EventPrincipalHolder::transitionIndex_
unsigned int transitionIndex_() const override
Definition: StreamerInputSource.cc:495
edm::StreamerInputSource::setRun
void setRun(RunNumber_t r) override
Definition: StreamerInputSource.cc:467
edm::StreamerInputSource::EventPrincipalHolder
Definition: StreamerInputSource.h:90
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::StreamerInputSource::processName_
std::string processName_
Definition: StreamerInputSource.h:122
edm::StreamerInputSource::EventPrincipalHolder::setEventPrincipal
void setEventPrincipal(EventPrincipal *ep)
Definition: StreamerInputSource.cc:500
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:35
edm::ParameterSet
Definition: ParameterSet.h:36
edm::StreamerInputSource::EventPrincipalHolder::getThinnedProduct
WrapperBase const * getThinnedProduct(ProductID const &, unsigned int &) const override
Definition: StreamerInputSource.cc:483
edm::StreamerInputSource::resetAfterEndRun
void resetAfterEndRun()
Definition: StreamerInputSource.cc:458
edm::BranchIDListHelper
Definition: BranchIDListHelper.h:15
edm::StreamerInputSource::EventPrincipalHolder::eventPrincipal_
EventPrincipal const * eventPrincipal_
Definition: StreamerInputSource.h:107
edm::StreamerInputSource::uncompressBufferZSTD
static unsigned int uncompressBufferZSTD(unsigned char *inputBuffer, unsigned int inputSize, std::vector< unsigned char > &outputBuffer, unsigned int expectedFullSize, bool hasHeader=true)
Definition: StreamerInputSource.cc:438
edm::WrapperBase
Definition: WrapperBase.h:23
edm::StreamerInputSource::EventPrincipalHolder::getThinnedProducts
void getThinnedProducts(ProductID const &pid, std::vector< WrapperBase const * > &wrappers, std::vector< unsigned int > &keys) const override
Definition: StreamerInputSource.cc:488
edm::StreamerInputSource::isBufferZSTD
bool isBufferZSTD(unsigned char const *inputBuffer, unsigned int inputSize)
Definition: StreamerInputSource.cc:431
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::StreamerInputSource::eventPrincipalHolder_
edm::propagate_const< std::unique_ptr< EventPrincipalHolder > > eventPrincipalHolder_
Definition: StreamerInputSource.h:118
Frameworkfwd.h
edm::StreamerInputSource::mergeIntoRegistry
static void mergeIntoRegistry(SendJobHeader const &header, ProductRegistry &, BranchIDListHelper &, ThinnedAssociationsHelper &, bool subsequent)
Definition: StreamerInputSource.cc:59
edm::StreamerInputSource::dest_
std::vector< unsigned char > dest_
Definition: StreamerInputSource.h:115
ParameterSetDescription
edm::StreamerInputSource::EventPrincipalHolder::~EventPrincipalHolder
~EventPrincipalHolder() override
Definition: StreamerInputSource.cc:477
edm::StreamerInputSource::uncompressBufferLZMA
static unsigned int uncompressBufferLZMA(unsigned char *inputBuffer, unsigned int inputSize, std::vector< unsigned char > &outputBuffer, unsigned int expectedFullSize, bool hasHeader=true)
Definition: StreamerInputSource.cc:386
edm::StreamerInputSource::StreamerInputSource
StreamerInputSource(ParameterSet const &pset, InputSourceDescription const &desc)
Definition: StreamerInputSource.cc:45
EDProductGetter.h
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
edm::SendJobHeader
Definition: StreamedProducts.h:102
edm::SendDescs
std::vector< BranchDescription > SendDescs
Definition: StreamedProducts.h:100
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
edm::StreamerInputSource::read
void read(EventPrincipal &eventPrincipal) override
Definition: StreamerInputSource.cc:280
edm::ProductID
Definition: ProductID.h:27
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
edm::StreamerInputSource::EventPrincipalHolder::EventPrincipalHolder
EventPrincipalHolder()
Definition: StreamerInputSource.cc:475
InitMsgView
Definition: InitMessage.h:61