//#include "TMarker.h" using namespace std; void figures() { const Bool_t pedestals = 0; const Bool_t nlCorr = 0; const Bool_t pedCorr = 0; const Bool_t calDemonstration = 0; const Bool_t pedTest = 1; if (pedestals) { TFile *frPed = new TFile("../data/WPT_tests/680pF_7okt/raw_data/TestTriggerMode_680pF_10minutes_7okt_0000.root"); TH2D *hPedRaw = (TH2D*)frPed->Get("adcAll"); TH2D *hPedA = (TH2D*)frPed->Get("adcAllWoBaseline"); TCanvas *c1 = new TCanvas("c1", "Pedestals raw"); hPedRaw->GetXaxis()->SetRangeUser(0, 64); hPedRaw->GetXaxis()->SetTitle("PMT pixel"); hPedRaw->GetYaxis()->SetTitle("A_{raw}"); hPedRaw->GetYaxis()->SetTitleOffset(1.38); hPedRaw->Draw(); c1->SaveAs("figures/pedestalsRaw.png"); TCanvas *c2 = new TCanvas("c2", "Pedestals"); hPedA->GetXaxis()->SetRangeUser(0, 64); hPedA->GetXaxis()->SetTitle("PMT pixel"); hPedA->GetYaxis()->SetTitle("A"); hPedA->GetYaxis()->SetTitleOffset(1.38); hPedA->Draw(); c2->SaveAs("figures/pedestalsCorr.png"); } if (nlCorr) { TFile *frCorr = new TFile("objects/histOutput680.root"); TH1D *hPeaks = (TH1D*)frCorr->Get("ch15"); TCanvas *c3 = new TCanvas("c3", "Voltage on 680pF"); hPeaks->SetAxisRange(100, 2000); hPeaks->SetXTitle("A"); hPeaks->SetTitleSize(0.06); hPeaks->SetTitleOffset(0.73); hPeaks->GetXaxis()->CenterTitle(); hPeaks->SetYTitle("Events"); hPeaks->Draw(); c3->SaveAs("figures/voltageAmplitudes.png"); TFile *frGraph = new TFile("objects/calGraphs680.root"); TGraph *gCorr = (TGraph*)frGraph->Get("gcal15"); TCanvas *c4 = new TCanvas("c4", "Dimensionless correction"); gCorr->GetXaxis()->SetRangeUser(-100, 1800); gCorr->GetXaxis()->CenterTitle(); gCorr->GetXaxis()->SetTitle("A"); gCorr->GetXaxis()->SetTitleSize(0.06); gCorr->GetXaxis()->SetTitleOffset(0.76); gCorr->GetYaxis()->CenterTitle(); gCorr->GetYaxis()->SetTitle("A'"); gCorr->GetYaxis()->SetTitleSize(0.06); gCorr->GetYaxis()->SetTitleOffset(0.76); gCorr->SetLineColor(kBlue); gCorr->SetLineWidth(4); gCorr->Draw(); c4->SaveAs("figures/calGraph.png"); } if (pedCorr) { TFile *frPed = new TFile("../data/WPT_tests/680pF_7okt/raw_data/TestTriggerMode_680pF_10minutes_7okt_0000.root"); TH2D *hPedAnl = (TH2D*)frPed->Get("fhAdcAllWoBaselineNonLinear"); TH2D *hPedAnlCorr = (TH2D*)frPed->Get("fhAdcAllWoBaselineNLcorr"); TCanvas *c5 = new TCanvas("c5", "Position of corrected pedestals"); hPedAnl->GetXaxis()->SetRangeUser(0, 64); hPedAnl->GetXaxis()->SetTitle("PMT pixel"); hPedAnl->GetXaxis()->CenterTitle(); hPedAnl->GetYaxis()->SetRangeUser(-50, 200); hPedAnl->GetYaxis()->SetTitle("A'"); hPedAnl->GetYaxis()->SetTitleSize(0.06); hPedAnl->GetYaxis()->SetTitleOffset(0.8); hPedAnl->GetYaxis()->CenterTitle(); hPedAnl->Draw("col"); c5->SaveAs("figures/pedestalsNL.png"); TCanvas *c6 = new TCanvas("c6", "Corrected non-linear pedestals "); // hPedAnlCorr->GetXaxis()->SetRangeUser(0, 64); hPedAnlCorr->GetXaxis()->SetTitle("PMT pixel"); hPedAnlCorr->GetYaxis()->SetRangeUser(-50, 200); hPedAnlCorr->GetYaxis()->SetTitle("A*"); hPedAnlCorr->GetYaxis()->SetTitleSize(0.06); hPedAnlCorr->GetYaxis()->SetTitleOffset(0.8); hPedAnlCorr->GetYaxis()->CenterTitle(); hPedAnlCorr->Draw("col"); c6->SaveAs("figures/pedestalsNLcorr.png"); } if (calDemonstration) { TFile *frCal680 = new TFile("../data/WPT_tests/680pF_11okt_measure_with_opt_grease/HV1000_Sci_mounted_Am241in_front_10cm_thr32_nxtrim1_11oct_30min_0000_cal.root"); TH1D *hRaw = (TH1D*)frCal680->Get("adcAllSum"); TH1D *hCal = (TH1D*)frCal680->Get("calAdcAllSum"); TH1D *hCorr1 = (TH1D*)frCal680->Get("fhAdcAllSumWoBaselineNonLinear"); TH1D *hCorr2 = (TH1D*)frCal680->Get("fhAdcAllSumWoBaselineNLcorr"); TCanvas *c7 = new TCanvas("c7", "Demonstration of calibration"); c7->Divide(2, 2); c7->cd(1); hCorr1->Draw(); c7->cd(2); hRaw->Draw(); c7->cd(3); hCorr2->Draw(); c7->cd(4); hCal->Draw(); } if (pedTest) { TFile *frGraph = new TFile("../parameters/calGraphs680.root"); ifstream iPeds; iPeds.open("parameters/correctedPedsPositions.par"); //canvases for calibration TString cName; TString cTitle; const Int_t pads = 9; const Int_t noCanvas = 64/pads+1; TCanvas *cWork[noCanvas]; for (Int_t i = 0; i < noCanvas; i++) { cName.Form("can%d", i); cTitle.Form("canvas %d", i); cWork[i] = new TCanvas(cName.Data(), cTitle.Data(), 0, 0, 960, 700); // cWork[i]->SetName(cName.Data()); // cWork[i]->SetTitle(cTitle.Data()); if (pads == 6) cWork[i]->Divide(2, 3); if (pads == 9) cWork[i]->Divide(3, 3); cWork[i]->cd(1); } Int_t pixel = -1, ped = 0; TString gName; // TGraph *gr[64]; TGraph *gr; for (Int_t i = 0; i < 64; i++) { iPeds >> pixel >> ped; Int_t cNumber = i/pads; cWork[cNumber]->cd(i-pads*cNumber+1); gName.Form("gcal%d", i); gr = (TGraph*)frGraph->Get(gName.Data()); gr->GetXaxis()->SetRangeUser(-30, 30); gr->GetXaxis()->SetTitle("A"); gr->GetXaxis()->CenterTitle(); gr->GetXaxis()->SetTitleSize(0.08); gr->GetXaxis()->SetTitleOffset(0.5); gr->GetYaxis()->SetRangeUser(0, 50); gr->GetYaxis()->SetTitle("A'"); gr->GetYaxis()->CenterTitle(); gr->GetYaxis()->SetTitleSize(0.08); gr->GetYaxis()->SetTitleOffset(0.6); gr->Draw(); TMarker *point = new TMarker(0, ped, 3); point->SetMarkerSize(3); point->SetMarkerColor(kRed); point->Draw(); // cout << pixel << "\t" << gName.Data() << endl; } cWork[2]->SaveAs("figures/pedestalsTest.png"); } }