I have a camera with a lot of photons that has landed on it. I want to calculate the locations of these individual points and how much light each of these points contain.
double x_max = hImage2D->GetXaxis()->GetXmax();
double x_min = hImage2D->GetXaxis()->GetXmin();
double y_max = hImage2D->GetYaxis()->GetXmax();
double y_min = hImage2D->GetYaxis()->GetXmin();
I get the value of xmin/max and ymin/max to be -4.6<x<4.6 and -4.6<y<4.6 but they all contain zero photons.
The problem is also that when showing the values of x and y I only get integers.
Anyway the code I use to display all values of x,y and nr of photons in vectors is:
int * pointer_x;
int * pointer_y;
int * pointer_n;
for (int n=0; n < 81; n=n+1)
for (int x=x_min; x< x_max; x++)
for (int y=y_min; y < y_max; y++)
pointer_x = binx + n; *pointer_x = x;
pointer_y = biny + n; *pointer_y = y;
pointer_n = bin + n; *pointer_n = hImage2D->GetBinContent(x,y);
std::cout << binx[n] << ", " << biny[n] << ", " << bin[n] << std::endl; } }
Though I still get zero in every point but if I loop over random points with GetBinContent(n) (0 < n < 81) then I get points that has values in them.
So basically my question is:
What am I doing wrong? Why do I get zero in all the photon points?
Does it have to do with the fact that its all integers (in x and y)? Do I need to calculate the bins instead and get the photons through that?