21 #include <TDirectory.h>
38 TList * l = p->GetListOfPrimitives();
43 while ((obj =
next()))
46 if (obj->IsA()->GetBaseClassOffset(TClass::GetClass(
"TPad")) >= 0)
48 if ((TPad *) obj !=
p)
51 else if (obj->IsA()->GetBaseClassOffset(TClass::GetClass(
"TH1")) >= 0)
53 cout <<
"Save TH1 " << obj->GetName() << endl;
54 obj->Clone()->Write(obj->GetName(), TObject::kOverwrite);
56 else if (obj->IsA()->GetBaseClassOffset(TClass::GetClass(
"TF1")) >= 0)
58 cout <<
"Save TF1 " << obj->GetName() << endl;
59 obj->Clone()->Write(obj->GetName(), TObject::kOverwrite);
61 else if (obj->IsA()->GetBaseClassOffset(TClass::GetClass(
"TGraph")) >= 0)
63 cout <<
"Save TGraph " << obj->GetName() << endl;
64 obj->Clone()->Write(obj->GetName(), TObject::kOverwrite);
78 if (
name.Length() == 0)
81 c->Print(
name +
".png");
83 TDirectory * oldd = gDirectory;
87 c->Print(rootfilename =
name +
".root");
89 TFile
f(rootfilename,
"update");
103 gStyle->GetPaperSize(x, y);
105 gStyle->SetPaperSize(c->GetWindowWidth() / 72 * 2.54,
106 c->GetWindowHeight() / 72 * 2.54);
108 c->Print(
name +
".svg");
109 gSystem->Exec(
"rsvg-convert -f pdf -o "+
name +
".pdf " +
name +
".svg");
110 gSystem->Exec(
"rm -fv " +
name +
".svg");
112 gStyle->SetPaperSize(x, y);
134 TCanvas *c1 =
new TCanvas(
"CanvasTest",
"CanvasTest", 800, 900);
136 TH1F *
h1 =
new TH1F(
"h1",
"histo from a gaussian", 100, -3, 3);
137 h1->FillRandom(
"gaus", 10000);