I have two samples with truth and reconstructed events. I want to plot the correlation between the reconstructed and truth events for certain variables by selecting the events that have the same eventnumber and runnumber.
My problem is I do not know to select the events that have the same eventnumber and runnumber.
Here, I have attached the macros for your kind information.
// Running over the entries of the branches
for (int i=0; i<nentries; i++) {
truth->GetEntry(i);
reco->GetEntry(i);
if (reco_eventnumber == truth_eventnumber && reco_runnumber == truth_runnumber) {
h_top_pt->Fill(reco_t_pt, truth_t_pt);
h_top_eta->Fill(reco_t_eta, truth_t_eta);
}
}
But this assumes the event number i in truth correspond to the event number i in reco. Is it the case ?
Also I noticed that your histograms have only 4 bins along X and Y . Is it normal ?
The test enclosing the filling of the histograms I added, is doing that. But, as I said, that will work only if the event number i in truth correspond to the event number i in reco .
Sorry, still we are not sure that the event number i in truth correspond to the event number i in reco.
I think for event number i in reco, we have to scan all the truth events and then if runNumber and eventNumber matches than that will be corresponding event at the truth level.
But I have no idea how to do scan of events using ROOT.