Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:56:38

0001 #ifndef _SiStripHistoPlotter_h_
0002 #define _SiStripHistoPlotter_h_
0003 
0004 #include <fstream>
0005 #include <sstream>
0006 #include <map>
0007 #include <vector>
0008 #include <string>
0009 
0010 #include "TCanvas.h"
0011 #include "DQMServices/Core/interface/DQMStore.h"
0012 
0013 class TH1;
0014 
0015 class SiStripHistoPlotter {
0016 public:
0017   typedef dqm::harvesting::MonitorElement MonitorElement;
0018   typedef dqm::harvesting::DQMStore DQMStore;
0019 
0020   SiStripHistoPlotter();
0021   ~SiStripHistoPlotter();
0022 
0023   void getNamedImageBuffer(const std::string& path, std::string& image);
0024   void createPlots(DQMStore* dqm_store);
0025   void setNewPlot(std::string const& path, std::string const& option, int width, int height);
0026   void createCondDBPlots(DQMStore* dqm_store);
0027   void setNewCondDBPlot(std::string const& path, std::string const& option, int width, int height);
0028   bool plotsToMake() { return !plotList_.empty(); }
0029   bool condDBPlotsToMake() { return !condDBPlotList_.empty(); }
0030 
0031 private:
0032   struct PlotParameter {
0033     std::string Path;
0034     std::string Option;
0035     int CWidth;
0036     int CHeight;
0037   };
0038 
0039   void fillNamedImageBuffer(TCanvas* c1, const std::string& name);
0040   void makePlot(DQMStore const* dqm_store, const PlotParameter& par);
0041   void makeCondDBPlots(DQMStore* dqm_store, const PlotParameter& par);
0042   bool hasNamedImage(const std::string& name);
0043   void createDummyImage(const std::string& name);
0044   void getDummyImage(std::string& image);
0045 
0046   void setDrawingOption(TH1* hist);
0047   void getProjection(MonitorElement* me, TH1F* tp);
0048 
0049   std::map<std::string, std::string> namedPictureBuffer_;
0050   std::vector<PlotParameter> plotList_;
0051   std::vector<PlotParameter> condDBPlotList_;
0052 };
0053 
0054 #endif