Is it possible to load base class in a tree to its child?

Dear all,

I save a class “Event” in a TTree. I have another class “Vertex”, inheriting from “Event”. It contains a functionVertex::Reconstruct() to use protected data members in “Event” to reconstruct the event vertex, and save it in a TVector3 data member. Would the following codes work?

Vertex *vtx = new Vertex;
tree->SetBranchAddress("event",&vtx);
for (UInt_t i=0; i<tree->GetEntries(); i++) {
   tree->GetEntry(i);
   vtx->Reconstruct();
}

Thanks,

Jing

The private data members in the base class cannot be inherited by the child. If I make all private members in the base class protected, then the child class contains all of them. Is it possible to load base class in a tree to its child in this case?