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 
15 
20 
22 class InputSourceDescription;
23 class ParameterSet;
24 
26 
27 public:
29  virtual ~FedRawDataInputSource();
30 
31 protected:
32  virtual bool checkNextEvent() override;
33  virtual void read(edm::EventPrincipal& eventPrincipal) override;
34 
35 private:
36  virtual void preForkReleaseResources() override;
37  virtual void postForkReacquireResources(boost::shared_ptr<edm::multicore::MessageReceiverForSource>) override;
38  virtual void rewind_() override;
39 
40  void maybeOpenNewLumiSection(const uint32_t lumiSection);
41  int cacheNextEvent();
42  edm::Timestamp fillFEDRawDataCollection(std::auto_ptr<FEDRawDataCollection>&) const;
43  void closeCurrentFile();
44  int openNextFile();
45  int searchForNextFile();
47  void openDataFile(std::string const&);
48  bool eofReached() const;
50  void renameToNextFree() const;
51 
52  const unsigned int eventChunkSize_; // for buffered read-ahead
53 
54  // get LS from filename instead of event header
55  const bool getLSFromFilename_;
56  const bool verifyAdler32_;
58 
60 
63 
65 
66  std::unique_ptr<FRDEventMsgView> event_;
67 
69  FILE* fileStream_;
71 
72  unsigned int currentLumiSection_;
75 
77 
78  unsigned char *dataBuffer_; // temporarily hold multiple event data
79  unsigned char *bufferCursor_;
80  uint32_t bufferLeft_;
81 
83 };
84 
85 #endif // EventFilter_Utilities_FedRawDataInputSource_h
86 
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 &)
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