RE: connecting signals & slots

From: Ilka Antcheva <Ilka.Antcheva_at_cern.ch>
Date: Mon, 29 Jan 2007 20:42:31 +0100


Hi Roger,  

For some reason my answer with the attached files did not reach the roottalk list. For completeness I am sending it second time without attached files.  

Cheers, Ilka


From: Ilka Antcheva
Sent: Mon 1/29/2007 3:09 PM
To: 'Roger Mason'
Cc: roottalk_at_pcroot.cern.ch
Subject: RE: [ROOT] connecting signals & slots

Hi Roger,

Please find attached your modified macro and the picture I got after the changes I made (as explained in my e-mail to you sent yesterday). 1) added one data member of type TGraph *fGraph which will be initialized to 0 in the constructor. Later, when you read the graph from the file, you assign it to the graph object read from the file (in fact, you have this in your code, but the graph pointer exists only localy in LoadFile method: f->GetObject("Cleaned",fGraph);

2) remove the parameters from your Fit(..) method.

3) keep the connection between "Clicked()" signal of the Fit futton to this method: fit->Connect("Clicked()","MyMainFrame",this,"Fit()");

4) create a TF1 function in the Fit method that behaves as a sum of your fit functions (background+gaus+lorentz).

The parameter values were given according to your advice: "NewFunction (select background)
change parameter2 to sth like 0.00001
NewFunction (select gaussian)
change first 3 params to 1.3, 16500, 1000 NewFunction (select lorentzian) change first 3 params to 100, 18400, 30"

Best regards, Ilka

-----Original Message-----
From: Roger Mason [mailto:rmason_at_esd.mun.ca] Sent: Monday, January 29, 2007 1:25 PM
To: Ilka Antcheva
Cc: roottalk_at_pcroot.cern.ch
Subject: Re: [ROOT] connecting signals & slots

Hi Ilka,

"Ilka Antcheva" <Ilka.Antcheva_at_cern.ch> writes:

> Why do you need this kind of class inheritance?

I'm following Valeri Fine's suggestion which, unless I misunderstand, provides a way of passing the TGraph and TF1 objects to the function that processes text button Clicked() events.

> Having just a text button will be fine for your application.

Then how do I pass the TGraph and TF1 objects? I tried doing that in my original code in the Connect() method.

Thanks for your help,
Roger Received on Mon Jan 29 2007 - 20:47:36 CET

This archive was generated by hypermail 2.2.0 : Mon Jan 29 2007 - 23:50:01 CET