Either I have a very deep misunderstanding of the way draw selections work in this case or there is a bug here.
My (simplified) situation is this:
I have two trees, each with multiple branches, some simple, some vectors of length 2240, one for each channel:
tree->Branch("run", &run, "run/I"); tree->Branch("channel",channel,"channel/I");
where channel[i] = i+1
The two trees are filled out of order, so that entry 15 might be run 5123 on tree1 and 9014 on tree2. The trees also have different numbers of entries.
So now I want to compare things with the runs matched up, so I call BuildIndex(“run”) on both of them, and then tree1->AddFriend(“tree2”). As I understand, this will match the trees up by their index values - and I had thought only draw entries where there is a match.
Now here’s where it gets really weird:
root  t96->Draw("channel : t95.channel","1") (Long64_t)11152960 root  t96->Draw("channel : t95.channel","channel == t95.channel") (Long64_t)11152960 root  t96->Draw("channel : t95.channel","run == t95.run") (Long64_t)9582720 root  t96->Draw("channel : t95.channel","run == t95.run && channel == t95.channel") (Long64_t)8556
As we can see, the channels are lined up, as expected. But when I make explicit the idea that the runs must be equal, I get a reduction in entries. What am I not seeing here?
Even worse, when I add the cut that the channels must be equal, which above had no effect, suddenly I cut away almost everything. The plot, which formerly went from 1 to 2241, now only has channels 1 and 2 on it. This especially feels very much like a bug to me.
I am running root v5.22 on OS 10.5.