Re: TChain

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Sep 22 1999 - 12:55:27 MEST


Hi Thomas,
Thanks for giving me access to your files.
I understand now what is the problem.
Your Trees in the chain have different definitions.
The first file for example has 84 branches and the last 115 branches.
TChain::Draw is not yet able to process this case. You have to go
via TTree::MakeClass to process this case.
However, I totally agree that it is very important to support
this realistic case and I will implement this in a future version.

Rene Brun

Thomas Hadig wrote:
> 
> Dear ROOTers,
> 
> i have a problem with TChain:
> I created several PAW NTupels, converted them to ROOT TFiles and made a
> plot after chaining the file. Obviously, not all events are put in the
> file.
> 
> I am using ROOT   *   Version   2.22/10      28 July 1999   *
> and tested it on SUN and SGI (IRIX 6.2) here at DESY.
> 
> Below the macro is given. It first plots the quantity for each file
> seperatly and in the end gives the chained version of all files, which
> should be the sum of all values before.
> 
> The output is:
> root [1] plottest()
> TH1.Print Name= q21, Total sum= 37063.6
>  fSumw[0]=13706.5
>  fSumw[1]=15168
>  fSumw[2]=13924.7
>  fSumw[3]=7970.94
>  fSumw[4]=180
> TH1.Print Name= q22, Total sum= 52277.5
>  fSumw[0]=19210.4
>  fSumw[1]=21285.9
>  fSumw[2]=19620
>  fSumw[3]=11371.5
>  fSumw[4]=270.534
> TH1.Print Name= q22a, Total sum= 16461
>  fSumw[0]=5469.4
>  fSumw[1]=6605.63
>  fSumw[2]=6189.12
>  fSumw[3]=3666.27
>  fSumw[4]=87.6057
> TH1.Print Name= q22b, Total sum= 16392.7
>  fSumw[0]=5515.03
>  fSumw[1]=6469.1
>  fSumw[2]=6360.5
>  fSumw[3]=3563.09
>  fSumw[4]=100.022
> TH1.Print Name= q22c, Total sum= 2.5015e+06
>  fSumw[0]=13522.1
>  fSumw[1]=2.48533e+06
>  fSumw[2]=10452.4
>  fSumw[3]=5721.22
>  fSumw[4]=2.52638e+08
> TH1.Print Name= q23, Total sum= 51065.3
>  fSumw[0]=16219.9
>  fSumw[1]=21262.8
>  fSumw[2]=18916
>  fSumw[3]=10886.6
>  fSumw[4]=254.686
> TH1.Print Name= q2a, Total sum= 89340.3
>  fSumw[0]=32917
>  fSumw[1]=36453.9
>  fSumw[2]=33545
>  fSumw[3]=19341.5
>  fSumw[4]=450.534
> 
> Obviously only the first to files are checked. Juggling with the sequence
> of the files changes the number of files checked, but i could not see
> a "broken" file of a maximal number of events (changing the TCut string
> can reduce the number of events, but does not change number of files checked).
> 
> Chaining the original paw files in PAW works fine, so the paw files are ok.
> 
> HERE is the code :
> 
> plottest()
>  {
>   Float_t bins[4] = { 200, 300, 600, 5000};
>   Text_t *Cmc = "Zwgt1*Zwgt2*Weight*(Ieltyp>0 && Rele>11 && Relth>0.087266463 && Relth<2.6703538)";
> 
>   TChain *c1 = new TChain("h100");
>   c1->Add("cteq1.root");
>   TChain *c2 = new TChain("h100");
>   c2->Add("cteq1a.root");
>   TChain *c2a = new TChain("h100");
>   c2a->Add("cteq1b2.root");
>   TChain *c2b = new TChain("h100");
>   c2b->Add("cteq1b3.root");
>   TChain *c2c = new TChain("h100");
>   c2c->Add("cteq1b.root");
>   TChain *c3 = new TChain("h100");
>   c3->Add("cteq1c.root");
>   TChain *ca = new TChain("h100");
>   ca->Add("cteq1.root");
>   ca->Add("cteq1a.root");
>   ca->Add("cteq1b2.root");
>   ca->Add("cteq1b3.root");
>   ca->Add("cteq1c.root");
>   ca->Add("cteq1b.root");
> 
>   TH1F *h1 = new TH1F("q21","",3,bins);
>   c1->Draw("Q2jo>>q21",Cmc,"goff");
>   h1->Print("all");
> 
>   TH1F *h2 = new TH1F("q22","",3,bins);
>   c2->Draw("Q2jo>>q22",Cmc,"goff");
>   h2->Print("all");
> 
>   TH1F *h2a = new TH1F("q22a","",3,bins);
>   c2a->Draw("Q2jo>>q22a",Cmc,"goff");
>   h2a->Print("all");
> 
>   TH1F *h2b = new TH1F("q22b","",3,bins);
>   c2b->Draw("Q2jo>>q22b",Cmc,"goff");
>   h2b->Print("all");
> 
>   TH1F *h2c = new TH1F("q22c","",3,bins);
>   c2c->Draw("Q2jo>>q22c",Cmc,"goff");
>   h2c->Print("all");
> 
>   TH1F *h3 = new TH1F("q23","",3,bins);
>   c3->Draw("Q2jo>>q23",Cmc,"goff");
>   h3->Print("all");
> 
>   TH1F *ha = new TH1F("q2a","",3,bins);
>   ca->Draw("Q2jo>>q2a",Cmc,"goff");
>   ha->Print("all");
>  }
> 
> Ciao
> Thomas
> 
> ----------------------------------------------------------------------------
> Thomas Hadig, Ottensen, Donnerstr. 20, D-22763 Hamburg    (+49 40 39901186)
>   office : I. Phys. Institut AAC, Room 1c354, Notkestr. 85, D-22607 Hamburg
>            hadig@rwth-aachen.de                       Tel. +49 40 8998 2312
> http://www-h1.desy.de/~hadig/                         FAX  +49 40 8998 4385
> ----------------------------------------------------------------------------
> Windows - the user friendly interface! Brought to you by the makers of EDLIN
> ----------------------------------------------------------------------------



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:39 MET