Re: Map the chi2

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Tue, 11 Mar 2008 09:58:12 +0100


What you show is OK for scanning 2 parameters. However replace

scan01->SetBinContent(p0, p1, calcChi2);

by

scan01->Fill(p0, p1, calcChi2);

You can specify a null pointer for the send argument of Eval.

Rene

Manuel Mussini wrote:
>
> Hi Rene,
>
> you mean something like this?
>
> TH2D *scan01 = new TH2D("scan01", "Scan par[1] vs par[0]", 17, 0.235,
> 0.405, 36, 2.45, 6.05);
>
> Double_t p0p1p2[3] = {0., 0., cdfCrossSectionFit->GetParameter(2)};
>
> Double_t calcChi2 = 0;
>
> for (Double_t p0 = 0.24; p0 <= 0.41; p0 += 0.01)
>
> {
>
> p0p1p2[0] = p0;
>
> for (Double_t p1 = 2.5; p1 <= 6.; p1 += 0.1)
>
> {
>
> p0p1p2[1] = p1;
>
> gMinuit->Eval(0, ???, calcChi2, p0p1p2, 3);
>
> scan01->SetBinContent(p0, p1, calcChi2);
>
> }
>
> }
>
> scan01->Draw("SURF2");
>
> Where can I get the second argument for Eval?
>
> Bye...
>
> > -----Original Message-----
>
> > From: Rene Brun [mailto:Rene.Brun_at_cern.ch]
>
> > Sent: Tuesday, March 11, 2008 08:37
>
> > To: Manuel Mussini
>
> > Cc: 'Lorenzo Moneta'; roottalk_at_lxbuild091.cern.ch
>
> > Subject: Re: [ROOT] Map the chi2
>
> >
>
> > Hi Manuel,
>
> >
>
> > What you require should be quite easy using:
>
> > gMinuit->Eval(Int_t npar, Double_t *grad, Double_t &fval, Double_t *par,
>
> > Int_t flag);
>
> >
>
> > Create a TH3 (or TGraph2D), make your nested 3 loops on each parameter
>
> > in the limits you want.
>
> > In the loop call gMinuit->Eval and store the returned value fval in your
>
> > TH3 or TGraph2D.
>
> >
>
> > Rene Brun
>
> >
>
> > Manuel Mussini wrote:
>
> > > Hi Lorenzo,
>
> > > contours scans only "near" the found minimum so I think it isn't
> the right
>
> > > choice for searching for another eventual "far" minimum!
>
> > > I've never tried SCAN! I'll do it as my next step!
>
> > > Is it possible to scan "by hand"? I mean ... can I fix all my 3
> parameters
>
> > and
>
> > > evaluate the chi2? With TMinuit::FixParameter(Int_t) I think I can
> get the
>
> > first
>
> > > part but ... how to update the chi2?
>
> > > The best result would be to obtain a 3D histo showing the chi2
> surface (for
>
> > each
>
> > > parameters couple)!
>
> > >
>
> > >
>
> > > Bye…
>
> > >
>
> > >
>
> > >
>
> > > ________________________________________
>
> > > From: Lorenzo Moneta [mailto:Lorenzo.Moneta_at_cern.ch]
>
> > > Sent: Monday, March 10, 2008 23:14
>
> > > To: Manuel Mussini
>
> > > Cc: roottalk_at_lxbuild091.cern.ch
>
> > > Subject: Re: [ROOT] Map the chi2
>
> > >
>
> > > Hi Manuel,
>
> > >
>
> > > you can either scan a single parameter around the minimum, (command
> SCAN in
>
> > > Minuit) or build contours for two parameters, like in fitcont.C.
>
> > > I think contours will give you the best way for maping the chi2
> around the
>
> > > minimum.
>
> > >
>
> > > Cheers
>
> > >
>
> > > Lorenzo
>
> > > On Mar 10, 2008, at 7:20 PM, Manuel Mussini wrote:
>
> > >
>
> > >
>
> > > Hi,
>
> > > I have a TH1D and a 3 parameters user defined TF1 to fit it.
>
> > > Which is the best way to map the chi2 around the convergence point?
>
> > > I thoughed to map the 3 parameters in pairs (fix one of them and
> scan the
>
> > other
>
> > > two) but it not so clear (to me!) how to implement the mapping!
>
> > > I’ve tried the fitcont.C tutorial but this is not what I want!
>
> > >
>
> > > Thanks!!!
>
> > >
>
> > > Bye…
>
> > >
>
> > >
>
> > >
>
Received on Tue Mar 11 2008 - 09:55:20 CET

This archive was generated by hypermail 2.2.0 : Tue Mar 11 2008 - 11:50:01 CET