Generating a TTree from an object: no splitting problem


I have the following vector in my main program

I want to generate a tree of TPeakFitter objects and I do it using the following function:

void SharinganAnalyzer::GenerateTree(){

  double Epeak;
  int peakID;

  TFile *fout = new TFile("treePeaks.root","recreate");
  TTree *masterTree=new TTree("masterTree","Tree containing current analysis");
  TPeakFitter *currPeak=new TPeakFitter();


  for(int idxTPF=0;idxTPF<UsrPeaksVector.size();idxTPF++){    


Now the definition of the TPeakFitter object contains the following relevant data members:

Class TPeakFitter {

string name; 
int fLinkPReqID;

int nPoints;
  Double_t binResolution;

  vector<double> px;
  vector<double> py;
  vector<CMSingletObj*> PeakFuns;
  vector<CMBackGroundObj*> BkGndFuns;

//Relevant accesors, mutators and member functions


}  //End of class definition

I have a problem. When a create the tree, the tree contains all the information except the components of

A leaf is created for each of those two vectors. They are not split at all despite I have the maximum tree splitting option (i.e. 99). When I used the TBrowser, I can see that the PeakFuns and BkGndFuns are treated as branches and they contain the information that I need, but when I use the tree viewer they are shown as leaves with empty content. I dont understand why this happen. Can somebody see what am I doing wrong?

Thank you,

  •                                     *
  •    W E L C O M E  to  R O O T       *
  •                                     *
  • Version 5.25/02 29 September 2009 *
  •                                     *
  • You are welcome to visit our Web site *
  •      [](            *
  •                                     *

ROOT 5.25/02 (trunk@30530, Sep 29 2009, 15:28:19 on linuxx8664gcc)

CINT/ROOT C/C++ Interpreter version 5.17.00, Dec 21, 2008


vector<T*> can contain objects that derived from T. Thus, by default, that vector is not split. You can specify the split level 199 to split across polymorphic vectors (starting in v5.26, I believe).

Cheers, Axel.