Correlation between two variables

Hi every one.

I want to find the correlation between two variables.

h_hist_1[8] and
h_hist_2[8].

What I tried is :

TH2D *h_hist1hist2[8];
for (int i = 0; i < 8; i++)
{
h_hist1hist2[i] = new TH2D(Form(“h_hist1hist2_%d”, i), " " , 100, 0, 100, 100, 0, 100);
}

for (int i = 0; i < 8; i++)
{
h_hist1hist2[i]->Fill(A1, A2);
}

Please have a look and correct me .
Thank you.

Hi,

This is the first error you can not use the dash in the name of an histogram (or array of histograms)

This is the second error that I see, you could not fill an histogram using other histogram.
You have fill it the TH2D with the data you used to create the other 16 histograms

Thank you for your time and your kind reply .

If you can give us more detail, I can try to be more helpful