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 
7 
8 #include "DQMFileIterator.h"
9 #include "TriggerSelector.h"
10 
11 #include <memory>
12 #include <string>
13 #include <vector>
14 
15 namespace dqmservices {
16 
18  public:
20  ~DQMStreamerReader() override;
21 
22  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
23 
24  bool newHeader();
25 
26  protected:
27  Next checkNext() override; /* from raw input source */
28  void skip(int toSkip) override; /* from raw input source */
29  void genuineReadFile() override;
30  void genuineCloseFile() override;
31 
32  private:
33  // our own, but we do inherit reset(),
34  // which will break things if called
35  void reset_() override;
36 
38  void closeFileImp_(const std::string& reason);
39 
40  bool openNextFileImp_();
41 
44 
45  void setupMetaData(edm::streamer::InitMsgView const& msg, bool subsequent);
47 
48  bool isFirstFile_ = true;
49  bool prepareNextFile();
51 
53  unsigned int processedEventPerLs_ = 0;
54 
55  unsigned int const minEventsPerLs_;
56  bool const flagSkipFirstLumis_;
57  bool const flagEndOfRunKills_;
58  bool const flagDeleteDatFiles_;
59  std::vector<std::string> const hltSel_;
60  bool const unitTest_;
61 
62  bool acceptAllEvt_ = false;
63  bool setAcceptAllEvt();
64 
65  bool matchTriggerSel_ = false;
66  bool setMatchTriggerSel(std::vector<std::string> const& tnames);
67 
68  //If the event meta data changes while reading a file, we need to
69  // cause a file transition to happen to allow synchronous update
71  struct OpenFile {
72  std::unique_ptr<edm::streamer::StreamerInputFile> streamFile_;
74 
75  bool open() { return (streamFile_.get() != nullptr); }
76 
77  } file_;
78 
79  std::shared_ptr<edm::EventSkipperByID> eventSkipperByID_;
80  std::shared_ptr<TriggerSelector> triggerSelector_;
81  };
82 
83 } // namespace dqmservices
84 
85 #endif // DQMServices_StreamerIO_DQMStreamerReader_h
unsigned int const minEventsPerLs_
std::vector< std::string > const hltSel_
bool acceptEvent(const edm::streamer::EventMsgView *)
edm::streamer::InitMsgView const * getHeaderMsg()
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::shared_ptr< TriggerSelector > triggerSelector_
bool setMatchTriggerSel(std::vector< std::string > const &tnames)
edm::streamer::EventMsgView const * getEventMsg()
void setupMetaData(edm::streamer::InitMsgView const &msg, bool subsequent)
void openFileImp_(const DQMFileIterator::LumiEntry &entry)
DQMStreamerReader(edm::ParameterSet const &pset, edm::InputSourceDescription const &desc)
edm::streamer::EventMsgView const * prepareNextEvent()
std::unique_ptr< edm::streamer::StreamerInputFile > streamFile_
tuple msg
Definition: mps_check.py:286
std::shared_ptr< edm::EventSkipperByID > eventSkipperByID_
void closeFileImp_(const std::string &reason)
struct dqmservices::DQMStreamerReader::OpenFile file_
void skip(int toSkip) override