{
//Reset ROOT and connect tree file
gROOT->Reset();
TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("Kinematics.root");
if (!f) {
  f = new TFile("Kinematics.root");
}
TTree   *tree  = (TTree*)f->Get("Event0/TreeK");//Tree
TBranch *branch = tree->GetBranch("fPx");//Branch

//Declaration of leaves types
const Int_t kMaxPar = 100;
Double_t        fPx;

//the following call is required when reading a branch of a superbranch
tree->SetMakeClass(1);

branch->SetAddress(&fPx);

Long64_t nentries = branch->GetEntries();
cout<<"Entries = "<<nentries<<endl;
Long64_t nbytes = 0;

for (Long64_t i=0; i<nentries;i++) 
{
  branch->GetEntry(i);
  cout<<"Px = "<<fPx<<endl;
}
}


