Reweight a histogram with a weight of histogram form

Dear Expert,

I want to reweight a deltaM histogram with a weight which is also in the histogram form saved in two different root files.

This is the script that I am using:
reweight.C (1.3 KB)
but it is not working.

Can you please suggest How can I do this?

Regards
Chanchal


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


tree1->GetEntry(i); tree2->GetEntry(i);

Dear @Wile_E_Coyote ,

Just to confirm, are you suggesting to do like below:

Int_t nentries = (Int_t)tree1->GetEntries();
for (Int_t i=0; i<nentries; i++)
{
tree1->GetEntry(i);
tree2->GetEntry(i);
{
h1->Fill(deltaM,Weight);
}
}

Its working but I don’t understand as I am looping over the entries of only one tree. Is it fine?

Regards
Chanchal

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.