Re: Cycles

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Sat, 1 Apr 2006 09:55:19 +0200 (MEST)


Hi,

The two Trees have the same name. Simply change the name of your Trees when reading as illustrated in the session below:

Rene Brun

root [0] TFile f("tree1.root")
root [1] .ls

TFile**         tree1.root
  TFile*         tree1.root

   KEY: TTree t1;3 a simple Tree with simple variables    KEY: TTree t1;2 a simple Tree with simple variables root [2] t2 = (TTree*)f->Get("t1;2")
(class TTree*)0x6305230
root [3] t2->SetName("t2")
root [4] t3 = (TTree*)f->Get("t1;3")
(class TTree*)0x6301900
root [5] t3->SetName("t3")
root [6] t2->GetEntries()
(const Long64_t)8318286
root [7] t3->GetEntries()
(const Long64_t)10000000
root [8]

On
Fri, 31 Mar 2006, Vassili Maroussov wrote:

> Dear ROOTers,
>
> if to generate with the macro tree1.C from ROOT tutorials the tree1.root file
> with 10000000 entries instead of 10000, the file contains 2 cycles of t1.
> Please take a look at the output of GetEntries() for "t1;2" in the ROOT
> session below. Is it a bug or it isn't supposed to use GetEntries() with all
> cycles except the last one?
>
> Regards,
>
> Vassili.
>
> [pcmspur5] ~/CyclePlay > root
> *******************************************
> * *
> * W E L C O M E to R O O T *
> * *
> * Version 5.06/00 30 October 2005 *
> * *
> * You are welcome to visit our Web site *
> * http://root.cern.ch *
> * *
> *******************************************
>
> FreeType Engine v2.1.9 used to render TrueType fonts.
> Compiled on 9 November 2005 for linux with thread support.
>
> CINT/ROOT C/C++ Interpreter version 5.16.2, July 14 2005
> Type ? for help. Commands must be C++ statements.
> Enclose multiple statements between { }.
>
> Welcome to the ROOT tutorials
>
>
> Type ".x demos.C" to get a toolbar from which to execute the demos
>
> Type ".x demoshelp.C" to see the help window
>
> root [0] TFile f("tree1.root")
> root [1] f->GetListOfKeys()->Print()
> TKey Name = t1, Title = a simple Tree with simple variables, Cycle = 3
> TKey Name = t1, Title = a simple Tree with simple variables, Cycle = 2
> root [2] t2 = (TTree*)f->Get("t1;2")
> (class TTree*)0xb32af98
> root [3] t3 = (TTree*)f->Get("t1;3")
> (class TTree*)0xb3e3778
> root [4] t2->GetEntries()
> (const Long64_t)181667083577196544
> root [5] t3->GetEntries()
> (const Long64_t)10000000
> root [6]
>
Received on Sat Apr 01 2006 - 09:55:25 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:58 MET