Hi all,
I am currently trying to merge GEANT4 and ROOT to book, fill and write a
TTree *t1Tree = new TTree(“t1”,“3L_sim2_rt Output Data”);
that consists of three major branches that each has a bunch of leaves as defined in the class MyTree (see below).
MyTree *sct = new MyTree;
MyTree *pm1 = new MyTree;
MyTree *pm2 = new MyTree;
TBranch *Scint = t1Tree->Branch(“Sct.”,“MyTree”,&sct,64000,1);
TBranch *Pmt1 = t1Tree->Branch(“Pmt1.”,“MyTree”,&pm1,64000,1);
TBranch *Pmt2 = t1Tree->Branch(“Pmt2.”,“MyTree”,&pm2,64000,1);
The definition of the Class is very simple, it only contains a bunch of variable definitions.
%%%%%% Definition of the Class: MyTree %%%%%%%%%%%%%%
#ifndef XeMyTree_h
#define XeMyTree_h 1
#include “XeEventAction.hh”
#include “globals.hh”
//#include “Rtypes.h”
class MyTree{
public:
int eventid;
int step;
int Nohits;
char type[25];
float xp;
float yp;
float zp;
float ke;
float Etot;
float time;
// ClassDef(MyTree, 1);
MyTree(void);
~MyTree();
};
#endif
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
What I learned is that ROOT needs a dictionary file for each such user-defined class in order for it to know how to handle the class.
I tried to generate such a dictionary file, using the ROOTCINT utility as follows:
rootcint -f MyTree_Dict.cc -c -I/sw/include/geant4/ -I/sw/include/ -p include/XeMyTree.hh MyTreeLinkDef.h
And the output after execution is:
In file included from include/XeEventAction.hh:20,
from include/XeMyTree.hh:4,
from /var/tmp/tmp.0.lO3mbp_rootcint.h:1,
from /var/tmp/tmp.5.EGLcQj_cint.cxx:1:
MyTree_Dict.h:5:2: #error MyTree_Dict.h/C is only for compilation. Abort cint.
Can somebody explain me why cint aborts? And tell me how to solve this problem? I am actually not very sure about the general procedure of generating such a dictionary.
The output after using rootcint is a *dict.h and *dict.cc file, do I still have to do anything with them first? Or is it enough to simply include the files (once they are generated properly) into my GEANT project and compile it as a whole?
Thanks for your help !!
Joerg