FairRoot/PandaRoot
Functions
detectors/mvd/MvdOfflineTBAnalysis_Topix4/MSaveBigPng.C File Reference

Go to the source code of this file.

Functions

void MSaveBigPNG (TString filename="", double scale=5)
 

Function Documentation

void MSaveBigPNG ( TString  filename = "",
double  scale = 5 
)

Definition at line 8 of file detectors/mvd/MvdOfflineTBAnalysis_Topix4/MSaveBigPng.C.

References filename.

8  {
9  TCanvas* old_canv = gPad->GetCanvas();
10 
11  gROOT->SetBatch(kTRUE);
12  gROOT->ForceStyle(kTRUE);
13 
14  Int_t orig_msz = gStyle->GetMarkerSize();
15  Int_t orig_mst = gStyle->GetMarkerStyle();
16  Int_t orig_lt = gStyle->GetLineWidth();
17 
18  gStyle->SetMarkerSize(1.0+scale/5);
19  gStyle->SetMarkerStyle(20);
20  gStyle->SetLineWidth(orig_lt*scale);
21 
22  if(filename == "") {
23  filename = old_canv->GetName();
24  filename += ".png";
25  }
26 
27  Int_t old_width = old_canv->GetWindowWidth();
28  Int_t old_height = old_canv->GetWindowHeight();
29 
30  Int_t new_width = old_width * scale;
31  Int_t new_height= old_height* scale;
32 
33  TCanvas* temp_canvas = new TCanvas("temp", "", new_width, new_height);
34  old_canv->DrawClonePad();
35 
36  temp_canvas->Draw();
37  temp_canvas->SaveAs(filename);
38  temp_canvas->Close();
39 
40  gStyle->SetMarkerSize(orig_msz);
41  gStyle->SetMarkerStyle(orig_mst);
42  gStyle->SetLineWidth(orig_lt);
43 
44  gROOT->ForceStyle(kFALSE);
45  gROOT->SetBatch(kFALSE);
46 
47  return;
48 }
const string filename