Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:11

0001 #ifndef IOPool_Streamer_StreamerOutputModuleCommon_h
0002 #define IOPool_Streamer_StreamerOutputModuleCommon_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 class InitMsgBuilder;
0013 class EventMsgBuilder;
0014 namespace edm {
0015   class ParameterSet;
0016   class ParameterSetDescription;
0017   class EventForOutput;
0018   class ThinnedAssociationsHelper;
0019   class TriggerResults;
0020 
0021   class StreamerOutputModuleCommon {
0022   public:
0023     struct Parameters {
0024       Strings hltTriggerSelections;
0025       std::string compressionAlgoStr;
0026       int compressionLevel;
0027       int lumiSectionInterval;
0028       bool useCompression;
0029     };
0030 
0031     static Parameters parameters(ParameterSet const& ps);
0032 
0033     explicit StreamerOutputModuleCommon(Parameters const& p,
0034                                         SelectedProducts const* selections,
0035                                         std::string const& moduleLabel);
0036 
0037     explicit StreamerOutputModuleCommon(ParameterSet const& ps,
0038                                         SelectedProducts const* selections,
0039                                         std::string const& moduleLabel)
0040         : StreamerOutputModuleCommon(parameters(ps), selections, moduleLabel) {}
0041 
0042     ~StreamerOutputModuleCommon();
0043     static void fillDescription(ParameterSetDescription& desc);
0044 
0045     std::unique_ptr<InitMsgBuilder> serializeRegistry(SerializeDataBuffer& sbuf,
0046                                                       BranchIDLists const& branchLists,
0047                                                       ThinnedAssociationsHelper const& helper,
0048                                                       std::string const& processName,
0049                                                       std::string const& moduleLabel,
0050                                                       ParameterSetID const& toplevel,
0051                                                       SendJobHeader::ParameterSetMap const* psetMap);
0052 
0053     std::unique_ptr<EventMsgBuilder> serializeEvent(SerializeDataBuffer& sbuf,
0054                                                     EventForOutput const& e,
0055                                                     Handle<TriggerResults> const& triggerResults,
0056                                                     ParameterSetID const& selectorCfg);
0057 
0058     SerializeDataBuffer* getSerializerBuffer();
0059 
0060   protected:
0061     std::unique_ptr<SerializeDataBuffer> serializerBuffer_;
0062 
0063   private:
0064     void setHltMask(EventForOutput const& e,
0065                     Handle<TriggerResults> const& triggerResults,
0066                     std::vector<unsigned char>& hltbits) const;
0067 
0068     StreamSerializer serializer_;
0069 
0070     int maxEventSize_;
0071     bool useCompression_;
0072     std::string compressionAlgoStr_;
0073     int compressionLevel_;
0074 
0075     StreamerCompressionAlgo compressionAlgo_;
0076 
0077     // test luminosity sections
0078     int lumiSectionInterval_;
0079     double timeInSecSinceUTC;
0080 
0081     unsigned int hltsize_;
0082     char host_name_[255];
0083 
0084     Strings hltTriggerSelections_;
0085     uint32 outputModuleId_;
0086 
0087   };  //end-of-class-def
0088 
0089 }  // namespace edm
0090 
0091 #endif