4 #include "TStopwatch.h"
12 if (storagefile.Get(currenthisto->GetName()) != 0) {
13 currenthisto->Add((TH1D*)storagefile.Get(currenthisto->GetName()));
16 currenthisto->Write();
27 TFile inputfile(infilename,
"READ");
28 TList* mylist = inputfile.GetListOfKeys();
29 TListIter myiter(mylist);
30 TFile outputstorage(outfilename,
"UPDATE");
36 TString histoClassName =
"TH1D";
38 if (mylist->GetEntries() != nHistos) {
39 cout <<
"Fatal Entry Mismatch: " << mylist->GetEntries() << endl;
45 while (mykey = (TKey*)myiter()) {
46 if (histoClassName ==
TString(mykey->GetClassName())) {
47 TH1D* myhisto = (TH1D*)mykey->ReadObj();
50 cout <<
"Ignored, not a histogram: " << mykey->GetName() <<
", " << mykey->GetClassName() << endl;
int combine_ana(TString infilename, TString outfilename="combined_psi3770.root")
void SaveAndUpdateHisto(TH1D *currenthisto, TFile &storagefile)