CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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/shared_ptr.hpp"
14 #include "boost/filesystem.hpp"
15 
16 #include <memory>
17 #include <string>
18 #include <vector>
19 #include <iterator>
20 #include <boost/property_tree/json_parser.hpp>
21 #include <boost/property_tree/ptree.hpp>
22 
23 namespace dqmservices {
24 
26  public:
28  edm::InputSourceDescription const& desc);
29  virtual ~DQMStreamerReader();
30 
31  bool newHeader();
32  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
33 
34  typedef std::vector<std::string> Strings;
35 
36  protected:
37  virtual bool checkNextEvent(); /* from raw input source */
38  virtual void skip(int toSkip); /* from raw input source */
39 
40  private:
41  // our own, but we do inherit reset(),
42  // which will break things if called
43  void reset_();
44 
45  void openFile_(const DQMFileIterator::LumiEntry& entry);
46  void closeFile_(const std::string& reason);
47 
48  bool openNextFile_();
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 
62  unsigned int runNumber_;
66 
67  unsigned int processedEventPerLs_;
68  unsigned int minEventsPerLs_;
69 
73 
75 
76  struct OpenFile {
77  std::unique_ptr<edm::StreamerInputFile> streamFile_;
79 
80  bool open() {
81  return (streamFile_.get() != nullptr);
82  }
83 
84  } file_;
85 
86  boost::shared_ptr<edm::EventSkipperByID> eventSkipperByID_;
87  std::shared_ptr<TriggerSelector> eventSelector_;
88 
89  /* this is for monitoring */
91 };
92 
93 } //end-of-namespace-def
94 
95 #endif
virtual void closeFile_()
Definition: InputSource.h:401
std::shared_ptr< TriggerSelector > eventSelector_
EventMsgView const * getEventMsg()
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void openFile_(const DQMFileIterator::LumiEntry &entry)
std::unique_ptr< edm::StreamerInputFile > streamFile_
virtual void skip(int toSkip)
DQMStreamerReader(edm::ParameterSet const &pset, edm::InputSourceDescription const &desc)
std::vector< std::string > Strings
boost::shared_ptr< edm::EventSkipperByID > eventSkipperByID_
bool acceptEvent(const EventMsgView *)
InitMsgView const * getHeaderMsg()
edm::Service< DQMMonitoringService > mon_
bool matchTriggerSel(Strings const &tnames)
EventMsgView const * prepareNextEvent()
struct dqmservices::DQMStreamerReader::OpenFile file_