#include #include "TTree.h" void tree_str_test_2 () { TTree *t = new TTree("t","tree t"); std::string str_1, str_2; t->Branch("str_1",&str_1); t->Branch("str_2",&str_2); str_1 = "aa1"; str_2 = "aa2"; t->Fill(); str_1 = "bb1"; str_2 = "bb2"; t->Fill(); str_1 = "aa1"; str_2 = "bb2"; t->Fill(); t->Scan(); t->Draw("str_1:str_2","","colz"); }