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 "boost/filesystem.hpp"
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  edm::InputSourceDescription const& desc);
28  ~DQMStreamerReader() override;
29 
30  bool newHeader();
31  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
32 
33  typedef std::vector<std::string> Strings;
34 
35  protected:
36  bool checkNextEvent() override; /* from raw input source */
37  void skip(int toSkip) override; /* from raw input source */
38 
39  private:
40  // our own, but we do inherit reset(),
41  // which will break things if called
42  void reset_() override;
43 
45  void closeFileImp_(const std::string& reason);
46 
47  bool openNextFileImp_();
48 
49  InitMsgView const* getHeaderMsg();
50  EventMsgView const* getEventMsg();
51 
53  bool prepareNextFile();
54  bool acceptEvent(const EventMsgView*);
55 
56  bool triggerSel();
57  bool matchTriggerSel(Strings const& tnames);
60 
61  unsigned int runNumber_;
64  Strings hltSel_;
65 
66  unsigned int processedEventPerLs_;
67  unsigned int minEventsPerLs_;
68 
72 
74 
75  struct OpenFile {
76  std::unique_ptr<edm::StreamerInputFile> streamFile_;
78 
79  bool open() { return (streamFile_.get() != nullptr); }
80 
81  } file_;
82 
83  std::shared_ptr<edm::EventSkipperByID> eventSkipperByID_;
84  std::shared_ptr<TriggerSelector> eventSelector_;
85 
86  /* this is for monitoring */
88 };
89 
90 } // end-of-namespace-def
91 
92 #endif
std::shared_ptr< TriggerSelector > eventSelector_
EventMsgView const * getEventMsg()
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
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
bool acceptEvent(const EventMsgView *)
InitMsgView const * getHeaderMsg()
edm::Service< DQMMonitoringService > mon_
std::shared_ptr< edm::EventSkipperByID > eventSkipperByID_
void closeFileImp_(const std::string &reason)
bool matchTriggerSel(Strings const &tnames)
EventMsgView const * prepareNextEvent()
struct dqmservices::DQMStreamerReader::OpenFile file_
void skip(int toSkip) override