No dictionary for class ROOT

Hi,

I am running code which compiles fine, but when opening a root file during run-time I get the following messages:

Warning in <TClass::TClass>: no dictionary for class ROOT::Math::PositionVector3D<ROOT::Math::Cartesian3D<float>,ROOT::Math::DefaultCoordinateSystemTag> is available
Warning in <TClass::TClass>: no dictionary for class ROOT::Math::Cartesian3D<float> is available
Warning in <TClass::TClass>: no dictionary for class ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<float> > is available
Warning in <TClass::TClass>: no dictionary for class ROOT::Math::PtEtaPhiM4D<float> is available

I get the very same messages when just opening the file in a CINT session first thing after starting the session.

They all appear to be ROOT functions so I am puzzled why dictionaries need to be manually created at all? I have tried all the described ways to created dictionaries from header files containing these classes but have failed (the “.L +” did not succeed). I have tried 5.32 and 5.34.

The code continues running but I cannot access some of the information in the ntuple (plus, it is ugly…).

I assume this has a trivial solution so I refrain from posting code fragments etc for now, but will happily do so if it helps.

Thanks a lot!

Hi,

the dictionaries for these classes are not generated/loaded correctly.
On the other hand, you select “float” as template parameter. Is this done to save memory at runtime, on disk or to do some floating point precision test?
Root natively provides all the classes you seem to need using double and Double32_t types.
In case you need to preserve all precision possible at runtime and save space on disk, you can take advantage of the opaque typedef Double32_t. This entity allows ROOT to persist floating point numbers as floats and treat them at runtime as doubles (therefore avoiding many issues arising from the usage of limited precision).
For more info: root.cern.ch/download/doc/InputO … double32_t

Danilo

Hi Danilo,

Thanks for your reply!
Unfortunately I do not have control over the data type - float is used in the input file produced by someone else which I have to handle.

Any idea on how to generate the dictionary?

Cheers,
Martin

Hi Martin,

if you cannot get your hands on the code of the person that wrote those files (she must have the dictionaties), you could write a LinkDef file mimicking what is done in the genvector package.
So:

  1. Linkdef file
#ifdef __CINT__
#pragma link C++ class ROOT::Math::PositionVector3D<ROOT::Math::Cartesian3D<float>,ROOT::Math::DefaultCoordinateSystemTag >+;
#endif
  1. Header:
#include "Math/GenVector/PositionVector3D.h"
ROOT::Math::PositionVector3D<ROOT::Math::Cartesian3D<float>,ROOT::Math::DefaultCoordinateSystemTag > a;
  1. Commandline:
    rootcint -f classes_dict.cpp -c classes.h LinkDef.h

Cheers,
Danilo

Thanks a lot, that works!

Hi everyone,
having the same trouble which is already solved, I decided to follow it hoping it will be work for me too, but unfortunately it doesn’t. In fact I was trying to open the root file with "TFile* f = new TFile(“ntuple.root”) in the cint, I get this:

Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<float> > > is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<TBits> is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<bool> is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<float> is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<int> is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<vector<ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<float> > > > is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<vector<TString> > is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<vector<bool> > is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<vector<float> > is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<vector<int> > is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<vector<vector<ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<float> > > > > is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<vector<vector<float> > > is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<vector<vector<int> > > is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<vector<unsigned int> > is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<unsigned int> is available
Warning in <TClass::TClass>: no dictionary for class edm::Wrapper<ULong64_t> is available
Warning in <TClass::TClass>: no dictionary for class edm::EventAuxiliary is available
Warning in <TClass::TClass>: no dictionary for class ROOT::Math::PxPyPzE4D<float> is available
Warning in <TClass::TClass>: no dictionary for class ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<float> > is available
Warning in <TClass::TClass>: no dictionary for class edm::Hash<2> is available
Warning in <TClass::TClass>: no dictionary for class edm::EventID is available
Warning in <TClass::TClass>: no dictionary for class edm::Timestamp is available
Warning in <TClass::TClass>: no dictionary for class edm::LuminosityBlockAuxiliary is available
Warning in <TClass::TClass>: no dictionary for class edm::LuminosityBlockID is available
Warning in <TClass::TClass>: no dictionary for class edm::RunAuxiliary is available
Warning in <TClass::TClass>: no dictionary for class edm::RunID is available
Warning in <TClass::TClass>: no dictionary for class edm::StoredProductProvenance is available
Warning in <TClass::TClass>: no dictionary for class edm::Hash<1> is available
Warning in <TClass::TClass>: no dictionary for class edm::FileFormatVersion is available
Warning in <TClass::TClass>: no dictionary for class edm::FileID is available
Warning in <TClass::TClass>: no dictionary for class edm::IndexIntoFile is available
Warning in <TClass::TClass>: no dictionary for class edm::IndexIntoFile::RunOrLumiEntry is available
Warning in <TClass::TClass>: no dictionary for class edm::ProcessConfiguration is available
Warning in <TClass::TClass>: no dictionary for class edm::ProcessHistory is available
Warning in <TClass::TClass>: no dictionary for class edm::ParameterSetBlob is available
Warning in <TClass::TClass>: no dictionary for class edm::BranchKey is available
Warning in <TClass::TClass>: no dictionary for class edm::BranchID is available
Warning in <TClass::TClass>: no dictionary for class edm::ProductRegistry is available
Warning in <TClass::TClass>: no dictionary for class edm::BranchDescription is available
Warning in <TClass::TClass>: no dictionary for class edm::Parentage is available
Warning in <TClass::TClass>: no dictionary for class edm::BranchChildren is available
Warning in <TClass::TClass>: no dictionary for class pair<edm::Hash<1>,edm::ParameterSetBlob> is available
Warning in <TClass::TClass>: no dictionary for class pair<edm::BranchKey,edm::BranchDescription> is available
Warning in <TClass::TClass>: no dictionary for class pair<edm::BranchID,set<edm::BranchID> > is available
Warning in <TClass::TClass>: no dictionary for class edm::IndexIntoFile::Transients is available
Warning in <TClass::TClass>: no dictionary for class edm::ProductRegistry::Transients is available
Warning in <TClass::TClass>: no dictionary for class edm::Parentage::Transients is available

so I did the same as proposed in the solution by using a LinkDef file and an header file, which are
[ul] LinkDef.h
[/ul]

#ifdef __CINT__
#pragma link C++ class
ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<float>>>+;
#endif

[ul]
headerfile.h
[/ul]

#include "Math/LorentzVector.h"
ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<float>>> a;
[/code]just to test if I will get rid of the furst warning before doing it for the remains, then typing this commandline : 
[code]
rootcint -f DictOutput.cpp -c  headerfile.h LinkDef.h
[/code]
but I get these errors:
[code]root [0] rootcint -f DictOutput.cpp -c -p headerfile.h LinkDef.h
Error: Symbol rootcint is not defined in current scope  (tmpfile):1:
Error: Invalid type 'f' in declaration of 'DictOutput' (tmpfile):1:
Error: Invalid type 'f' in declaration of 'DictOutput' (tmpfile):1:
Error: Symbol f DictOutput is not defined in current scope  (tmpfile):1:
Error: Failed to evaluate f DictOutput.cpp
Error: Symbol c is not defined in current scope  (tmpfile):1:
Error: Invalid type 'p' in declaration of 'headerfile' (tmpfile):1:
Error: Invalid type 'p' in declaration of 'headerfile' (tmpfile):1:
Error: Invalid type 'p' in declaration of 'headerfile' (tmpfile):1:
Error: Symbol p headerfile is not defined in current scope  (tmpfile):1:
Error: Failed to evaluate p headerfile.h LinkDef
Error: Failed to evaluate p headerfile.h LinkDef.h
(const int)0
*** Interpreter error recovered ***

I would appreciate some help please.
cheers

Hi,

your case is rather different.
You are trying to open a ROOT file written with CMSSW with ROOT standalone. It is normal that you see a warning for about every single class of the CMS datamodel.
My advice would be to setup an adequate CMSSW environment and retry.

Danilo

Hi Danilo,
I tried to change my CMSSW version from CMSSW_5_3_22 to CMSSW_5_3_32, but I get the same error.
I tried at first this version CMSSW_6_2_3 but I get this warning

WARNING: Developer's area is created for non-production architecture slc6_amd64_gcc472. Production architecture for this release is slc5_amd64_gcc472.
That’s why I chose the CMSSW_5_3_32 version.
Cheers

Hi,

this really looks like a question for CMS specific fora. I am sure you will find the help needed to read the file there.

Cheers,
Danilo