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 NoCache {};
32 } // namespace alcabeammonitor
33 
34 class AlcaBeamMonitor : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<alcabeammonitor::NoCache>> {
35 public:
38 
39 protected:
40  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
41  void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;
42  std::shared_ptr<alcabeammonitor::NoCache> globalBeginLuminosityBlock(const edm::LuminosityBlock& iLumi,
43  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
62  bool perLSsaving_; //to avoid nanoDQMIO crashing, driven by DQMServices/Core/python/DQMStore_cfi.py
63 
64  //Service variables
66  std::unique_ptr<BeamFitter> theBeamFitter_;
67  std::unique_ptr<PVFitter> thePVFitter_;
69  mutable std::vector<int> processedLumis_;
70 
71  // MonitorElements:
74  //mutable MonitorElement* theValuesContainer_;
75 
76  //Containers
80  std::vector<std::string> varNamesV_; //x,y,z,sigmax(y,z)
81  std::multimap<std::string, std::string> histoByCategoryNames_; //run, lumi
82  mutable std::vector<reco::VertexCollection> vertices_;
83 };
84 
85 #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_
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 &)
BeamSpotContainer beamSpotsMap_
std::vector< int > processedLumis_
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::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
std::shared_ptr< alcabeammonitor::NoCache > globalBeginLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) const override
void dqmEndRun(edm::Run const &, edm::EventSetup const &) override
std::vector< reco::VertexCollection > vertices_