#include #include void NA(){ // TFile f("Run0001.root"); // f.GetListOfKeys()->Print(); // TH1F *h1 = (TH1F*)f.Get("hExI0to36TSC_1"); // TH1F *h2 = (TH1F*)f.Get("hExI0to36TSC_2"); // TH1F *h3 = (TH1F*)f.Get("hExI0to36TSC_3"); // h1->SetDirectory(0); // h2->SetDirectory(0); // h3->SetDirectory(0); // h1->Add(h2); // h1->Add(h3); // h1->Draw(); // string s = "abc"; // stringstream ss; ss << 42; // s = s + "_1" + ss.str(); // cout<Print(); //Test // Read First TSC spectrum (real = 0) string stmp1 = prefix_TSCname + "0"; TH1F *h1 = (TH1F*)f.Get(stmp1.c_str()); h1->SetDirectory(0); // Loop for all TSC spectra for (int i=1; iAdd(h2); delete h2; }//End for loop // Scale histogram h1->Scale(1.0/number_of_Realization); double xbins[13]={0.1,0.5,1,1.5,2.0, 2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0}; TH1F *h1new = (TH1F*)h1->Rebin(12,"h1new",xbins); //h1->Rebin(15); h1new->Draw(); }