TClass::BuildRealData : Cannot find any ShowMembers function for

Hello Experts,

I am trying to read a root tree that has custom class entries. I keep getting the following error, and I am not really sure what it is referring to. I could not find an answer by looking it up on the forum.

TClass::BuildRealData : Cannot find any ShowMembers function for StV0I!

With respect to where my run macro is, here are the header files.
The header file for the class StV0I. is in ./StRoot/StStrangeMuDstMaker/StV0I.hh. The class StV0MuDst is in ./StRoot/StStrangeMuDstMaker/StV0MuDst.hh. I load StStrangeMuDstMaker as part of my macro.

StV0MuDst inherits from StV0I, and the lambda branch in the root tree is of the class StV0MuDst.

Not sure if this is helpful or not, but I get the same error when the split level of generating the lambda branch is set to max (99).

The following is the layout of the tree:

******************************************************************************
*Tree    :v0Tree    : Reconstructed V0 Tree                                  *
*Entries :       20 : Total =            5947 bytes  File  Size =       2401 *
*        :          : Tree compression factor =   2.29                       *
******************************************************************************
*Br    0 :nTzero    : eventNTZero/I                                          *
*Entries :       20 : Total  Size=        648 bytes  File Size  =        129 *
*Baskets :        1 : Basket Size=      32000 bytes  Compression=   1.20     *
*............................................................................*
*Br    1 :numLambda : numLambda/I                                            *
*Entries :       20 : Total  Size=        648 bytes  File Size  =        109 *
*Baskets :        1 : Basket Size=      32000 bytes  Compression=   1.45     *
*............................................................................*
*Br    2 :lambda    : StV0MuDst                                              *
*Entries :       20 : Total  Size=       4205 bytes  File Size  =       1521 *
*Baskets :        1 : Basket Size=      32000 bytes  Compression=   2.45     *
*............................................................................*

The following is my run macro:

void read_v0Tree(int nevent=1000000000, const char* inputFile = "test_weakDecayAnalysis_16138024.root") {
        gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
        loadSharedLibraries();
        gSystem->Load("StStrangeMuDstMaker");

        // Variables
        const Int_t maxNumV0 = 200;

        TChain* v0Chain = new TChain("v0Tree"); // Chains trees named v0Tree from all input files
        v0Chain->Add(inputFile);

        // Create branches you need
        Int_t nTzero;
        Int_t nLambda; // Number of lambda's in each event
        StV0MuDst lambdaArry[maxNumV0];
        v0Tree->SetBranchAddress("nTzero", nTzero);
        v0Tree->SetBranchAddress("numLambda", nLambda);
        v0Tree->SetBranchAddress("lambda", lambdaArry); // =====>Issues arises here 



        // Get number of entries in the tree
        Int_t nEntries = v0Tree->GetEntries();

        // Loop over entries in the tree
        for(int iEntry=0; iEntry<nEntries; iEntry++) {
                //v0Tree->GetEntry(iEntry);

        }

}

Thank you very much for the help in advance!

I think @pcanal can help you.

Humm … odd …

Can you give the value of :

TClass::GetClass("StV0MuDst")->IsLoaded()

and the complete output of:

TClass::GetClass("StV0MuDst")->GetListOfRealData()->ls();

Hello @pcanal,

Thank you very much for your reply! Here is what the commands you suggested return:

root4star [1] TClass::GetClass("StV0MuDst")->IsLoaded()
(const Bool_t)0
root4star [2] TClass::GetClass("StV0MuDst")->GetListOfRealData()->ls();
Error: illegal pointer to class object GetListOfRealData() 0x0 68  (tmpfile):1:
*** Interpreter error recovered ***

It looks like root doesn’t recognize the class StV0MuDst.

So despite,

        gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
        loadSharedLibraries();
        gSystem->Load("StStrangeMuDstMaker");

The dictionary for the class StV0MuDst s not loaded. Where is that dictionary declared/generated?

Hello @pcanal,

Thank you for the reply!

I see the following relevant information defined:

  1. In ./StRoot/StStrangeMuDstMaker/StV0MuDst.hh we have:
    ClassDef(StV0MuDst,7)
  2. In ./StRoot/StStrangeMuDstMaker/StV0MuDst.cc we have:
    ClassImp(StV0MuDst)
  3. In ./StRoot/StStrangeMuDstMaker/StStrangeMuDstMakerLinkDef.h we have:
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragme link C++ global gFakeTopoPtr;
#pragma link C++ class DcaService+;
#pragma link C++ class StDecayMode+;
#pragma link C++ class StKinkI+;
#pragma link C++ class StKinkBase+;
#pragma link C++ class StKinkMc+;
#pragma link C++ class StKinkMuDst+;
#pragma link C++ class StStrangeControllerBase+;
#pragma link C++ class StV0Controller+;
#pragma link C++ class StXiController+;
#pragma link C++ class StKinkController+;
#pragma link C++ class StStrangeCuts+;
#pragma link C++ class StStrangeEvMuDst+;
#pragma link C++ class StStrangeMuDst+;
#pragma link C++ class StStrangeAssoc+;
#pragma link C++ class StStrangeMuDstMaker+;
#pragma link C++ class StrangeMuDstPlayer+;
#pragma link C++ class StV0I;
#pragma link C++ class StV0Mc+;
#pragma link C++ class StV0MuDst+;
#pragma link C++ class StXiI;
#pragma link C++ class StXiMc+;
#pragma link C++ class StXiMuDst+;
#endif

Hummm … strange … Which version of ROOT are you using?
What does

gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
loadSharedLibraries();
gSystem->Load("StStrangeMuDstMaker");
StV0MuDst *p = nullptr;
p = new StV0MuDst();

prints?

I believe I am using root version 5.34.38.

And I get the following:

*** Float Point Exception is OFF ***
 *** Start at Date : Tue May 31 12:16:04 2022
QAInfo:You are using STAR_LEVEL : pro, ROOT_LEVEL : 5.34.38 and node : rcas6005.rcf.bnl.gov 
root4star [0] 
Processing read_v0Tree.C...
Warning in <TClass::TClass>: no dictionary for class StStrangeMuDst is available
Warning in <TClass::TClass>: no dictionary for class StStrangeAssoc is available
strangeArrayNames-arrayNames-__NARRAYS__ = 0
 loading of shared libraries done
Error: Symbol nullptr is not defined in current scope  read_v0Tree.C:9:
*** Interpreter error recovered ***

I have come up with a different way to store the information I want in a tree that doesn’t require special classes. But, it would be informative to know why specifying a class is not working.

I am confused. Why would the 5 lines:

gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
loadSharedLibraries();
gSystem->Load("StStrangeMuDstMaker");
StV0MuDst *p = nullptr;
p = new StV0MuDst();

lead to this message:

Processing read_v0Tree.C...

@pcanal Thank you very much for your help!

As you might already know, I am switched to a different that doesn’t require saving special classes in the tree. I appreciate your time and effort in addressing this! :slight_smile: