chp = new TChain("STNTUPLE") chp->AddFile("an_stntuple.root",0); TH1::AddDirectory(1); TStnAna xx(chp); fp = new TFlatNtupleModule(); xx.AddModule(fp); fp->SetFileName("flat.root") xx.Run(10); fp->SaveHistograms();