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 NoCache {};
30 } // namespace onlinebeammonitor
31 
32 class OnlineBeamMonitor : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<onlinebeammonitor::NoCache>> {
33 public:
36 
37 protected:
38  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
39  std::shared_ptr<onlinebeammonitor::NoCache> globalBeginLuminosityBlock(const edm::LuminosityBlock& iLumi,
40  const edm::EventSetup& iSetup) const override;
41  void globalEndLuminosityBlock(const edm::LuminosityBlock& iLumi, const edm::EventSetup& iSetup) override;
42  void dqmEndRun(edm::Run const&, edm::EventSetup const&) override;
43 
44 private:
45  //Typedefs
46  // BF,BS...
47  typedef std::map<std::string, reco::BeamSpot> BeamSpotContainer;
48  // x,y,z,sigmax(y,z)... [run,lumi] Histo name
49  typedef std::map<std::string, std::map<std::string, std::map<std::string, MonitorElement*>>> HistosContainer;
50  // x,y,z,sigmax(y,z)... [run,lumi] Histo name
51  typedef std::map<std::string, std::map<std::string, std::map<std::string, int>>> PositionContainer;
52 
53  //Parameters
58  std::ofstream fasciiDIP;
59 
60  //Service variables
63  mutable std::vector<int> processedLumis_;
64  // MonitorElements:
66 
67  //Containers
71  std::vector<std::string> varNamesV_; //x,y,z,sigmax(y,z)
72  std::multimap<std::string, std::string> histoByCategoryNames_; //run, lumi
73 
74  //For File Writing
78 };
79 
80 #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
BeamSpotContainer beamSpotsMap_
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::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_
PositionContainer positionsMap_
std::shared_ptr< onlinebeammonitor::NoCache > globalBeginLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) const override
std::map< std::string, std::map< std::string, std::map< std::string, int > > > PositionContainer
Definition: Run.h:45