#include "TFile.h" #include "TCanvas.h" #include "TStyle.h" #include "TH1.h" #include "TH2.h" #include "TH3.h" #include "TGaxis.h" #include "TRandom.h" #include "TLegend.h" #include "TPaveStats.h" #include "TGraph.h" void profilopianomultipad() { TFile *f = TFile::Open("G:/cors/prot/prot1/cors_plot-prot1.root"); if (f == 0) { // if we cannot open the file, print an error message and return immediatly printf("Error: cannot open cors_plot.root!\n"); return; } f->ls(); TFile *g = TFile::Open("G:/cors/prot/prot2/cors_plot-prot2.root"); if (g == 0) { // if we cannot open the file, print an error message and return immediatly printf("Error: cannot open cors_plot.root!\n"); return; } g->ls(); TFile *h = TFile::Open("G:/cors/prot/prot3/cors_plot-prot3.root"); if (h == 0) { // if we cannot open the file, print an error message and return immediatly printf("Error: cannot open cors_plot.root!\n"); return; } h->ls(); TFile *i = TFile::Open("G:/cors/prot/prot4/cors_plot-prot4.root"); if (i == 0) { // if we cannot open the file, print an error message and return immediatly printf("Error: cannot open cors_plot.root!\n"); return; } i->ls(); TFile *l = TFile::Open("G:/cors/prot/prot5/cors_plot-prot5.root"); if (l == 0) { // if we cannot open the file, print an error message and return immediatly printf("Error: cannot open cors_plot.root!\n"); return; } l->ls(); TH2F *hgamrxry1 = (TH2F *)f->Get("hgamrxry"); if (hgamrxry == 0) { printf("Error getting an histogram from the file!\n"); return; } TH2F *hgamrxry2 = (TH2F *)g->Get("hgamrxry"); if (hgamrxry == 0) { printf("Error getting an histogram from the file!\n"); return; } TH2F *hgamrxry3 = (TH2F *)h->Get("hgamrxry"); if (hgamrxry == 0) { printf("Error getting an histogram from the file!\n"); return; } TH2F *hgamrxry4 = (TH2F *)i->Get("hgamrxry"); if (hgamrxry == 0) { printf("Error getting an histogram from the file!\n"); return; } TH2F *hgamrxry5 = (TH2F *)l->Get("hgamrxry"); if (hgamrxry == 0) { printf("Error getting an histogram from the file!\n"); return; } TCanvas *c2 = new TCanvas("c2","hists with different scales",1280,1024); // c2->Divide(1,2,3,4,5); c2->Divide(3,2); float xmin= -5e6; float xmax= 5e6; float ymin= -8e3; float ymax= 8e3; hgamrxry1->SetTitle("Profilo degli adroni nell'EAS- Set 1"); hgamrxry1->GetXaxis()->SetLimits(xmin, xmax); hgamrxry1->GetYaxis()->SetLimits(ymin, ymax); hgamrxry2->SetTitle("Profilo degli adroni nell'EAS- Set 2"); hgamrxry2->GetXaxis()->SetLimits(xmin, xmax); hgamrxry2->GetYaxis()->SetLimits(ymin, ymax); hgamrxry3->SetTitle("Profilo degli adroni nell'EAS- Set 3"); hgamrxry3->GetXaxis()->SetLimits(xmin, xmax); hgamrxry3->GetYaxis()->SetLimits(ymin, ymax); hgamrxry4->SetTitle("Profilo degli adroni nell'EAS- Set 4"); hgamrxry4->GetXaxis()->SetLimits(xmin, xmax); hgamrxry4->GetYaxis()->SetLimits(ymin, ymax); hgamrxry5->SetTitle("Profilo degli adroni nell'EAS- Set 5"); hgamrxry5->GetXaxis()->SetLimits(xmin, xmax); hgamrxry5->GetYaxis()->SetLimits(ymin, ymax); //gStyle->SetPalette(kBird); c2->cd(1); hgamrxry1->Draw("COLZ"); c2->cd(2); hgamrxry2->Draw("COLZ"); c2->cd(3); hgamrxry3->Draw("COLZ"); c2->cd(4); hgamrxry4->Draw("COLZ"); c2->cd(5); hgamrxry5->Draw("COLZ"); gROOT->ProcessLine("gROOT->SetBatch()"); c2.Print("G:/cors/prot/prot_5set_gamma_rxry.pdf"); delete c2; gROOT->ProcessLine("gROOT->SetBatch(kFALSE)"); }