TNtupleD extended

Hi,

To follow up the topic started by M. Gilardi

root.cern.ch/phpBB2/viewtopic.ph … pled+limit

We still want to try to extend the available number of branches (even though the recommendation to use TTree).

So we just modify a little TNtupleD::TNtupleD(const char *name, const char *title, const char *varlist, Int_t bufsize):

[code] TDSNtupleD::TDSNtupleD(const char* name, const char* title, const char* varlist, Int_t bufsize):TNtupleD()
{
initTTree(name, title);

          fNvar = 0;
          fArgs = 0;     
          
      // Defaults color and form
      SetMarkerColor(2);
      SetMarkerSize(4);
      SetMarkerStyle(7);

          // Number of variables
          TString sVarList(varlist);
          TObjArray* lVarList = sVarList.Tokenize(':');
          fNvar = lVarList->GetEntries();
          fArgs = new Double_t[fNvar];
          
          // Alternative creation of each variable
          for (Int_t i = 0; i < fNvar; i++)
          {
              TObjString* varName = (TObjString*)lVarList->At(i);
              TString sDescriptor = Form("%s/D", varName->GetName());
              TTree::Branch(varName->GetName(), &fArgs[i], sDescriptor.Data(), bufsize); 
          }              
      }
      
      
      TDSNtupleD::~TDSNtupleD()
      {
          delete [] fArgs;
          fArgs = 0;
      }


void TDSNtupleD::initTTree(const char* name, const char* title)
{
  // TNamed params
  SetName(name);
  SetTitle(title);
      
  gDirectory->Append(this);
  fDirectory = gDirectory;
      
}[/code]

This code seems to work well with Unix (we use TDSNtupleD like a TNtupleD) but with Windows XP(ROOT 5.20.00), it is impossible to open a startViewer(). Is there something missing in TDSNtupleD::initTTree() to use a startViewer() with Windows?

Thanks,

Cédric

I do not understand why you need to derive from TNtupleD.
You should simply use a standard TTree and create as many branches as you want.

Rene