Re: Cloning of histogram and then writing into a directory

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Tue, 16 Mar 2010 14:56:26 +0100


Do:

 mydirectory->cd();
 myhisto->Write();

Rene Brun

Wajid Ali Khan wrote:
>
> Dear Root Experts,
>
> I want to clone a histogram and then I want to write it into a already
> created directory. I am trying to do it in a following way
>
> TFileDirectory MCPlots = fs->mkdir( "MC" );
> TFileDirectory RecoPlots = fs->mkdir( "RECO" );
> TFileDirectory Eff = fs->mkdir( "EFF" );
>
>
>
> h_Lept_Eta = RecoPlots.make<TH1F>("LeptEta","Lep Eta",100,-5,5);
> h_MCLepton_Eta =
> MCPlots.make<TH1F>("MCLep_Eta","MC_Lep_eta",100,-5,5);
>
> h_ele_absetaEff =(TH1F*)h_Lept_Eta->Clone("h_MCLepton_Eta");
> h_ele_absetaEff->Reset();
> h_ele_absetaEff->Divide(h_Lept_Eta,h_MCLepton_Eta,1,1);
> h_ele_absetaEff->GetXaxis()->SetTitle("|#eta|");
> h_ele_absetaEff->GetYaxis()->SetTitle("eff");
>
> I want to write the "h_ele_absetaEff" histogram in a separate directory.
>
> Can any one help in this issue.
>
> Best Regards
> Wajid Ali
>
>
>
>
>
Received on Tue Mar 16 2010 - 14:53:25 CET

This archive was generated by hypermail 2.2.0 : Wed Mar 17 2010 - 17:50:01 CET