Unable to load a macro in Root V6.14 in mac os

Hi,
I have loaded a ‘.cxx’ file in my roofit macro the following way:
#ifdef CINT
gROOT->ProcessLineSync(".L RoodMyRBW.cxx+") ;
#endif

I am trying to run my roofit macro in root V 6.14 in a mac OS machine. I am getting following error message when I try to call a function from this ‘RoodMyRBW.cxx’ file.

rocessing MLfit2dw.C…

In file included from input_line_10:1:

/Users/vindy/Documents/bes3/dalitz/dtowphi/Fit/MLfit2dw.C:34:3: error: unknown type name 'RoodMyRBW’

RoodMyRBW signal_(“signal_”,“Signal”, Dikmass, mean, sigma);

Any idea how to fix this problem? Thanks in advance. My short code snippet is given below:

RooRealVar mean(“mean”,“mean”,1.019461);
RooRealVar sigma(“sigma”,“sigma”,0.004266);
RoodMyRBW signal_(“signal_”,“Signal”, Dikmass, mean, sigma);

Thanks,
V. Prasad

That looks like an

#include "RooMy..."

is missing.

Thanks for your quick response. I am still getting following error messages after including the header file.

RooFit v3.60 – Developed by Wouter Verkerke and David Kirkby
Copyright © 2000-2013 NIKHEF, University of California & Stanford University
All rights reserved, please read http://roofit.sourceforge.net/license.txt

IncrementalExecutor::executeFunction: symbol ‘ZN9RoodMyRBWC1EPKcS1_R10RooAbsRealS3_S3’ unresolved while linking [cling interface function]!
You are probably missing the definition of RoodMyRBW::RoodMyRBW(char const*, char const*, RooAbsReal&, RooAbsReal&, RooAbsReal&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol ‘_ZTV9RoodMyRBW’ unresolved while linking [cling interface function]!
You are probably missing the definition of vtable for RoodMyRBW
Maybe you need to load the corresponding shared library?

My short code snippet can be seen below:

#include “RoodMyRBW.h”
void MLfit2dw()
{
using namespace RooFit ;

// #ifdef CINT
gROOT->ProcessLineSync(".x RoodMyRBW.cxx++") ; // please find RoodMyRBW.cxx/h file from the attachment.
// #endif

RooRealVar Dikmass(“Dikmass”,“m_{K^{+}K^{-}} (GeV/c^{2})”,0.987354,1.05);

RooRealVar mean(“mean”,“mean”,1.019461);
RooRealVar sigma(“sigma”,“sigma”,0.004266);
RoodMyRBW signal_(“signal_”,“Signal”, Dikmass, mean, sigma);
}

RoodMyRBW.cxx (2.4 KB)

Thanks,
V. Prasad

RoodMyRBW.h (1.4 KB)

Try this:

#include "RoodMyRBW.cxx"

void MLfit2dw()
{
  using namespace RooFit;
  RooRealVar Dikmass(“Dikmass”,“m_{K^{+}K^{-}} (GeV/c^{2})”,0.987354,1.05);

  RooRealVar mean(“mean”,“mean”,1.019461)
  RooRealVar sigma(“sigma”,“sigma”,0.004266);
  RoodMyRBW signal_(“signal_”,“Signal”, Dikmass, mean, sigma);
}

I guess you cannot load things while defining a function using gROOT->, but I think there is a simple solution:
In your macro, include the .cxx file, so cling sees both the header and the code in the cxx. Then, put the MLfit2dw function as usual, don’t put any gROOT.

The macro can be loaded with .L, or directly run with .x

Dear Axel and Stephan,
Thanks a lot! This suggestion works for me.

Thanks,
V. Prasad

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.