CMS 3D CMS Logo

OnlineBeamMonitor.h
Go to the documentation of this file.
1 #ifndef DQM_BeamMonitor_OnlineBeamMonitor_h
2 #define DQM_BeamMonitor_OnlineBeamMonitor_h
3 
8 // C++
9 #include <map>
10 #include <vector>
11 #include <string>
12 #include <fstream>
13 // CMS
27 
28 namespace onlinebeammonitor {
29  struct BeamSpotInfo {
30  typedef std::map<std::string, reco::BeamSpot> BeamSpotContainer;
32  };
33 } // namespace onlinebeammonitor
34 
35 class OnlineBeamMonitor : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<onlinebeammonitor::BeamSpotInfo>> {
36 public:
39 
40 protected:
41  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
42  std::shared_ptr<onlinebeammonitor::BeamSpotInfo> globalBeginLuminosityBlock(
43  const edm::LuminosityBlock& iLumi, const edm::EventSetup& iSetup) const override;
44  void globalEndLuminosityBlock(const edm::LuminosityBlock& iLumi, const edm::EventSetup& iSetup) override;
45  void dqmEndRun(edm::Run const&, edm::EventSetup const&) override;
46 
47 private:
48  //Typedefs
49  // BF,BS...
50  typedef std::map<std::string, reco::BeamSpot> BeamSpotContainer;
51  // x,y,z,sigmax(y,z)... [run,lumi] Histo name
52  typedef std::map<std::string, std::map<std::string, std::map<std::string, MonitorElement*>>> HistosContainer;
53  // x,y,z,sigmax(y,z)... [run,lumi] Histo name
54  typedef std::map<std::string, std::map<std::string, std::map<std::string, int>>> PositionContainer;
55 
56  //Parameters
61  std::ofstream fasciiDIP;
62 
63  //Service variables
65  std::vector<int> processedLumis_;
66  // MonitorElements:
68 
69  //Containers
72  std::vector<std::string> varNamesV_; //x,y,z,sigmax(y,z)
73  std::multimap<std::string, std::string> histoByCategoryNames_; //run, lumi
74 
75  //For File Writing
79 };
80 
81 #endif
std::map< std::string, std::map< std::string, std::map< std::string, MonitorElement * > > > HistosContainer
std::multimap< std::string, std::string > histoByCategoryNames_
edm::ESGetToken< BeamSpotOnlineObjects, BeamSpotOnlineLegacyObjectsRcd > bsLegacyToken_
void dqmEndRun(edm::Run const &, edm::EventSetup const &) override
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::string outputDIPTxt_
std::vector< std::string > varNamesV_
OnlineBeamMonitor(const edm::ParameterSet &)
void globalEndLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) override
std::shared_ptr< onlinebeammonitor::BeamSpotInfo > globalBeginLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) const override
std::vector< int > processedLumis_
std::string monitorName_
std::map< std::string, reco::BeamSpot > BeamSpotContainer
MonitorElement * bsChoice_
edm::ESGetToken< BeamSpotOnlineObjects, BeamSpotOnlineHLTObjectsRcd > bsHLTToken_
static void fillDescriptions(edm::ConfigurationDescriptions &)
std::ofstream fasciiDIP
HistosContainer histosMap_
edm::ESGetToken< BeamSpotObjects, BeamSpotTransientObjectsRcd > bsTransientToken_
std::map< std::string, reco::BeamSpot > BeamSpotContainer
PositionContainer positionsMap_
std::map< std::string, std::map< std::string, std::map< std::string, int > > > PositionContainer
Definition: Run.h:45