Polar Color Graph

You are facing floating point “rounding errors” (coming mainly from bins’ edges calculation in ROOT).
To understand it better, try to calculate e.g.:

((TMath::Pi()*5.)/3.) - ((TMath::Pi()/3.)*5.)

and try your macro with e.g.:

double slip = -1e-11; // try with -1e-11, 0, +1e-11
hist[0] = new TH2D("h1","h1",16, -TMath::TwoPi(), TMath::TwoPi() + slip, 8, -TMath::TwoPi(), TMath::TwoPi() + slip);
hist[1] = new TH2D("h2","h2", 8, -TMath::TwoPi(), TMath::TwoPi() + slip, 8, -TMath::TwoPi(), TMath::TwoPi() + slip);