[ROOT] directories in rootfiles

From: Jan Olzem (olzem@toots.physik.rwth-aachen.de)
Date: Fri Apr 14 2000 - 14:04:15 MEST


Dear rooters,

I experience some problem with directory structures inside a rootfile.
My executable fills a couple of histograms and writes them to a
resultfile. When I afterwards browse the file with a TBrowser, all
histograms seem to be written properly to their directories. But after
once descending into the directory tree and going up again I find a copy
of each directory (including the whole subtree) 'mounted' inside itself. 

This is what my code looks like:

  // create directories 
  TFile *resultfile = new TFile("MuonResults.root","RECREATE");
  TDirectory *efficiencydir = resultfile->mkdir("TriggerEfficiencies");
  gDirectory->cd("/TriggerEfficiencies");
  TDirectory *supportdir = efficiencydir->mkdir("SupportHistograms"); 
  TDirectory *resultdir = efficiencydir->mkdir("ResultHistograms");
  gDirectory->cd("/");
  ...

  // create histograms
  TH1F *TrigCondHisto = new TH1F("TrigCondHisto","CondHisto", 64, 0, 64);
  TrigCondHisto->SetDirectory(supportdir);
  ...

  // fill histograms
  ...
  TrigCondHisto->Fill( module_counter )  
  ...

  resultfile->Write()



I am using ROOT version 2.23/10 for Linux.


Thank you very much in advance,
Jan Olzem


  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     Jan Olzem                                          
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     I. Phys. Institut RWTH Aachen / office 28B202      
     Tel. 0241-807197                                   
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     DESY H1/AAC1, office 1c354                         
     Tel. 040-8998-2312                                 
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:23 MET