14 #include "TPaveText.h" 15 #include "TImageDump.h" 18 #include "TPaveLabel.h" 28 " Creating SiStripHistoPlotter " <<
"\n" ;
35 " Deleting SiStripHistoPlotter " <<
"\n" ;
60 for (std::vector<PlotParameter>::iterator it =
plotList_.begin();
86 TH1F* tproject =
nullptr;
87 if (dopt ==
"projection") {
89 if (tproject) tproject->Draw();
96 histo->SetStats( kFALSE );
98 if (name.find(
"Summary_Mean") != std::string::npos) {
99 histo->SetStats( kFALSE );
101 histo->SetFillColor(1);
104 histo->Draw(dopt.c_str());
108 tTitle.SetTextFont(64);
109 tTitle.SetTextSizePixels(20);
114 tt.SetTextSize(0.12);
115 tt.SetTextColor(icol);
116 tt.DrawTextNDC(0.5, 0.5, tag.c_str());
127 std::map<std::string, std::string>::iterator cPos;
128 if (path ==
"dummy_path") {
129 std::cout <<
" Sending Dummy Image for : " 130 << path << std::endl;
132 image = cPos->second;
136 image = cPos->second;
139 std::cout <<
" Sending Dummy Image for : " 140 << path << std::endl;
142 image = cPos->second;
163 TImageDump imgdump(
"tmp.png", 114);
168 TImage *image = imgdump.GetImage();
170 if( image ==
nullptr )
179 image->GetImageBuffer(&buf, &sz);
181 std::ostringstream local_str;
182 for (
int i = 0;
i < sz;
i++) local_str << buf[
i];
215 std::ostringstream local_str;
219 if(imagefile->is_open()) {
220 while (getline( *imagefile, line )) {
221 local_str << line << std::endl ;
225 image = local_str.str();
232 TAxis* xa = hist->GetXaxis();
233 TAxis* ya = hist->GetYaxis();
235 xa->SetTitleOffset(0.7);
236 xa->SetTitleSize(0.05);
237 xa->SetLabelSize(0.04);
239 ya->SetTitleOffset(0.7);
240 ya->SetTitleSize(0.05);
241 ya->SetLabelSize(0.04);
249 ptit +=
"-Yprojection";
253 tp =
new TH1F(ptit.c_str(),ptit.c_str(),hist2->GetNbinsY(),
254 hist2->GetYaxis()->GetXmin(),hist2->GetYaxis()->GetXmax());
255 tp->GetXaxis()->SetTitle(ptit.c_str());
256 for (
int j = 1; j < hist2->GetNbinsY()+1; j++) {
257 float tot_count = 0.0;
258 for (
int i = 1;
i < hist2->GetNbinsX()+1;
i++) {
259 tot_count += hist2->GetBinContent(
i,j);
261 tp->SetBinContent(j, tot_count);
265 tp =
new TH1F(ptit.c_str(),ptit.c_str(),100,
266 0.0,prof->GetMaximum()*1.2);
267 tp->GetXaxis()->SetTitle(ptit.c_str());
268 for (
int i = 1;
i < prof->GetNbinsX()+1;
i++) {
269 tp->Fill(prof->GetBinContent(
i));
273 tp =
new TH1F(ptit.c_str(),ptit.c_str(),100,
274 0.0,hist1->GetMaximum()*1.2);
275 tp->GetXaxis()->SetTitle(ptit.c_str());
276 for (
int i = 1;
i < hist1->GetNbinsX()+1;
i++) {
277 tp->Fill(hist1->GetBinContent(
i));
285 TH1* hist1 = me->
getTH1();
286 TCanvas*
canvas =
new TCanvas(
"TKCanvas",
"TKCanvas", 600, 400);
289 tTitle.SetTextFont(64);
290 tTitle.SetTextSizePixels(20);
298 hist1_ref->SetLineColor(3);
299 hist1_ref->SetMarkerColor(3);
300 if (name.find(
"Summary") != std::string::npos) hist1_ref->Draw(
"same");
301 else hist1_ref->DrawNormalized(
"same", hist1->GetEntries());
307 gSystem->Exec(command.c_str());
308 canvas->Print(file_name.c_str(),
"png");
331 for (std::vector<PlotParameter>::iterator it =
condDBPlotList_.begin();
343 std::vector<std::string> htypes;
348 std::vector<MonitorElement*> all_mes = dqm_store->
getContents(par.
Path);
350 for (std::vector<std::string>::const_iterator ih = htypes.begin();
351 ih!= htypes.end(); ih++) {
353 if (type.empty())
continue;
355 for (std::vector<MonitorElement *>::const_iterator it = all_mes.begin();
356 it!= all_mes.end(); it++) {
360 if (hname.find(type) != std::string::npos) {
std::map< std::string, std::string > namedPictureBuffer_
const std::string & getName(void) const
get name of ME
bool hasNamedImage(const std::string &name)
TH1 * getRefTH1(void) const
void createPlots(DQMStore *dqm_store)
void setDrawingOption(TH1 *hist)
void setNewCondDBPlot(std::string &path, std::string &option, int width, int height)
static void split(const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ")
void createStaticPlot(MonitorElement *me, const std::string &file_name)
std::vector< PlotParameter > condDBPlotList_
void getNamedImageBuffer(const std::string &path, std::string &image)
std::string getTitle(void) const
get MonitorElement title
void createCondDBPlots(DQMStore *dqm_store)
Kind kind(void) const
Get the type of the monitor element.
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
std::vector< MonitorElement * > getContents(const std::string &path) const
void makeCondDBPlots(DQMStore *dqm_store, const PlotParameter &par)
static void getMEStatusColor(int status, int &rval, int &gval, int &bval)
static int getMEStatus(MonitorElement *me)
TH1F * getTH1F(void) const
return(e1-e2)*(e1-e2)+dp *dp
TProfile * getTProfile(void) const
void getProjection(MonitorElement *me, TH1F *tp)
void setNewPlot(std::string &path, std::string &option, int width, int height)
void fillNamedImageBuffer(TCanvas *c1, const std::string &name)
(Documentation under construction).
void createDummyImage(const std::string &name)
std::vector< PlotParameter > plotList_
TH2F * getTH2F(void) const
void getDummyImage(std::string &image)
TObject * getRefRootObject(void) const
void makePlot(DQMStore *dqm_store, const PlotParameter &par)