TCutG: hatch not visible in .ps and .eps files

hello,

using ROOT 5.18.00 i created a graphical cut which highlights an excluded region with a hatch a) via the GUI and b) with the attached script. it worked fine, but when i tried to save it in a .eps or a .ps file either by clicking on File->Save As or via the script the hatch was not shown in the output file.

if i save the file as .png or .gif (via the GUI) it works, but there seems to be an issue with postscript.

the script accesses the histograms from attached root file.

thanks in advance for your help,

cheers,
axel.
cutTest.root (5.58 KB)
cutTestScript.C (888 Bytes)

I do not see any problem with your script with ps or pdf. I suggest to simplify it as shown below.

Rene

[code]{
TFile* file_1 = TFile::Open(“cutTest.root”);
TH1D* zVtx = (TH1D*) file_1->Get(“ZVertex”);
TH1D* zVtx_MC = (TH1D*) file_1->Get(“ZVertex_MC”);

zVtx->Rebin(4);
zVtx_MC->Rebin(4);

zVtx_MC->Scale(zVtx->Integral()/zVtx_MC->Integral());
zVtx->Divide(zVtx_MC);

TCanvas myCanvas;

zVtx->Draw();

float leftCutPointsX[5] = {-32.,-32.,-40.,-40.,-32.};
float leftCutPointsY[5] = {-12.,12.,12.,-12.,-12.};
TCutG leftAreaCut("leftCut",5,leftCutPointsX,leftCutPointsY);	

leftAreaCut.SetFillStyle(3005);
leftAreaCut.Draw("f");

float rightCutPointsX[5] = {32.,32.,40.,40.,32.};
float rightCutPointsY[5] = {-12.,12.,12.,-12.,-12.};
TCutG rightAreaCut("rightCut",5,rightCutPointsX,rightCutPointsY);	

rightAreaCut.SetFillStyle(3005);
rightAreaCut.Draw("f");

myCanvas.Print("cutTest.ps");

}
[/code]

hi rene,

thanks for the reply. anti-aliasing made the hatch disappear.

actually that depends on the screen resolution, i think, cause my laptop displays the hatch as a checkers pattern, depending on the zoom.

cheers,
axel.

I guess you were trying to visualize your PS file using “gv”.
" gv" has a bug regarding pattern visualization.
It is explained at the bottom of this page:

root.cern.ch/drupal/content/how- … -interface

This page gives the instructions you need to put in your .gv file to avoid this problem.

thanks for the link, i didn’t know that.

but this ‘bug’ is not a feature of gv only. i observe this with other ps-viewers based on ghostscript when using anti-aliasing.

cheers,
axel.

Yes all the application based on “gs” (ghostscript) have the same problem. For instance, in the how-to page is also mentioned the “convert” application .