Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:41:38

0001 #ifndef BeamSpotProblemMonitor_H
0002 #define BeamSpotProblemMonitor_H
0003 
0004 /** \class BeamSpotProblemMonitor
0005  * *
0006  *  \author  Sushil S. Chauhan/UC Davis
0007  *      
0008  *
0009  */
0010 // C++
0011 #include <string>
0012 // CMS
0013 #include "FWCore/Framework/interface/Frameworkfwd.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 #include "DataFormats/Scalers/interface/BeamSpotOnline.h"
0016 #include "DataFormats/Scalers/interface/DcsStatus.h"
0017 #include "DataFormats/TrackReco/interface/Track.h"
0018 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0019 #include "DQMServices/Core/interface/DQMStore.h"
0020 #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
0021 
0022 //
0023 // class declaration
0024 //
0025 
0026 class BeamSpotProblemMonitor : public DQMOneLumiEDAnalyzer<> {
0027 public:
0028   explicit BeamSpotProblemMonitor(const edm::ParameterSet&);
0029   static void fillDescriptions(edm::ConfigurationDescriptions&);
0030 
0031 protected:
0032   //The order it runs
0033 
0034   // BeginRun
0035   void bookHistograms(DQMStore::IBooker& i, const edm::Run& r, const edm::EventSetup& c) override;
0036   void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0037   void dqmBeginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& context) override;
0038   void dqmEndLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c) override;
0039   // EndRun
0040   void dqmEndRun(const edm::Run& r, const edm::EventSetup& c) override;
0041 
0042 private:
0043   void fillPlots(int&, int&, int);
0044   std::string monitorName_;
0045   const edm::EDGetTokenT<DcsStatusCollection> dcsStatus_;       // dcs status collection
0046   const edm::EDGetTokenT<BeamSpotOnlineCollection> scalertag_;  // scalar collection
0047   const edm::EDGetTokenT<reco::TrackCollection> trkSrc_;        //  track collection
0048 
0049   int nTracks_;
0050   const int nCosmicTrk_;
0051   const int fitNLumi_;
0052   const bool debug_;
0053   const bool onlineMode_;
0054   const bool doTest_;
0055   const int alarmONThreshold_;
0056   const int alarmOFFThreshold_;
0057 
0058   int lastlumi_;  // previous LS processed
0059   int nextlumi_;  // next LS of Fit
0060   bool processed_;
0061 
0062   //Alarm Variable
0063   bool alarmOn_;
0064   double beamSpotStatus_;
0065   int beamSpotFromDB_;
0066 
0067   // MonitorElements:
0068   MonitorElement* beamSpotStatusLumi_ = nullptr;
0069   MonitorElement* beamSpotStatusLumiAll_ = nullptr;
0070   MonitorElement* beamSpotError_ = nullptr;
0071 };
0072 
0073 #endif
0074 
0075 // Local Variables:
0076 // show-trailing-whitespace: t
0077 // truncate-lines: t
0078 // End: