TTree::Draw with array branches

Dear experts,

suppose I have defined the following TTree structure:

tree->Branch("njt",      &njt_,       "njt/I");
tree->Branch("jtrank",    jtrank_,    "jtrank[njt]/b");
tree->Branch("jte",       jte_,       "jte[njt]/F");
tree->Branch("jtpt",      jtpt_,      "jtpt[njt]/F");
tree->Branch("jteta",     jteta_,     "jteta[njt]/F");
tree->Branch("jtphi",     jtphi_,     "jtphi[njt]/F");

And then do

I would have expected that for each event, the pT of all those entries would be drawn for which |eta|<2.5.

Unfortunately, it appears that all pT will be considered for events where at least one array entry fulfills the eta requirement.

Is there a way to achieve what I was expecting instead?

Thanks,

Philipp

Cheers,
Philippe.

Hi Philippe,

I am trying again, and everything works as expected (also with abs) … so I might have simply misinterpreted the result before :blush:

The integer number returned by TTree::Draw() corresponds to the number of selected entries, not events, correct? Maybe that is what confused me, I thought it always returns the number of events, in which case it shouldn’t have been equal to the number of entries in the histo.

Sorry for the spam!

Cheers,
Philipp

[quote]The integer number returned by TTree::Draw() corresponds to the number of selected entries, not events, correct?[/quote]Indeed, it should be the number of entries in the histogram.

Cheers,
Philippe.