{ TH1F *hEta = new TH1F("heta","Eta Histogram",100,-6,6); TKey *key; char *str2 = "/TreeK"; char filename[100]; for(Int_t j=1; j<4; j++){ sprintf(filename,"Kinematics_%d.root",j); TFile *f = new TFile(filename,"read"); TIter next(f.GetListOfKeys()); while (key = (Key*)next()) { TString t1 = TString(key->GetName())+TString(str2); TTree *tree = (TTree*)f->Get(t1);//Tree TBranch *branch = tree->GetBranch("Particles");//Branch TParticle *particles; chain.SetBranchAddress("particles",&Particles); branch->SetAddress(&particles); Long64_t nentries = chain->GetEntries(); cout<<"Entries = "<GetEntry(i); TParticlePDG* pdg=particles->GetPDG(); if(particles->IsPrimary()){ Int_t charge = pdg->Charge(); if(charge !=0) { cout<<"charge= "<