Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-31 04:19:41

0001 #ifndef IOPool_Streamer_StreamerOutputMsgBuilders_h
0002 #define IOPool_Streamer_StreamerOutputMsgBuilders_h
0003 
0004 #include "IOPool/Streamer/interface/MsgTools.h"
0005 #include "FWCore/Common/interface/TriggerNames.h"
0006 #include "IOPool/Streamer/interface/StreamSerializer.h"
0007 #include "DataFormats/Common/interface/Handle.h"
0008 #include "DataFormats/Streamer/interface/StreamedProducts.h"
0009 #include <memory>
0010 #include <vector>
0011 
0012 namespace edm {
0013   class EventForOutput;
0014   class ThinnedAssociationsHelper;
0015   class TriggerResults;
0016   class ParameterSet;
0017   class ParameterSetDescription;
0018 
0019   namespace streamer {
0020     class InitMsgBuilder;
0021     class EventMsgBuilder;
0022 
0023     class StreamerOutputMsgBuilders {
0024     public:
0025       struct Parameters {
0026         Strings hltTriggerSelections;
0027         std::string compressionAlgoStr;
0028         int compressionLevel;
0029         int lumiSectionInterval;
0030         bool useCompression;
0031       };
0032 
0033       static Parameters parameters(ParameterSet const& ps);
0034 
0035       explicit StreamerOutputMsgBuilders(Parameters const& p,
0036                                          SelectedProducts const* selections,
0037                                          std::string const& moduleLabel);
0038 
0039       ~StreamerOutputMsgBuilders();
0040       static void fillDescription(ParameterSetDescription& desc);
0041 
0042       std::unique_ptr<InitMsgBuilder> serializeRegistry(SerializeDataBuffer& sbuf,
0043                                                         std::string const& processName,
0044                                                         std::string const& moduleLabel,
0045                                                         ParameterSetID const& toplevel,
0046                                                         SendJobHeader::ParameterSetMap const* psetMap) const;
0047 
0048       std::pair<std::unique_ptr<EventMsgBuilder>, uint32_t> serializeEventMetaData(
0049           SerializeDataBuffer& sbuf, BranchIDLists const& branchLists, ThinnedAssociationsHelper const& helper) const;
0050 
0051       std::unique_ptr<EventMsgBuilder> serializeEvent(SerializeDataBuffer& sbuf,
0052                                                       EventForOutput const& e,
0053                                                       Handle<TriggerResults> const& triggerResults,
0054                                                       ParameterSetID const& selectorCfg,
0055                                                       uint32_t eventMetaDataChecksum) const;
0056 
0057     private:
0058       std::unique_ptr<EventMsgBuilder> serializeEventCommon(uint32 run,
0059                                                             uint32 lumi,
0060                                                             uint64 event,
0061                                                             std::vector<unsigned char> hltbits,
0062                                                             unsigned int hltsize,
0063                                                             SerializeDataBuffer& sbuf) const;
0064 
0065       void setHltMask(EventForOutput const& e,
0066                       Handle<TriggerResults> const& triggerResults,
0067                       std::vector<unsigned char>& hltbits) const;
0068 
0069       StreamSerializer serializer_;
0070 
0071       int maxEventSize_;
0072       bool useCompression_;
0073       std::string compressionAlgoStr_;
0074       int compressionLevel_;
0075 
0076       StreamerCompressionAlgo compressionAlgo_;
0077 
0078       // test luminosity sections
0079       int lumiSectionInterval_;
0080       double timeInSecSinceUTC;
0081 
0082       unsigned int hltsize_;
0083       char host_name_[255];
0084 
0085       Strings hltTriggerSelections_;
0086       uint32 outputModuleId_;
0087 
0088       uint32_t eventMetaDataChecksum_ = 0;
0089     };  //end-of-class-def
0090   }     // namespace streamer
0091 }  // namespace edm
0092 
0093 #endif