-
Notifications
You must be signed in to change notification settings - Fork 1
/
fit.C
210 lines (201 loc) · 13.7 KB
/
fit.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
void fit(TString CutOff="")
{
double fs0[91] = {-900.0, -880.0, -860.0, -840.0, -820.0, -800.0, -780.0, -760.0, -740.0, -720.0, -700.0, -680.0, -660.0, -640.0, -620.0, -600.0, -580.0, -560.0, -540.0, -520.0, -500.0, -480.0, -460.0, -440.0, -420.0, -400.0, -380.0, -360.0, -340.0, -320.0, -300.0, -280.0, -260.0, -240.0, -220.0, -200.0, -180.0, -160.0, -140.0, -120.0, -100.0, -80.0, -60.0, -40.0, -20.0, 0.0, 20.0, 40.0, 60.0, 80.0, 100.0, 120.0, 140.0, 160.0, 180.0, 200.0, 220.0, 240.0, 260.0, 280.0, 300.0, 320.0, 340.0, 360.0, 380.0, 400.0, 420.0, 440.0, 460.0, 480.0, 500.0, 520.0, 540.0, 560.0, 580.0, 600.0, 620.0, 640.0, 660.0, 680.0, 700.0, 720.0, 740.0, 760.0, 780.0, 800.0, 820.0, 840.0, 860.0, 880.0, 900.0};
double fs1[67] = {-330.0, -320.0, -310.0, -300.0, -290.0, -280.0, -270.0, -260.0, -250.0, -240.0, -230.0, -220.0, -210.0, -200.0, -190.0, -180.0, -170.0, -160.0, -150.0, -140.0, -130.0, -120.0, -110.0, -100.0, -90.0, -80.0, -70.0, -60.0, -50.0, -40.0, -30.0, -20.0, -10.0, 0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0, 120.0, 130.0, 140.0, 150.0, 160.0, 170.0, 180.0, 190.0, 200.0, 210.0, 220.0, 230.0, 240.0, 250.0, 260.0, 270.0, 280.0, 290.0, 300.0, 310.0, 320.0, 330.0};
double fm0[85] = {-42.0, -41.0, -40.0, -39.0, -38.0, -37.0, -36.0, -35.0, -34.0, -33.0, -32.0, -31.0, -30.0, -29.0, -28.0, -27.0, -26.0, -25.0, -24.0, -23.0, -22.0, -21.0, -20.0, -19.0, -18.0, -17.0, -16.0, -15.0, -14.0, -13.0, -12.0, -11.0, -10.0, -9.0, -8.0, -7.0, -6.0, -5.0, -4.0, -3.0, -2.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0};
double fm1[67] = {-165.0, -160.0, -155.0, -150.0, -145.0, -140.0, -135.0, -130.0, -125.0, -120.0, -115.0, -110.0, -105.0, -100.0, -95.0, -90.0, -85.0, -80.0, -75.0, -70.0, -65.0, -60.0, -55.0, -50.0, -45.0, -40.0, -35.0, -30.0, -25.0, -20.0, -15.0, -10.0, -5.0, 0.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0, 85.0, 90.0, 95.0, 100.0, 105.0, 110.0, 115.0, 120.0, 125.0, 130.0, 135.0, 140.0, 145.0, 150.0, 155.0, 160.0, 165.0};
double fm6[84] = {-84.0, -82.0, -80.0, -78.0, -76.0, -74.0, -72.0, -70.0, -68.0, -66.0, -64.0, -62.0, -60.0, -58.0, -56.0, -54.0, -52.0, -50.0, -48.0, -46.0, -44.0, -42.0, -40.0, -38.0, -36.0, -34.0, -32.0, -30.0, -28.0, -26.0, -24.0, -22.0, -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 22.0, 24.0, 26.0, 28.0, 30.0, 32.0, 34.0, 36.0, 38.0, 40.0, 42.0, 44.0, 46.0, 48.0, 50.0, 52.0, 54.0, 56.0, 58.0, 60.0, 62.0, 64.0, 66.0, 68.0, 70.0, 72.0, 74.0, 76.0, 78.0, 80.0, 82.0};
double fm7[121] = {-300.0, -295.0, -290.0, -285.0, -280.0, -275.0, -270.0, -265.0, -260.0, -255.0, -250.0, -245.0, -240.0, -235.0, -230.0, -225.0, -220.0, -215.0, -210.0, -205.0, -200.0, -195.0, -190.0, -185.0, -180.0, -175.0, -170.0, -165.0, -160.0, -155.0, -150.0, -145.0, -140.0, -135.0, -130.0, -125.0, -120.0, -115.0, -110.0, -105.0, -100.0, -95.0, -90.0, -85.0, -80.0, -75.0, -70.0, -65.0, -60.0, -55.0, -50.0, -45.0, -40.0, -35.0, -30.0, -25.0, -20.0, -15.0, -10.0, -5.0, 0.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0, 85.0, 90.0, 95.0, 100.0, 105.0, 110.0, 115.0, 120.0, 125.0, 130.0, 135.0, 140.0, 145.0, 150.0, 155.0, 160.0, 165.0, 170.0, 175.0, 180.0, 185.0, 190.0, 195.0, 200.0, 205.0, 210.0, 215.0, 220.0, 225.0, 230.0, 235.0, 240.0, 245.0, 250.0, 255.0, 260.0, 265.0, 270.0, 275.0, 280.0, 285.0, 290.0, 295.0, 300.0};
double ft0[69] = {-6.8, -6.6, -6.4, -6.2, -6.0, -5.8, -5.6, -5.4, -5.2, -5.0, -4.8, -4.6, -4.4, -4.2, -4.0, -3.8, -3.6, -3.4, -3.2, -3.0, -2.8, -2.6, -2.4, -2.2, -2.0, -1.8, -1.6, -1.4, -1.2, -1.0, -0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 6.6, 6.8};
double ft1[51] = {-12.5, -12.0, -11.5, -11.0, -10.5, -10.0, -9.5, -9.0, -8.5, -8.0, -7.5, -7.0, -6.5, -6.0, -5.5, -5.0, -4.5, -4.0, -3.5, -3.0, -2.5, -2.0, -1.5, -1.0, -0.5, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0, 10.5, 11.0, 11.5, 12.0, 12.5};
double ft2[83] = {-20.5, -20.0, -19.5, -19.0, -18.5, -18.0, -17.5, -17.0, -16.5, -16.0, -15.5, -15.0, -14.5, -14.0, -13.5, -13.0, -12.5, -12.0, -11.5, -11.0, -10.5, -10.0, -9.5, -9.0, -8.5, -8.0, -7.5, -7.0, -6.5, -6.0, -5.5, -5.0, -4.5, -4.0, -3.5, -3.0, -2.5, -2.0, -1.5, -1.0, -0.5, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0, 10.5, 11.0, 11.5, 12.0, 12.5, 13.0, 13.5, 14.0, 14.5, 15.0, 15.5, 16.0, 16.5, 17.0, 17.5, 18.0, 18.5, 19.0, 19.5, 20.0, 20.5};
TFile *f = new TFile("ch1_splitted_TF1_hfm0"+CutOff+".root");
TH1 *dd1 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_1");
TH1 *dd2 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_2");
TH1 *dd3 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_3");
TH1 *dd4 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_4");
TFile *outFile = new TFile("signal_proc_ch1_splitted_TF1_hfm0"+CutOff+".root","RECREATE");
outFile->cd();
TF1 *fit_1 = new TF1("bin_content_par1_1","pol2",fm0[0]-0.5,fm0[84]-0.5);
TF1 *fit_2 = new TF1("bin_content_par1_2","pol2",fm0[0]-0.5,fm0[84]-0.5);
TF1 *fit_3= new TF1("bin_content_par1_3","pol2",fm0[0]-0.5,fm0[84]-0.5);
TF1 *fit_4 = new TF1("bin_content_par1_4","pol2",fm0[0]-0.5,fm0[84]-0.5);
dd1->Fit("bin_content_par1_1","R");
fit_1->Write();
dd2->Fit("bin_content_par1_2","R");
fit_2->Write();
dd3->Fit("bin_content_par1_3","R");
fit_3->Write();
dd4->Fit("bin_content_par1_4","R");
fit_4->Write();
f->Delete();
outFile->Delete();
TFile *f = new TFile("ch1_splitted_TF1_hfm1"+CutOff+".root");
TH1 *dd1 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_1");
TH1 *dd2 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_2");
TH1 *dd3 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_3");
TH1 *dd4 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_4");
TFile *outFile = new TFile("signal_proc_ch1_splitted_TF1_hfm1"+CutOff+".root","RECREATE");
outFile->cd();
TF1 *fit_1 = new TF1("bin_content_par1_1","pol2",fm1[0]-2.5,fm1[66]-2.5);
TF1 *fit_2 = new TF1("bin_content_par1_2","pol2",fm1[0]-2.5,fm1[66]-2.5);
TF1 *fit_3= new TF1("bin_content_par1_3","pol2",fm1[0]-2.5,fm1[66]-2.5);
TF1 *fit_4 = new TF1("bin_content_par1_4","pol2",fm1[0]-2.5,fm1[66]-2.5);
dd1->Fit("bin_content_par1_1","R");
fit_1->Write();
dd2->Fit("bin_content_par1_2","R");
fit_2->Write();
dd3->Fit("bin_content_par1_3","R");
fit_3->Write();
dd4->Fit("bin_content_par1_4","R");
fit_4->Write();
f->Delete();
outFile->Delete();
TFile *f = new TFile("ch1_splitted_TF1_hfm6"+CutOff+".root");
TH1 *dd1 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_1");
TH1 *dd2 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_2");
TH1 *dd3 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_3");
TH1 *dd4 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_4");
TFile *outFile = new TFile("signal_proc_ch1_splitted_TF1_hfm6"+CutOff+".root","RECREATE");
outFile->cd();
TF1 *fit_1 = new TF1("bin_content_par1_1","pol2",fm6[0]-1.0,fm6[83]-1.0);
TF1 *fit_2 = new TF1("bin_content_par1_2","pol2",fm6[0]-1.0,fm6[83]-1.0);
TF1 *fit_3= new TF1("bin_content_par1_3","pol2",fm6[0]-1.0,fm6[83]-1.0);
TF1 *fit_4 = new TF1("bin_content_par1_4","pol2",fm6[0]-1.0,fm6[83]-1.0);
dd1->Fit("bin_content_par1_1","R");
fit_1->Write();
dd2->Fit("bin_content_par1_2","R");
fit_2->Write();
dd3->Fit("bin_content_par1_3","R");
fit_3->Write();
dd4->Fit("bin_content_par1_4","R");
fit_4->Write();
f->Delete();
outFile->Delete();
TFile *f = new TFile("ch1_splitted_TF1_hfm7"+CutOff+".root");
TH1 *dd1 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_1");
TH1 *dd2 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_2");
TH1 *dd3 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_3");
TH1 *dd4 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_4");
TFile *outFile = new TFile("signal_proc_ch1_splitted_TF1_hfm7"+CutOff+".root","RECREATE");
outFile->cd();
TF1 *fit_1 = new TF1("bin_content_par1_1","pol2",fm7[0]-2.5,fm7[120]-2.5);
TF1 *fit_2 = new TF1("bin_content_par1_2","pol2",fm7[0]-2.5,fm7[120]-2.5);
TF1 *fit_3= new TF1("bin_content_par1_3","pol2",fm7[0]-2.5,fm7[120]-2.5);
TF1 *fit_4 = new TF1("bin_content_par1_4","pol2",fm7[0]-2.5,fm7[120]-2.5);
dd1->Fit("bin_content_par1_1","R");
fit_1->Write();
dd2->Fit("bin_content_par1_2","R");
fit_2->Write();
dd3->Fit("bin_content_par1_3","R");
fit_3->Write();
dd4->Fit("bin_content_par1_4","R");
fit_4->Write();
f->Delete();
outFile->Delete();
TFile *f = new TFile("ch1_splitted_TF1_hft0"+CutOff+".root");
TH1 *dd1 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_1");
TH1 *dd2 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_2");
TH1 *dd3 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_3");
TH1 *dd4 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_4");
TFile *outFile = new TFile("signal_proc_ch1_splitted_TF1_hft0"+CutOff+".root","RECREATE");
outFile->cd();
TF1 *fit_1 = new TF1("bin_content_par1_1","pol2",ft0[0]-0.1,ft0[68]-0.1);
TF1 *fit_2 = new TF1("bin_content_par1_2","pol2",ft0[0]-0.1,ft0[68]-0.1);
TF1 *fit_3= new TF1("bin_content_par1_3","pol2",ft0[0]-0.1,ft0[68]-0.1);
TF1 *fit_4 = new TF1("bin_content_par1_4","pol2",ft0[0]-0.1,ft0[68]-0.1);
dd1->Fit("bin_content_par1_1","R");
fit_1->Write();
dd2->Fit("bin_content_par1_2","R");
fit_2->Write();
dd3->Fit("bin_content_par1_3","R");
fit_3->Write();
dd4->Fit("bin_content_par1_4","R");
fit_4->Write();
f->Delete();
outFile->Delete();
TFile *f = new TFile("ch1_splitted_TF1_hft1"+CutOff+".root");
TH1 *dd1 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_1");
TH1 *dd2 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_2");
TH1 *dd3 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_3");
TH1 *dd4 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_4");
TFile *outFile = new TFile("signal_proc_ch1_splitted_TF1_hft1"+CutOff+".root","RECREATE");
outFile->cd();
TF1 *fit_1 = new TF1("bin_content_par1_1","pol2",ft1[0]-0.25,ft1[50]-0.25);
TF1 *fit_2 = new TF1("bin_content_par1_2","pol2",ft1[0]-0.25,ft1[50]-0.25);
TF1 *fit_3= new TF1("bin_content_par1_3","pol2",ft1[0]-0.25,ft1[50]-0.25);
TF1 *fit_4 = new TF1("bin_content_par1_4","pol2",ft1[0]-0.25,ft1[50]-0.25);
dd1->Fit("bin_content_par1_1","R");
fit_1->Write();
dd2->Fit("bin_content_par1_2","R");
fit_2->Write();
dd3->Fit("bin_content_par1_3","R");
fit_3->Write();
dd4->Fit("bin_content_par1_4","R");
fit_4->Write();
f->Delete();
outFile->Delete();
TFile *f = new TFile("ch1_splitted_TF1_hft2"+CutOff+".root");
TH1 *dd1 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_1");
TH1 *dd2 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_2");
TH1 *dd3 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_3");
TH1 *dd4 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_4");
TFile *outFile = new TFile("signal_proc_ch1_splitted_TF1_hft2"+CutOff+".root","RECREATE");
outFile->cd();
TF1 *fit_1 = new TF1("bin_content_par1_1","pol2",ft2[0]-0.25,ft2[82]-0.25);
TF1 *fit_2 = new TF1("bin_content_par1_2","pol2",ft2[0]-0.25,ft2[82]-0.25);
TF1 *fit_3= new TF1("bin_content_par1_3","pol2",ft2[0]-0.25,ft2[82]-0.25);
TF1 *fit_4 = new TF1("bin_content_par1_4","pol2",ft2[0]-0.25,ft2[82]-0.25);
dd1->Fit("bin_content_par1_1","R");
fit_1->Write();
dd2->Fit("bin_content_par1_2","R");
fit_2->Write();
dd3->Fit("bin_content_par1_3","R");
fit_3->Write();
dd4->Fit("bin_content_par1_4","R");
fit_4->Write();
f->Delete();
outFile->Delete();
TFile *f = new TFile("ch1_splitted_TF1_hfs0"+CutOff+".root");
TH1 *dd1 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_1");
TH1 *dd2 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_2");
TH1 *dd3 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_3");
TH1 *dd4 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_4");
TFile *outFile = new TFile("signal_proc_ch1_splitted_TF1_hfs0"+CutOff+".root","RECREATE");
outFile->cd();
TF1 *fit_1 = new TF1("bin_content_par1_1","pol2",fs0[0]-10,fs0[90]-10);
TF1 *fit_2 = new TF1("bin_content_par1_2","pol2",fs0[0]-10,fs0[90]-10);
TF1 *fit_3= new TF1("bin_content_par1_3","pol2",fs0[0]-10,fs0[90]-10);
TF1 *fit_4 = new TF1("bin_content_par1_4","pol2",fs0[0]-10,fs0[90]-10);
dd1->Fit("bin_content_par1_1","R");
fit_1->Write();
dd2->Fit("bin_content_par1_2","R");
fit_2->Write();
dd3->Fit("bin_content_par1_3","R");
fit_3->Write();
dd4->Fit("bin_content_par1_4","R");
fit_4->Write();
f->Delete();
outFile->Delete();
TFile *f = new TFile("ch1_splitted_TF1_hfs1"+CutOff+".root");
TH1 *dd1 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_1");
TH1 *dd2 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_2");
TH1 *dd3 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_3");
TH1 *dd4 = (TH1*) gDirectory->FindObjectAny("bin_content_par1_4");
TFile *outFile = new TFile("signal_proc_ch1_splitted_TF1_hfs1"+CutOff+".root","RECREATE");
outFile->cd();
TF1 *fit_1 = new TF1("bin_content_par1_1","pol2",fs1[0]-5,fs1[66]-5);
TF1 *fit_2 = new TF1("bin_content_par1_2","pol2",fs1[0]-5,fs1[66]-5);
TF1 *fit_3= new TF1("bin_content_par1_3","pol2",fs1[0]-5,fs1[66]-5);
TF1 *fit_4 = new TF1("bin_content_par1_4","pol2",fs1[0]-5,fs1[66]-5);
dd1->Fit("bin_content_par1_1","R");
fit_1->Write();
dd2->Fit("bin_content_par1_2","R");
fit_2->Write();
dd3->Fit("bin_content_par1_3","R");
fit_3->Write();
dd4->Fit("bin_content_par1_4","R");
fit_4->Write();
f->Delete();
outFile->Delete();
}