CMS 3D CMS Logo

DAQSourceModels.h
Go to the documentation of this file.
1 #ifndef EventFilter_Utilities_DAQSourceModels_h
2 #define EventFilter_Utilities_DAQSourceModels_h
3 
4 #include <condition_variable>
5 #include <cstdio>
6 #include <filesystem>
7 #include <memory>
8 #include <mutex>
9 #include <thread>
10 
11 #include "tbb/concurrent_queue.h"
12 #include "tbb/concurrent_vector.h"
13 
22 
25 
26 //import InputChunk
28 
29 class DAQSource;
30 
31 //evf?
32 class DataMode {
33 public:
34  DataMode(DAQSource* daqSource) : daqSource_(daqSource) {}
35  virtual ~DataMode() = default;
36  virtual std::vector<std::shared_ptr<const edm::DaqProvenanceHelper>>& makeDaqProvenanceHelpers() = 0;
37  virtual void readEvent(edm::EventPrincipal& eventPrincipal) = 0;
38  virtual int dataVersion() const = 0;
39  virtual void detectVersion(unsigned char* fileBuf, uint32_t fileHeaderOffset) = 0;
40  virtual uint32_t headerSize() const = 0;
41  virtual bool versionCheck() const = 0;
42  virtual uint64_t dataBlockSize() const = 0;
43  virtual void makeDataBlockView(unsigned char* addr,
44  size_t maxSize,
45  std::vector<uint64_t> const& fileSizes,
46  size_t fileHeaderSize) = 0;
47  virtual bool nextEventView() = 0;
48  virtual bool checksumValid() = 0;
49  virtual std::string getChecksumError() const = 0;
50  virtual bool isRealData() const = 0;
51  virtual uint32_t run() const = 0;
52  virtual bool dataBlockCompleted() const = 0;
53  virtual bool requireHeader() const = 0;
54  virtual bool fitToBuffer() const = 0;
55 
56  virtual bool dataBlockInitialized() const = 0;
57  virtual void setDataBlockInitialized(bool) = 0;
58 
59  virtual void setTCDSSearchRange(uint16_t, uint16_t) = 0;
60  virtual std::pair<bool, std::vector<std::string>> defineAdditionalFiles(std::string const& primaryName,
61  bool fileListMode) const = 0;
62 
63  virtual bool isMultiDir() { return false; }
64  virtual void makeDirectoryEntries(std::vector<std::string> const& baseDirs,
65  std::vector<int> const& numSources,
66  std::string const& runDir) = 0;
67  void setTesting(bool testing) { testing_ = testing; }
68 
69 protected:
71  bool testing_ = false;
72 };
73 
74 #endif // EventFilter_Utilities_DAQSourceModels_h
bool testing
virtual uint32_t run() const =0
virtual bool checksumValid()=0
virtual bool dataBlockInitialized() const =0
virtual std::string getChecksumError() const =0
virtual ~DataMode()=default
virtual bool isMultiDir()
virtual bool versionCheck() const =0
virtual std::vector< std::shared_ptr< const edm::DaqProvenanceHelper > > & makeDaqProvenanceHelpers()=0
virtual void setTCDSSearchRange(uint16_t, uint16_t)=0
void setTesting(bool testing)
virtual uint64_t dataBlockSize() const =0
virtual void detectVersion(unsigned char *fileBuf, uint32_t fileHeaderOffset)=0
virtual std::pair< bool, std::vector< std::string > > defineAdditionalFiles(std::string const &primaryName, bool fileListMode) const =0
virtual void makeDataBlockView(unsigned char *addr, size_t maxSize, std::vector< uint64_t > const &fileSizes, size_t fileHeaderSize)=0
virtual void setDataBlockInitialized(bool)=0
virtual void readEvent(edm::EventPrincipal &eventPrincipal)=0
virtual int dataVersion() const =0
unsigned long long uint64_t
Definition: Time.h:13
virtual bool requireHeader() const =0
DataMode(DAQSource *daqSource)
virtual uint32_t headerSize() const =0
virtual bool fitToBuffer() const =0
DAQSource * daqSource_
virtual bool isRealData() const =0
virtual bool dataBlockCompleted() const =0
virtual bool nextEventView()=0
virtual void makeDirectoryEntries(std::vector< std::string > const &baseDirs, std::vector< int > const &numSources, std::string const &runDir)=0