PlotParameter

SiStripHistoPlotter

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
#ifndef _SiStripHistoPlotter_h_
#define _SiStripHistoPlotter_h_

#include <fstream>
#include <sstream>
#include <map>
#include <vector>
#include <string>

#include "TCanvas.h"
#include "DQMServices/Core/interface/DQMStore.h"

class TH1;

class SiStripHistoPlotter {
public:
  typedef dqm::harvesting::MonitorElement MonitorElement;
  typedef dqm::harvesting::DQMStore DQMStore;

  SiStripHistoPlotter();
  ~SiStripHistoPlotter();

  void getNamedImageBuffer(const std::string& path, std::string& image);
  void createPlots(DQMStore* dqm_store);
  void setNewPlot(std::string const& path, std::string const& option, int width, int height);
  void createCondDBPlots(DQMStore* dqm_store);
  void setNewCondDBPlot(std::string const& path, std::string const& option, int width, int height);
  bool plotsToMake() { return !plotList_.empty(); }
  bool condDBPlotsToMake() { return !condDBPlotList_.empty(); }

private:
  struct PlotParameter {
    std::string Path;
    std::string Option;
    int CWidth;
    int CHeight;
  };

  void fillNamedImageBuffer(TCanvas* c1, const std::string& name);
  void makePlot(DQMStore const* dqm_store, const PlotParameter& par);
  void makeCondDBPlots(DQMStore* dqm_store, const PlotParameter& par);
  bool hasNamedImage(const std::string& name);
  void createDummyImage(const std::string& name);
  void getDummyImage(std::string& image);

  void setDrawingOption(TH1* hist);
  void getProjection(MonitorElement* me, TH1F* tp);

  std::map<std::string, std::string> namedPictureBuffer_;
  std::vector<PlotParameter> plotList_;
  std::vector<PlotParameter> condDBPlotList_;
};

#endif