Possible bug in TTree::Draw with vector of strings

Hello,

I have a TTree with a branch “s” that is a vector. If I call Draw(“s”), this seems to work OK, but any calls to Draw(“s [ n ]”) always draw the first entry in the vector. Scanning, on the other hand, works as expected. The following demonstrates the effect:

{
  vector<string> s1;
  TFile* fout = new TFile("testtree.root","RECREATE");
  TTree* tree = new TTree("tree","tree");
  tree->Branch("s1",&s1);
  for(int evt=0; evt<10; ++evt){
    s1.clear();
    for(size_t i=0; i<gRandom->Uniform(4,10); ++i){
      char val[10];
      sprintf(val,"s1_%d",i);
      s1.push_back(val);
    }
    tree->Fill();		   
  }
  tree->Write();
  tree->Draw("s1[3]");
  tree->Scan("s1[3]"); 
}

If you run the snippet, it draws a histogram with all entries in the bin (“s1_0”), but scans correctly.

I’m using root 5.28/00g on scientific linux with gcc 4.1.2.

Cheers,
~Ben