On occasion you need to specify that ROOT load some new dictionary object. And this object may be something well know (like vector<bool>), but not known to ROOT. There is a facility for something like this that avoids having to write a custom object project as detailed earlier – one adds a file with some extra info.

The Extra Info File

Before parsing the TTree/ROOT file, create a new file in the same directory as your ROOT file: fname.root-extra-info. fname must be the same name as your ntuple. The file format is quite simple – like an old-style INI format.

The File Header

Text before the first section header can contain anything you like – it will always be ignored.

CreateDictionary

This section is a list of semicolon separated text:

[CreateDictionary]
vector<Long64_t> ; vector

Where the first item is the name of the object for which a dictionary must be created, and the second one is a list of include files that need to be specified. These dictionaries are created before any root file is opened!

CINT

This section contains C++ code for ROOTCINT to parse

[CINT]
#pragma link C++ class vector<bool>

These lines will be put straight into the C++ file that is generated (and compiled by ACLiC), and should also cause the dictionary to be generated.

Last edited Apr 17, 2011 at 12:41 AM by gwatts, version 4

Comments

No comments yet.