Vector of TVector3 in ROOT compiling with Makefile in Geant4

Dear ROOT users and experts

I am trying to implement the vector of TVector3 which is a branch of a analysis tree. I am running simulation with Geant4 in which I am generating a final ROOT output file having ROOT Tree. With the previous post I came to know that one has to generate a dictionary. I do not having any idea how to do that although I have tries by creating a file LoadVect.hh as

#ifndef LoadVect
#define LoadVect

#include “TVector3.h”
#include “TObject.h”

class LoadVect : public TObject{
std::vector< TVector3*> dvec;


but I do not know how to implement this…

I have the branch element as

anlTree->Branch(“dvec”,&dvec); which is defined in header as std::vector<TVector3*> dvec;

please help me out to solve this issue.


if you want to perform I/O and have access interactively (in the interpreter or via pyroot) to the classes of your datamodel, you need to create dictionaries for those.
I think that here … t-classdef , if you also follow all of the hyperlinks, you will find all the information you need.
You basically need to:
[li] Create a dictionary, i.e. an autogenerated c++ file, from your header using rootcint or genreflex[/li]
[li] To keep it simple, compile this file in the shared library where the compilation units of the classes for which you created the dictionary with the step above reside.[/li]
[li] Load the library using the “TSystem::Load” method when you need to perform I/O or interactive usage of the classes (there are ways to automate this, but in first approximation this is the way to go)[/li][/ul]