CMS 3D CMS Logo

AlcaBeamMonitor.h
Go to the documentation of this file.
1 #ifndef DQM_BeamMonitor_AlcaBeamMonitor_h
2 #define DQM_BeamMonitor_AlcaBeamMonitor_h
3 
9 // C++
10 #include <map>
11 #include <vector>
12 #include <string>
13 // CMS
26 
27 class BeamFitter;
28 class PVFitter;
29 
30 namespace alcabeammonitor {
31  struct BeamSpotInfo {
32  std::vector<reco::VertexCollection> vertices_;
33  typedef std::map<std::string, reco::BeamSpot> BeamSpotContainer;
35  };
36 } // namespace alcabeammonitor
37 
38 class AlcaBeamMonitor : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<alcabeammonitor::BeamSpotInfo>> {
39 public:
42 
43 protected:
44  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
45  void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;
46  std::shared_ptr<alcabeammonitor::BeamSpotInfo> globalBeginLuminosityBlock(
47  const edm::LuminosityBlock& iLumi, const edm::EventSetup& iSetup) const override;
48  void globalEndLuminosityBlock(const edm::LuminosityBlock& iLumi, const edm::EventSetup& iSetup) override;
49  void dqmEndRun(edm::Run const&, edm::EventSetup const&) override;
50 
51 private:
52  //Typedefs
53  // BF,BS...
54  typedef std::map<std::string, reco::BeamSpot> BeamSpotContainer;
55  // x,y,z,sigmax(y,z)... [run,lumi] Histo name
56  typedef std::map<std::string, std::map<std::string, std::map<std::string, MonitorElement*>>> HistosContainer;
57  // x,y,z,sigmax(y,z)... [run,lumi] Histo name
58  typedef std::map<std::string, std::map<std::string, std::map<std::string, int>>> PositionContainer;
59 
60  //Parameters
66  bool perLSsaving_; //to avoid nanoDQMIO crashing, driven by DQMServices/Core/python/DQMStore_cfi.py
67 
68  //Service variables
70  std::unique_ptr<BeamFitter> theBeamFitter_;
71  std::unique_ptr<PVFitter> thePVFitter_;
72  std::vector<int> processedLumis_;
73 
74  // MonitorElements:
77  //mutable MonitorElement* theValuesContainer_;
78 
79  //Containers
82  std::vector<std::string> varNamesV_; //x,y,z,sigmax(y,z)
83  std::multimap<std::string, std::string> histoByCategoryNames_; //run, lumi
84 };
85 
86 #endif
MonitorElement * hD0Phi0_
std::map< std::string, reco::BeamSpot > BeamSpotContainer
MonitorElement * hDxyBS_
static void fillDescriptions(edm::ConfigurationDescriptions &)
std::multimap< std::string, std::string > histoByCategoryNames_
PositionContainer positionsMap_
BeamSpotContainer beamSpotMap_
std::map< std::string, std::map< std::string, std::map< std::string, MonitorElement * > > > HistosContainer
std::vector< std::string > varNamesV_
int iEvent
Definition: GenABIO.cc:224
AlcaBeamMonitor(const edm::ParameterSet &)
std::shared_ptr< alcabeammonitor::BeamSpotInfo > globalBeginLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) const override
std::vector< int > processedLumis_
std::map< std::string, reco::BeamSpot > BeamSpotContainer
const edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcd > beamSpotToken_
std::unique_ptr< PVFitter > thePVFitter_
std::unique_ptr< BeamFitter > theBeamFitter_
HistosContainer histosMap_
void globalEndLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) override
std::string monitorName_
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
const edm::EDGetTokenT< reco::BeamSpot > scalerLabel_
std::vector< reco::VertexCollection > vertices_
std::map< std::string, std::map< std::string, std::map< std::string, int > > > PositionContainer
const edm::EDGetTokenT< reco::TrackCollection > trackLabel_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
const edm::EDGetTokenT< reco::VertexCollection > primaryVertexLabel_
Definition: Run.h:45
void dqmEndRun(edm::Run const &, edm::EventSetup const &) override