Dear ROOTers,
I have the following code:
TH2Poly *h2p = new TH2Poly();
h2p->SetName("h2poly_name");
h2p->SetTitle("h2poly_title");
double px[] = {x1, x2, x3, x4};
double py[] = {y1, y2, y3, y4};
h2p->AddBin(4, px, py);
for (int i=0; i<100; i++) {
h2p->Fill(1400, 0);
}
h2p->Draw();
h2p->Write();
This works.
However, I would like to fill my TH2Poly
not by x, y coords. ((1400, 0) in the above example) but rather by bin number or rather bin name. The class reference for TH2Poly
states it can be done by name but doesn’t provide an option to AddBin
by bin name in addition to x,y coords. Nevertheless, I see that BinNumber can be extracted from TH2Poly
once they are written.
How can this be overcome? Ideally, I would be able to fill the TH2Poly
by bin number or name as shown to work with the USA example. Alas, this doesn’t work for me.
Any advice would be highly appreciated.
Kind regards,
Roy
_ROOT Version: 6-18-04
_Platform: 5.4.0-81-generic #91-Ubuntu
_Compiler: C++ ROOT compiler