A warning message

Hello!

I created a root file with my analysis program.
When I click on the root file icon in the ROOT Object Browser,
there was a warning message shown below.

###############################################
root [0] TBrowser b
root [1] Warning in TClass::TClass: no dictionary for class MyEvent is available
###############################################

And I cannot see any histograms in the root file.
Eventhough I click on the histogram icon in the root file,
nothing happens.
The message above suspected to be the only reason for this problem.
The line, #pragma link C++ class MyEvent+;, is present in the
LinkDef_MyEvent.h file.
But this seems to be used only in the compilation of my analysis program to produce the root file.
And this seems nothing to do with the root session since no dynamic library is loaded in the root session.

I hope to hear some hint to solve this problem.

Cheers, Sangryul Ro

Hi,
you shouldload the dynamic library containing the dictionary of your object. The dictionary is created when you load your macro using myMacro.C+, so in that case just call gSystem->Load(“myMacro_C.so”).

The fact that now histograms are drawn is unrelated. It might be a problem with your graphics setting - root might be in batch mode. If “new TCanvas()” does not show a canvas, and “gROOT->IsBatch()” returns 1, then check the following:

  • did you call root with the “-b” command line argument? That will torn graphics off.
  • is DISPLAY set, or are you using root win32? Either one is needed to get graphics output. But root will complain during start-up if something is wrong with the DISPLAY variable.
  • are you using your own main(), instead of root.exe, when trying to open the histograms? In that case you’ll need a TApplication to have graphics, see e.g. http://root.cern.ch/viewcvs/main/src/rmain.cxx?rev=1.6&content-type=text/vnd.viewcvs-markup
  • did you disable graphics by modifying the relevant entries e.g. in $ROOTSYS/etc/system.rootrc?
    Axel.

Hi! Axel.

Thanks for your valuable input.
I tried to load the dynamic library as shown below.

#########################################
root [7] gSystem->Load("/afs/cern.ch/user/s/sro/sw/ORCA_8_7_1/lib/Linux__2.4/l$
dlopen error: /afs/cern.ch/user/s/sro/sw/ORCA_8_7_1/lib/Linux__2.4/libqghbb.so: undefined symbol: _ZTI14TLorentzVector
Load Error: Failed to load Dynamic link library /afs/cern.ch/user/s/sro/sw/ORCA_8_7_1/lib/Linux__2.4/libqghbb.so
(int)(-1)
*** Interpreter error recovered ***
###########################

But it detected an undefined reference which is also difficult and
prolonged problem to me.

When I use an example root file which other person created with similar
program to mine(writing the root tree is the same),
I could see the histograms without loading the dynamic library.
The “new TCanvas()” shows a canvas.
And “gROOT->IsBatch()” returns 0.
I didn’t use the “-b” command line argument.
My root version is rh73_gcc32 in Linux.
I am using the root.exe in that version.
No modification in $ROOTSYS/etc/system.rootrc is done.
The graphics seems fine since I can see histograms when I use other person’s root file.
It seems that I have to solve the undefined reference probelm mentioned above.

Cheers, Sangryul

The libPhysics.so was already loaded without any problem before
loading the dynamic library.
S.

[quote]The libPhysics.so was already loaded without any problem before
loading the dynamic library.[/quote]
If this is true, them you must have a problem due to the fact that ROOT and your ORCA library have been build with different version of the compiler.

Cheers,
Philippe.

That seems true.
Someone suggested that some time ago.
And I checked this.
But they seem to be using the same library.
There must be different library used somewhere.
I have no idea how to find that.

Cheers, Sangryul

Before loading your libqghbb.so, could you do:
root > gSystem->Load(“libPhysics”)
root > .class TLorentzVector

If this works, loading libqghbb should then work, otherwise this will be the
sign that you are mixing libraries (ROOT and ORCA) compiled
with different compilers.

Rene

Thanks for all the help.
The problem with the undefined reference is solved.
It was the conflicting compiler version.
But I still cannot see the histograms after successfully loading the dynamic link library.
The “new TCanvas()” shows a canvas.
But it is empty.
And no histogram is shown eventhough I click on the histogram icon in the ROOT Object Browser;nothing happens.
Can anybody tell me possible reason for this probelm?

Cheers, Sangryul Ro

Please send the shortest possible running script reproducing the problem.

Rene

My rootlogon.C file contains the following,
{
char *hosttype = gSystem->Getenv( “HOSTTYPE” );
char *rootsys = gSystem->Getenv( “ROOTSYS” );

// gROOT->Reset(); // Reseting ROOT
gSystem.Load(“libPhysics.so”); // Loading Physics library (TVector3)
gSystem.Load("…/…/…/…/lib/Linux__2.4/libqghbb.so");
printf( “libraries loaded\n” );

}

It is successfully executed when I get into root.
Then I issued the command “TBrowser b”.
The Root Object Browser(ROB) is popped up.
On the ROB I followed to the root tree myusertree.root ->rootTree;1
->EventBranch.
On EventBranch, there are my histograms icons; histo1 and histo2.
I clicked on the icons.
But there is no effect.

Hi Sangryul,
do you really have your histos in a TTree? What do you expect root to draw? Suppose your tree had one tree and 1000 events: that means Root would have to draw 1000 histograms (one per event) - double clicking it won’t get you anywhere. Instead, write the histos directly to the file, not into the tree.
Axel.

Axel,

Adding histograms to a Tree may be an excellent idea in case each event
produces one or more histograms. For example, assuming an “event” branch with two members “hist1” and “hist2” of type TH1*
from the ROOT command line, you can do inresting things like
tree.Draw(“event.hist1.GetMean()”)
if you have a Tree with 1000 events (ie 1000x2 histograms),
the above command will loop on all 1000 events and produce an histogram filled with the mean value of each of the 1000 histograms
,etc, try also
tree.Draw(“hist1.GetMean():hist2.GetRMS()”)

Rene

Thanks a lot everybody.
It works now.
The number of events was just small to fill the tree.
That’s my first histograms in ROOT.
Bye now.

Cheers, Sangryul

Hi Rene,

[quote=“brun”]if you have a Tree with 1000 events (ie 1000x2 histograms),
the above command will loop on all 1000 events and produce an histogram filled with the mean value of each of the 1000 histograms[/quote]Wow! Thanks for the info, I’m impressed - I’ve never heard of that!
Axel.