Hi - the following script in ROOT 4.00/08 produces messed up tilde’s in my EPS output:
hep.caltech.edu/~edward/penalty.eps
(Executed using the ROOT command line)
.L mypenalty.C
TF1 * myfunc = new TF1("myfunc","x",0.0,10);
TF1 * myfunc2 = new TF1("myfunc2",mypenalty,0.0,10,1);
//myfunc->SetTitle("")
myfunc->SetTitle("#tilde{B}'");
//myfunc2->SetTitle("")
myfunc->Draw();
myfunc->GetXaxis()->SetTitle("#tilde{B}");
//myfunc->GetYaxis()->SetTitle("#tilde{B}'");
myfunc->SetTitle("#tilde{B}'");
myfunc->Draw();
myfunc2->SetLineColor(2);
myfunc2->Draw("SAME");
Float_t legendX1C;
Float_t legendX2C;
Float_t legendY1C;
Float_t legendY2C;
legendY1C = 0.70;
legendY2C = 0.89;
legendX1C = 0.15;
legendX2C = 0.29;
TLegend * myLegend = new TLegend(legendX1C,legendY1C,legendX2C,legendY2C);
myLegend->SetFillStyle(0);
myLegend->SetBorderSize(0);
myLegend->SetTextSize(0.03);
myLegend->AddEntry(myfunc,"Unpenalized event count","L");
myLegend->AddEntry(myfunc2,"Penalized event count","L");
myLegend->Draw();
.x myprint.cc("ps/penalty",113);
where
#include <TString.h>
void myprint(TString myFile,Int_t psVal=112, Int_t x=26, Int_t y=20)
{
// psVal: 111 = Portrait, 112 = Landscape, 113 = eps
cout << " Calling myprint for " << myFile << endl;
TString myFullFile;
if (psVal == 113){
myFullFile = myFile+".eps";
}
else{
myFullFile = myFile+".ps";
}
TPostScript * myps = new TPostScript(myFullFile,psVal);
if (psVal != 113) myps->Range(x,y);
c1->Draw();
myps->Close();
delete myps;
}
and
mypenalty.C:
Double_t mypenalty(Double_t *x, Double_t *par)
{
Double_t xx =x[0];
Double_t f = 0;
if (xx <= 5){
f = 2.0 + ((1 - ((2*2.0)/5)) * xx) + (((2.0/(5.0*5.0))) * xx*xx);
}
else{
f = xx;
}
return f;
}
Is there a way to fix this without switching ROOT versions? Thanks.