Commit 6ba655bd authored by Kostyleva D.A's avatar Kostyleva D.A

Merge branch 'master' of http://er.jinr.ru/AculUtils

parents f75d3bfd 08178659
This diff is collapsed.
#pragma once
//#include "TObject.h"
//#include "TROOT.h"
#include <iostream>
#include <fstream>
#include "TFile.h"
#include "TTree.h"
#include "TCutG.h"
#include "TCanvas.h"
#include "TClonesArray.h"
#include "TH1I.h"
#include "TGraphErrors.h"
#include "TArrayD.h"
#include "TF1.h"
#define NOCALFILES 5
using std::cout;
using std::endl;
class AculCalibCsI {
private:
TString detName;
TString partName;
TClonesArray fr; //TFile
// TFile *fData;
TClonesArray tr;
TClonesArray colFiles;
TClonesArray colTrees;
Int_t nofiles;
TString fileNames[100];
TString cutNames[100];
Int_t energyPoints;
TArrayD fE;
TFile *fCuts;
TString cutsFileName;
Int_t nCuts; //number of cuts
TClonesArray cutsCol;
TH1I *hfull[NOCALFILES][16];
TH1I *hcut[NOCALFILES][16];
Int_t peakMin[NOCALFILES][16];
Int_t peakMax[NOCALFILES][16];
Double_t mean[NOCALFILES][16];
Double_t meanRMS[NOCALFILES][16];
TGraphErrors *gCal[16];
TFile *fGraphs;
TArrayD fA;
TArrayD fB;
TString fParFileName;
public:
// AculCalibCsI() : a(0), b(0), c(0), p(0){};
AculCalibCsI();
AculCalibCsI(const char* parfile);
virtual ~AculCalibCsI();
// Define the class for the cint dictionary
ClassDef (AculCalibCsI,1);
void OpenTrees();
void LoadCuts();
void SetParFile(const char* parfile);
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 GetPeakMean(const char* variable, Int_t tree, 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 FillGraph(TGraphErrors *g, Int_t npoints, Double_t *energies, Int_t graphNumber, const char* option = "");
void WriteClbParameters(const char* filename);
void SaveClbGraphs(const char* filename, const char* option = "READ");
void ReadClbParameters(const char* filename);
void DrawClbGraphs(const char* filename, const char* graphname, TCanvas *canvas);
void DrawEnergyDeposite(const char* variable, TCanvas *canvas, Int_t tree, const char* option = "");
void PrintTrees();
void PrintFiles();
void PrintCuts();
Double_t GetA(Int_t i);
Double_t GetB(Int_t i);
private:
void SetPars();
};
......@@ -7,20 +7,20 @@ ACULDATALIBS := -lCore -lCint -lRIO -lTree -lNet -lThread -lHist -lMatrix -lMath
# Add inputs and outputs from these tool invocations to the build variables
ACULDATA_HEADERS += \
$(ACULDATA)/AculCalibration.h \
$(ACULDATA)/ConfigDictionary.h \
$(ACULDATA)/AculCalibCsI.h \
$(ACULDATA)/linkdef.h
ACULDATACPP_SRCS += \
$(ACULDATA)/AculCalibration.cpp \
$(ACULDATA)/ConfigDictionary.cpp \
$(ACULDATA)/AculCalibCsI.cpp \
$(ACULDATA)/AculDataCint.cpp
ACULDATAOBJS += \
$(ACULDATA)/AculCalibration.o \
$(ACULDATA)/ConfigDictionary.o \
$(ACULDATA)/AculCalibCsI.o \
$(ACULDATA)/AculDataCint.o
ACULDATACPP_DEPS += \
$(ACULDATA)/AculCalibration.d \
$(ACULDATA)/ConfigDictionary.d \
$(ACULDATA)/AculCalibCsI.d \
$(ACULDATA)/AculDataCint.d
\ No newline at end of file
......@@ -6,7 +6,8 @@
//#pragma link C++ class AculRaw;
//#pragma link C++ class AculConvert;
#pragma link C++ class AculCalibration;
#pragma link C++ class ConfigDictionary;
#pragma link C++ class AculCalibCsI;
//#pragma link C++ class ConfigDictionary;
#endif
......
{
// gSystem->Load("CsICalib_C.so");
gSystem->Load("../../libAculData.so");
//CsICalib cal;
AculCalibCsI cal("parameters/SQ13Alpha.par");
// CsICalib cal("SQ13AlphaAlt.par");
// cal.OpenSQ13AlphaTrees();
// cal.LoadCutsSQ13A();
TCanvas *c1 = new TCanvas("c1", "Plain");
TCanvas *c2 = new TCanvas("c2", "Plain");
TCanvas *c3 = new TCanvas("c3", "Plain");
TCanvas *c4 = new TCanvas("c4", "Plain");
cal.PrintTrees();
cal.PrintFiles();
cal.PrintCuts();
// cal.ReadParFile("ranges.dat");
// cal.PrintParameters();
// cal.DrawVariable("SQ13", 1, c1);
//return;
// cal.DrawVariable("TDC", 2, c2);
// cal.DrawVariable("QDC", 3, c3);
// cal.DrawBeam(c4, 4, "SQ13");
//return;
// cal.DrawVariableCut("SQ13", 0, c1, "cutsSQ13Alpha16");
// cal.DrawVariableCut("SQ13", 0, c1, "cutsSQ13Alpha16", "cutSQ13Alpha16Amp");
//return;
// cal.DrawVariableCut("SQ13", 1, c2, "cutSQ13Alpha21", "cutSQ13Alpha21Amp");
// cal.DrawVariableCut("SQ13", 2, c3, "cutSQ13Alpha26", "cutSQ13Alpha26Amp");
// cal.DrawVariableCut("SQ13", 3, c4, "cutSQ13Alpha30", "cutSQ13Alpha30Amp");
//return;
cal.GetPeakMean("SQ13", 0, 0, c1, "cutSQ13Alpha16Amp", 256);
cal.GetPeakMean("SQ13", 1, 1, c2, "cutSQ13Alpha21Amp", 256);
cal.GetPeakMean("SQ13", 2, 2, c3, "cutSQ13Alpha26Amp", 256);
cal.GetPeakMean("SQ13", 3, 3, c4, "cutSQ13Alpha30Amp", 256);
TCanvas *cCal = new TCanvas("cCal", "calibration Alpha");
cal.Calibrate(cCal);
// cal.SaveClbGraphs("gSQ13Alpha.root", "RECREATE");
// cal.SaveClbGraphs("gSQ13Alpha2points.root", "RECREATE");
// cal.SaveClbGraphs("gSQ13AlphaAlt.root", "RECREATE");
// cal.WriteClbParameters("calSQ13Alpha.clb");
// cal.WriteClbParameters("calSQ13Alpha2points.clb");
// cal.WriteClbParameters("calSQ13AlphaAlt.clb");
return;
}
{
gSystem->Load("CsICalib_C.so");
//CsICalib cal;
CsICalib cal("SQ13Trit.par");
// cal.OpenSQ13TritTrees();
// cal.LoadCutsSQ13T();
TCanvas *c1 = new TCanvas("c1", "Plain");
TCanvas *c2 = new TCanvas("c2", "Plain");
TCanvas *c3 = new TCanvas("c3", "Plain");
// cal.PrintTrees();
// cal.PrintFiles();
// cal.PrintCuts();
cal.PrintParameters();
// cal.DrawBeam(c3, 3);
// cal.DrawVariableCut("SQ13", 0, c1, "cutSQ13Trit");
// cal.DrawVariableCut("SQ13", 1, c2, "cutSQ13Trit19", "cutSQ13Trit19Amp");
// cal.DrawVariableCut("SQ13", 2, c3, "cutSQ13Trit24", "cutSQ13Trit24Amp");
cal.GetPeakMean("SQ13", 0, 0, c1, "cutSQ13Trit14Amp", 256);
cal.GetPeakMean("SQ13", 1, 1, c2, "cutSQ13Trit19Amp", 256);
cal.GetPeakMean("SQ13", 2, 2, c3, "cutSQ13Trit24Amp", 256);
TCanvas *cCal = new TCanvas("cCal", "calibration SQ13 Triton");
cal.Calibrate(cCal);
cal.SaveClbGraphs("gSQ13Trit.root", "RECREATE");
cal.WriteClbParameters("calSQ13Trit.clb");
return;
}
{
gSystem->Load("CsICalib_C.so");
// CsICalib cal;
CsICalib cal("parameters/SQ23Alpha.par");
// cal.PrintCuts();
//return;
TCanvas *c1 = new TCanvas("c1", "Plain");
TCanvas *c2 = new TCanvas("c2", "Plain");
TCanvas *c3 = new TCanvas("c3", "Plain");
TCanvas *c4 = new TCanvas("c4", "Plain");
cal.DrawBeam(c4, 4, "SQ23");
return;
// cal.ReadParFile("SQ23Alpha.par");
// cal.OpenTrees();
// cal.ReadClbParameters("calSQ23Alpha.clb");
// cal.DrawEnergyDeposite("SQ23", c4, 3, "same");
//return;
// cal.DrawVariable("SQ23", 1, c1);
// cal.DrawVariable("TDC", 2, c2, 0, 700);
// cal.DrawVariable("QDC", 3, c3);
//return;
// cal.DrawVariableCut("SQ23", 0, c1, "cutAlpha16", "cutAlpha16Amp");
// cal.DrawVariableCut("SQ23", 0, c2, "cutAlpha20", "cutAlpha20Amp");
// cal.DrawVariableCut("SQ23", 0, c3, "cutAlpha25", "cutAlpha25Amp");
// cal.DrawVariableCut("SQ23", 0, c4, "cutAlpha30", "cutAlpha30Amp");
// cal.GetPeakMean("SQ23", 0, c1, "cutAlpha16Amp", minAlpha16, maxAlpha16);
// cal.GetPeakMean("SQ23", 1, c2, "cutAlpha20Amp", minAlpha20, maxAlpha20);
// cal.GetPeakMean("SQ23", 2, c3, "cutAlpha25Amp", minAlpha25, maxAlpha25);
// cal.GetPeakMean("SQ23", 3, c4, "cutAlpha30Amp", minAlpha30, maxAlpha30);
cal.GetPeakMean("SQ23", 0, 0, c1, "cutAlpha16Amp");
cal.GetPeakMean("SQ23", 1, 1, c2, "cutAlpha20Amp");
cal.GetPeakMean("SQ23", 2, 2, c3, "cutAlpha25Amp");
cal.GetPeakMean("SQ23", 3, 3, c4, "cutAlpha30Amp");
TCanvas *cCal = new TCanvas("cCal", "calibration Alpha");
cal.Calibrate(cCal);
// cal.SaveClbGraphs("gSQ23Alpha.root", "RECREATE");
// cal.WriteClbParameters("calSQ23Alpha.clb");
return;
}
{
gSystem->Load("CsICalib_C.so");
CsICalib cal("SQ23Trit.par");
TCanvas *c1 = new TCanvas("c1", "Plain");
TCanvas *c2 = new TCanvas("c2", "Plain");
TCanvas *c3 = new TCanvas("c3", "Plain");
// cal.LoadCutsSQ23T();
cal.PrintCuts();
// cal.PrintTrees();
// cal.PrintFiles();
// cal.PrintCuts();
// cal.ReadPeakRanges();
// cal.PrintPeakRanges();
// cal.ReadParFile("ranges.dat");
// cal.PrintParameters();
// return;
// cal.DrawVariable("SQ23", 1, c1);
// cal.DrawVariable("TDC", 2, c2);
// cal.DrawVariable("QDC", 3, c3);
// cal.DrawVariableCut("SQ23", 0, c1, "cutAlpha16", "cutAlpha16Amp");
// cal.DrawVariableCut("SQ23", 0, c2, "cutAlpha20", "cutAlpha20Amp");
// cal.DrawVariableCut("SQ23", 0, c3, "cutAlpha25", "cutAlpha25Amp");
// cal.DrawVariableCut("SQ23", 0, c4, "cutAlpha30", "cutAlpha30Amp");
// cal.GetPeakMean("SQ23", 0, c1, "cutAlpha16Amp", minAlpha16, maxAlpha16);
// cal.GetPeakMean("SQ23", 1, c2, "cutAlpha20Amp", minAlpha20, maxAlpha20);
// cal.GetPeakMean("SQ23", 2, c3, "cutAlpha25Amp", minAlpha25, maxAlpha25);
// cal.GetPeakMean("SQ23", 3, c4, "cutAlpha30Amp", minAlpha30, maxAlpha30);
cal.GetPeakMean("SQ23", 0, 0, c1, "cutTrit13Amp");
cal.GetPeakMean("SQ23", 1, 1, c2, "cutTrit20Amp");
cal.GetPeakMean("SQ23", 2, 2, c3, "cutTrit24Amp");
TCanvas *cCal = new TCanvas("cCal", "calibration SQ23 Alpha");
cal.Calibrate(cCal);
cal.SaveClbGraphs("gSQ23Trit.root", "RECREATE");
cal.WriteClbParameters("calSQ23Trit.clb");
}
energies 4 #number of energy points
files 4
data/csi_13_Ealpha16.root
data/csi_13_Ealpha21.root
data/csi_13_Ealpha26.root
data/csi_13_Ealpha30.root
#keyword; filename; number of cuts in file
cutFile cuts/cutsSQ13Alpha.root 8
cutsSQ13Alpha16
cutSQ13Alpha21
cutSQ13Alpha26
cutSQ13Alpha30
cutSQ13Alpha16Amp
cutSQ13Alpha21Amp
cutSQ13Alpha26Amp
cutSQ13Alpha30Amp
#detector particle
detector SQ13 Alpha
#energy [MeV/A]
energy 66.542
#channel minimum maximum
0 650 830
1 920 1150
2 850 1000
3 1200 1400
4 960 1100
5 700 850
6 650 800
7 1040 1240
8 850 1050
9 650 850
10 950 1200
11 900 1100
12 740 860
13 1140 1380
14 420 500
15 800 1000
#CsI2, energy ~ 21 MeV/A, Alpha
energy 85.437
0 1050 1200
1 1350 1550
2 1190 1400
3 1650 1950
4 1300 1500
5 950 1100
6 900 1050
7 1450 1700
8 1150 1400
9 900 1100
10 1350 1600
11 1250 1500
12 950 1200
13 1600 1860
14 550 640
15 1150 1350
#CsI2, energy ~ 26 MeV/A, Alpha
energy 105.5
0 1300 1600
1 1750 2050
2 1560 1800
3 2250 2500
4 1720 2000
5 1200 1450
6 1160 1400
7 1800 2200
8 1600 1850
9 1200 1400
10 1750 2100
11 1650 1900
12 1250 1600
13 2150 2450
14 690 900
15 1500 1700
#CsI2, energy ~ 30 MeV/A, Alpha
energy 119.54
0 1450 1750
1 2200 2450
2 1900 2150
3 2590 3000
4 2100 2350
5 1500 1650
6 1400 1600
7 2250 2550
8 1900 2150
9 1400 1600
10 2050 2600
11 1950 2200
12 1580 1710
13 2550 2900
14 1100 1250
15 1800 2000
energies 3 #number of energy points
files 3
csi_13_Etrit14.root
csi_13_Etrit19.root
csi_13_Etrit24.root
#keyword; filename; number of cuts in file
cutFile cutsSQ13Trit.root 6
cutSQ13Trit
cutSQ13Trit19
cutSQ13Trit24
cutSQ13Trit14Amp
cutSQ13Trit19Amp
cutSQ13Trit24Amp
#detector particle
detector SQ13 Triton
#energy [MeV/A]
energy 43.636 #14 AMeV
#channel minimum maximum
0 300 500
1 400 550
2 400 500
3 500 700
4 450 550
5 350 450
6 300 400
7 500 600
8 400 550
9 300 400
10 450 600
11 400 600
12 350 450
13 550 700
14 200 300
15 400 500
#CsI2, energy ~ 19 MeV/A, Triton
energy 61.52
0 200 500
1 650 750
2 580 680
3 850 1000
4 650 800
5 500 600
6 450 550
7 750 850
8 600 750
9 450 550
10 650 850
11 650 750
12 500 600
13 800 1000
14 250 350
15 590 700
#CsI2, energy ~ 24 MeV/A, Triton
energy 69.382
0 600 700
1 800 950
2 700 850
3 400 600
4 800 1000
5 600 700
6 550 650
7 950 1050
8 780 900
9 550 650
10 850 1000
11 800 900
12 650 740
13 1050 1200
14 350 450
15 740 840
#keywords: detector, energies, files, cutFile
energies 4 #number of energy points
files 4
data/csi2_beam_Ealpha16all.root
data/csi2_beam_Ealpha20all.root
data/csi2_beam_Ealpha25all.root
data/csi2_beam_Ealpha30all.root
#keyword; filename; number of cuts in file
cutFile cuts/beamCuts.root 8
cutAlpha16
cutAlpha20
cutAlpha25
cutAlpha30
cutAlpha16Amp
cutAlpha20Amp
cutAlpha25Amp
cutAlpha30Amp
#detector particle
detector SQ23 Alpha
#energy [MeV/A]
energy 66.508
#channel minimum maximum
0 650 830
1 1060 1200
2 1040 1180
3 1080 1200
4 1060 1200
5 1250 1460
6 1100 1280
7 1200 1400
8 1100 1250
9 1050 1200
10 1050 1220
11 1100 1280
12 660 750
13 1150 1300
14 1400 1600
15 1250 1420
#CsI2, energy ~ 20 MeV/A, Alpha
energy 85.236
0 900 1050
1 1400 1550
2 1350 1500
3 1400 1550
4 1400 1550
5 1650 1900
6 1450 1650
7 1600 1800
8 1400 1650
9 1350 1550
10 1400 1600
11 1400 1650
12 800 1100
13 1450 1650
14 1800 2050
15 1650 1850
#CsI2, energy ~ 25 MeV/A, Alpha
energy 104.532
0 1100 1250
1 1730 1900
2 1680 1850
3 1600 2000
4 1720 1900
5 2100 2300
6 1800 2000
7 2000 2200
8 1800 2000
9 1700 1900
10 1750 1900
11 1800 2000
12 1050 1200
13 1850 2050
14 2300 2500
15 2030 2300
#CsI2, energy ~ 30 MeV/A, Alpha
energy 119.42
0 1200 1400
1 2000 2150
2 1900 2050
3 1900 2200
4 1950 2150
5 2400 2600
6 2050 2250
7 2280 2500
8 2060 2200
9 1900 2100
10 1980 2150
11 2080 2250
12 1100 1400
13 2100 2300
14 2600 2850
15 2380 2550
energies 3 #number of energy points
files 3
csi2_beam_Ealpha30all.root
csi2_Etrit20all.root
csi2_Etrit24all.root
#keyword; filename; number of cuts in file
cutFile beamCuts_CsI2_trit.root 6
cutTrit13
cutTrit20
cutTrit24
cutTrit13Amp
cutTrit20Amp
cutTrit24Amp
#detector particle
detector SQ23 Tritium
#CsI2, energy ~ 13 MeV/A, Tritium
energy 39.102
#channel minimum maximum
0 450 520
1 670 750
2 650 750
3 650 800
4 700 750
5 800 900
6 700 800
7 780 850
8 700 800
9 650 750
10 680 750
11 700 800
12 440 500
13 740 800
14 880 990
15 800 900
#CsI2, energy ~ 20 MeV/A, Tritium
energy 61.17
0 700 750
1 1040 1100
2 1000 1100
3 1000 1150
4 1050 1150
5 1250 1350
6 1100 1200
7 1200 1300
8 1050 1200
9 1000 1100
10 1040 1150
11 1050 1200
12 650 700
13 1100 1200
14 1350 1450
15 1000 1400
#CsI2, energy ~ 24 MeV/A, Tritium
energy 73.272
0 800 900
1 1200 1300
2 1200 1300
3 700 1300
4 1200 1350
5 1450 1800
6 1250 1400
7 1400 1500
8 1250 1400
9 1200 1300
10 1200 1350
11 1300 1450
12 700 850
13 1300 1400
14 1600 1800
15 1450 1550
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment