CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FedRawDataInputSource.h
Go to the documentation of this file.
1 #ifndef EventFilter_Utilities_FedRawDataInputSource_h
2 #define EventFilter_Utilities_FedRawDataInputSource_h
3 
4 #include <memory>
5 #include <stdio.h>
6 
7 #include "boost/filesystem.hpp"
8 
16 
21 
23 class InputSourceDescription;
24 class ParameterSet;
25 
27 
28 public:
30  virtual ~FedRawDataInputSource();
31 
32 protected:
33  virtual bool checkNextEvent() override;
34  virtual void read(edm::EventPrincipal& eventPrincipal) override;
35 
36 private:
37  virtual void preForkReleaseResources() override;
38  virtual void postForkReacquireResources(boost::shared_ptr<edm::multicore::MessageReceiverForSource>) override;
39  virtual void rewind_() override;
40 
41  void maybeOpenNewLumiSection(const uint32_t lumiSection);
42  int cacheNextEvent();
43  edm::Timestamp fillFEDRawDataCollection(std::auto_ptr<FEDRawDataCollection>&) const;
44  void closeCurrentFile();
45  int openNextFile();
46  int searchForNextFile();
48  void openDataFile(std::string const&);
49  bool eofReached() const;
51  void renameToNextFree() const;
52 
53  const unsigned int eventChunkSize_; // for buffered read-ahead
54 
55  // get LS from filename instead of event header
56  const bool getLSFromFilename_;
57  const bool verifyAdler32_;
59 
61 
64 
66 
67  std::unique_ptr<FRDEventMsgView> event_;
68 
70  FILE* fileStream_;
73 
74  unsigned int currentLumiSection_;
77 
79 
80  unsigned char *dataBuffer_; // temporarily hold multiple event data
81  unsigned char *bufferCursor_;
82  uint32_t bufferLeft_;
83 
85 };
86 
87 #endif // EventFilter_Utilities_FedRawDataInputSource_h
88 
virtual void read(edm::EventPrincipal &eventPrincipal) override
virtual void rewind_() override
void maybeOpenNewLumiSection(const uint32_t lumiSection)
FedRawDataInputSource(edm::ParameterSet const &, edm::InputSourceDescription const &)
boost::filesystem::path currentInputJson_
const edm::RunNumber_t runNumber_
bool grabNextJsonFile(boost::filesystem::path const &)
void openDataFile(std::string const &)
edm::ProcessHistoryID processHistoryID_
virtual void preForkReleaseResources() override
const edm::DaqProvenanceHelper daqProvenanceHelper_
const std::string fuOutputDir_
virtual bool checkNextEvent() override
const unsigned int eventChunkSize_
std::unique_ptr< FRDEventMsgView > event_
virtual void postForkReacquireResources(boost::shared_ptr< edm::multicore::MessageReceiverForSource >) override
edm::Timestamp fillFEDRawDataCollection(std::auto_ptr< FEDRawDataCollection > &) const
const std::string buInputDir_
boost::filesystem::path openFile_
Unserialize a JSON document into a Value.
Definition: reader.h:16
unsigned int currentInputEventCount_
unsigned int RunNumber_t
Definition: EventRange.h:32