Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-19 23:41:15

0001 #ifndef IOPool_Streamer_interface_FRDOutputModule_h
0002 #define IOPool_Streamer_interface_FRDOutputModule_h
0003 
0004 // CMSSW headers
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0007 
0008 //#include "DataFormats/FEDRawData/interface/FEDRawData.h"
0009 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
0010 #include "FWCore/Framework/interface/EventForOutput.h"
0011 #include "FWCore/Framework/interface/LuminosityBlockForOutput.h"
0012 #include "FWCore/Framework/interface/one/OutputModule.h"
0013 //#include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h"
0014 
0015 class FRDOutputModule : public edm::one::OutputModule<edm::one::WatchLuminosityBlocks> {
0016 public:
0017   explicit FRDOutputModule(edm::ParameterSet const& ps);
0018   ~FRDOutputModule() override;
0019 
0020   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0021 
0022 private:
0023   void write(edm::EventForOutput const& e) override;
0024   //void beginRun(edm::RunForOutput const&) override {}
0025   //void endRun(edm::RunForOutput const&) override {}
0026   void writeRun(const edm::RunForOutput&) override {}
0027   void writeLuminosityBlock(const edm::LuminosityBlockForOutput&) override {}
0028 
0029   void beginLuminosityBlock(edm::LuminosityBlockForOutput const&) override;
0030   void endLuminosityBlock(edm::LuminosityBlockForOutput const&) override;
0031 
0032   void finishFileWrite(int ls);
0033   uint32_t adler32() const { return (adlerb_ << 16) | adlera_; }
0034 
0035   const edm::EDGetTokenT<FEDRawDataCollection> token_;
0036 
0037   const uint32_t frdVersion_;
0038   const uint32_t frdFileVersion_;
0039   std::string filePrefix_;
0040   std::string fileName_;
0041 
0042   int outfd_ = -1;
0043   uint32_t adlera_;
0044   uint32_t adlerb_;
0045 
0046   uint32_t perFileEventCount_;
0047   uint64_t perFileSize_;
0048 
0049   bool fileWritten_ = false;
0050 };
0051 
0052 #endif  // IOPool_Streamer_interface_FRDOutputModule_h