Re: [ROOT] TChain::merge opens a X socket??

From: Stefano Lacaprara (Stefano.Lacaprara@pd.infn.it)
Date: Tue Jul 16 2002 - 10:24:30 MEST


Hi Rene,
  way 1: works perfectly!
Many thanks,
  Stefano

* On Mon, Jul 15, 2002 at 09:23:33PM +0200, Rene Brun wrote:
> Hi Stefano,
> 
> Your program "merge" does not define a TApplication.
> For some operations, like building the dictionary for a class,
> a TApplication is necessary. If no TApplication exists, ROOT will
> automatically create one. The application will be by default
> assuming an interactive session with graphics.
> You can make a batch application  in two ways
>   way1: add the following line at the beginning of your program.
>         you can replace the useless call to the TROOT constructor by
>         gROOT->SetBatch();
> 
>   way2: you create yoursel a TApplication object. See examples
>         in $ROOTSYS/test programs. You can use the option "-b"
>         to run your application in batch mode.
> 
> The first option is the simplest one in your case.
> 
> Rene Brun
> 
> On Mon, 15 Jul 2002, Stefano Lacaprara wrote:
> 
> > Hi Rene,
> >   the version I'm using is
> > Version  3.01/06 10 July 2001,
> > (CINT/ROOT C/C++ Interpreter version 5.15.06, June 30 2001)
> > on: Linux 2.2.19-6.2.1.1smp #1 SMP Tue Apr 17 20:00:04 CEST 2001 i686 unknown
> > 
> > Running your example I have no problem, neither X connection.
> > 
> > It seems that this funny behavior depends on the type of trees I try to
> > merge: I've put a full example on
> > 
> > /afs/cern.ch/user/s/slacapra/public/for_Rene/TreeMerge.tgz
> > 
> > with merge.cpp, the Makefile I use and one of the trees I'm trying to merge.
> > When I try to execute
> > ~>./merge lista
> > I'm asked (by mxconns) to accept an incoming connection, and, if I say ok,
> > the merging is successful. If I deny the permission, the jobs crashes:
> > ...
> > Xlib: connection to "lxcmspc3.pd.infn.it:64.0" refused by server
> > Xlib: Client is not authorized to connect to Server
> > Error in <TGClient::TGClient>: can't open display "lxcmspc3.pd.infn.it:64.", bombing...
> > ...
> > 
> > Cheers,
> >   Stefano
> > 
> > * On Sat, Jul 13, 2002 at 12:43:46PM +0200, Rene Brun wrote:
> > > Hi Stefano,
> > > 
> > > I cannot reproduce this problem. Which version are you using?
> > > Could you do the following
> > > 
> > > cd $ROOTSYS/tutorials
> > > root -b -q hsimple.C
> > > g++ -o cmerge cmerge.cxx `root-config --cflags --libs`
> > > cmerge
> > > 
> > > where cmerge.cxx is the file below
> > > 
> > > Rene Brun
> > > 
> > > //file cmerge.cxx
> > > #include "TChain.h"
> > >    
> > > int main(int argc, char **argv)
> > > {
> > >   TChain dataset("ntuple");
> > >   dataset.Add("hsimple.root");
> > >   dataset.Add("hsimple.root");
> > >   
> > >   dataset.Merge("dataset.root");
> > >   dataset.Print();
> > > }
> > > 
> > > 
> > > On Fri, 12 Jul 2002, Stefano Lacaprara wrote:
> > > 
> > > > Hi,
> > > >   I've written a simple program which takes a list of Trees and merge them in
> > > > a TChain object
> > > > 
> > > > int main(int argc, char **argv)
> > > > {
> > > >   TROOT loop("loop","Loop on events");
> > > > 
> > > >   char* datasetname="";
> > > >   if(argc>=2) datasetname = argv[1];
> > > > 
> > > >   //Reset ROOT and connect tree file
> > > >   TChain dataset("MuonRecoTree");
> > > > 
> > > >   FILE *filelist = fopen(datasetname,"r");
> > > >   char line[80];
> > > > 
> > > >   while(fscanf(filelist,"%s",&line)>0)
> > > >     dataset.Add(line);
> > > > 
> > > >   fclose(filelist);
> > > >   dataset.Merge("dataset.root");
> > > >   dataset.Print();
> > > > }
> > > > where the first argument is the name of a file which contains the list of
> > > > trees to be merged.
> > > > 
> > > > Running it on a remote host behind a firewall, I've noticed that the issue
> > > > of TChain::Merge tries to open a X connection to my machine: this fails and
> > > > the process aborts. If the socket can be opened, then the merging is ok.
> > > > 
> > > > Why (and who -) it tries to open a X connection? Does it make sense?
> > > > 
> > > > Cheers,
> > > >   Stefano Lacaprara
> > > > 
> > > > -- 
> > > > Stefano Lacaprara Ph.D Lacaprara@pd.infn.it   \\\|///
> > > > I.N.F.N. & Universita' di Padova            \\  - -  //
> > > > http://www.pd.infn.it/~lacaprar              (  0 0  )
> > > > PHONE +39-049-8277100 FAX +39-049-8756233 -oOOo-(_)-oOOo-
> > > > 
> > 
> > -- 
> > Stefano Lacaprara Ph.D Lacaprara@pd.infn.it   \\\|///
> > I.N.F.N. & Universita' di Padova            \\  - -  //
> > http://www.pd.infn.it/~lacaprar              (  0 0  )
> > PHONE +39-049-8277100 FAX +39-049-8756233 -oOOo-(_)-oOOo-
> > 

-- 
Stefano Lacaprara Ph.D Lacaprara@pd.infn.it   \\\|///
I.N.F.N. & Universita' di Padova            \\  - -  //
http://www.pd.infn.it/~lacaprar              (  0 0  )
PHONE +39-049-8277100 FAX +39-049-8756233 -oOOo-(_)-oOOo-



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