Re: Fwd: [ROOT] Re: Filtering chains (again!) (fwd)

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Nov 27 2002 - 23:43:31 MET


Did you make progress with this problem?
If not, I will need a data file and a script
reproducing the problem.

Rene Brun

On Mon, 25 Nov 2002, [iso-8859-1] Antonio Sidoti wrote:

> 
> Thanks Rene,
> but it still doesn't work.
> I am still having the same error message:
> 
>  *** Break *** segmentation violation
> Root > Function Filter() busy flag cleared
> 
> Any suggestions?
> Thanks a lot,
> Regards
> Antonio
> 
> P.S. Apolgize if this is a duplicated mail, but I have
> problems with my e-mails
>  
>  
> > ---------- Forwarded message ----------
> > Date: Sat, 23 Nov 2002 12:49:27 +0100 (MET)
> > From: Rene Brun <Rene.Brun@cern.ch>
> > To: Antonio SIDOTI <antonio.sidoti@pi.infn.it>
> > Cc: roottalk@pcroot.cern.ch, about-root@fnal.gov
> > Subject: [ROOT] Re: Filtering chains (again!)
> > 
> > Hi Antonio,
> > 
> > TTree::CloneTree is currently not able to copy the
> > branch addresses
> > correctly in case the source tree is initialized in
> > MakeClass mode.
> > I think that the following lines should fix the
> > problem.
> > Let me know
> > 
> > After the line
> >    TTree *newtree =
> > (TTree*)fChain->GetTree()->CloneTree(0);
> > add
> >    newtree->SetMakeClass(1);
> >    fChain->GetTree()->CopyAddresses(newtree);
> > 
> > Rene Brun
> > 
> > On Sat, 23 Nov 2002, Antonio SIDOTI wrote:
> > 
> > > Dear Rooters,
> > > I am following the suggestions described in
> > >
> >
> http://root.cern.ch/root/roottalk/roottalk02/0481.html
> > to filter out a
> > > chain.
> > > I want to filter in Loop method that has been
> > generated by MakeClass.
> > > 
> > > void MyClass::Loop(){
> > >   bool pass = false;
> > >   fChain->SetBranchStatus("*",1);  // enable all
> > branches
> > > 
> > >   Int_t nentries = Int_t(fChain->GetEntries());
> > >   fChain->GetEntry(0);
> > >   TFile *newFile = new
> > TFile("small.root","recreate");
> > >   TTree *newtree =
> > (TTree*)fChain->GetTree()->CloneTree(0);
> > >   for (Int_t jentry=0; jentry<nentries;jentry++) {
> > >     Int_t ientry = LoadTree(jentry);
> > >      pass = false;
> > >     for(Int_t itk1=0; itk1< numTk; ++itk1){
> > >       for(Int_t itk2=itk1+1; itk2< numTk; ++itk2){
> > >         if(itk1==itk2) continue;
> > >         pass = Select(itk1,itk2);
> > >         }
> > >       }
> > >    if(pass){
> > >         cout << "Passed!\n";
> > >       newtree->Fill();
> > >     }
> > > }
> > >  newFile->cd();
> > >  newtree->Write();
> > > }
> > > 
> > > My problem is that as soon as I try to fill the
> > newtree I got a
> > > Segmaentation violation:
> > > 
> > >  *** Break *** segmentation violation
> > > Root > Function Loop() busy flag cleared
> > > 
> > > What I am doing wrong?
> > > Thanks a lot,
> > > Antonio
> > > 
> > > P.S. I am using  3.03/07
> > > 
> > >
> >
> -------------------------------------------------------------
> > >            sidoti   antonio: PostDoc(AdR) -
> > University Pisa and INFN
> > >            e-mail:  antonio.sidoti@pi.infn.it
> > >                     sidoti@fnal.gov
> > >            www:    
> > http://higgs.tn.infn.it/~sidoti/
> > >            Tel:     +39 + 050 880 456
> > >            Fax:     +39 + 050 880 317-318
> > >
> >
> -------------------------------------------------------------
> > > "A program is a device used to convert data into
> > error messages."
> > > 
> >  
> 
> ______________________________________________________________________
> Per te Blu American Express è gratis!
> http://it.yahoo.com/mail_it/foot/?http://www.americanexpress.it/land_yahoo
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:21 MET