How to get the points in the polygon?

Hello,everyone!May I have your help,please?I have just used TCutG class to paint a polygon,and now I want to get the points in the polygon.I am a beginner…:slight_smile:

Thanks first!

What do you mean by that ?

  • Do you want to retrieve the vertices of the polygon ?

  • Do you want to apply this cut to a ntuple of a tree ?

…

[quote=“couet”][quote]
now I want to get the points in the polygon
[/quote]

What do you mean by that ?

  • Do you want to retrieve the vertices of the polygon ?

  • Do you want to apply this cut to a ntuple of a tree ?

…[/quote]
Thank you very much for your reply!Now I am doing the work of Particle identification,using the method called △E-E.I have painted a polygon to contain the points I need,which stand for the paiticles we want to study.

ok … so what is the question ?
Are you using an ntuple or a tree ?

[quote=“couet”]ok … so what is the question ?
Are you using an ntuple or a tree ?[/quote]
I think……a tree.The “suffix” of the file containing datas is “.root”.

So you should just draw your tree using this graphical cut:

mytree->Draw("my_x_variable:my_y_variable", "[my_cutg] ");

after that the histogram htemp is available.
You can get its number of entries.

see
root.cern.ch/root/html534/TTree. … ree:Draw@1

[quote=“couet”]So you should just draw your tree using this graphical cut:

mytree->Draw("my_x_variable:my_y_variable", "[my_cutg] ");

after that the histogram htemp is available.
You can get its number of entries.

see
root.cern.ch/root/html534/TTree. … ree:Draw@1[/quote]

Thank you very much!^_^I will learn and have a try now. :smiley: