void Example2(const char *inputFile) { gSystem->Load("libDelphes"); TChain *chain = new TChain("Delphes"); chain->Add(inputFile); ExRootTreeReader *treeReader = new ExRootTreeReader(chain); ExRootResult *result = new ExRootResult(); MyPlots *plots = new MyPlots; BookHistograms(result, plots); AnalyseEvents(treeReader, plots); PrintHistograms(result, plots); result->Write("results.root"); cout << "** Exiting..." << endl; delete plots; delete result; delete treeReader; delete chain; }
int timewalk_fits(TString dir) { gStyle->SetOptFit(111); TString fname = "timewalk-fits.txt"; ofstream fout; fout.open(fname); ofstream fout_ccdb; fout_ccdb.open("tdc_timewalk.txt"); for (int i=1;i<=274;i++) { // counters stringstream ss; ss << i; const int N = 41; // pulse-height bins double y[N]; double dy[N]; double max = 0.0; double min = 1000.0; GetData(dir+"/counter_"+TString(ss.str())+".txt",y,dy,min,max); WriteTimewalkFitResults(fout,fout_ccdb,i,y,dy,min,max); } fout.close(); fout_ccdb.close(); PrintHistograms(fname); return 0; }