Re: Writing histograms in a ROOT FOLDER

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Thu, 1 Dec 2005 10:41:42 +0100 (MET)


Monika,

Sorry for the delay (your email was misplaced due to your double mail with the cc)

Use TFolder::Add to add one object to a folder, eg

mean1->Add( hmean_mean[ksm][kchain]);

constant1->Add(hcon_mean[ksm][kchain]);

Rene Brun

On Thu, 24 Nov 2005,
monika_at_rcf.rhic.bnl.gov wrote:

>
>
> Hi,
>
> I have a set of array of histograms and I want them to be written in
> different folders.
>
> For example :
> hcontent[ksm][kchain]->Write();
> hmpv_mean[ksm][kchain]->Write();
> hmean_mean[ksm][kchain]->Write();
> hcon_mean[ksm][kchain]->Write();
> I want hcontent[ksm][kchain] to be written in one folder and others to be
> written in different folders.
>
> I could define the folders and subfolders :
> ##################################################################
> TFolder *rootfiles = gROOT->GetRootFolder()->AddFolder("rootfiles","Go
> inside to see histograms");
> gROOT->GetListOfBrowsables()->Add(rootfiles,"rootfiles");
> TFolder *mean1 = rootfiles->AddFolder("mean1","1D histograms of all
> mean of SM+CHAIN");
> TFolder *mpv1 = rootfiles->AddFolder("mpv","1D histograms of all mpv
> of SM+CHAIN");
> TFolder *constant1 = rootfiles->AddFolder("constant","1D histograms of
> contents of all SM+CHAIN");
> ####################################################################
>
> Now how do I write each set of histograms in different folders.
> Any help is appreciated.
>
> Thanks & regards
> Monika
>
Received on Thu Dec 01 2005 - 10:41:51 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:14 MET