I’ve attached an example file. It seems that TTree::Scan/Draw has problems seeing a string member in all of the objects I’ve stored in a TClonesArray.
For example, in the attached file I have an event class with TClonesArrays holding “bolometer” data. In the bolometer object, I have a member variable called fDetectorName.
There are 4 events in this file. The first two events have two bolometer, and the second two events have only one.
if I do a
You’ll see that the fDetectorName branch has the values “ID5” and "ID401"
fBolo.fDetectorName = ID5, ID401
for t->Show(1), you get ID4 and ID6.
Now, if I do a t->Scan(“fDetectorName”), I get the following.
root  t->Scan(“fDetectorName”)
- Row * fDetector *
0 * ID5 *
1 * ID4 *
2 * ID401 *
3 * ID5 *
When I do a t->Draw(“fDetectorName”) I get a histogram that matches this. Notice that there is NO entry here for ID6 and there is only one entry for ID401. Where are they?? They should be in Row 0 Instance 1 and Row 1 Instance 1. Only Instance 0 shows up here. (You can also reproduce this problem using the ‘fRunName’ variable, which is a value stored in another TClonesArray in this file.)
If you scan for a different variable, you’ll see that you get all of the objects stored in the array for each event.
root  t->Scan(“fEnergyIon”)
- Row * Instance * fEnergyIo *
0 * 0 * 161.97799 *
0 * 1 * 1837.6500 *
1 * 0 * 0 *
1 * 1 * 0 *
2 * 0 * 154.06100 *
3 * 0 * 159.38000 *
Thanks for your help!!
ps - Mac OS 10.6
ROOT v5.27.04, 5.27.06 and 5.28.00