14 #include "TPaveText.h" 15 #include "TImageDump.h" 18 #include "TPaveLabel.h" 27 edm::LogInfo(
"SiStripHistoPlotter") <<
" Creating SiStripHistoPlotter " 34 edm::LogInfo(
"SiStripHistoPlotter") <<
" Deleting SiStripHistoPlotter " 87 TH1F* tproject =
nullptr;
88 if (dopt ==
"projection") {
99 histo->SetStats( kFALSE );
101 if (name.find(
"Summary_Mean") != std::string::npos) {
102 histo->SetStats(kFALSE);
104 histo->SetFillColor(1);
107 histo->Draw(dopt.c_str());
111 tTitle.SetTextFont(64);
112 tTitle.SetTextSizePixels(20);
117 tt.SetTextSize(0.12);
118 tt.SetTextColor(icol);
119 tt.DrawTextNDC(0.5, 0.5, tag.c_str());
130 std::map<std::string, std::string>::iterator cPos;
131 if (path ==
"dummy_path") {
132 std::cout <<
" Sending Dummy Image for : " 133 << path << std::endl;
135 image = cPos->second;
139 image = cPos->second;
142 std::cout <<
" Sending Dummy Image for : " << path << std::endl;
144 image = cPos->second;
166 TImageDump imgdump(
"tmp.png", 114);
171 TImage *image = imgdump.GetImage();
173 if( image ==
nullptr )
175 std::cout <<
"No TImage found for " << name << std::endl;
180 image->GetImageBuffer(&buf, &sz);
182 std::ostringstream local_str;
183 for (
int i = 0;
i < sz;
i++) local_str << buf[
i];
216 std::ostringstream local_str;
220 if(imagefile->is_open()) {
221 while (getline( *imagefile, line )) {
222 local_str << line << std::endl ;
226 image = local_str.str();
233 TAxis* xa = hist->GetXaxis();
234 TAxis* ya = hist->GetYaxis();
236 xa->SetTitleOffset(0.7);
237 xa->SetTitleSize(0.05);
238 xa->SetLabelSize(0.04);
240 ya->SetTitleOffset(0.7);
241 ya->SetTitleSize(0.05);
242 ya->SetLabelSize(0.04);
250 ptit +=
"-Yprojection";
254 tp =
new TH1F(ptit.c_str(),
257 hist2->GetYaxis()->GetXmin(),
258 hist2->GetYaxis()->GetXmax());
259 tp->GetXaxis()->SetTitle(ptit.c_str());
260 for (
int j = 1; j < hist2->GetNbinsY()+1; j++) {
261 float tot_count = 0.0;
262 for (
int i = 1;
i < hist2->GetNbinsX()+1;
i++) {
263 tot_count += hist2->GetBinContent(
i, j);
265 tp->SetBinContent(j, tot_count);
270 new TH1F(ptit.c_str(), ptit.c_str(), 100, 0.0, prof->GetMaximum() * 1.2);
271 tp->GetXaxis()->SetTitle(ptit.c_str());
272 for (
int i = 1;
i < prof->GetNbinsX()+1;
i++) {
273 tp->Fill(prof->GetBinContent(
i));
278 new TH1F(ptit.c_str(), ptit.c_str(), 100, 0.0, hist1->GetMaximum() * 1.2);
279 tp->GetXaxis()->SetTitle(ptit.c_str());
280 for (
int i = 1;
i < hist1->GetNbinsX()+1;
i++) {
281 tp->Fill(hist1->GetBinContent(
i));
289 TH1* hist1 = me->
getTH1();
290 auto canvas =
new TCanvas(
"TKCanvas",
"TKCanvas", 600, 400);
293 tTitle.SetTextFont(64);
294 tTitle.SetTextSizePixels(20);
302 hist1_ref->SetLineColor(3);
303 hist1_ref->SetMarkerColor(3);
304 if (name.find(
"Summary") != std::string::npos)
305 hist1_ref->Draw(
"same");
307 hist1_ref->DrawNormalized(
"same", hist1->GetEntries());
313 gSystem->Exec(command.c_str());
314 canvas->Print(file_name.c_str(),
"png");
340 for (std::vector<PlotParameter>::iterator it =
condDBPlotList_.begin();
353 std::vector<std::string> htypes;
358 std::vector<MonitorElement*> all_mes = dqm_store->
getContents(par.
Path);
360 for (std::vector<std::string>::const_iterator ih = htypes.begin();
361 ih!= htypes.end(); ih++) {
363 if (type.empty())
continue;
365 for (std::vector<MonitorElement*>::const_iterator it = all_mes.begin();
371 if (hname.find(type) != std::string::npos) {
std::map< std::string, std::string > namedPictureBuffer_
TProfile * getTProfile() const
bool hasNamedImage(const std::string &name)
std::vector< MonitorElement * > getContents(std::string const &path) const
void createPlots(DQMStore *dqm_store)
void setDrawingOption(TH1 *hist)
const std::string & getName() const
get name of ME
TObject * getRefRootObject() const
void createStaticPlot(MonitorElement *me, const std::string &file_name)
void setNewPlot(std::string const &path, std::string const &option, int width, int height)
std::vector< PlotParameter > condDBPlotList_
std::string getTitle() const
get MonitorElement title
void getNamedImageBuffer(const std::string &path, std::string &image)
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
void createCondDBPlots(DQMStore *dqm_store)
void makePlot(DQMStore const *dqm_store, const PlotParameter &par)
void setNewCondDBPlot(std::string const &path, std::string const &option, int width, int height)
void makeCondDBPlots(DQMStore *dqm_store, const PlotParameter &par)
static void getMEStatusColor(int status, int &rval, int &gval, int &bval)
static void split(std::string const &str, std::vector< std::string > &tokens, std::string const &delimiters=" ")
void getProjection(MonitorElement *me, TH1F *tp)
void fillNamedImageBuffer(TCanvas *c1, const std::string &name)
(Documentation under construction).
void createDummyImage(const std::string &name)
std::vector< PlotParameter > plotList_
static int getMEStatus(MonitorElement const *me)
void getDummyImage(std::string &image)
Kind kind() const
Get the type of the monitor element.