Errror Accessing RooFit 'custom' PDF saved in root file

Dear all,
I’m using a PDF created with RooClassFactory (named Acceptance) to perform a Fit.
The code compiles and runs.
The Acceptance.* files are created using the RooClassFactory methods and compiled: the shared libraries used to link the application.

The fit is ok and I save it in a file (using the ->Write() methods).
I save the likelihood and the dataset. Later I can access them in the save file without problems.
But When I try to save the PDF inside the file I fail to read it back. (I need the PDF because I want to reobtain the likelihood scans after the fit is finished).

When I load the file I see:
Warning in TClass::TClass: no dictionary for class Acceptance is available

The pdfs have been saved:
root [1] _file0->ls()

TFile** Sim_data_stri_FitRes.root
TFile* Sim_data_stri_FitRes.root
KEY: RooFitResult L;1 @0+@1+@2-@3
KEY: RooAddPdf pdf_fit_BS2KK;1 Total(B+S) BS -> K+ K- PDF
KEY: RooDataSet pdf_fit_BS2KKData;1 Generated From Total(B+S) BS -> K+ K- PDF
KEY: RooAddPdf pdf_fit_BS2Kpi;1 Total(B+S) BS -> K+ pi- PDF
KEY: RooDataSet pdf_fit_BS2KpiData;1 Generated From Total(B+S) BS -> K+ pi- PDF
KEY: RooAddPdf pdf_fit_BS2piK;1 Total(B+S) BS -> pi+ K- PDF
KEY: RooDataSet pdf_fit_BS2piKData;1 Generated From Total(B+S) BS -> pi+ K- PDF

But When I try to access them I have the bad crash appended below.

How can I add the class dictionary to ROOT?
I am doing:
#include </home/asarti/roofit/b2hh/B2hhFit/Acceptance.h>
and
gSystem->Load(“Acceptance_cxx.so”);
in my macro…
Am I missing something stupid?

The same also applies when using a compiled code. The crash is appended Below the one of the macro.

Thanks,
alessio

Macro crash:

Error: Can’t call Acceptance::Acceptance() in current scope macro/LikeScan.cc:15:
Possible candidates are…
(in Acceptance)
/home/asarti/roofit/b2hh/B2hhFit/Acceptance.h -1:0 0 public: Acceptance Acceptance::Acceptance(const char* name,const char* title,RooAbsReal& _tom,RooAbsReal& _alpha,RooAbsReal& _mass);
/home/asarti/roofit/b2hh/B2hhFit/Acceptance.h -1:0 0 public: Acceptance Acceptance::Acceptance(const Acceptance& other,const char* name=0);
/home/asarti/roofit/b2hh/B2hhFit/Acceptance.h -1:-1 0 public: Acceptance Acceptance::Acceptance(const char* name,const char* title,RooAbsReal& _tom,RooAbsReal& _alpha,RooAbsReal& _mass);
/home/asarti/roofit/b2hh/B2hhFit/Acceptance.h -1:-1 0 public: Acceptance Acceptance::Acceptance(const Acceptance& other,const char* name=0);
(in RooAbsReal)
(in RooAbsArg)
(in RooPrintable)
Error in TBufferFile::ReadVersion: Could not find the StreamerInfo with a checksum of 1073742729 for the class “RooRealProxy” in /home/asarti/roofit/b2hh/B2hhFit/Sim_data_stri_FitRes.root.
Error in TBufferFile::CheckByteCount: object of class TNamed read too few bytes: 18 instead of 868
Error in TBufferFile::ReadVersion: Could not find the StreamerInfo with a checksum of 0 for the class “RooAbsProxy” in /home/asarti/roofit/b2hh/B2hhFit/Sim_data_stri_FitRes.root.
Error in TBufferFile::CheckByteCount: object of class RooRealProxy read too few bytes: 898 instead of 911

Compiled code crash:
Error in TClass::New: cannot create object of class Acceptance
Error in TBufferFile::ReadObject: could not create object of class Acceptance
Error in TBufferFile::CheckByteCount: object of class RooRefCountList read too few bytes: 41 instead of 956
Error in TClass::New: cannot create object of class Acceptance
Error in TBufferFile::ReadObject: could not create object of class Acceptance
Error in TBufferFile::CheckByteCount: object of class RooRefCountList read too few bytes: 30 instead of 953
Error in TClass::New: cannot create object of class Acceptance
Error in TBufferFile::ReadObject: could not create object of class Acceptance
Error in TExMap::Remove: key 29620 not found at 447
Warning in TBufferFile::CheckObject: reference to object of unavailable class RooAbsArg, offset=29620 pointer will be 0
Error in TClass::New: cannot create object of class Acceptance
Error in TBufferFile::ReadObject: could not create object of class Acceptance
Error in TExMap::Remove: key 7340037 not found at 261
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=7340037 pointer will be 0
Error in TExMap::Remove: key 16402 not found at 309
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=16402 pointer will be 0
Error in TExMap::Remove: key 593625089 not found at 82
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=593625089 pointer will be 0
Error in TExMap::Remove: key 33554431 not found at 327
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=33554431 pointer will be 0
Error in TExMap::Remove: key 278528 not found at 373
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=278528 pointer will be 0
Error in TExMap::Remove: key 2752513 not found at 106
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=2752513 pointer will be 0
Error in TExMap::Remove: key 65536 not found at 147
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=65536 pointer will be 0
Error in TExMap::Remove: key 65537 not found at 148
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=65537 pointer will be 0
Error in TExMap::Remove: key 768 not found at 269
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=768 pointer will be 0
Error in TExMap::Remove: key 675295274 not found at 192
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=675295274 pointer will be 0
Error in TExMap::Remove: key 2657 not found at 144
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=2657 pointer will be 0
Error in TExMap::Remove: key 846227824 not found at 242
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=846227824 pointer will be 0
Error in TExMap::Remove: key 1667592308 not found at 440
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=1667592308 pointer will be 0
Error in TExMap::Remove: key 541217586 not found at 150
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=541217586 pointer will be 0
Error in TExMap::Remove: key 1073741826 not found at 304
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=1073741826 pointer will be 0
Error in TExMap::Remove: key 81920 not found at 444
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=81920 pointer will be 0
Error in TExMap::Remove: key 31981569 not found at 332
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=31981569 pointer will be 0
Error in TBufferFile::CheckByteCount: object of class RooRefCountList read too few bytes: 102 instead of 1188794
Error in TClass::New: cannot create object of class Acceptance
Error in TBufferFile::ReadObject: could not create object of class Acceptance
Error in TExMap::Remove: key 53741 not found at 423
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=53741 pointer will be 0
Error in TClass::New: cannot create object of class Acceptance
Error in TBufferFile::ReadObject: could not create object of class Acceptance
Error in TBufferFile::CheckByteCount: object of class RooRefCountList read too few bytes: 30 instead of 1133715
Error in TClass::New: cannot create object of class Acceptance
Error in TBufferFile::ReadObject: could not create object of class Acceptance
Error in TExMap::Remove: key 16384 not found at 241
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=16384 pointer will be 0
Error in TExMap::Remove: key 261029889 not found at 583
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=261029889 pointer will be 0
Error in TExMap::Remove: key 2490369 not found at 161
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=2490369 pointer will be 0
Error in TExMap::Remove: key 1075042035 not found at 968
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=1075042035 pointer will be 0
Error in TExMap::Remove: key 2145 not found at 132
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=2145 pointer will be 0
Error in TBufferFile::CheckByteCount: object of class RooRefCountList read too few bytes: 33178 instead of 39042
Error in TClass::New: cannot create object of class Acceptance
Error in TBufferFile::ReadObject: could not create object of class Acceptance
Error in TExMap::Remove: key 69928 not found at 309
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=69928 pointer will be 0
Error in TClass::New: cannot create object of class Acceptance
Error in TBufferFile::ReadObject: could not create object of class Acceptance
Error in TExMap::Remove: key 108561 not found at 602
Warning in TBufferFile::CheckObject: reference to object of unavailable class TObject, offset=108561 pointer will be 0

[quote]I am doing:
#include </home/asarti/roofit/b2hh/B2hhFit/Acceptance.h>
and
gSystem->Load(“Acceptance_cxx.so”); [/quote] What is the content of Acceptance.cxx?

Philippe.

Acceptance was created with RooClassFactory methods.
I’m attaching the cxx and the h files.

Acceptance.cxx:
/*****************************************************************************

  • Project: RooFit *
  •                                                                       * 
    
  • Copyright © 2000-2005, Regents of the University of California *
  •                      and Stanford University. All rights reserved.    * 
    
  •                                                                       * 
    
  • Redistribution and use in source and binary forms, *
  • with or without modification, are permitted according to the terms *
  • listed in LICENSE (roofit.sourceforge.net/license.txt) *
    *****************************************************************************/

// – CLASS DESCRIPTION [PDF] –
// Your description goes here…

#include

#include “Acceptance.h”
#include “RooAbsReal.h”

ClassImp(Acceptance)

Acceptance::Acceptance(const char *name, const char *title,
RooAbsReal& _tom,
RooAbsReal& _alpha,
RooAbsReal& _mass) :
RooAbsReal(name,title),
tom(“tom”,“tom”,this,_tom),
alpha(“alpha”,“alpha”,this,_alpha),
mass(“mass”,“mass”,this,_mass)
{
}

Acceptance::Acceptance(const Acceptance& other, const char* name) :
RooAbsReal(other,name),
tom(“tom”,this,other.tom),
alpha(“alpha”,this,other.alpha),
mass(“mass”,this,other.mass)
{
}

Double_t Acceptance::evaluate() const
{

Double_t val = 0;
if(tom>0) {
val = pow((alphatommass),5)/(1+pow((alphatommass),5));
}

// ENTER EXPRESSION IN TERMS OF VARIABLE ARGUMENTS HERE
return val;
}

Acceptance.h:

/*****************************************************************************

  • Project: RooFit *
  •                                                                       *
    
  • Copyright © 2000-2005, Regents of the University of California *
  •                      and Stanford University. All rights reserved.    *
    
  •                                                                       *
    
  • Redistribution and use in source and binary forms, *
  • with or without modification, are permitted according to the terms *
  • listed in LICENSE (roofit.sourceforge.net/license.txt) *
    *****************************************************************************/

#ifndef ACCEPTANCE
#define ACCEPTANCE

#include “RooAbsReal.h”
#include “RooRealProxy.h”
#include “RooAbsReal.h”

class Acceptance : public RooAbsReal {
public:
Acceptance(const char name, const char title,
RooAbsReal& _tom,
RooAbsReal& _alpha,
RooAbsReal& _mass);
Acceptance(const Acceptance& other, const char
name=0) ;
virtual TObject
clone(const char* newname) const { return new Acceptance(*this,newname); }
inline virtual ~Acceptance() { }

protected:

RooRealProxy tom ;
RooRealProxy alpha ;
RooRealProxy mass ;

Double_t evaluate() const ;

private:

ClassDef(Acceptance,0) // Your description goes here…
};

#endif

Hi,

The class version 0 indicates that you do NOT want to do I/O for this class but the error messages indicates that you are indeed attempting to do so :slight_smile:.

UseClassDef(Acceptance,1) // Your description goes here...

Also you need implement either a default constructor or a constructor take one argument of type TRootIOCtor*.

Cheers,
Philippe.

Also you need implement either a default constructor or a constructor take one >argument of type TRootIOCtor*.

Sorry,
can you please provide me an example or a little bit more detail on what you mean?
An where am I supposed to write/use this default constructor? Inside Acceptance or in my code accessing it?

thank you so much for your kind help
alessio

Hi,

You just need to add a proper default constructor for the class Acceptance.

class Acceptance { int fValue; public: Acceptance() : fValue(-1) {}; };

Cheers,
Philippe.

Great, now the errors are nearly all gone.
ButI’m left with a nasty

*** Break *** segmentation violation

followed by the log pasted below.
If I use the compiled version and use gdb I get
Program received signal SIGSEGV, Segmentation fault.
0x07843c62 in TStreamerInfo::ReadBuffer<char**> () from /home/Packages/root/lib/libRIO.so
Missing separate debuginfos, use: debuginfo-install glibc-2.9-2.i686 gsl-1.11-4.fc10.i386 libgcc-4.3.2-7.i386 libstdc+±4.3.2-7.i386

Thanks again.
alessio

(no debugging symbols found)
Attaching to program: /proc/6889/exe, process 6889
(no debugging symbols found)…done.
(no debugging symbols found)…done.
[Thread debugging using libthread_db enabled]
[New Thread 0xb80a66d0 (LWP 6889)]
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)
0x00110416 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install glibc-2.9-2.i686 libgcc-4.3.2-7.i386 libstdc+±4.3.2-7.i386
#1 0x07779f43 in __waitpid_nocancel () from /lib/libc.so.6
#2 0x0771432b in do_system () from /lib/libc.so.6
#3 0x0018859d in system () from /lib/libpthread.so.0
#4 0x0042e76d in TUnixSystem::Exec () from /home/Packages/root/lib/libCore.so
#5 0x00433b5b in TUnixSystem::StackTrace () from /home/Packages/root/lib/libCore.so
#6 0x004348fd in TUnixSystem::DispatchSignals () from /home/Packages/root/lib/libCore.so
#7 0x004349fd in SigHandler () from /home/Packages/root/lib/libCore.so
#8 0x0042b312 in sighandler () from /home/Packages/root/lib/libCore.so
#9
#10 0x0784c561 in main_arena () from /lib/libc.so.6
#11 0x0a603ce0 in ?? ()
#12 0x0a480fb0 in ?? ()
#13 0xbffa0c20 in ?? ()
#14 0xb7f64049 in ?? ()
#15 0xbffa0c24 in ?? ()
#16 0xbffa0c64 in ?? ()
#17 0xbffa0c18 in ?? ()
#18 0x00359c24 in TDirectory::cd () from /home/Packages/root/lib/libCore.so
#19 0x019f7889 in TDirectoryFile::Get () from /home/Packages/root/lib/libRIO.so
#20 0x004e20cd in G__G__Base1_8_0_32 () from /home/Packages/root/lib/libCore.so
#21 0x0099bd56 in Cint::G__ExceptionWrapper () from /home/Packages/root/lib/libCint.so
#22 0x00a519dc in G__execute_call () from /home/Packages/root/lib/libCint.so
#23 0x00a52b36 in G__call_cppfunc () from /home/Packages/root/lib/libCint.so
#24 0x00a2929c in G__interpret_func () from /home/Packages/root/lib/libCint.so
#25 0x00a18a24 in G__getfunction () from /home/Packages/root/lib/libCint.so
#26 0x00b06da1 in G__getstructmem () from /home/Packages/root/lib/libCint.so
#27 0x00b004be in G__getvariable () from /home/Packages/root/lib/libCint.so
#28 0x009eae2f in G__getitem () from /home/Packages/root/lib/libCint.so
#29 0x009f0a63 in G__getexpr () from /home/Packages/root/lib/libCint.so
#30 0x00a19847 in G__getfunction () from /home/Packages/root/lib/libCint.so
#31 0x009eaf38 in G__getitem () from /home/Packages/root/lib/libCint.so
#32 0x009f0a63 in G__getexpr () from /home/Packages/root/lib/libCint.so
#33 0x00a178b9 in G__getfunction () from /home/Packages/root/lib/libCint.so
#34 0x009eaf38 in G__getitem () from /home/Packages/root/lib/libCint.so
#35 0x009f0a63 in G__getexpr () from /home/Packages/root/lib/libCint.so
#36 0x009db4b5 in G__define_var () from /home/Packages/root/lib/libCint.so
#37 0x00a797b0 in G__exec_statement () from /home/Packages/root/lib/libCint.so
#38 0x00a2a56d in G__interpret_func () from /home/Packages/root/lib/libCint.so
#39 0x00a18507 in G__getfunction () from /home/Packages/root/lib/libCint.so
#40 0x009eaf38 in G__getitem () from /home/Packages/root/lib/libCint.so
#41 0x009f0a63 in G__getexpr () from /home/Packages/root/lib/libCint.so
#42 0x009feb18 in G__calc_internal () from /home/Packages/root/lib/libCint.so
#43 0x00a8b872 in G__process_cmd () from /home/Packages/root/lib/libCint.so
#44 0x0041def4 in TCint::ProcessLine () from /home/Packages/root/lib/libCore.so
#45 0x0041a72f in TCint::ProcessLineSynch () from /home/Packages/root/lib/libCore.so
#46 0x00343b3e in TApplication::ExecuteFile () from /home/Packages/root/lib/libCore.so
#47 0x00343e54 in TApplication::ProcessFile () from /home/Packages/root/lib/libCore.so
#48 0x003424a3 in TApplication::ProcessLine () from /home/Packages/root/lib/libCore.so
#49 0x0011e561 in TRint::Run () from /home/Packages/root/lib/libRint.so
#50 0x08048d75 in main ()
The program is running. Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]
Detaching from program: /proc/6889/exe, process 6889
Root > Function MacroLikeScan() busy flag cleared

Hi,

Maybe you are trying to call ‘Get’ on a TDirectory and/or TFile that has already been deleted?

Philippe.

No,
It’s not that easy.
Nothing to do with opening/cd of anything.
In my macro I just do:

#include </home/asarti/roofit/b2hh/B2hhFit/Acceptance.h>

void MacroLikeScan() {

TFile f("/home/asarti/roofit/b2hh/B2hhFit/Sim_data_stri_FitRes.root");
int sigplbkg = 0;
f.ls();
cout<<"Started "<<endl;
RooFitResult * result = ((RooFitResult*)gDirectory->Get(“L”));
RooDataSet * pl_data = ((RooDataSet*)gDirectory->Get(“pdf_fit_BS2piKData”));
//Acceptance * accBS2piK = ((Acceptance*)gDirectory->Get(“accBS2piK”));
cout<<"Ended "<<endl;
return;
}

But If I uncomment the Acceptance retrieval the macro crashes and do not reach the end… The ‘Started’ cout is obtained, so the ls of the file is not causing troubles…

I’m really puzzled.
Alessio

Can you try: RooFitResult * result = ((RooFitResult*)f.Get("L")); RooDataSet * pl_data = ((RooDataSet*)f.Get("pdf_fit_BS2piKData")); Acceptance * accBS2piK = ((Acceptance*)f.Get("accBS2piK"));

Philippe.

PS. Actually a safer syntax issue: RooFitResult * result; f.GetObject("L",result); RooDataSet * pl_data; f.GetObject("pdf_fit_BS2piKData",pl_data); Acceptance * accBS2piK; f.GetObject("accBS2piK", accBS2piK); where the pointer are initialized to zero if the requested name point to an object of the wrong type.

I have tried both. But the crash remain.

The compiled version under gdb tells me:

Program received signal SIGSEGV, Segmentation fault.
0x04d95c62 in TStreamerInfo::ReadBuffer<char**> () from /home/Packages/root/lib/libRIO.so

While the macro exits with:

*** Break *** segmentation violation
(no debugging symbols found)
Attaching to program: /proc/6769/exe, process 6769
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
[Thread debugging using libthread_db enabled]
[New Thread 0xb80456d0 (LWP 6769)]
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)
0x00110416 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install glibc-2.9-2.i686 libgcc-4.3.2-7.i386 libstdc+±4.3.2-7.i386
#1 0x0178bf43 in __waitpid_nocancel () from /lib/libc.so.6
#2 0x0172632b in do_system () from /lib/libc.so.6
#3 0x0018859d in system () from /lib/libpthread.so.0
#4 0x0042e76d in TUnixSystem::Exec () from /home/Packages/root/lib/libCore.so
#5 0x00433b5b in TUnixSystem::StackTrace ()
from /home/Packages/root/lib/libCore.so
#6 0x004348fd in TUnixSystem::DispatchSignals ()
from /home/Packages/root/lib/libCore.so
#7 0x004349fd in SigHandler () from /home/Packages/root/lib/libCore.so
#8 0x0042b312 in sighandler () from /home/Packages/root/lib/libCore.so
#9
#10 0x0185e559 in main_arena () from /lib/libc.so.6
#11 0x08be64e0 in ?? ()
#12 0x003f1360 in TClass::Streamer () from /home/Packages/root/lib/libCore.so
#13 0x010ce193 in TKey::ReadObjectAny () from /home/Packages/root/lib/libRIO.so
#14 0x010ae470 in TDirectoryFile::GetObjectChecked ()
from /home/Packages/root/lib/libRIO.so
#15 0x010a8510 in TDirectoryFile::GetObjectChecked ()
from /home/Packages/root/lib/libRIO.so
#16 0x0033e8bf in G__ManualBase4_101_0_98 ()
from /home/Packages/root/lib/libCore.so
#17 0x0099bd56 in Cint::G__ExceptionWrapper ()
from /home/Packages/root/lib/libCint.so
#18 0x00a519dc in G__execute_call () from /home/Packages/root/lib/libCint.so
#19 0x00a52b36 in G__call_cppfunc () from /home/Packages/root/lib/libCint.so
#20 0x00a2929c in G__interpret_func () from /home/Packages/root/lib/libCint.so
#21 0x00a18a24 in G__getfunction () from /home/Packages/root/lib/libCint.so
#22 0x00b06da1 in G__getstructmem () from /home/Packages/root/lib/libCint.so
#23 0x00afcd02 in G__getvariable () from /home/Packages/root/lib/libCint.so
#24 0x009eae2f in G__getitem () from /home/Packages/root/lib/libCint.so
#25 0x009f0a63 in G__getexpr () from /home/Packages/root/lib/libCint.so
#26 0x00a7ffe8 in G__exec_statement () from /home/Packages/root/lib/libCint.so
#27 0x00a2a56d in G__interpret_func () from /home/Packages/root/lib/libCint.so
#28 0x00a18507 in G__getfunction () from /home/Packages/root/lib/libCint.so
#29 0x009eaf38 in G__getitem () from /home/Packages/root/lib/libCint.so
#30 0x009f0a63 in G__getexpr () from /home/Packages/root/lib/libCint.so
#31 0x009feb18 in G__calc_internal () from /home/Packages/root/lib/libCint.so
#32 0x00a8b872 in G__process_cmd () from /home/Packages/root/lib/libCint.so
#33 0x0041def4 in TCint::ProcessLine () from /home/Packages/root/lib/libCore.so
#34 0x0041a72f in TCint::ProcessLineSynch ()
from /home/Packages/root/lib/libCore.so
#35 0x00343b3e in TApplication::ExecuteFile ()
from /home/Packages/root/lib/libCore.so
#36 0x00343e54 in TApplication::ProcessFile ()
from /home/Packages/root/lib/libCore.so
#37 0x003424a3 in TApplication::ProcessLine ()
from /home/Packages/root/lib/libCore.so
#38 0x0011e561 in TRint::Run () from /home/Packages/root/lib/libRint.so
#39 0x08048d75 in main ()
The program is running. Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]
Detaching from program: /proc/6769/exe, process 6769
Root > Function MacroLikeScan() busy flag cleared

Hi,

The macro you showed does not contain the necessary:

gSystem->Load(“Acceptance_cxx.so”);

Is it done outside of your macro?

Philippe

Hi,

It is difficult to write single RooFit objects to a TFile like you do because they contain pointers to other objects. There exists a special container class RooWorkspace that you can use to persist (clusters of) RooFit objects safely

A complete example on how to do this is given here:

$ROOTSYS/tutorials/roofit/rf502_wspacewrite.C
$ROOTSYS/tutorials/roofit/rf503_wspaceread.C

Wouter