diff --git a/macros_W/README.md b/macros_W/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4b51ab04d0f90cb45d644bc700a88f10a5a1f54d --- /dev/null +++ b/macros_W/README.md @@ -0,0 +1,17 @@ +Macros related to Wuppertal tests of NeuRad prototype. + + +cal1ePeaks.cxx: + Script for calibration of amplitudes to 1e units. Input and output file should be set in the script. + +showHists.cxx: + Show 2D histograms with voltage calibration (used for non-linearity estimation of electronics) for 680 pF. + +extract1DHists.cxx: + Extract TH1D's from TH2D (voltage calibration) for 680 pF and write them as ch* into output ROOT file. It is almost useless script as far as drawing of histograms is realized in the following script. + +calPeaksVoltage.cxx: + Open file with histograms created by "extract1DHists.cxx", draw all 1D histograms and search for peaks corresponding to voltage. The root file containing 64 graphs calibration the non-linear behaviour of the electronics is on the output. + +graphToHist.cxx: + It was probably some testing of the conversion of graph to histogram. diff --git a/macros_W/cal1ePeaks.cxx b/macros_W/cal1ePeaks.cxx new file mode 100644 index 0000000000000000000000000000000000000000..cc0a9818e0758c81d39340b525735702f6f1d479 --- /dev/null +++ b/macros_W/cal1ePeaks.cxx @@ -0,0 +1,142 @@ +//script for calibration of each pixel of MAPMT +//#include + +using namespace std; + +void cal1ePeaks() +{ + + TString location = "../data/WPT_tests"; + + //name of input root file + TString iFile; + iFile.Form("%s/680pF_11okt_measure_with_opt_grease/HV1000_Sci_mounted_Am241in_front_10cm_thr32_nxtrim1_11oct_30min_0000.root", location.Data()); +// iFile.Form("%s/680pF_11okt_measure_with_opt_grease/HV950_Sci_mounted_Am241in_front_10cm_thr32_nxtrim1_11oct_30min_0000.root", location.Data()); +// iFile.Form("%s/680pF_11okt_measure_with_opt_grease/HV900_Sci_mounted_Am241in_front_10cm_thr28_nxtrim1_11oct_30min_0000.root", location.Data()); + + //name of file with calibration parameters + TString oFile = "cal1e_HV1000.par"; +// TString oFile = "cal1e_HV950.par"; +// TString oFile = "cal1e_HV900.par"; + + //name of file with peak ranges + TString pFile = "peaksRange1000HV.par"; +// TString pFile = "../parameters/peaksRange950HV.par"; +// TString pFile = ""; + + ofstream calFile; + calFile.open(oFile.Data()); + if (calFile.is_open()) { + Info("calPeaks", "Calibration parameters will be saved in %s.", oFile.Data()); + } else { + Error("calPeaks", "File %s was not open.", oFile.Data()); + return; + } + + //2D histogram to be calibrated + TString histName = "adcAllWoBaseline"; + + //xaxis range + const Double_t xmin = 0; + const Double_t xmax = 600.; + + Bool_t useParFile = 1; + if ( pFile.Length() == 0 ) useParFile = 0; + + ifstream parFile; + if (useParFile) { + parFile.open(pFile.Data()); + if (!parFile.is_open()) { + Error("calPeaks", "File with input parameters %s was not open.", pFile.Data()); + return; + } + Info("calPeaks", "File with peak ranges %s will be loaded.", pFile.Data()); + } + + +/////////////////////////////////////////////////////////// + TFile *fr = new TFile(iFile.Data()); + + TH2D *h2 = (TH2D*)fr->Get(histName.Data()); + + TCanvas *c1 = new TCanvas(); + c1->Divide(2,2); + + c1->cd(1); + h2->Draw(); + + c1->cd(2); + TH1D *h1 = h2->ProjectionY("ch1", 64, 64); + h1->Draw(); + + c1->cd(4); + TH1D *h1 = h2->ProjectionY("ch2", 1, 1); + h1->Draw(); + + c1->cd(3); +// h2->SetShowProjection(); + + + TH1D *hTemp; + TString hName; + TString hTitle; + + + //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); + } + + + string line; + Int_t ch = 0, min = 0, max = 0; + + for (Int_t i = 0; i < 64; i++) { + hName.Form("ch%d", i); + hTitle.Form("channel %d", i); + hTemp = h2->ProjectionY(hName.Data(), i+1, i+1); + hTemp->SetTitle(hTitle.Data()); + hTemp->GetXaxis()->SetRangeUser(0, 2000); + Int_t cNumber = i/pads; + cWork[cNumber]->cd(i-pads*cNumber+1); + hTemp->Draw(); + hTemp->GetXaxis()->SetRangeUser(xmin, xmax); + if (useParFile) { + std::getline(parFile, line); + std::istringstream(line,ios_base::in) >> ch >> min >> max; + cout << i << "\t" << min << "\t" << max << endl; + hTemp->Fit("gaus", "q", "", min, max); + } else + hTemp->Fit("gaus", "q", "", 100, 400); + calFile << i << "\t" << gaus->GetParameter(1) << endl; + } + + calFile.close(); + +} + +void fillParFilePreliminary(Int_t noChannels, Int_t min, Int_t max) { + + ofstream parFile; + parFile.open("parTemplate.par"); + for (Int_t i = 0; i < noChannels; i++) { + parFile << i << "\t" << min << "\t" << max << endl; + } + + parFile.close(); + +} diff --git a/macros_W/calPeaksVoltage.cxx b/macros_W/calPeaksVoltage.cxx new file mode 100644 index 0000000000000000000000000000000000000000..03f54b66ad87485772a046731e3c4425fe5f5064 --- /dev/null +++ b/macros_W/calPeaksVoltage.cxx @@ -0,0 +1,110 @@ +#include +#include // std::vector +#include + +void calPeaksVoltage() +{ + + TString inFile = "histOutput680.root"; +// TString inFile = "histOutput.root"; + + TString outFile = "calGraphs680.root"; +// TString outFile = "calGraphs.root"; + + TFile *fr = new TFile(inFile.Data()); + if (fr->IsZombie()) { + Error("calPeaksVoltage.cxx", "File %s was not open correctly.", inFile.Data()); + return; + } + + TH1D *hch[64]; + TGraph *gr[64]; + TString hName; + + for (Int_t i = 0; i <64; i++) { + hName.Form("ch%d", i); + hch[i] = (TH1D*)fr->Get(hName.Data()); + } + + + + TString cName; + TString cTitle; + + TCanvas *cWork[11]; + for (Int_t i = 0; i < 11; i++) { + cWork[i] = new TCanvas(); + cName.Form("can%d", i); + cTitle.Form("canvas %d", i); + cWork[i]->SetName(cName.Data()); + cWork[i]->SetTitle(cTitle.Data()); + cWork[i]->Divide(2, 3); + cWork[i]->cd(1); + } + + + + TFile fw(outFile.Data(), "RECREATE"); + if (fw.IsZombie()) { + Error("calPeaksVoltage.cxx", "File %s was not open correctly.", outFile.Data()); + return; + } + TString gName; + + for (Int_t i = 0; i < 64; i++) { + hch[i]->GetXaxis()->SetRangeUser(100, 2000); + Int_t cNumber = i/6; + cWork[cNumber]->cd(i-6*cNumber+1); + hch[i]->Draw(); + if (i!=42) gr[i] = searchPeaks(hch[i]); + if (i == 42) { + gr[i] = searchPeaks(hch[i], 0.08); + } + fw.cd(); + gName.Form("gcal%d", i); + gr[i]->SetName(gName.Data()); + gr[i]->Write(); + } + + fw.Close(); + + return; +} + +TGraph* searchPeaks(TH1D *hInput, Double_t relHight = 0.05) { + + Double_t voltage[] = {0.5, 1., 1.5, 1.75, 2., 2.25, 2.5, 2.75, 3., 3.25, 0.}; +// const Double_t corr1e = 1.18; +// const Double_t corr1e = 1.; + + hInput->GetXaxis()->SetRangeUser(100., 2000.); + + hInput->ShowPeaks(2., "", relHight); + + TList *functions = hInput->GetListOfFunctions(); + TPolyMarker *pm = (TPolyMarker*)functions->FindObject("TPolyMarker"); + + const Int_t noPeaks = pm->GetN(); + Double_t *energy = pm->GetX(); + std::vector vEnergy; + + for (Int_t i = 0; i < pm->GetN(); i++) { + vEnergy.push_back(energy[i]); + } + + std::sort(vEnergy.begin(), vEnergy.end()); + + TGraph *gr = new TGraph(noPeaks+1); + const Double_t delta_vEnergy = 2*vEnergy[0] - vEnergy[1]; + + vEnergy.push_back(delta_vEnergy); + gr->SetPoint(0, vEnergy[10], voltage[10]/voltage[0]*(vEnergy[0]-delta_vEnergy)); + if (noPeaks == 10) Info("searchPeaks", "%d peaks found in hist %s", noPeaks, hInput->GetName()); + else Error("searchPeaks", "%d peaks found in hist %s", noPeaks, hInput->GetName()); + for (Int_t i = 0; i < noPeaks; i++) { + if (i>=10) break; + gr->SetPoint(i+1, vEnergy[i], voltage[i]/voltage[0]*(vEnergy[0]-delta_vEnergy)); + } + + return gr; +} diff --git a/macros_W/extract1DHists.cxx b/macros_W/extract1DHists.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d8622c655d0da2148522b82b144a07963dc9013c --- /dev/null +++ b/macros_W/extract1DHists.cxx @@ -0,0 +1,154 @@ +void extract1DHists() +{ + + //output in channel units +// TString outputFile = "histOutput.root"; +// TString outputFile = "histOutput680.root"; + + //output in 1e units + TString outputFile = "histOutput1e.root"; + +// TString histName = "adcAllWoBaseline"; + TString histName = "adcAllWoBaseline"; + + TString location = "../data/WPT_tests"; +// TString suffix = ""; + TString suffix = "_HV1000"; + + TString f0, f1, f2, f3, f4, + f10, f11, f12, f13, + f20, f21, f22; + + f0.Form("%s/680pF_10okt_chargeCalib/pedestals_10okt_withGenerator_woPMT_scan_0000%s.root", location.Data(), suffix.Data()); + f1.Form("%s/680pF_10okt_chargeCalib/pedestals_10okt_withGenerator_woPMT_scan_0001%s.root", location.Data(), suffix.Data()); + f2.Form("%s/680pF_10okt_chargeCalib/pedestals_10okt_withGenerator_woPMT_scan_0002%s.root", location.Data(), suffix.Data()); + f3.Form("%s/680pF_10okt_chargeCalib/pedestals_10okt_withGenerator_woPMT_scan_0003%s.root", location.Data(), suffix.Data()); + f4.Form("%s/680pF_10okt_chargeCalib/pedestals_10okt_withGenerator_woPMT_scan_0004%s.root", location.Data(), suffix.Data()); + + f10.Form("%s/680pF_11okt_chargeCalib/pedestals_11okt_withGenerator_woPMT_scan_0000%s.root", location.Data(), suffix.Data()); + f11.Form("%s/680pF_11okt_chargeCalib/pedestals_11okt_withGenerator_woPMT_scan_0001%s.root", location.Data(), suffix.Data()); + f12.Form("%s/680pF_11okt_chargeCalib/pedestals_11okt_withGenerator_woPMT_scan_0002%s.root", location.Data(), suffix.Data()); + f13.Form("%s/680pF_11okt_chargeCalib/pedestals_11okt_withGenerator_woPMT_scan_0003%s.root", location.Data(), suffix.Data()); + + f20.Form("%s/680pF_14okt_measure_chargeCalib/pedestals_14oct_Generator_thr35_woPMT_680pF_0000%s.root", location.Data(), suffix.Data()); + f21.Form("%s/680pF_14okt_measure_chargeCalib/pedestals_14oct_Generator_thr35_woPMT_680pF_0001%s.root", location.Data(), suffix.Data()); + f22.Form("%s/680pF_14okt_measure_chargeCalib/pedestals_14oct_Generator_thr35_woPMT_680pF-a_0000%s.root", location.Data(), suffix.Data()); + + TFile *fr0 = new TFile(f0.Data()); + TFile *fr1 = new TFile(f1.Data()); + TFile *fr2 = new TFile(f2.Data()); + TFile *fr3 = new TFile(f3.Data()); + TFile *fr4 = new TFile(f4.Data()); + + TFile *fr10 = new TFile(f10.Data()); + TFile *fr11 = new TFile(f11.Data()); + TFile *fr12 = new TFile(f12.Data()); + TFile *fr13 = new TFile(f13.Data()); + + TFile *fr20 = new TFile(f20.Data()); + TFile *fr21 = new TFile(f21.Data()); + TFile *fr22 = new TFile(f22.Data()); + + if (fr0->IsZombie() || fr1->IsZombie() || fr2->IsZombie() || fr3->IsZombie() || fr4->IsZombie() + || fr10->IsZombie() || fr12->IsZombie() || fr12->IsZombie() || fr13->IsZombie() + || fr20->IsZombie() || fr21->IsZombie() || fr22->IsZombie()) { + Error("extract1DHists", "One of files was not open."); + return; + } + + TH2D *hraw0 = (TH2D*)fr0->Get(histName.Data()); + TH2D *hraw1 = (TH2D*)fr1->Get(histName.Data()); + TH2D *hraw2 = (TH2D*)fr2->Get(histName.Data()); + TH2D *hraw3 = (TH2D*)fr3->Get(histName.Data()); + TH2D *hraw4 = (TH2D*)fr4->Get(histName.Data()); + + TH2D *hraw10 = (TH2D*)fr10->Get(histName.Data()); + TH2D *hraw11 = (TH2D*)fr11->Get(histName.Data()); + TH2D *hraw12 = (TH2D*)fr12->Get(histName.Data()); + TH2D *hraw13 = (TH2D*)fr13->Get(histName.Data()); + + TH2D *hraw20 = (TH2D*)fr20->Get(histName.Data()); + TH2D *hraw21 = (TH2D*)fr21->Get(histName.Data()); + TH2D *hraw22 = (TH2D*)fr22->Get(histName.Data()); + TH2D *hSum2 = new TH2D(*hraw20); + hSum2->Add(hraw21); + hSum2->Add(hraw22); + + + +// extractHist() + +//return; + + TH2D *hSum = new TH2D(*hraw1); + hSum->Add(hraw3); + hSum->Add(hraw4); + hSum->Add(hraw11); + hSum->Add(hraw2); + hSum->Add(hraw1); + hSum->Add(hraw12); + + TCanvas *c1 = new TCanvas(); + c1->Divide(2,2); + + c1->cd(1); + hSum->GetXaxis()->SetRangeUser(0, 64); + hSum->Draw(); + + c1->cd(2); + hSum2->GetXaxis()->SetRangeUser(0, 64); + hSum2->Draw(); + + + + TFile *fw = new TFile(outputFile.Data(), "RECREATE"); + TH1D *hch[64]; + + for (Int_t i = 0; i < 64; i++) { + hch[i] = extractHist(hSum, i); + //file fr10 + if (i == 17 || i == 21 || i == 25 || i == 29 || i == 33 || i == 37 || i == 41 || i == 45) { + hch[i] = extractHist(hraw10, i); + } + //files fr2* + if (i == 9 || i == 12 || i == 13 || i == 14 || i == 26 || i == 31 || /*i == 42 ||*/ i == 45 || i == 53 || i == 60) { + hch[i] = extractHist(hSum2, i); + } + if (i == 42) { + hch[i]->Add( extractHist(hSum2, i) ); + } + fw->cd(); + hch[i]->Write(); + } + + fw->Close(); + + return; + +} + +TH1D* extractHist(TH2D *hInput, Int_t channel) { + + TH1D *hTemp; + TString hName; + TString hTitle; + + hName.Form("ch%d", channel); + hTitle.Form("channel %d", channel); + hTemp = hInput->ProjectionY(hName.Data(), channel+1, channel+1); + hTemp->SetTitle(hTitle.Data()); +// hTemp->GetXaxis()->SetRangeUser(0, 2000); +// hTemp->Fit("gaus", "", "", 100, 400); +// calFile << i << "\t" << gaus->GetParameter(1) << endl; +// Int_t cNumber = i/6; +// cout << cNumber << endl; +// cWork[cNumber]->cd(i-6*cNumber+1); +// hTemp->Draw(); + + + + + + return hTemp; + +} diff --git a/macros_W/graphToHist.cxx b/macros_W/graphToHist.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e5042bee3df915d66fdfac1a352c4402885f0b63 --- /dev/null +++ b/macros_W/graphToHist.cxx @@ -0,0 +1,58 @@ +using namespace std; + +void graphToHist() +{ + + TFile fr("calGraphs680.root"); + + TGraph *fGraph[64]; + + TList *gList = fr.GetListOfKeys(); + const Int_t nEntries = gList->GetEntries(); + if (nEntries!=64) { + Error("cls_Calibrator::ImportGraphs", "Something wrong, only %d graphs found instead of 64", nEntries); + return; + } + + TString gName; + for (Int_t i = 0; i < nEntries; i++) { + gName.Form("gcal%d", i); + fGraph[i] = (TGraph*)fr.Get(gName.Data()); + if ( fGraph[i] == 0) { + Error("cls_Calibrator::ImportGraphs", "Graph %s was not found in file %s", gName.Data(), fr.GetName()); + fr.Close(); + return; + } + }//for + + fr.Close(); + + TH1D* fLUT[64]; + +//LUT function + + TString hName; + TString hTitle; + const Double_t minX = -50.; + const Double_t maxX = 4096.; + + Double_t xmin = 0; + Double_t xmax = 0; + Double_t ymin = 0; + Double_t ymax = 0; + + for (Int_t i = 0; i < 64; i++) { + hName.Form("calHist%d", i); + hTitle.Form("do we need it for channel %d?", i); + fLUT[i] = new TH1D(hName.Data(), hTitle.Data(), maxX - minX, minX, maxX); +// fGraph[i]->ComputeRange(&xmin, &ymin, &xmax, &ymax); + fGraph[i]->ComputeRange(xmin, ymin, xmax, ymax); + cout << xmin << "\t" << xmax << endl; + for (Int_t j = xmin; j <= xmax; j++) { + fLUT[i]->SetBinContent(j, fGraph[i]->Eval(j) ); + } + }//for + + + +} diff --git a/macros_W/opentree.cxx b/macros_W/opentree.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b8e68a5085d57acf6be6202056bf0b20f016c163 --- /dev/null +++ b/macros_W/opentree.cxx @@ -0,0 +1,7 @@ +void opentree() +{ + + TFile *fr = new TFile("~/zpracovani/NeuRad/NeuRad_root_data/pedestals_10okt_withGenerator_woPMT_scan_0000_tree.root"); + TTree *tr = (TTree*)fr->Get("theTree"); + +} diff --git a/macros_W/showHistOutput.cxx b/macros_W/showHistOutput.cxx new file mode 100644 index 0000000000000000000000000000000000000000..9e0ff7eaaa7415db3730201ee4f5daad035df400 --- /dev/null +++ b/macros_W/showHistOutput.cxx @@ -0,0 +1,47 @@ +void showHistOutput() +{ + TFile *fr = new TFile("histOutput.root"); + + TH1D *hch[64]; + TString histName; + + for (Int_t i = 0; i<64; i++) { + histName.Form("ch%d", i); + hch[i] = (TH1D*)fr->Get(histName.Data()); + } + + //canvases to show 1D histograms + TString cName; + TString cTitle; + + const Int_t pads = 9; + const Int_t noCanvas = 64/pads+1; + + const Double_t xmin = 100; + const Double_t xmax = 2000.; + + 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); + } + + for (Int_t i = 0; i < 64; i++) { + histName.Form("ch%d", i); +// hTitle.Form("channel %d", i); +// hTemp = h2->ProjectionY(hName.Data(), i+1, i+1); +// hTemp->SetTitle(hTitle.Data()); +// hTemp->GetXaxis()->SetRangeUser(0, 2000); + Int_t cNumber = i/pads; + cWork[cNumber]->cd(i-pads*cNumber+1); + hch[i]->Draw(); + hch[i]->GetXaxis()->SetRangeUser(xmin, xmax); + } + +} diff --git a/macros_W/showHists.cxx b/macros_W/showHists.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e88612b08e060d2cfc57ccf003cf04085528d551 --- /dev/null +++ b/macros_W/showHists.cxx @@ -0,0 +1,143 @@ +//#include "TString.h" + +void showHists() +{ + + TString location = "../data/WPT_tests"; + + TString f0, f1, f2, f3, f4, + f10, f11, f12, f13, + f20, f21, f22; + + f0.Form("%s/680pF_10okt_chargeCalib/pedestals_10okt_withGenerator_woPMT_scan_0000.root", location.Data()); + f1.Form("%s/680pF_10okt_chargeCalib/pedestals_10okt_withGenerator_woPMT_scan_0001.root", location.Data()); + f2.Form("%s/680pF_10okt_chargeCalib/pedestals_10okt_withGenerator_woPMT_scan_0002.root", location.Data()); + f3.Form("%s/680pF_10okt_chargeCalib/pedestals_10okt_withGenerator_woPMT_scan_0003.root", location.Data()); + f4.Form("%s/680pF_10okt_chargeCalib/pedestals_10okt_withGenerator_woPMT_scan_0004.root", location.Data()); + + f10.Form("%s/680pF_11okt_chargeCalib/pedestals_11okt_withGenerator_woPMT_scan_0000.root", location.Data()); + f11.Form("%s/680pF_11okt_chargeCalib/pedestals_11okt_withGenerator_woPMT_scan_0001.root", location.Data()); + f12.Form("%s/680pF_11okt_chargeCalib/pedestals_11okt_withGenerator_woPMT_scan_0002.root", location.Data()); + f13.Form("%s/680pF_11okt_chargeCalib/pedestals_11okt_withGenerator_woPMT_scan_0003.root", location.Data()); + + f20.Form("%s/680pF_14okt_measure_chargeCalib/pedestals_14oct_Generator_thr35_woPMT_680pF_0000.root", location.Data()); + f21.Form("%s/680pF_14okt_measure_chargeCalib/pedestals_14oct_Generator_thr35_woPMT_680pF_0001.root", location.Data()); + f22.Form("%s/680pF_14okt_measure_chargeCalib/pedestals_14oct_Generator_thr35_woPMT_680pF-a_0000.root", location.Data()); + + TFile *fr0 = new TFile(f0.Data()); + TFile *fr1 = new TFile(f1.Data()); + TFile *fr2 = new TFile(f2.Data()); + TFile *fr3 = new TFile(f3.Data()); + TFile *fr4 = new TFile(f4.Data()); + + TFile *fr10 = new TFile(f10.Data()); + TFile *fr11 = new TFile(f11.Data()); + TFile *fr12 = new TFile(f12.Data()); + TFile *fr13 = new TFile(f13.Data()); + + TFile *fr20 = new TFile(f20.Data()); + TFile *fr21 = new TFile(f21.Data()); + TFile *fr22 = new TFile(f22.Data()); + +// TH2D *hraw0 = (TH2D*)fr0->Get("cal1eAdcAllWoBaseline"); +// TH2D *hraw1 = (TH2D*)fr1->Get("cal1eAdcAllWoBaseline"); +// TH2D *hraw2 = (TH2D*)fr2->Get("cal1eAdcAllWoBaseline"); +// TH2D *hraw3 = (TH2D*)fr3->Get("cal1eAdcAllWoBaseline"); +// TH2D *hraw4 = (TH2D*)fr4->Get("cal1eAdcAllWoBaseline"); + +// TH2D *hraw10 = (TH2D*)fr10->Get("cal1eAdcAllWoBaseline"); +// TH2D *hraw11 = (TH2D*)fr11->Get("cal1eAdcAllWoBaseline"); +// TH2D *hraw12 = (TH2D*)fr12->Get("cal1eAdcAllWoBaseline"); +// TH2D *hraw13 = (TH2D*)fr13->Get("cal1eAdcAllWoBaseline"); + + TH2D *hraw0 = (TH2D*)fr0->Get("adcAllWoBaseline"); + TH2D *hraw1 = (TH2D*)fr1->Get("adcAllWoBaseline"); + TH2D *hraw2 = (TH2D*)fr2->Get("adcAllWoBaseline"); + TH2D *hraw3 = (TH2D*)fr3->Get("adcAllWoBaseline"); + TH2D *hraw4 = (TH2D*)fr4->Get("adcAllWoBaseline"); + + TH2D *hraw10 = (TH2D*)fr10->Get("adcAllWoBaseline"); + TH2D *hraw11 = (TH2D*)fr11->Get("adcAllWoBaseline"); + TH2D *hraw12 = (TH2D*)fr12->Get("adcAllWoBaseline"); + TH2D *hraw13 = (TH2D*)fr13->Get("adcAllWoBaseline"); + + TH2D *hraw20 = (TH2D*)fr20->Get("adcAllWoBaseline"); + TH2D *hraw21 = (TH2D*)fr21->Get("adcAllWoBaseline"); + TH2D *hraw22 = (TH2D*)fr22->Get("adcAllWoBaseline"); + + TCanvas *c1 = new TCanvas(); + c1->Divide(3,2); + + c1->cd(1); + hraw0->GetXaxis()->SetRangeUser(0, 64); + hraw0->Draw(); + + c1->cd(2); + hraw1->GetXaxis()->SetRangeUser(0, 64); + hraw1->Draw(); + + c1->cd(3); + hraw2->GetXaxis()->SetRangeUser(0, 64); + hraw2->Draw(); + + c1->cd(4); + hraw3->GetXaxis()->SetRangeUser(0, 64); + hraw3->Draw(); + + c1->cd(5); + hraw4->GetXaxis()->SetRangeUser(0, 64); + hraw4->Draw(); + + c1->cd(6); + TH2D *hSum = new TH2D(*hraw1); + hSum->Add(hraw3); + hSum->Add(hraw4); + hSum->Add(hraw11); + hSum->Add(hraw2); + hSum->Add(hraw1); + hSum->Add(hraw12); + hSum->Draw(); + + + TCanvas *c2 = new TCanvas(); + c2->Divide(2,2); + + c2->cd(1); + hraw10->GetXaxis()->SetRangeUser(0, 64); + hraw10->Draw(); + + c2->cd(2); + hraw11->GetXaxis()->SetRangeUser(0, 64); + hraw11->Draw(); + + c2->cd(3); + hraw12->GetXaxis()->SetRangeUser(0, 64); + hraw12->Draw(); + + c2->cd(4); + hraw13->GetXaxis()->SetRangeUser(0, 64); + hraw13->Draw(); + + + TCanvas *c3 = new TCanvas(); + c3->Divide(2,2); + + c3->cd(1); + hraw20->GetXaxis()->SetRangeUser(0, 64); + hraw20->Draw(); + + c3->cd(2); + hraw21->GetXaxis()->SetRangeUser(0, 64); + hraw21->Draw(); + + c3->cd(3); + hraw22->GetXaxis()->SetRangeUser(0, 64); + hraw22->Draw(); + + c3->cd(4); + TH2D *hSum2 = new TH2D(*hraw20); + hSum2->Add(hraw21); + hSum2->Add(hraw22); + hSum2->Draw(); + +}