From 8bd7b5f0a1c17ea0297e2aa8b6bf8d4780c105d0 Mon Sep 17 00:00:00 2001 From: vratislav3 Date: Mon, 24 Oct 2016 20:33:52 +0300 Subject: [PATCH] Probably all functionality of CsI calibration works in newArch. --- AculCalib/AculCalPars.h | 18 +- AculCalib/AculCalParsScint.cpp | 33 +- AculCalib/AculCalParsScint.h | 4 +- AculCalib/AculCalib.cpp | 15 + AculCalib/AculCalib.h | 2 + AculCalib/AculCalibScint.cpp | 291 +++++++++++++++++- AculCalib/AculCalibScint.h | 43 ++- .../calibration_CsI/calibrationSQ13Alpha.cxx | 1 + macros/myMacros/parTest.cxx | 19 +- 9 files changed, 390 insertions(+), 36 deletions(-) diff --git a/AculCalib/AculCalPars.h b/AculCalib/AculCalPars.h index 02a65a5..6246de3 100644 --- a/AculCalib/AculCalPars.h +++ b/AculCalib/AculCalPars.h @@ -16,6 +16,7 @@ #include "TString.h" #include "TArrayD.h" #include "TArrayI.h" +#include "TCutG.h" //todo ommit this constant #define NOCALFILES 5 @@ -58,17 +59,20 @@ public: //getters const char* GetParFileName() {return fParFileName.Data();} // Int_t GetNoCrystals() {return fNoCrystals;} -// const char* GetDetName() {return fDetName.Data();} -// const char* GetParticleName() {return fPartName.Data();} + virtual const char* GetDetName() {return 0;} + virtual const char* GetParticleName() {return 0;} virtual Int_t GetNoRawFiles() {return 0;}; virtual const char* GetFileName(Int_t i) {return 0;}; // const char* GetCutName(Int_t i); -// Int_t GetNoEPoints() {return fEnergyPoints;} -// Double_t GetCalEnergy(Int_t i); + virtual Int_t GetNoEPoints() {return 0;} + virtual Double_t GetCalEnergy(Int_t i) {return 0.;}; virtual const char* GetCutsFileName() {return 0;} - Int_t GetNoCuts() {return 0;} -// Int_t GetMinChannel(Int_t energy, Int_t crystal); -// Int_t GetMaxChannel(Int_t energy, Int_t crystal); + virtual Int_t GetNoCuts() {return 0;} + virtual TCutG* GetCut(Int_t i) {return 0;}; + virtual TCutG* GetCut(const char* cutName) {return 0;}; +// virtual TCutG* GetCutName(Int_t i) {return 0;}; + virtual Int_t GetMinChannel(Int_t energy, Int_t crystal) {return 0;}; + virtual Int_t GetMaxChannel(Int_t energy, Int_t crystal) {return 0;}; void SetParFileName(const char* parFile) {fParFileName = parFile;} diff --git a/AculCalib/AculCalParsScint.cpp b/AculCalib/AculCalParsScint.cpp index add39f1..1e1da1f 100644 --- a/AculCalib/AculCalParsScint.cpp +++ b/AculCalib/AculCalParsScint.cpp @@ -204,6 +204,32 @@ const char* AculCalParsScint::GetCutName(Int_t i) { return fCutName[i].Data(); } +TCutG* AculCalParsScint::GetCut(Int_t i) { + if ( i >= (Int_t)fCuts.size() ) { + cerr << "\"AculCalParsScint::GetCut\" index i cannot be higher than " << fCuts.size() - 1 << endl; + return 0; + } + return &fCuts[i]; +} + +TCutG* AculCalParsScint::GetCut(const char* cutName) { + +// TClonesArray cutsCol; +// +// for (Int_t i = 0; i < nCuts; i++) { +// cutsCol[i] = (TCutG*)fCuts->Get(cutNames[i]); +// } + const TString cName = cutName; + + for (Int_t i = 0; i <= (Int_t)fCuts.size(); i++) { + if (cName.EqualTo(fCutName[i])) { return &fCuts[i]; } + } + + + cerr << "\"AculCalParsScint::GetCut\" cut \"" << cutName << "\" was not found." << endl; + return 0; +} + Double_t AculCalParsScint::GetCalEnergy(Int_t i) { if ( i > (Int_t)fE.size()-1 ) { @@ -262,9 +288,12 @@ void AculCalParsScint::LoadCuts() { for (Int_t i = 0; i < (Int_t)fCutName.size(); i++) { TCutG *currentCut = (TCutG*)cutFile.Get(fCutName[i]); - if (currentCut) { - fCuts.push_back(*currentCut); + if (!currentCut) { + cout << "\"AculCalParsScint::LoadCuts\" Cut \"" << fCutName[i] + << "\" was not found in file " << fCutsFileName << "." << endl; + continue; } + fCuts.push_back(*currentCut); } } diff --git a/AculCalib/AculCalParsScint.h b/AculCalib/AculCalParsScint.h index 2a2be50..4d48574 100644 --- a/AculCalib/AculCalParsScint.h +++ b/AculCalib/AculCalParsScint.h @@ -9,7 +9,7 @@ #define ACULCALIB_ACULCALPARSSCINT_H_ #include "AculCalPars.h" -#include "TCutG.h" +//#include "TCutG.h" using std::cerr; @@ -60,6 +60,8 @@ public: Double_t GetCalEnergy(Int_t i); const char* GetCutsFileName() {return fCutsFileName.Data();} Int_t GetNoCuts() {return fNoCuts;} + TCutG* GetCut(Int_t i); + TCutG* GetCut(const char* cutName); Int_t GetMinChannel(Int_t energy, Int_t crystal); Int_t GetMaxChannel(Int_t energy, Int_t crystal); diff --git a/AculCalib/AculCalib.cpp b/AculCalib/AculCalib.cpp index 07d219f..0773c1f 100644 --- a/AculCalib/AculCalib.cpp +++ b/AculCalib/AculCalib.cpp @@ -68,3 +68,18 @@ Double_t AculCalib::GetB(Int_t i) { } return fB[i]; } + +void AculCalib::CanDivider(TCanvas *c, Int_t noPads, Int_t columns, Int_t rows) { + + c->Clear(); + + if (noPads == 16) { + c->Divide(4, 4); + return; + } + + if (rows != 0 && columns != 0) { + c->Divide(columns, rows); + return; + } +} diff --git a/AculCalib/AculCalib.h b/AculCalib/AculCalib.h index d48afc4..4a771ed 100644 --- a/AculCalib/AculCalib.h +++ b/AculCalib/AculCalib.h @@ -8,6 +8,7 @@ #include "TArrayD.h" #include "TString.h" +#include "TCanvas.h" #include "./AculCalPars.h" @@ -45,6 +46,7 @@ public: protected: //essential + void CanDivider(TCanvas *c, Int_t noPads, Int_t columns = 0, Int_t rows = 0); }; diff --git a/AculCalib/AculCalibScint.cpp b/AculCalib/AculCalibScint.cpp index 4c8fdfb..e48f604 100644 --- a/AculCalib/AculCalibScint.cpp +++ b/AculCalib/AculCalibScint.cpp @@ -38,6 +38,12 @@ void AculCalibScint::Init() { fPars = new AculCalParsScint(fParFileName.Data()); OpenFiles(); LoadTrees(); + + fHistFull.resize(fPars->GetNoRawFiles()); + fHistCut.resize(fPars->GetNoRawFiles()); + + fMeanPeakPos.resize(fPars->GetNoRawFiles()); + fMeanPeakRMS.resize(fPars->GetNoRawFiles()); // SetPars(); } @@ -55,7 +61,7 @@ void AculCalibScint::PrintTrees() { if (fTrees[i]) { printf("\tTree No. %d; File: %s; Name: %s\n", i, fTrees[i]->GetDirectory()->GetName(), fTrees[i]->GetName()); } else { - printf("\tTree No. %d was not loaded. Maximal number of trees is %d\n", i, NOCALFILES); + printf("\tTree No. %d was not loaded. Maximal number of trees is %d\n", i, fPars->GetNoRawFiles()); } } @@ -94,29 +100,43 @@ void AculCalibScint::LoadTrees() { } -void AculCalibScint::DrawVariable(const char* variable, Int_t tree, TCanvas *canvas, Int_t lowRange, Int_t upRange) { +TTree* AculCalibScint::GetTree(Int_t treeID) { + if (treeID >= fPars->GetNoRawFiles()) { + cerr << "\"AculCalibScint::DrawVariable\" Tree number " << treeID + << " cannot exist. Maximal treeID is " << fPars->GetNoRawFiles() - 1 << "." << endl; + return 0; + } -// if (!canvas) TCanvas *c = new TCanvas(); - if (!canvas) return; + return fTrees[treeID]; +} + +void AculCalibScint::DrawVariable(const char* variable, Int_t treeID, TCanvas *canvas, Int_t lowRange, Int_t upRange) { - canvas->Clear(); - canvas->Divide(4,4); + + if (!canvas) { + cerr << "\"AculCalibScint::DrawVariable\" Canvas pointer was NULL" << endl; + return; + } + + //todo change 16 to parameter + const Int_t nPads = 16; + CanDivider(canvas, nPads); TString canvasTitle; TString var; TString con; TTree *curTree = 0; - curTree = fTrees[tree]; + curTree = GetTree(treeID); if (!curTree) { - printf("AculCalibScint::DrawVariable: Tree No. %d was not found.\n", tree); + printf("AculCalibScint::DrawVariable: Tree No. %d was not found.\n", treeID); return; } - canvasTitle.Form("variable: %s; tree: %d", variable, tree); + canvasTitle.Form("variable: %s; tree: %d", variable, treeID); canvas->SetTitle(canvasTitle.Data()); - for (Int_t i = 0; i < 16; i++) { + for (Int_t i = 0; i < nPads; i++) { var.Form("%s[%d]", variable, i); con.Form("%s[%d]>%d && %s[%d]<%d", variable, i, lowRange, variable, i, upRange); canvas->cd(i+1); @@ -125,3 +145,254 @@ void AculCalibScint::DrawVariable(const char* variable, Int_t tree, TCanvas *can } } + +void AculCalibScint::DrawBeam(TCanvas *canvas, Int_t file, const char* variable) { + + canvas->SetTitle("Beam"); + + const Int_t noFiles = file; + + //todo delet parameter "files" + CanDivider(canvas, 0, noFiles, 3); + + TTree *curTree = 0; + TCutG *curCutG = 0; + TString var; + TString con; + + cout << "cuts " << fPars->GetNoCuts() << endl; + + for (Int_t i = 0; i < noFiles; i++) { + canvas->cd(i+1); + curTree = GetTree(i); + if (!curTree) { + printf("AculCalibCsI::DrawBeam: Tree No. %d was not found.\n", i); + continue; + } + curTree->Draw("QDC[0]:TDC[0]", "TDC[0]<1000 && QDC[0]<2000", "cont"); +// curTree->Draw("QDC[0]+QDC[1]:(TDC[2]+TDC[3])/2. - (TDC[0]+TDC[1])/2.", "", "cont"); +// cout << "aksjda\t" << energyPoints << endl; + for (Int_t j = 0; j < fPars->GetNoRawFiles(); j++) { + if ( fPars->GetCut(j) ) { + TCutG *cutTemp = fPars->GetCut(j); + curCutG = new TCutG(*cutTemp); + curCutG->Draw("same"); +// printf("AculCalibCsI::DrawBeam: cTOF cut No. %d cannot be drawn, need to repair this function.\n", j); + } + } + + canvas->cd(noFiles+1+i); + curTree->Draw("QDC[0]:QDC[1]", "", "cont"); + for (Int_t j = 0; j < fPars->GetNoRawFiles(); j++) { + if ( fPars->GetCut(noFiles + j) ) { + TCutG *cutTemp = fPars->GetCut(noFiles + j); + curCutG = new TCutG(*cutTemp); + curCutG->Draw("same"); +// printf("AculCalibCsI::DrawBeam: cQCD cut No. %d cannot be drawn, need to repair this function.\n", j); + } + } + + canvas->cd(2*noFiles+1+i); + var.Form("%s[5]:TDC[0]", variable); + con.Form("%s[5]>200", variable); + curTree->Draw(var.Data(), con.Data(), "cont"); + for (Int_t j = 0; j < fPars->GetNoRawFiles(); j++) { +// if ( cutsCol.At(files + j) ) { +// curCutG = (TCutG*)cutsCol.At(files + j); +// curCutG->Draw("same"); +// printf("AculCalibCsI::DrawBeam: cQCD cut No. %d cannot be drawn, need to repair this function.\n", j); +// } + } + canvas->Update(); + } +} + +void AculCalibScint::GetPeakMean(const char* variable, Int_t treeID, Int_t energy, TCanvas *canvas, const char* beamcut, const Int_t nbins, Int_t lowRange) { + +// todo: change this parameter as nonconstant + const Int_t noCrystals = 16; + CanDivider(canvas, noCrystals); + + TString var; + TString con; + TString hname; + TString canvasTitle; + +// todo manage the canvas name using cut name + canvasTitle.Form("variable: %s; tree: %d; cut: %s;", variable, treeID, fPars->GetCut(beamcut)->GetName()); + canvas->SetTitle(canvasTitle.Data()); + + TTree *curTree = 0; + curTree = GetTree(treeID); + if (!curTree) { + printf("AculCalibCsI::GetPeakMean: Tree No. %d was not found.\n", treeID); + return; + } + + TString sVariable = variable; + sVariable.ToLower(); + Int_t channel = 0; + + for (Int_t i = 0; i < noCrystals; i++) { + + if (sVariable.Contains("anc")) { + channel = i+1; + } else { + channel = i; + } + + var.Form("%s[%d]>>hfull[%d][%d]", variable, channel, treeID, i); + con.Form("%s[%d]>%d && %s", variable, channel, lowRange, fPars->GetCut(beamcut)->GetName()); + canvas->cd(i+1); + hname.Form("hfull[%d][%d]", treeID, i); + fHistFull[treeID].push_back( new TH1I(hname.Data(), "title", nbins, 0, 4096) ); + curTree->SetLineColor(1); + curTree->Draw(var.Data(), con.Data()); + + var.Form("%s[%d]>>hcut[%d][%d]", variable, channel, treeID, i); + con.Form("%s[%d]>%d && %s[%d]<%d && %s", + variable, channel, fPars->GetMinChannel(energy, i), + variable, channel, fPars->GetMaxChannel(energy, i), + fPars->GetCut(beamcut)->GetName()); + hname.Form("hcut[%d][%d]", treeID, i); + fHistCut[treeID].push_back( new TH1I(hname.Data(), "title", nbins, 0, 4096) ); + fHistCut[treeID][i]->SetLineColor(3); + curTree->Draw(var.Data(), con.Data(), "same"); + + gPad->Update(); + fMeanPeakPos[treeID].push_back(fHistCut[treeID][i]->GetMean()); +// cout << fMeanPeakPos[treeID][i] << endl; + fMeanPeakRMS[treeID].push_back(fHistCut[treeID][i]->GetRMS()); + } + + +// cout << fMeanPeakPos.size() << "\t" << fMeanPeakPos[treeID].size() << endl; +// cout << fMeanPeakPos.size() << "\t" << fMeanPeakPos[0].size() << endl; +// cout << fMeanPeakPos.size() << "\t" << fMeanPeakPos[1].size() << endl; +// cout << fMeanPeakPos.size() << "\t" << fMeanPeakPos[2].size() << endl; +// cout << fMeanPeakPos.size() << "\t" << fMeanPeakPos[3].size() << endl; + + canvas->Update(); + +} + +void AculCalibScint::Calibrate(TCanvas *canvas, Bool_t savefile, const char* filename, const char* option) { + + //todo change this parameter as nonconstant + //e.g. the number of found fPeakMeans + const Int_t noChannels = 16; + + //todo + if (!canvas) return; + CanDivider(canvas, noChannels); + + for (Int_t i = 0; i < fPars->GetNoRawFiles(); i++) { + cout << i << "\t" << fMeanPeakPos[i].size() << endl; + if (fMeanPeakPos[i].size() < noChannels || fMeanPeakRMS[i].size() < noChannels) { +// cout << i << "\t" << fMeanPeakPos[i].size() << endl; + cout << "\"AculCalibScint::Calibrate\" something bad here" << endl; + return; + } + } + +// cout << alphas2.GetSize()+1 << endl; +// cout << energyPoints+1 << endl; + cout << fPars->GetNoEPoints() << endl; + const Int_t energyPoints = fPars->GetNoEPoints(); + + TString gName; + TString gTitle; + +// if (savefile) fGraphs->Open(filename, "RECREATE"); + + TF1 *fnc; + + for (Int_t i = 0; i < noChannels; i++) { + canvas->cd(i+1); + gCal[i] = new TGraphErrors(energyPoints+1); +// FillGraph(gCal[i], energies.GetSize()+1, energies.GetArray(), i); + FillGraph(gCal[i], energyPoints+1, i); +// if (savefile) gCal[i]->Write(); +// gCal[i]->Draw("Al*"); + gCal[i]->Draw("A*"); + gName.Form("g%s%s%d\n", fPars->GetDetName(), fPars->GetParticleName(), i); + gTitle.Form("%s %s\n", fPars->GetDetName(), fPars->GetParticleName()); +// gCal[i]->SetTitle(gTitle.Data()); + gCal[i]->SetName(gName.Data()); + gCal[i]->Fit("pol1"); + fnc = gCal[i]->GetFunction("pol1"); + fnc->SetLineColor(kRed); + fA.push_back(fnc->GetParameter(1)); + fB.push_back(fnc->GetParameter(0)); + canvas->Update(); + } + if (savefile) SaveClbGraphs(filename, option); + +} + +void AculCalibScint::FillGraph(TGraphErrors *g, Int_t npoints, /*Double_t *energies,*/ Int_t graphNumber, const char* option) { + + TString opt = option; + + //todo check if fMeanPeakPos is full + + //all available energy points and (0,0) + g->SetPoint(0, 0., 0.); + for (Int_t i = 0; i < npoints-1; i++) { +// g->SetPoint(i+1, energies[i], mean[i][graphNumber]); +// g->SetPointError(i+1, 0, meanRMS[i][graphNumber]); +// cout << "Graph number: " << graphNumber << endl; +// cout << graphNumber << "\t" << fMeanPeakPos[i][graphNumber] << endl; + g->SetPoint(i+1, fMeanPeakPos[i][graphNumber], fPars->GetCalEnergy(i)); + g->SetPointError(i+1, fMeanPeakRMS[i][graphNumber], 0); + } + +// for (Int_t j = 1; j < 4; j++) { +// g->SetPoint(j, 0., 0.); +// } + + +} + +void AculCalibScint::SaveClbGraphs(const char* filename, const char* option) { + +// cout << "asdasd" << endl; +// cout << fGraphs << endl; + TFile fGraphs(filename, option); + +// if (fGraphs) fGraphs->Close(); + +// cout << "asdasd" << endl; +// fGraphs = new TFile(filename, option); + cout << fGraphs.IsOpen() << endl; + cout << fGraphs.GetName() << endl; + fGraphs.Print(); +// if (!fGraphs->IsOpen()) { +// printf("AculCalibCsI::SaveClbGraphs: file %s was not open.\n", filename); +// return; +// } + + for (Int_t i = 0; i<16; i++) { + fGraphs.cd(); + gCal[i]->Write(); + } + fGraphs.Close(); + return; +} + +void AculCalibScint::WriteClbParameters(const char* filename) { + + std::ofstream outfile(filename); + if ( !outfile.is_open() ) { + printf("AculCalibCsI::WriteClbParameters: File %s was not open.\n", filename); + return; + } + + outfile << "#detector:\t" << fPars->GetDetName() << ",\tparticle:\t" << fPars->GetParticleName() << endl; + outfile << "#channel\tfA\tfB" << endl; + for (Int_t i = 0; i < (Int_t)fA.size(); i++) { + outfile << i << "\t" << fA[i] << "\t" << fB[i] << endl; + } + + outfile.close(); +} diff --git a/AculCalib/AculCalibScint.h b/AculCalib/AculCalibScint.h index c97a0ee..a6225fd 100644 --- a/AculCalib/AculCalibScint.h +++ b/AculCalib/AculCalibScint.h @@ -4,19 +4,21 @@ //#include "TROOT.h" #include #include +//#include #include "TFile.h" #include "TTree.h" -#include "TCanvas.h" -//#include "TH1I.h" -//#include "TGraphErrors.h" +//#include "TCanvas.h" +#include "TH1I.h" +#include "TGraphErrors.h" //#include "TArrayD.h" -//#include "TF1.h" +#include "TF1.h" #include "./AculCalib.h" using std::cout; using std::endl; +//using std::vector; class AculCalibScint : public AculCalib { @@ -29,13 +31,18 @@ private: TFile *fCutFile; // TClonesArray cutsCol; // -// TH1I *hfull[NOCALFILES][16]; -// TH1I *hcut[NOCALFILES][16]; +// TH1I *fHistFull[NOCALFILES][16]; + vector< vector > fHistFull; +// TH1I *fHistCut[NOCALFILES][16]; + vector< vector > fHistCut; // -// Double_t mean[NOCALFILES][16]; -// Double_t meanRMS[NOCALFILES][16]; +// Double_t fMeanPeakPos[NOCALFILES][16]; + vector< vector > fMeanPeakPos; +// Double_t fMeanPeakRMS[NOCALFILES][16]; + vector< vector > fMeanPeakRMS; // -// TGraphErrors *gCal[16]; + //todo make vector of graphs + TGraphErrors *gCal[16]; // TFile *fGraphs; public: @@ -54,10 +61,15 @@ public: // void PrintParameters(const char* option = ""); // void PrintPeakRanges(); - void DrawVariable(const char* variable, Int_t tree, TCanvas *canvas, Int_t lowRange = 0, Int_t upRange = 4096); -// void DrawBeam(TCanvas *canvas, Int_t files, const char* variable); - // void DrawdEE(const char* variable, Int_t tree, TCanvas *canvas); -// void DrawVariableCut(const char* variable, Int_t tree, TCanvas *canvas, const char* cut1, const char* cut2 = "", Int_t lowRange = 0); + void DrawVariable(const char* variable, Int_t treeID, TCanvas *canvas, Int_t lowRange = 0, Int_t upRange = 4096); + void DrawBeam(TCanvas *canvas, Int_t file, const char* variable); + + void GetPeakMean(const char* variable, Int_t treeID, Int_t energy, TCanvas *canvas, const char* beamcut, const Int_t nbins = 4096, Int_t lowRange = 0); + void Calibrate(TCanvas *canvas, Bool_t savefile = 0, const char* filename = "", const char* option = "READ"); + + void WriteClbParameters(const char* filename); + + TTree* GetTree(Int_t treeID); //private functions: // void LoadCuts(); @@ -65,5 +77,10 @@ public: private: void OpenFiles(); void LoadTrees(); + + void SaveClbGraphs(const char* filename, const char* option = "READ"); + void FillGraph(TGraphErrors *g, Int_t npoints, /*Double_t *energies,*/ Int_t graphNumber, const char* option = ""); + + // void SetPars(); }; diff --git a/macros/calibration_CsI/calibrationSQ13Alpha.cxx b/macros/calibration_CsI/calibrationSQ13Alpha.cxx index 3a337aa..2b3d25d 100644 --- a/macros/calibration_CsI/calibrationSQ13Alpha.cxx +++ b/macros/calibration_CsI/calibrationSQ13Alpha.cxx @@ -31,6 +31,7 @@ // cal.DrawBeam(c4, 4, "SQ13"); //return; // cal.DrawVariableCut("SQ13", 0, c1, "cutsSQ13Alpha16"); +// return; // cal.DrawVariableCut("SQ13", 0, c1, "cutsSQ13Alpha16", "cutSQ13Alpha16Amp"); //return; // cal.DrawVariableCut("SQ13", 1, c2, "cutSQ13Alpha21", "cutSQ13Alpha21Amp"); diff --git a/macros/myMacros/parTest.cxx b/macros/myMacros/parTest.cxx index 708663f..9154414 100644 --- a/macros/myMacros/parTest.cxx +++ b/macros/myMacros/parTest.cxx @@ -1,4 +1,6 @@ //#include "../../AculCalib/AculCalPars.h" +//#include "../../AculCalib/AculCalibScint.h" +//#include "TSystem.h" void parTest() { @@ -19,16 +21,27 @@ void parTest() // c.LoadTrees(); c.PrintTrees(); -// c.DrawVariable(.........) + TCanvas *c1 = new TCanvas("c1", "Plain"); + TCanvas *c2 = new TCanvas("c2", "Plain"); + TCanvas *c3 = new TCanvas("c3", "Plain"); + TCanvas *c4 = new TCanvas("c4", "Plain"); +// c.DrawVariable("SQ13", 2, c1); +// c.DrawBeam(c1, 4, "SQ13"); + c.GetPeakMean("SQ13", 0, 0, c1, "cutSQ13Alpha16Amp", 256); + c.GetPeakMean("SQ13", 1, 1, c2, "cutSQ13Alpha21Amp", 256); + c.GetPeakMean("SQ13", 2, 2, c3, "cutSQ13Alpha26Amp", 256); + c.GetPeakMean("SQ13", 3, 3, c4, "cutSQ13Alpha30Amp", 256); + +//return; // c.PrintFiles(); // c.PrintCuts(); // TCanvas *c1 = new TCanvas("c1", "Plain"); // c.GetPeakMean("SQ13", 0, 0, c1, "cutSQ13Alpha16Amp", 256); -// TCanvas *cCal = new TCanvas("cCal", "calibration Alpha"); -// cal.Calibrate(cCal); + TCanvas *cCal = new TCanvas("cCal", "calibration Alpha"); + c.Calibrate(cCal); return; } -- 2.18.1