Bonjour,
I have lost some hours looking for a inexistant bug while filling TTree with TClonesArray containing an array. At the end it turned out to be a “feature” of the TTreeFormula.
My TTree is made of Event containing a TClonesArray fHits (of length fNhits), which in turn contains a fixed size array fThr[3]. All the hits must at least have the lowest threshold set to 1 (useless information apparently).
But the Draw or Scan command with “fThr[0]” (or “fHits.fThr[0]”) reports some 0 :
[code] Event->Scan(“fHeader.fEvtNum:fNhits:fThr[0]:fThr[1]”,"","", 274, 0);
- Row * Instance * fHeader.f * fNhits * fThr[0] * fThr[1] *
-
0 * 0 * 0 * 1 * 1 * *
-
0 * 1 * 0 * 1 * 1 * *
-
0 * 2 * 0 * 1 * 0 * *
-
1 * 0 * 1 * 2 * 1 * 1 *
-
1 * 1 * 1 * 2 * 1 * 1 *
-
1 * 2 * 1 * 2 * 0 * 0 *
-
2 * 0 * 2 * 1 * 1 * *
-
2 * 1 * 2 * 1 * 1 * *
-
2 * 2 * 2 * 1 * 0 * *
[/code]
while the "fHits[].fThr[0] is OK.
The 1,1,0 sequence actually reflexes the content if the full fThr[] array.
In principle knowing that the fHits is an array of variable length, the TTreeFormula could add fHits[] rather than fHits, and produce a correct output.
Best regards,
Vincent.