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
dqmservices::DQMStreamerReader::reset_
void reset_() override
Definition: DQMStreamerReader.cc:53
dqmservices::DQMStreamerReader::triggerSel
bool triggerSel()
Definition: DQMStreamerReader.cc:346
dqmservices
Definition: DQMFileIterator.cc:18
dqmservices::DQMStreamerReader::acceptAllEvt_
bool acceptAllEvt_
Definition: DQMStreamerReader.h:59
dqmservices::DQMStreamerReader::acceptEvent
bool acceptEvent(const EventMsgView *)
Definition: DQMStreamerReader.cc:381
mps_splice.entry
entry
Definition: mps_splice.py:68
dqmservices::DQMStreamerReader::openFileImp_
void openFileImp_(const DQMFileIterator::LumiEntry &entry)
Definition: DQMStreamerReader.cc:95
dqmservices::DQMStreamerReader::OpenFile::streamFile_
std::unique_ptr< edm::StreamerInputFile > streamFile_
Definition: DQMStreamerReader.h:78
edm::StreamerInputSource
Definition: StreamerInputSource.h:31
edm::InputSourceDescription
Definition: InputSourceDescription.h:21
dqmservices::DQMStreamerReader::closeFileImp_
void closeFileImp_(const std::string &reason)
Definition: DQMStreamerReader.cc:137
DQMFileIterator.h
dqmservices::DQMStreamerReader::isFirstFile_
bool isFirstFile_
Definition: DQMStreamerReader.h:61
dqmservices::DQMStreamerReader::genuineReadFile
void genuineReadFile() override
Definition: DQMStreamerReader.cc:146
dqmservices::DQMStreamerReader::DQMStreamerReader
DQMStreamerReader(edm::ParameterSet const &pset, edm::InputSourceDescription const &desc)
Definition: DQMStreamerReader.cc:29
dqmservices::DQMStreamerReader::runInputDir_
std::string runInputDir_
Definition: DQMStreamerReader.h:64
dqmservices::DQMStreamerReader::openNextFileImp_
bool openNextFileImp_()
Definition: DQMStreamerReader.cc:158
dqmservices::DQMStreamerReader::newHeader
bool newHeader()
dqmservices::DQMFileIterator::LumiEntry
Definition: DQMFileIterator.h:20
dqmservices::DQMStreamerReader::minEventsPerLs_
unsigned int minEventsPerLs_
Definition: DQMStreamerReader.h:69
EventMsgView
Definition: EventMessage.h:72
dqmservices::DQMStreamerReader::flagEndOfRunKills_
bool flagEndOfRunKills_
Definition: DQMStreamerReader.h:72
TriggerSelector.h
dqmservices::DQMStreamerReader::~DQMStreamerReader
~DQMStreamerReader() override
Definition: DQMStreamerReader.cc:45
dqmservices::DQMStreamerReader::checkNext
Next checkNext() override
Definition: DQMStreamerReader.cc:317
dqmservices::DQMStreamerReader::flagDeleteDatFiles_
bool flagDeleteDatFiles_
Definition: DQMStreamerReader.h:73
dqmservices::DQMStreamerReader::matchTriggerSel_
bool matchTriggerSel_
Definition: DQMStreamerReader.h:60
dqmservices::DQMStreamerReader::prepareNextFile
bool prepareNextFile()
Definition: DQMStreamerReader.cc:221
dqmservices::DQMStreamerReader::file_
struct dqmservices::DQMStreamerReader::OpenFile file_
Service.h
StreamerInputSource.h
dqmservices::DQMStreamerReader::streamLabel_
std::string streamLabel_
Definition: DQMStreamerReader.h:65
StreamerInputFile.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
dqmservices::DQMStreamerReader::prepareNextEvent
EventMsgView const * prepareNextEvent()
Definition: DQMStreamerReader.cc:278
edm::ParameterSet
Definition: ParameterSet.h:47
dqmservices::DQMStreamerReader::eventSkipperByID_
std::shared_ptr< edm::EventSkipperByID > eventSkipperByID_
Definition: DQMStreamerReader.h:85
edm::Service
Definition: Service.h:30
dqmservices::DQMStreamerReader::OpenFile::lumi_
DQMFileIterator::LumiEntry lumi_
Definition: DQMStreamerReader.h:79
MsgTools.h
dqmservices::DQMFileIterator
Definition: DQMFileIterator.h:18
dqmservices::DQMStreamerReader::processedEventPerLs_
unsigned int processedEventPerLs_
Definition: DQMStreamerReader.h:68
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PixelMapPlotter.reason
reason
Definition: PixelMapPlotter.py:509
dqmservices::DQMStreamerReader::flagSkipFirstLumis_
bool flagSkipFirstLumis_
Definition: DQMStreamerReader.h:71
edm::RawInputSource::Next
Next
Definition: RawInputSource.h:24
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
dqmservices::DQMStreamerReader::skip
void skip(int toSkip) override
Definition: DQMStreamerReader.cc:401
dqmservices::DQMStreamerReader::genuineCloseFile
void genuineCloseFile() override
Definition: DQMStreamerReader.cc:135
dqmservices::DQMStreamerReader::getHeaderMsg
InitMsgView const * getHeaderMsg()
Definition: DQMStreamerReader.cc:184
dqmservices::DQMStreamerReader::fiterator_
DQMFileIterator fiterator_
Definition: DQMStreamerReader.h:75
dqmservices::DQMStreamerReader::matchTriggerSel
bool matchTriggerSel(Strings const &tnames)
Definition: DQMStreamerReader.cc:360
dqmservices::DQMStreamerReader::OpenFile
Definition: DQMStreamerReader.h:77
dqmservices::DQMStreamerReader::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: DQMStreamerReader.cc:417
dqmservices::DQMStreamerReader::Strings
std::vector< std::string > Strings
Definition: DQMStreamerReader.h:32
dqmservices::DQMStreamerReader::getEventMsg
EventMsgView const * getEventMsg()
Definition: DQMStreamerReader.cc:195
dqmservices::DQMStreamerReader::mon_
edm::Service< DQMMonitoringService > mon_
Definition: DQMStreamerReader.h:89
dqmservices::DQMStreamerReader::runNumber_
unsigned int runNumber_
Definition: DQMStreamerReader.h:63
dqmservices::DQMStreamerReader
Definition: DQMStreamerReader.h:24
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dqmservices::DQMStreamerReader::eventSelector_
std::shared_ptr< TriggerSelector > eventSelector_
Definition: DQMStreamerReader.h:86
dqmservices::DQMStreamerReader::OpenFile::open
bool open()
Definition: DQMStreamerReader.h:81
InitMsgView
Definition: InitMessage.h:61
DQMMonitoringService.h
dqmservices::DQMStreamerReader::hltSel_
Strings hltSel_
Definition: DQMStreamerReader.h:66