#define e143_comparison_cxx #include #include #include #include "TROOT.h" #include "TFile.h" #include "TChain.h" #include "TTree.h" #include "TBranch.h" #include "TCanvas.h" #include "TGraph.h" #include "TGraphPainter.h" #include "TColor.h" #include "TH1.h" #include "TH2.h" #include "TH3.h" #include "TH1F.h" #include "TH2F.h" #include "TH3F.h" #include "THStack.h" #include "THistPainter.h" using namespace std; void e143_comparison() { TH2 *h1vt_410MHz_07m01d22h_10ms = new TH2F("h1vt_410MHz_07m01d22h_10ms","410Mhz 07.01.22h Additiion (10 ms res);frequency (Hz);time (s)",256,4.06704e+08,4.06753e+08,200,0,2); int nframes = 200; vector tf_frames; vector h1_frames(nframes,NULL); char chname[300]; for(int i=0; iGetObject("th1f",h1_frames[i]); for(long j=0; j<256; j++) { h1vt_410MHz_07m01d22h_10ms->SetBinContent(j+1, i+1, h1_frames[i]->GetBinContent(j)); } } cout << "Total Bins: " << h1_frames[100]->GetNbinsX() << ", Xlow: " << h1_frames[100]->GetBinCenter(1) << ", Xhigh: " << h1_frames[100]->GetBinCenter(h1_frames[100]->GetNbinsX()) << endl; TCanvas *c1 = new TCanvas("c1","c1",50,50,1000,800); h1vt_410MHz_07m01d22h_10ms->Draw("COLZ"); TFile *fhists = new TFile("e143_added_th2s.root","RECREATE"); h1vt_410MHz_07m01d22h_10ms->Write(); cout << "Written h1vt_410MHz_07m01d22h_10ms to file." << endl; fhists->Close(); } int main () { e143_comparison(); return 0; }