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:
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  std::optional<std::tuple<edm::WrapperBase const*, unsigned int>> getThinnedProduct(ProductID const&,
97  unsigned int) const override;
98  void getThinnedProducts(ProductID const& pid,
99  std::vector<WrapperBase const*>& wrappers,
100  std::vector<unsigned int>& keys) const override;
101  OptionalThinnedKey getThinnedKeyFrom(ProductID const&, unsigned int, ProductID const&) const override;
102 
103  unsigned int transitionIndex_() const override;
104 
106 
107  private:
108  // We don't own the principal. The lifetime must be managed externally.
110  };
111 
112  void read(EventPrincipal& eventPrincipal) override;
113 
114  void setRun(RunNumber_t r) override;
115 
117  std::vector<unsigned char> dest_;
118  TBufferFile xbuf_;
121  std::vector<edm::propagate_const<std::unique_ptr<EventPrincipalHolder>>> streamToEventPrincipalHolders_;
123 
125  unsigned int protocolVersion_;
126  }; //end-of-class-def
127 } // namespace edm
128 
129 #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:116
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:513
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:119
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:118
edm::StreamerInputSource::streamToEventPrincipalHolders_
std::vector< edm::propagate_const< std::unique_ptr< EventPrincipalHolder > > > streamToEventPrincipalHolders_
Definition: StreamerInputSource.h:121
edm::StreamerInputSource::deserializeAndMergeWithRegistry
void deserializeAndMergeWithRegistry(InitMsgView const &initView, bool subsequent=false)
Definition: StreamerInputSource.cc:167
edm::ProductRegistry
Definition: ProductRegistry.h:37
edm::StreamerInputSource::protocolVersion_
unsigned int protocolVersion_
Definition: StreamerInputSource.h:125
edm::EDProductGetter
Definition: EDProductGetter.h:41
RawInputSource.h
edm::propagate_const< TClass * >
edm::EventPrincipal
Definition: EventPrincipal.h:46
edm::StreamerInputSource::adjustEventToNewProductRegistry_
bool adjustEventToNewProductRegistry_
Definition: StreamerInputSource.h:122
edm::StreamerInputSource::EventPrincipalHolder::transitionIndex_
unsigned int transitionIndex_() const override
Definition: StreamerInputSource.cc:506
edm::StreamerInputSource::setRun
void setRun(RunNumber_t r) override
Definition: StreamerInputSource.cc:467
edm::StreamerInputSource::EventPrincipalHolder::getThinnedKeyFrom
OptionalThinnedKey getThinnedKeyFrom(ProductID const &, unsigned int, ProductID const &) const override
Definition: StreamerInputSource.cc:497
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:124
edm::StreamerInputSource::EventPrincipalHolder::setEventPrincipal
void setEventPrincipal(EventPrincipal *ep)
Definition: StreamerInputSource.cc:511
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
edm::ParameterSet
Definition: ParameterSet.h:47
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:109
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:490
edm::StreamerInputSource::isBufferZSTD
bool isBufferZSTD(unsigned char const *inputBuffer, unsigned int inputSize)
Definition: StreamerInputSource.cc:431
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::OptionalThinnedKey
std::variant< unsigned int, detail::GetThinnedKeyFromExceptionFactory, std::monostate > OptionalThinnedKey
Definition: EDProductGetter.h:39
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::StreamerInputSource::eventPrincipalHolder_
edm::propagate_const< std::unique_ptr< EventPrincipalHolder > > eventPrincipalHolder_
Definition: StreamerInputSource.h:120
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:117
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::StreamerInputSource::EventPrincipalHolder::getThinnedProduct
std::optional< std::tuple< edm::WrapperBase const *, unsigned int > > getThinnedProduct(ProductID const &, unsigned int) const override
Definition: StreamerInputSource.cc:484
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