void makeFiles(TFile *f_init, TString f_out) { TH1::SetDefaultSumw2(); // --- hadd histograms TString ST150 = "150"; TString ST250 = "250"; TString ST350 = "350"; TString ST450 = "450"; // -- vector to hold the HT bins to merge vector<TString> HT; HT.push_back("750"); HT.push_back("1000"); // -- name of the histogram to merge TString histo2merge = "LPf_tot"; // --- output [merged] histograms TH1D *hST150 = haddHistos(f_init,histo2merge,ST150,HT); hST150->SetName("hST150"); TH1D *hST250 = haddHistos(f_init,histo2merge,ST250,HT); hST250->SetName("hST250"); TH1D *hST350 = haddHistos(f_init,histo2merge,ST350,HT); hST350->SetName("hST350"); TH1D *hST450 = haddHistos(f_init,histo2merge,ST450,HT); hST450->SetName("hST450"); // --- save histograms in a root file. TFile *hData = createRootFile(f_out,"150","750",hST150,histo2merge); TFile *hData = createRootFile(f_out,"250","750",hST250,histo2merge); TFile *hData = createRootFile(f_out,"350","750",hST350,histo2merge); TFile *hData = createRootFile(f_out,"450","750",hST450,histo2merge); }
int main(int argc, char* argv[]) { std::string cmd(argv[1]); std::cout << cmd << std::endl; std::cout << sizeof(MyROOTObject) << std::endl; if (cmd == "create") { createRootFile(); } else if (cmd == "load") { loadRootFile(); } else if (cmd == "append") { appendRootFile(); } else if (cmd == "overwrite") { overwriteRootFile(); } }