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 <memory>
14 #include <string>
15 #include <vector>
16 
17 namespace dqmservices {
18 
20  public:
22  ~DQMStreamerReader() override;
23 
24  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
25 
26  bool newHeader();
27 
28  protected:
29  Next checkNext() override; /* from raw input source */
30  void skip(int toSkip) override; /* from raw input source */
31  void genuineReadFile() override;
32  void genuineCloseFile() override;
33 
34  private:
35  // our own, but we do inherit reset(),
36  // which will break things if called
37  void reset_() override;
38 
40  void closeFileImp_(const std::string& reason);
41 
42  bool openNextFileImp_();
43 
44  InitMsgView const* getHeaderMsg();
45  EventMsgView const* getEventMsg();
46 
48 
49  bool isFirstFile_ = true;
50  bool prepareNextFile();
51  bool acceptEvent(const EventMsgView*);
52 
54  unsigned int processedEventPerLs_ = 0;
55 
56  unsigned int const minEventsPerLs_;
57  bool const flagSkipFirstLumis_;
58  bool const flagEndOfRunKills_;
59  bool const flagDeleteDatFiles_;
60  std::vector<std::string> const hltSel_;
61 
62  bool acceptAllEvt_ = false;
63  bool setAcceptAllEvt();
64 
65  bool matchTriggerSel_ = false;
66  bool setMatchTriggerSel(std::vector<std::string> const& tnames);
67 
68  struct OpenFile {
69  std::unique_ptr<edm::StreamerInputFile> streamFile_;
71 
72  bool open() { return (streamFile_.get() != nullptr); }
73 
74  } file_;
75 
76  std::shared_ptr<edm::EventSkipperByID> eventSkipperByID_;
77  std::shared_ptr<TriggerSelector> triggerSelector_;
78 
79  /* this is for monitoring */
81  };
82 
83 } // namespace dqmservices
84 
85 #endif // DQMServices_StreamerIO_DQMStreamerReader_h
unsigned int const minEventsPerLs_
std::vector< std::string > const hltSel_
InitMsgView const * getHeaderMsg()
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::shared_ptr< TriggerSelector > triggerSelector_
bool setMatchTriggerSel(std::vector< std::string > const &tnames)
EventMsgView const * getEventMsg()
std::unique_ptr< edm::StreamerInputFile > streamFile_
void openFileImp_(const DQMFileIterator::LumiEntry &entry)
DQMStreamerReader(edm::ParameterSet const &pset, edm::InputSourceDescription const &desc)
EventMsgView const * prepareNextEvent()
bool acceptEvent(const EventMsgView *)
edm::Service< DQMMonitoringService > mon_
std::shared_ptr< edm::EventSkipperByID > eventSkipperByID_
void closeFileImp_(const std::string &reason)
struct dqmservices::DQMStreamerReader::OpenFile file_
void skip(int toSkip) override