Re: [ROOT] variable histgram name

From: Jyothsna Rani (jyothsna@fnal.gov)
Date: Thu Oct 17 2002 - 08:33:22 MEST


Do include myfit.C in your test.C

Give an argument to myfit.

That is:
void myfit(TProfile *histname)

and call it inside your main macro as
myfit(Dca_phi_1);
myfit(Dca_phi_2);
myfit(Dca_phi_3);

Hope this helps.

Jyothsna
   -------------------------------------------------------------
        K. Jyothsna Rani,       Phone Number:
        Tata Institute,                 630-840-3590 (Office)
        DZero Experiment,               630-840-4236 (Residence)
        Mail Station : 352,     FAX:
        P.O.Box : 500,                  630-840-8481
        Fermilab,               E-mail:
        Batavia, IL - 60510             jyothsna@fnal.gov
  ---------------------------------------------------------------


On Thu, 17 Oct 2002, Avdhesh Chandra wrote:

>
> Hi,
>     I am trying to fit histogram using defined fit function. It works well
> when i am giving histogram name in the function. Now i want to do same
> thing with different histograms  using variable name, i tried but it
> is not working.
>
>     I am having a main macro(say test.C) in which i define histogram and
> filling, and i am having fit macro(say fitf.C) in which i define my fit
> and doing fitting by calling  myfit();   (see attached files)
>
>     In myfit() if i am giving histogram name(say Dca_phi_1) then
> Dca_phi_1->Fit("fitf");  wroks fine. Now i want, instead of using
> particular histogram name(Dca_phi_1), it take a variable histogram(say
> hitsname), where histname is given in main macro(test.C)
>
> Thanks for any help
>  Avdhesh
>



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