Renamed class and error "trying to read an emulated class"

I have renamed this class LbMclassTrack but when I try to run the code I get the message below.
When running search through whole solution there is no more names of this class.
What can I do? From where does it see this class name?

Warning in <TClass::TClass>: no dictionary for class LbMclassTrack is available Error in <TBufferFile::ReadObject>: trying to read an emulated class (LbMclassTrack) to store in a compiled pointer (TObject) Error in <TBufferFile::ReadObject>: trying to read an emulated class (LbMclassTrack) to store in a compiled pointer (TObject) Error in <TBufferFile::ReadObject>: trying to read an emulated class (LbMclassTrack) to store in a compiled pointer (TObject) Error in <TBufferFile::ReadObject>: trying to read an emulated class (LbMclassTrack) to store in a compiled pointer (TObject) Error in <TBufferFile::ReadObject>: trying to read an emulated class (LbMclassTrack) to store in a compiled pointer (TObject) Error in <TBufferFile::ReadObject>: trying to read an emulated class (LbMclassTrack) to store in a compiled pointer (TObject)

Hi,

It comes from the input files where you stored some object with the all class name. To solve the problem you need to tell the I/O what is the relationship between the two classes by adding to your linkdef:

#pragma read #pragma read sourceClass = "LbMclassTrack" targetClass = "NewName" version = "[1-]" and/or regenerate the input file.

Cheers,
Philippe.

Hi @pcanal

So I have a similar problem where I stored a pdf in RooWorkspace *combined using the RooSimultaneous class that I renamed to RooSimultaneous1. When I try to do

combined->addClassImplImportDir("/Users/cashcrusaders/Documents/UJ_LimitSetting/src/")

I get the following error:

Error in <TBufferFile::ReadObject>: trying to read an emulated class (RooSimultaneous1) to store in a compiled pointer (RooAbsArg)

 *** Break *** segmentation violation
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TGenCollectionStreamer::ReadBufferGeneric(TBuffer&, void*, TClass const*) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TGenCollectionStreamer.cxx:1337
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TBufferFile::ReadFastArray(void*, TClass const*, int, TMemberStreamer*, TClass const*) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TBufferFile.cxx:1609
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] int TStreamerInfoActions::ReadSTL<&(TStreamerInfoActions::ReadSTLMemberWiseSameClass(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*, short)), &(TStreamerInfoActions::ReadSTLObjectWiseFastArray(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*, short, unsigned int))>(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TStreamerInfoActions.cxx:0
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TBufferFile::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:1390
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TBufferFile::ReadClassBuffer(TClass const*, void*, TClass const*) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TBufferFile.cxx:3486
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] int TStreamerInfo::ReadBuffer<char**>(TBuffer&, char** const&, TStreamerInfo::TCompInfo* const*, int, int, int, int, int) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TStreamerInfoReadBuffer.cxx:1315
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TStreamerInfoActions::GenericReadAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TStreamerInfoActions.cxx:185
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TBufferFile::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:1390
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TBufferFile::ReadClassBuffer(TClass const*, void*, TClass const*) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TBufferFile.cxx:3486
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRooFitCore.so] RooAbsArg::Streamer(TBuffer&) /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/deque:2614
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libCore.so] TStreamerBase::ReadBuffer(TBuffer&, char*) /Users/cashcrusaders/Applications/root-6.18.04_limit/core/meta/src/TStreamerElement.cxx:0
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] int TStreamerInfo::ReadBuffer<char**>(TBuffer&, char** const&, TStreamerInfo::TCompInfo* const*, int, int, int, int, int) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TStreamerInfoReadBuffer.cxx:1342
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TStreamerInfoActions::GenericReadAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TStreamerInfoActions.cxx:185
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TBufferFile::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:1390
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TBufferFile::ReadClassBuffer(TClass const*, void*, TClass const*) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TBufferFile.cxx:3486
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libCore.so] TStreamerBase::ReadBuffer(TBuffer&, char*) /Users/cashcrusaders/Applications/root-6.18.04_limit/core/meta/src/TStreamerElement.cxx:0
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] int TStreamerInfo::ReadBuffer<char**>(TBuffer&, char** const&, TStreamerInfo::TCompInfo* const*, int, int, int, int, int) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TStreamerInfoReadBuffer.cxx:1342
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TStreamerInfoActions::GenericReadAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TStreamerInfoActions.cxx:185
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TBufferFile::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:1390
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TBufferFile::ReadClassBuffer(TClass const*, void*, TClass const*) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TBufferFile.cxx:3486
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libCore.so] TStreamerBase::ReadBuffer(TBuffer&, char*) /Users/cashcrusaders/Applications/root-6.18.04_limit/core/meta/src/TStreamerElement.cxx:0
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] int TStreamerInfo::ReadBuffer<char**>(TBuffer&, char** const&, TStreamerInfo::TCompInfo* const*, int, int, int, int, int) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TStreamerInfoReadBuffer.cxx:1342
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TStreamerInfoActions::GenericReadAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TStreamerInfoActions.cxx:185
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TBufferFile::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:1390
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TBufferFile::ReadClassEmulated(TClass const*, void*, TClass const*) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TBufferFile.cxx:3254
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TBufferFile::ReadObjectAny(TClass const*) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TBufferFile.cxx:2473
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TBufferFile::CheckObject(unsigned int, TClass const*, bool) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TBufferFile.cxx:3140
[/Users/cashcrusaders/Applications/root-6.18.04_limit/root-6.18.04-builddir/lib/libRIO.so] TBufferFile::ReadObjectAny(TClass const*) /Users/cashcrusaders/Applications/root-6.18.04_limit/io/io/src/TBufferFile.cxx:2423

So I tried to do what you suggested above using

#pragma read #pragma read sourceClass = "RooSimultaneous" targetClass = "RooSimultaneous1" version = "[1-]"

then I recompiled root. However, I still get the same error when I do:

combined->addClassImplImportDir("/Users/cashcrusaders/Documents/UJ_LimitSetting/src/")
Error in <TBufferFile::ReadObject>: trying to read an emulated class (RooSimultaneous1) to store in a compiled pointer (RooAbsArg)

This means that the library implementing RooSimultaneous1 and this thus the dictionary the rule has not been loaded.

#pragma read #pragma read sourceClass = "RooSimultaneous" targetClass = "RooSimultaneous1" version = "[1-]"

has some extra words. You need just:

#pragma read sourceClass = "RooSimultaneous" targetClass = "RooSimultaneous1" version = "[1-]"

Cheers,
Philippe.