Re: [ROOT] Tree and TClonesArray Problem

From: Claus Peter Buszello (buszello@paco210.physik.uni-freiburg.de)
Date: Wed Dec 13 2000 - 15:22:21 MET


On Wed, 13 Dec 2000, Rene Brun wrote:

> Hi Claus,
> Change the line
>       m_Tree->SetBranchAddress("particles",m_Fruits);
> to
>       m_Tree->SetBranchAddress("particles",&m_Fruits);
> 

I tried this and it doesn't help. still i only get 0 entries per Event
And it doesnt solve my problem in another way. As I am trying to generate
a pythia.root file for atlfast, I dont want to change atlfast, but my
root-file.


I looked at ATLFMCMaker.cxx from ATLFast++ and found:

included from ATLFMaker.h:
   TObject       *m_Fruits;      //Pointer to maker fruits (result)

//.............................................
//... Reading a Pythia file
//.............................................
   Text_t fname[20];
   if (m_ProductionMode > 100) {
      m_Fruits     = new TClonesArray("TMCParticle",kMAXPART, kFALSE);
      TDirectory *dirsav  = gDirectory;
      sprintf(fname,"pythia%i.root",m_ProductionMode%100);
        // Open the Root/Pythia file:
      m_File = new TFile(fname);

        // Get the Tree called "t" from the file
      m_Tree = (TTree*)m_File->Get("t");

     // Data will be read in in the standard ClonesArray
      m_Tree->SetBranchAddress("particles",m_Fruits);
 //                                    =====================<<<<<<<
      if (dirsav) dirsav->cd();
      return;
   }
  

Then this would be wrong, too, wouldn't it? 
 

BTW: I am using 
Version   2.25/03 18 September 2000 
on 
[buszello@paco212 buszello]$ uname -a
Linux paco212.physik.uni-freiburg.de 2.2.14-5.0smp #1 SMP Tue Mar 7 
21:01:40 EST 2000 i686 unknown
[buszello@paco212 buszello]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)



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