CMS 3D CMS Logo

DQMStreamerReader.h
Go to the documentation of this file.
1 #ifndef DQMServices_StreamerIO_DQMStreamerReader_h
2 #define DQMServices_StreamerIO_DQMStreamerReader_h
3 
8 
9 #include "DQMFileIterator.h"
10 #include "DQMMonitoringService.h"
11 #include "TriggerSelector.h"
12 
13 #include <filesystem>
14 
15 #include <memory>
16 #include <string>
17 #include <vector>
18 #include <iterator>
19 #include <boost/property_tree/json_parser.hpp>
20 #include <boost/property_tree/ptree.hpp>
21 
22 namespace dqmservices {
23 
25  public:
27  ~DQMStreamerReader() override;
28 
29  bool newHeader();
30  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
31 
32  typedef std::vector<std::string> Strings;
33 
34  protected:
35  Next checkNext() override; /* from raw input source */
36  void skip(int toSkip) override; /* from raw input source */
37  void genuineReadFile() override;
38  void genuineCloseFile() override;
39 
40  private:
41  // our own, but we do inherit reset(),
42  // which will break things if called
43  void reset_() override;
44 
46  void closeFileImp_(const std::string& reason);
47 
48  bool openNextFileImp_();
49 
50  InitMsgView const* getHeaderMsg();
51  EventMsgView const* getEventMsg();
52 
54  bool prepareNextFile();
55  bool acceptEvent(const EventMsgView*);
56 
57  bool triggerSel();
58  bool matchTriggerSel(Strings const& tnames);
61  bool isFirstFile_ = true;
62 
63  unsigned int runNumber_;
67 
68  unsigned int processedEventPerLs_;
69  unsigned int minEventsPerLs_;
70 
74 
76 
77  struct OpenFile {
78  std::unique_ptr<edm::StreamerInputFile> streamFile_;
80 
81  bool open() { return (streamFile_.get() != nullptr); }
82 
83  } file_;
84 
85  std::shared_ptr<edm::EventSkipperByID> eventSkipperByID_;
86  std::shared_ptr<TriggerSelector> eventSelector_;
87 
88  /* this is for monitoring */
90  };
91 
92 } // namespace dqmservices
93 
94 #endif
std::shared_ptr< TriggerSelector > eventSelector_
InitMsgView const * getHeaderMsg()
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
EventMsgView const * getEventMsg()
std::unique_ptr< edm::StreamerInputFile > streamFile_
void openFileImp_(const DQMFileIterator::LumiEntry &entry)
DQMStreamerReader(edm::ParameterSet const &pset, edm::InputSourceDescription const &desc)
std::vector< std::string > Strings
EventMsgView const * prepareNextEvent()
bool acceptEvent(const EventMsgView *)
edm::Service< DQMMonitoringService > mon_
std::shared_ptr< edm::EventSkipperByID > eventSkipperByID_
void closeFileImp_(const std::string &reason)
bool matchTriggerSel(Strings const &tnames)
struct dqmservices::DQMStreamerReader::OpenFile file_
void skip(int toSkip) override