Commit 01734bb7 authored by Adrien Matta's avatar Adrien Matta
Browse files

* Switching nebula gamma calib to crystall ball

parent 0fc09479
Pipeline #125100 passed with stages
in 8 minutes and 3 seconds
...@@ -3,6 +3,7 @@ TChain* MakeChain2(); ...@@ -3,6 +3,7 @@ TChain* MakeChain2();
TChain* MakeChain(); TChain* MakeChain();
TH2F* MakeTH2(); TH2F* MakeTH2();
TH2F* GetTH2(); TH2F* GetTH2();
TGraph* graph = new TGraph(200);
double off; double off;
double c_light=299.792458;//mm/ns double c_light=299.792458;//mm/ns
auto chain = MakeChain(); auto chain = MakeChain();
...@@ -33,6 +34,8 @@ void gamma(){ ...@@ -33,6 +34,8 @@ void gamma(){
process1bar(i); process1bar(i);
} }
output.close(); output.close();
new TCanvas();
graph->Draw("ap");
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
...@@ -43,13 +46,16 @@ void process1bar(int b){ ...@@ -43,13 +46,16 @@ void process1bar(int b){
double R = r1->GetBinCenter(r1->GetMaximumBin()); double R = r1->GetBinCenter(r1->GetMaximumBin());
auto h1 = h->ProjectionY(Form("h%d",b),b,b+1); auto h1 = h->ProjectionY(Form("h%d",b),b,b+1);
h1->Rebin(10); h1->Rebin(8);
double max = h1->GetBinCenter(h1->GetMaximumBin()); double max = h1->GetBinCenter(h1->GetMaximumBin());
//h1->Draw(); //h1->Draw();
auto f = new TF1("f","gaus(0)+pol0(3)",max-50,max+50); auto f = new TF1("f","crystalball",max-50,max+50);
f->SetParameter(0,h1->GetMaximum()); f->SetParameter(0,h1->GetMaximum());
f->SetParameter(1,max); f->SetParameter(1,max);
f->SetParameter(2,50); f->SetParameter(2,35);
f->SetParameter(3,0.1);
f->SetParameter(4,1);
h1->Fit(f,"R"); h1->Fit(f,"R");
// Vbad = R/(TOF) -> TOF/R = 1/Vbad // Vbad = R/(TOF) -> TOF/R = 1/Vbad
...@@ -58,10 +64,13 @@ void process1bar(int b){ ...@@ -58,10 +64,13 @@ void process1bar(int b){
// X=R*(1/c-1/Vbad) // X=R*(1/c-1/Vbad)
double offset=R*(1/c_light-1/f->GetParameter(1)) ; double offset=R*(1/c_light-1/f->GetParameter(1)) ;
// double offset=R*(1/c_light-1/max) ;
cout <<f->GetParameter(1) << " " << offset << " " << R/(f->GetParameter(1)-offset) << endl; cout <<f->GetParameter(1) << " " << offset << " " << R/(f->GetParameter(1)-offset) << endl;
if(offset>0) if(offset>0){
output << "NEBULA_T_ID" << b << " " << offset << endl; output << "NEBULA_T_ID" << b << " " << offset << endl;
graph->SetPoint(b,b,offset);
}
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
TH2F* GetTH2(){ TH2F* GetTH2(){
......
NEBULA_T_ID1 34.4496 NEBULA_T_ID1 33.9836
NEBULA_T_ID2 34.6314 NEBULA_T_ID2 33.9881
NEBULA_T_ID3 34.7365 NEBULA_T_ID3 34.8719
NEBULA_T_ID4 34.647 NEBULA_T_ID4 34.0808
NEBULA_T_ID5 34.7288 NEBULA_T_ID5 34.841
NEBULA_T_ID6 34.7956 NEBULA_T_ID6 35.7267
NEBULA_T_ID7 34.6829 NEBULA_T_ID7 33.9836
NEBULA_T_ID8 34.7084 NEBULA_T_ID8 34.0748
NEBULA_T_ID9 34.7057 NEBULA_T_ID9 34.7627
NEBULA_T_ID10 34.5743 NEBULA_T_ID10 33.9202
NEBULA_T_ID11 34.4985 NEBULA_T_ID11 33.8699
NEBULA_T_ID12 34.6159 NEBULA_T_ID12 33.9415
NEBULA_T_ID13 34.5739 NEBULA_T_ID13 33.8628
NEBULA_T_ID14 34.5371 NEBULA_T_ID14 34.8015
NEBULA_T_ID15 34.6919 NEBULA_T_ID15 35.0343
NEBULA_T_ID16 34.6399 NEBULA_T_ID16 34.7608
NEBULA_T_ID17 34.4489 NEBULA_T_ID17 34.5725
NEBULA_T_ID18 34.2927 NEBULA_T_ID18 34.4594
NEBULA_T_ID19 34.3836 NEBULA_T_ID19 34.4878
NEBULA_T_ID20 34.2563 NEBULA_T_ID20 34.6039
NEBULA_T_ID21 34.3294 NEBULA_T_ID21 34.3944
NEBULA_T_ID22 34.3534 NEBULA_T_ID22 34.5224
NEBULA_T_ID23 34.3104 NEBULA_T_ID23 34.4107
NEBULA_T_ID24 34.2289 NEBULA_T_ID24 34.38
NEBULA_T_ID25 34.4384 NEBULA_T_ID25 33.8072
NEBULA_T_ID26 34.6984 NEBULA_T_ID26 34.7813
NEBULA_T_ID27 34.8323 NEBULA_T_ID27 34.9628
NEBULA_T_ID28 34.6539 NEBULA_T_ID28 34.9443
NEBULA_T_ID29 34.6869 NEBULA_T_ID29 34.9635
NEBULA_T_ID30 34.8888 NEBULA_T_ID30 35.8073
NEBULA_T_ID31 34.3095 NEBULA_T_ID31 34.4768
NEBULA_T_ID32 34.4284 NEBULA_T_ID32 33.7205
NEBULA_T_ID33 34.4589 NEBULA_T_ID33 34.6776
NEBULA_T_ID34 34.3198 NEBULA_T_ID34 34.4922
NEBULA_T_ID35 34.2234 NEBULA_T_ID35 33.5622
NEBULA_T_ID36 34.2379 NEBULA_T_ID36 33.5742
NEBULA_T_ID37 34.5804 NEBULA_T_ID37 34.8329
NEBULA_T_ID38 34.5025 NEBULA_T_ID38 34.5208
NEBULA_T_ID39 34.3255 NEBULA_T_ID39 33.7213
NEBULA_T_ID40 34.1503 NEBULA_T_ID40 34.3867
NEBULA_T_ID41 34.1428 NEBULA_T_ID41 34.3812
NEBULA_T_ID42 34.3929 NEBULA_T_ID42 34.443
NEBULA_T_ID43 34.3742 NEBULA_T_ID43 34.5214
NEBULA_T_ID44 34.3814 NEBULA_T_ID44 34.7027
NEBULA_T_ID45 34.4177 NEBULA_T_ID45 35.3566
NEBULA_T_ID46 34.4584 NEBULA_T_ID46 35.3286
NEBULA_T_ID47 34.4725 NEBULA_T_ID47 35.3585
NEBULA_T_ID48 34.4918 NEBULA_T_ID48 34.6563
NEBULA_T_ID49 34.4687 NEBULA_T_ID49 34.5372
NEBULA_T_ID50 34.4166 NEBULA_T_ID50 34.7778
NEBULA_T_ID51 34.4939 NEBULA_T_ID51 34.6312
NEBULA_T_ID52 34.4224 NEBULA_T_ID52 34.6078
NEBULA_T_ID53 34.5229 NEBULA_T_ID53 34.7642
NEBULA_T_ID54 34.4312 NEBULA_T_ID54 35.1783
NEBULA_T_ID55 34.4396 NEBULA_T_ID55 34.712
NEBULA_T_ID56 34.5145 NEBULA_T_ID56 34.7362
NEBULA_T_ID57 34.562 NEBULA_T_ID57 34.0617
NEBULA_T_ID58 34.928 NEBULA_T_ID58 35.0756
NEBULA_T_ID59 35.183 NEBULA_T_ID59 35.2966
NEBULA_T_ID60 35.1656 NEBULA_T_ID60 35.3255
NEBULA_T_ID61 32.9242 NEBULA_T_ID61 32.6669
NEBULA_T_ID62 34.1653 NEBULA_T_ID62 33.1417
NEBULA_T_ID63 34.8501 NEBULA_T_ID63 34.7794
NEBULA_T_ID64 34.9316 NEBULA_T_ID64 34.9666
NEBULA_T_ID65 34.6732 NEBULA_T_ID65 34.7637
NEBULA_T_ID66 34.9875 NEBULA_T_ID66 34.2186
NEBULA_T_ID67 34.7117 NEBULA_T_ID67 34.0453
NEBULA_T_ID68 34.2271 NEBULA_T_ID68 34.3257
NEBULA_T_ID69 33.7254 NEBULA_T_ID69 33.8024
NEBULA_T_ID70 33.9647 NEBULA_T_ID70 34.0133
NEBULA_T_ID71 34.2237 NEBULA_T_ID71 33.4669
NEBULA_T_ID72 33.7863 NEBULA_T_ID72 33.8204
NEBULA_T_ID73 33.9696 NEBULA_T_ID73 34.0523
NEBULA_T_ID74 34.1399 NEBULA_T_ID74 33.439
NEBULA_T_ID75 34.1908 NEBULA_T_ID75 34.3122
NEBULA_T_ID76 34.583 NEBULA_T_ID76 34.6244
NEBULA_T_ID77 34.8935 NEBULA_T_ID77 34.1306
NEBULA_T_ID78 34.1324 NEBULA_T_ID78 34.2332
NEBULA_T_ID79 33.8117 NEBULA_T_ID79 33.9023
NEBULA_T_ID80 34.5081 NEBULA_T_ID80 34.4602
NEBULA_T_ID81 34.6843 NEBULA_T_ID81 34.5478
NEBULA_T_ID82 33.7928 NEBULA_T_ID82 33.8178
NEBULA_T_ID83 36.6808 NEBULA_T_ID83 33.7832
NEBULA_T_ID84 34.7277 NEBULA_T_ID84 33.838
NEBULA_T_ID85 33.7536 NEBULA_T_ID85 33.9126
NEBULA_T_ID86 34.0577 NEBULA_T_ID86 34.115
NEBULA_T_ID87 34.1767 NEBULA_T_ID87 34.3017
NEBULA_T_ID88 33.5782 NEBULA_T_ID88 33.6413
NEBULA_T_ID89 33.8209 NEBULA_T_ID89 33.8961
NEBULA_T_ID90 34.0865 NEBULA_T_ID90 33.3322
NEBULA_T_ID91 33.864 NEBULA_T_ID91 34.1547
NEBULA_T_ID92 34.3914 NEBULA_T_ID92 34.9315
NEBULA_T_ID93 34.3636 NEBULA_T_ID93 33.6377
NEBULA_T_ID94 34.3067 NEBULA_T_ID94 34.3891
NEBULA_T_ID95 34.1675 NEBULA_T_ID95 34.1814
NEBULA_T_ID96 34.4526 NEBULA_T_ID96 34.5955
NEBULA_T_ID97 34.5612 NEBULA_T_ID97 34.6112
NEBULA_T_ID98 34.5703 NEBULA_T_ID98 35.7835
NEBULA_T_ID99 34.2859 NEBULA_T_ID99 34.0818
NEBULA_T_ID100 34.9442 NEBULA_T_ID100 35.1193
NEBULA_T_ID101 34.5888 NEBULA_T_ID101 34.8071
NEBULA_T_ID102 34.2186 NEBULA_T_ID102 34.9883
NEBULA_T_ID103 34.3319 NEBULA_T_ID103 34.497
NEBULA_T_ID104 34.6388 NEBULA_T_ID104 34.703
NEBULA_T_ID105 34.8648 NEBULA_T_ID105 34.8702
NEBULA_T_ID106 35.0072 NEBULA_T_ID106 35.0965
NEBULA_T_ID107 34.8953 NEBULA_T_ID107 35.0943
NEBULA_T_ID108 34.2836 NEBULA_T_ID108 34.6046
NEBULA_T_ID109 34.4106 NEBULA_T_ID109 34.532
NEBULA_T_ID110 33.6492 NEBULA_T_ID110 33.7859
NEBULA_T_ID111 33.7064 NEBULA_T_ID111 33.7819
NEBULA_T_ID112 34.4706 NEBULA_T_ID112 34.4952
NEBULA_T_ID113 34.5228 NEBULA_T_ID113 34.5332
NEBULA_T_ID114 34.591 NEBULA_T_ID114 34.6209
NEBULA_T_ID115 33.8096 NEBULA_T_ID115 34.1114
NEBULA_T_ID116 33.8616 NEBULA_T_ID116 33.9028
NEBULA_T_ID117 34.7569 NEBULA_T_ID117 34.8262
NEBULA_T_ID118 34.7341 NEBULA_T_ID118 34.77
NEBULA_T_ID119 34.8225 NEBULA_T_ID119 34.9263
NEBULA_T_ID120 35.0814 NEBULA_T_ID120 35.2043
NEBULA_T_ID121 33.131 NEBULA_T_ID121 33.2796
NEBULA_T_ID122 33.6019 NEBULA_T_ID122 33.6612
NEBULA_T_ID123 33.9949 NEBULA_T_ID123 34.327
NEBULA_T_ID124 34.5415 NEBULA_T_ID124 34.5055
NEBULA_T_ID125 34.5331 NEBULA_T_ID125 34.6266
NEBULA_T_ID126 34.5245 NEBULA_T_ID126 34.6292
NEBULA_T_ID127 34.3994 NEBULA_T_ID127 34.5133
NEBULA_T_ID128 34.298 NEBULA_T_ID128 34.3952
NEBULA_T_ID129 34.2552 NEBULA_T_ID129 34.3441
NEBULA_T_ID130 34.1823 NEBULA_T_ID130 34.2643
NEBULA_T_ID131 34.2367 NEBULA_T_ID131 34.3707
NEBULA_T_ID132 33.1246 NEBULA_T_ID132 33.5937
NEBULA_T_ID133 33.0361 NEBULA_T_ID133 32.9952
NEBULA_T_ID134 34.5136 NEBULA_T_ID134 34.6796
NEBULA_T_ID135 34.5645 NEBULA_T_ID135 34.4951
NEBULA_T_ID136 34.7663 NEBULA_T_ID136 34.8009
NEBULA_T_ID137 35.1848 NEBULA_T_ID137 35.2459
NEBULA_T_ID138 35.2722 NEBULA_T_ID138 35.755
NEBULA_T_ID139 35.1103 NEBULA_T_ID139 35.3797
NEBULA_T_ID140 34.9122 NEBULA_T_ID140 34.826
NEBULA_T_ID141 28.3828 NEBULA_T_ID141 27.6101
NEBULA_T_ID142 29.6987 NEBULA_T_ID142 30.1551
NEBULA_T_ID143 34.9079 NEBULA_T_ID143 35.078
NEBULA_T_ID144 34.5023 NEBULA_T_ID144 34.5041
NEBULA_T_ID145 34.3085 NEBULA_T_ID145 34.2362
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