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  ~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  bool checkNextEvent() override; /* from raw input source */
36  void skip(int toSkip) override; /* from raw input source */
37 
38  private:
39  // our own, but we do inherit reset(),
40  // which will break things if called
41  void reset_() override;
42 
44  void closeFileImp_(const std::string& reason);
45 
46  bool openNextFileImp_();
47 
48  InitMsgView const* getHeaderMsg();
49  EventMsgView const* getEventMsg();
50 
52  bool prepareNextFile();
53  bool acceptEvent(const EventMsgView*);
54 
55  bool triggerSel();
56  bool matchTriggerSel(Strings const& tnames);
59 
60  unsigned int runNumber_;
63  Strings hltSel_;
64 
65  unsigned int processedEventPerLs_;
66  unsigned int minEventsPerLs_;
67 
71 
73 
74  struct OpenFile {
75  std::unique_ptr<edm::StreamerInputFile> streamFile_;
77 
78  bool open() { return (streamFile_.get() != nullptr); }
79 
80  } file_;
81 
82  std::shared_ptr<edm::EventSkipperByID> eventSkipperByID_;
83  std::shared_ptr<TriggerSelector> eventSelector_;
84 
85  /* this is for monitoring */
87  };
88 
89 } // namespace dqmservices
90 
91 #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