#include #include "TFile.h" #include "TTree.h" #include "TH1F.h" #include "TClonesArray.h" #include "TRandom3.h" void readTClonesArraty() { long int nbytes = 0, nb = 0; TChain * fChain = new TChain("ana",""); fChain->Add("out.root"); TClonesArray *muoHits; Int_t nMuo; TBranch *b_muoHits; //! TBranch *b_nMuo; //! muoHits = 0; fChain->SetMakeClass(1); fChain->SetBranchAddress("muoHits", &muoHits, &b_muoHits); fChain->SetBranchAddress("nMuo", &nMuo, &b_nMuo); int nentries = fChain->GetEntries(); for (int jentry=0; jentryGetEntry(jentry); nbytes += nb; for(int n=0;nAt(n); for(int nBin=1; nBin < tmpHisto0->GetNbinsX()+1; nBin++) cout << jentry << " " << n << " " << nBin-1 << " " << tmpHisto0->GetBinContent(nBin) << endl; tmpHisto0->Reset(); } } }