TTree::Scan break when TString is empty in a TClonesArray

Hi again.

I posted the other day about my issue with a TString inside an object that I store in a TClonesArray. You guys are usually amazingly fast at responding to people and so I thought that perhaps I slipped under the radar.

please see the last paragraph of this recent post:
root.cern.ch/phpBB2/viewtopic.ph … c9b3e96007

In short, I have an event branch with a TClonesArray of objects (that I have called ‘sub records’). The sub-record object contains a TString member variable (I’ve also tried string, TString* and string*). However, there are some entries in the tree where there are no sub-records in this TClonesArray. When I call TTree::Scan, it breaks. In the above link, I’ve attached my ROOT file, “new.root” and given two lines from the Cint that reproduces my problem.

Also, I’m open to suggestions about how to obtain the following behavior. I’d like to essentially be able to call
TTree::Scan("",“fDetectorName.fData==“MyDetectorname””), where fDetectorName is the TString that is inside of the sub-record object. If its possible to get this working with an array of Char_t* instead, I’d like to know how.

Thanks again, and let me know if there’s any more information that would be helpful.

Adam

Hi,

All your questions are hopefully now addressed in the thread you are pointing to. Let us know if you any additional issues.

Cheers,
Philippe.

Thanks again!

Adam