-
Notifications
You must be signed in to change notification settings - Fork 1
/
ThesisPlots.cpp
3684 lines (3192 loc) · 137 KB
/
ThesisPlots.cpp
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "ThesisPlots.h"
#include <stdlib.h>
#include "FemtoBoyzScripts.h"
#include "CATS.h"
#include "CATSconstants.h"
#include "DLM_Potentials.h"
#include "DLM_Source.h"
#include "DLM_SubPads.h"
#include "DLM_CkDecomposition.h"
#include "DLM_Ck.h"
#include "DLM_CkDecomp.h"
#include "DLM_RootWrapper.h"
#include "DLM_CkModels.h"
#include "DLM_Fitters.h"
#include "CommonAnaFunctions.h"
#include "EnvVars.h"
#include "TStyle.h"
#include "TString.h"
#include "TGraph.h"
#include "TGraphErrors.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TRandom3.h"
#include "TFile.h"
#include "TF1.h"
#include "TCanvas.h"
#include "TLegend.h"
#include "TGaxis.h"
#include "TPaveText.h"
#include "TROOT.h"
DLM_CkDecomposition* CKDEC_FIT_PP;
void SetStyleAxis_1(TH1F* hAxis){
hAxis->SetStats(false);
hAxis->SetTitle("");
hAxis->GetXaxis()->SetTitleSize(0.07);
hAxis->GetXaxis()->SetLabelSize(0.07);
hAxis->GetXaxis()->SetTitleOffset(1.3);
hAxis->GetXaxis()->SetLabelOffset(0.02);
hAxis->GetYaxis()->SetTitleSize(0.07);
hAxis->GetYaxis()->SetLabelSize(0.07);
hAxis->GetYaxis()->SetTitleOffset(1.00);
hAxis->GetYaxis()->SetNdivisions(505);
}
void SetStyleAxis_2(TH1F* hAxis){
hAxis->SetStats(false);
hAxis->SetTitle("");
hAxis->GetXaxis()->SetTitleSize(0.06);
hAxis->GetXaxis()->SetLabelSize(0.06);
hAxis->GetXaxis()->SetTitleOffset(1.3);
hAxis->GetXaxis()->SetLabelOffset(0.02);
hAxis->GetYaxis()->SetTitleSize(0.06);
hAxis->GetYaxis()->SetLabelSize(0.06);
hAxis->GetYaxis()->SetTitleOffset(0.95);
hAxis->GetYaxis()->SetNdivisions(505);
}
void SetStyleAxis2D_2(TH2F* hAxis){
hAxis->SetStats(false);
hAxis->SetTitle("");
hAxis->GetXaxis()->SetTitleSize(0.06);
hAxis->GetXaxis()->SetLabelSize(0.06);
hAxis->GetXaxis()->SetTitleOffset(1.3);
hAxis->GetXaxis()->SetLabelOffset(0.02);
hAxis->GetYaxis()->SetTitleSize(0.06);
hAxis->GetYaxis()->SetLabelSize(0.06);
hAxis->GetYaxis()->SetTitleOffset(0.95);
hAxis->GetYaxis()->SetNdivisions(505);
hAxis->GetZaxis()->SetTitleSize(0.05);
hAxis->GetZaxis()->SetLabelSize(0.05);
hAxis->GetZaxis()->SetTitleOffset(1.25);
}
void SetStyleAxis_3(TH1F* hAxis){
hAxis->SetStats(false);
hAxis->SetTitle("");
hAxis->GetXaxis()->SetTitleSize(0.08);
hAxis->GetXaxis()->SetLabelSize(0.08);
hAxis->GetXaxis()->SetTitleOffset(1.3);
hAxis->GetXaxis()->SetLabelOffset(0.02);
hAxis->GetYaxis()->SetTitleSize(0.08);
hAxis->GetYaxis()->SetLabelSize(0.08);
hAxis->GetYaxis()->SetTitleOffset(0.5);
hAxis->GetYaxis()->SetNdivisions(505);
}
void ToyPotentials_PS_WF_CF(){
printf("Start: ToyPotentials_PS_WF_CF\n");
const TString OutputFolder = TString::Format("%s/Plots/PhDThesis/CATS/",GetCernBoxDimi()).Data();
const double MassX = 1116;
const double MassY = 1116;
const double MassXY = (MassX*MassY)/(MassX+MassY);
const double kMin = 0;
const double kMax = 200;
const unsigned NumMomBins = 100;
const double dfit_Min = 2;
const double dfit_Max = 100;
const double rMin = 0;
const double rMax = 48;
const unsigned NumRadBins = 512;
const double rWidth = (rMax-rMin)/double(NumRadBins);
const unsigned NumRad = 3;
double* RADIUS = new double[NumRad];
//RADIUS[0] = 0.8;
//RADIUS[1] = 1.2;
//RADIUS[2] = 1.6;
//RADIUS[3] = 3.0;
RADIUS[0] = 1.0;
RADIUS[1] = 1.5;
RADIUS[2] = 4.0;
const unsigned NumFreeWF = 3;
double* FreeWaveK = new double[NumFreeWF];
FreeWaveK[0] = 50;
FreeWaveK[1] = 100;
FreeWaveK[2] = 200;
const unsigned NumPot = 3;
TString* PotNames = new TString[NumPot];
PotNames[0] = "Toy1_X";
PotNames[1] = "ND54_X";
PotNames[2] = "ND46_X";
TString PotLegend[NumPot];
PotLegend[0] = "V_{#minus}";
PotLegend[1] = "V_{+}";
PotLegend[2] = "V_{B}";
int* PotColors = new int[NumPot];
PotColors[0] = kRed+1;
PotColors[1] = kGreen+2;
PotColors[2] = kAzure+10;
int* FwfColors = new int[NumFreeWF];
FwfColors[0] = kMagenta+1;
FwfColors[1] = kCyan+1;
FwfColors[2] = kYellow+2;
TGraph** gCk = new TGraph* [NumPot];
for(unsigned uPot=0; uPot<NumPot; uPot++){
gCk[uPot] = new TGraph [NumRad];
for(unsigned uSor=0; uSor<NumRad; uSor++){
gCk[uPot][uSor].SetName("gCk_"+PotNames[uPot]+TString::Format("_%.1f",RADIUS[uSor]));
}
}
TF1** fPot = new TF1* [NumPot];
for(unsigned uPot=0; uPot<NumPot; uPot++){
//V0*exp(-r^2/β0^2)+V1*exp(-r^2/β1^2)+V2*exp(-r^2/β2^2)
fPot[uPot] = new TF1("fPot_"+PotNames[uPot],"[0]*exp(-pow(x/[1],2.))+[2]*exp(-pow(x/[3],2.))+[4]*exp(-pow(x/[5],2.))",0,6);
}
TGraph* gWFref = new TGraph [NumPot];
TGraph* gWFas = new TGraph [NumPot];
TGraph* gWF = new TGraph [NumPot];
TGraph* grWFref = new TGraph [NumPot];
TGraph* grWFas = new TGraph [NumPot];
TGraph* grWF = new TGraph [NumPot];
TGraph* gWFd = new TGraph [NumPot];//diff to ref
TGraph* gWFda = new TGraph [NumPot];//diff to as
TGraph* gTotWF = new TGraph [NumPot];
for(unsigned uPot=0; uPot<NumPot; uPot++){
gWFref[uPot].SetName("gWFref_"+PotNames[uPot]);
gWFas[uPot].SetName("gWFas_"+PotNames[uPot]);
gWF[uPot].SetName("gWF_"+PotNames[uPot]);
grWFref[uPot].SetName("grWFref_"+PotNames[uPot]);
grWFas[uPot].SetName("grWFas_"+PotNames[uPot]);
grWF[uPot].SetName("grWF_"+PotNames[uPot]);
gWFd[uPot].SetName("gWFd_"+PotNames[uPot]);
gWFda[uPot].SetName("gWFda_"+PotNames[uPot]);
gTotWF[uPot].SetName("gTotWF_"+PotNames[uPot]);
}
TGraph* gFreeWF = new TGraph [NumFreeWF];
for(unsigned uFWF=0; uFWF<NumFreeWF; uFWF++){
gFreeWF[uFWF].SetName(TString::Format("gFreeWF_%.0f",FreeWaveK[uFWF]));
}
TGraph* gSource = new TGraph [NumRad];
for(unsigned uSor=0; uSor<NumRad; uSor++){
gSource[uSor].SetName("gSource_"+PotNames[uSor]);
}
TH1F** hPhaseShiftsPar = new TH1F* [NumPot];
TH1F** hPhaseShifts = new TH1F* [NumPot];
TF1** fPhaseShiftsPar = new TF1* [NumPot];
TF1** fPhaseShifts = new TF1* [NumPot];
for(unsigned uPot=0; uPot<NumPot; uPot++){
hPhaseShiftsPar[uPot] = new TH1F("hPhaseShiftsPar_"+PotNames[uPot],"hPhaseShiftsPar_"+PotNames[uPot],NumMomBins,kMin,kMax);
hPhaseShifts[uPot] = new TH1F("hPhaseShifts_"+PotNames[uPot],"hPhaseShifts_"+PotNames[uPot],NumMomBins,kMin,kMax);
fPhaseShiftsPar[uPot] = new TF1("fPhaseShiftsPar_"+PotNames[uPot],"[2]*x*x*x*x+0.5*[1]/197.327*x*x+197.327/[0]", dfit_Min, dfit_Max);
if(uPot==0) fPhaseShifts[uPot] = new TF1("fPhaseShifts_"+PotNames[uPot],"57.2957795*TMath::ATan2(1./([2]*x*x*x+0.5*[1]/197.327*x+197.327/[0]/x),1.)", dfit_Min, dfit_Max);
else if(uPot==1) fPhaseShifts[uPot] = new TF1("fPhaseShifts_"+PotNames[uPot],"57.2957795*TMath::ATan2(1./([2]*x*x*x+0.5*[1]/197.327*x+197.327/[0]/x),1.)", dfit_Min, dfit_Max);
else fPhaseShifts[uPot] = new TF1("fPhaseShifts_"+PotNames[uPot],"-57.2957795*TMath::ATan2(1./([2]*x*x*x+0.5*[1]/197.327*x+197.327/[0]/x),-1.)", dfit_Min, dfit_Max);
}
CATSparameters ParsSource(CATSparameters::tSource,1,true);
ParsSource.SetParameter(0,1.2);
CATSparameters ParsPot(CATSparameters::tPotential,6,true);
CATS Kitty;
Kitty.SetMomBins(NumMomBins,kMin,kMax);
Kitty.SetThetaDependentSource(false);
Kitty.SetAnaSource(GaussSource, ParsSource);
Kitty.SetUseAnalyticSource(true);
Kitty.SetMomentumDependentSource(false);
Kitty.SetExcludeFailedBins(false);
Kitty.SetQ1Q2(0);
Kitty.SetQuantumStatistics(false);
Kitty.SetPdgId(1,2);
Kitty.SetRedMass( MassXY );
Kitty.SetNumChannels(1);
Kitty.SetNumPW(0,1);
Kitty.SetSpin(0,0);
Kitty.SetChannelWeight(0, 1.);
Kitty.SetEpsilonConv(2e-9);
Kitty.SetEpsilonProp(2e-9);
Kitty.SetMaxNumThreads(4);
for(unsigned uPot=0; uPot<NumPot; uPot++){
switch(uPot){
//Toy1_X (modified)
case 0 : //ParsPot.SetParameter(0,-144.5);
//ParsPot.SetParameter(1,2.11);
//ParsPot.SetParameter(2,520.0);
//ParsPot.SetParameter(3,0.54);
ParsPot.SetParameter(0,-150);
ParsPot.SetParameter(1,1.0);
ParsPot.SetParameter(2,2000);
ParsPot.SetParameter(3,0.7);
ParsPot.SetParameter(4,0.0);
ParsPot.SetParameter(5,100.0);
break;
//ND54_X (modified)
case 1 : ParsPot.SetParameter(0,-150);
ParsPot.SetParameter(1,1.0);
ParsPot.SetParameter(2,1000);
ParsPot.SetParameter(3,0.5);
ParsPot.SetParameter(4,0.0);
ParsPot.SetParameter(5,100.0);
break;
//ND46_X (modified)
case 2 : ParsPot.SetParameter(0,-150);
ParsPot.SetParameter(1,1.0);
ParsPot.SetParameter(2,125);
ParsPot.SetParameter(3,0.5);
ParsPot.SetParameter(4,0.0);
ParsPot.SetParameter(5,100.0);
break;
default : break;
}
Kitty.RemoveShortRangePotential(0,0);
Kitty.SetShortRangePotential(0,0,TripleGaussSum,ParsPot);
for(unsigned uSor=0; uSor<NumRad; uSor++){
Kitty.SetAnaSource(0,RADIUS[uSor]);
Kitty.KillTheCat();
for(unsigned uMomBin=0; uMomBin<NumMomBins; uMomBin++){
gCk[uPot][uSor].SetPoint(uMomBin,Kitty.GetMomentum(uMomBin),Kitty.GetCorrFun(uMomBin));
if(uSor==0){
hPhaseShiftsPar[uPot]->SetBinContent(uMomBin+1, Kitty.GetMomentum(uMomBin)/tan(Kitty.GetPhaseShift(uMomBin,0,0)));
hPhaseShifts[uPot]->SetBinContent(uMomBin+1, Kitty.GetPhaseShift(uMomBin,0,0)*RadToDeg);
}
}
if(uSor==0){
switch(uPot){
//Toy1
case 0 : fPhaseShiftsPar[uPot]->SetParameter(0, -0.73);
fPhaseShiftsPar[uPot]->SetParameter(1, 7.72);
fPhaseShifts[uPot]->SetParameter(0, -0.73);
fPhaseShifts[uPot]->SetParameter(1, 7.72);
break;
//ND54
case 1 : fPhaseShiftsPar[uPot]->SetParameter(0, 1.89);
fPhaseShiftsPar[uPot]->SetParameter(1, 3.39);
fPhaseShifts[uPot]->SetParameter(0, 1.89);
fPhaseShifts[uPot]->SetParameter(1, 3.39);
break;
//ND46
case 2 : fPhaseShiftsPar[uPot]->SetParameter(0, -4.62);
fPhaseShiftsPar[uPot]->SetParameter(1, 1.3);
fPhaseShifts[uPot]->SetParameter(0, -4.72);
fPhaseShifts[uPot]->SetParameter(1, 1.31);
break;
default : break;
}
fPhaseShiftsPar[uPot]->SetParLimits(0, -10., 10.);
fPhaseShiftsPar[uPot]->SetParLimits(1, 0., 32.);
fPhaseShiftsPar[uPot]->FixParameter(2, 0);
hPhaseShiftsPar[uPot]->Fit(fPhaseShiftsPar[uPot], "S, N, R, M");
fPhaseShifts[uPot]->FixParameter(0, fPhaseShiftsPar[uPot]->GetParameter(0));
fPhaseShifts[uPot]->FixParameter(1, fPhaseShiftsPar[uPot]->GetParameter(1));
//fPhaseShifts[uPot]->SetParLimits(0, fPhaseShiftsPar[uPot]->GetParameter(0)*0.9, fPhaseShiftsPar[uPot]->GetParameter(0)*1.1);
//fPhaseShifts[uPot]->SetParLimits(1, fPhaseShiftsPar[uPot]->GetParameter(1)*0.9, fPhaseShiftsPar[uPot]->GetParameter(1)*1.1);
fPhaseShifts[uPot]->FixParameter(2, 0);
hPhaseShifts[uPot]->Fit(fPhaseShifts[uPot], "S, N, R, M");
fPot[uPot]->SetParameter(0,ParsPot.GetParameter(0));
fPot[uPot]->SetParameter(1,ParsPot.GetParameter(1));
fPot[uPot]->SetParameter(2,ParsPot.GetParameter(2));
fPot[uPot]->SetParameter(3,ParsPot.GetParameter(3));
fPot[uPot]->SetParameter(4,ParsPot.GetParameter(4));
fPot[uPot]->SetParameter(5,ParsPot.GetParameter(5));
for(unsigned uRadBin=0; uRadBin<NumRadBins; uRadBin++){
double RAD = rMin+0.5*rWidth+double(uRadBin)*rWidth;
gWFref[uPot].SetPoint(uRadBin,RAD,real(Kitty.EvalReferenceRadialWF(Kitty.GetMomBin(50),0,RAD,true)));
grWFref[uPot].SetPoint(uRadBin,RAD,real(Kitty.EvalReferenceRadialWF(Kitty.GetMomBin(50),0,RAD,false)));
if(uPot==0){
for(unsigned uFWF=0; uFWF<NumFreeWF; uFWF++){
gFreeWF[uFWF].SetPoint(uRadBin,RAD,real(Kitty.EvalReferenceRadialWF(Kitty.GetMomBin(FreeWaveK[uFWF]),0,RAD,true)));
}
}
gWFas[uPot].SetPoint(uRadBin,RAD,real(Kitty.EvalAsymptoticRadialWF(Kitty.GetMomBin(50),0,0,RAD,true)));
grWFas[uPot].SetPoint(uRadBin,RAD,real(Kitty.EvalAsymptoticRadialWF(Kitty.GetMomBin(50),0,0,RAD,false)));
gWF[uPot].SetPoint(uRadBin,RAD,real(Kitty.EvalRadialWaveFunction(Kitty.GetMomBin(50),0,0,RAD,true)));
grWF[uPot].SetPoint(uRadBin,RAD,real(Kitty.EvalRadialWaveFunction(Kitty.GetMomBin(50),0,0,RAD,false)));
gWFd[uPot].SetPoint(uRadBin,RAD,real(Kitty.EvalRadialWaveFunction(Kitty.GetMomBin(50),0,0,RAD,true))-real(Kitty.EvalReferenceRadialWF(Kitty.GetMomBin(50),0,RAD,true)));
gWFda[uPot].SetPoint(uRadBin,RAD,fabs(real(Kitty.EvalRadialWaveFunction(Kitty.GetMomBin(50),0,0,RAD,true))-real(Kitty.EvalAsymptoticRadialWF(Kitty.GetMomBin(50),0,0,RAD,true))));
gTotWF[uPot].SetPoint(uRadBin,RAD,Kitty.EvalWaveFun2(Kitty.GetMomBin(50),RAD,0));
}
}
if(uPot==0){
for(unsigned uRadBin=0; uRadBin<NumRadBins; uRadBin++){
double RAD = rMin+0.5*rWidth+double(uRadBin)*rWidth;
gSource[uSor].SetPoint(uRadBin,RAD,Kitty.EvaluateTheSource(50,RAD,0));
}
}
}
}
//POTENTIAL PLOTS
TH1F* hPot_Dummy = new TH1F("hPot_Dummy","hPot_Dummy",128,0,2.5);
SetStyleAxis_1(hPot_Dummy);
hPot_Dummy->GetXaxis()->SetTitle("r (fm)");
hPot_Dummy->GetYaxis()->SetTitle("V(r) (MeV)");
hPot_Dummy->GetYaxis()->SetRangeUser(-100,400);
TLegend* lLegend_Pot = new TLegend(0.7,0.60,0.85,0.85);//lbrt
lLegend_Pot->SetName(TString::Format("lLegend_Pot"));
lLegend_Pot->SetTextSize(0.07);
for(unsigned uPot=0; uPot<NumPot; uPot++){
lLegend_Pot->AddEntry(fPot[uPot],PotLegend[uPot]);
}
TCanvas* cPotentials = new TCanvas("cPotentials", "cPotentials", 1);
cPotentials->cd(0); cPotentials->SetCanvasSize(1920, 1080); cPotentials->SetMargin(0.15,0.05,0.2,0.05);//lrbt
cPotentials->SetGrid(true);
hPot_Dummy->Draw("axis");
for(unsigned uPot=0; uPot<NumPot; uPot++){
fPot[uPot]->SetLineWidth(4.-0.33*double(uPot));
fPot[uPot]->SetLineColor(PotColors[uPot]);
fPot[uPot]->Draw("same");
}
lLegend_Pot->Draw("same");
cPotentials->SaveAs(OutputFolder+"cPotentials.png");
cPotentials->SaveAs(OutputFolder+"cPotentials.pdf");
//FREE S-WAVE
TH1F* hFWF_Dummy = new TH1F("hFWF_Dummy","hFWF_Dummy",128,0,32);
SetStyleAxis_1(hFWF_Dummy);
hFWF_Dummy->GetXaxis()->SetTitle("r (fm)");
hFWF_Dummy->GetYaxis()->SetTitle("j_{0}(kr) = a_{k,0}(r)/r");
hFWF_Dummy->GetYaxis()->SetRangeUser(-0.3,1.0);
TLegend* lLegend_FWF = new TLegend(0.475,0.575,0.925,0.925);//lbrt
lLegend_FWF->SetName(TString::Format("lLegend_FWF"));
lLegend_FWF->SetTextSize(0.07);
for(unsigned uFWF=0; uFWF<NumFreeWF; uFWF++){
lLegend_FWF->AddEntry(&gFreeWF[uFWF],TString::Format("j_{0}(kr) (k=%.0f MeV)",FreeWaveK[uFWF]));
}
TCanvas* cFWF = new TCanvas("cFWF", "cFWF", 1);
cFWF->cd(0); cFWF->SetCanvasSize(1920, 1080); cFWF->SetMargin(0.15,0.05,0.2,0.05);//lrbt
cFWF->SetGrid(true);
hFWF_Dummy->Draw("axis");
for(unsigned uFWF=0; uFWF<NumFreeWF; uFWF++){
gFreeWF[uFWF].SetLineWidth(4.-0.33*double(uFWF));
gFreeWF[uFWF].SetLineColor(FwfColors[uFWF]);
gFreeWF[uFWF].Draw("C,same");
}
lLegend_FWF->Draw("same");
cFWF->SaveAs(OutputFolder+"cFWF.png");
cFWF->SaveAs(OutputFolder+"cFWF.pdf");
//plot the wave functions
double WF_Mom = Kitty.GetMomentum(Kitty.GetMomBin(50));
double WFu_yMax = 1.8;
double WFtot_yMax = 2.4;
double WF_rMax = 16;
double WF_rhoMax = WF_rMax*FmToNu*WF_Mom;
TH1F* hWFu_Dummy = new TH1F("hWFu_Dummy","hWFu_Dummy",128,0,WF_rMax);
SetStyleAxis_2(hWFu_Dummy);
hWFu_Dummy->GetXaxis()->SetTitle("r (fm)");
hWFu_Dummy->GetYaxis()->SetTitle("u_{k,0}(r)/r");
hWFu_Dummy->GetYaxis()->SetRangeUser(-0.575,WFu_yMax);
TF1* fWFu_base = new TF1("fWFu_base","0",0,WF_rMax);
fWFu_base->SetLineColor(kBlack);
fWFu_base->SetLineWidth(1.5);
fWFu_base->SetLineStyle(2);
TH1F* hWFda_Dummy = new TH1F("hWFda_Dummy","hWFda_Dummy",128,0,WF_rMax);
SetStyleAxis_2(hWFda_Dummy);
hWFda_Dummy->GetXaxis()->SetTitle("r (fm)");
hWFda_Dummy->GetYaxis()->SetTitle("[u_{k,0}(r)-a_{k,0}(r)]/r");
hWFda_Dummy->GetYaxis()->SetRangeUser(-1.0,1.0);
TH1F* hWFtot_Dummy = new TH1F("hWFtot_Dummy","hWFtot_Dummy",128,0,WF_rMax);
SetStyleAxis_2(hWFtot_Dummy);
hWFtot_Dummy->GetXaxis()->SetTitle("r (fm)");
hWFtot_Dummy->GetYaxis()->SetTitle("|#Psi_{k}(r)|^{2}");
hWFtot_Dummy->GetYaxis()->SetRangeUser(-0.1,WFtot_yMax);
TF1* fWFtot_base = new TF1("fWFtot_base","1",0,WF_rMax);
fWFtot_base->SetLineColor(kBlack);
fWFtot_base->SetLineWidth(1.5);
fWFtot_base->SetLineStyle(2);
TH1F* hSource_Dummy = new TH1F("hSource_Dummy","hSource_Dummy",128,0,WF_rMax);
SetStyleAxis_2(hSource_Dummy);
hSource_Dummy->GetXaxis()->SetTitle("r (fm)");
hSource_Dummy->GetYaxis()->SetTitle("4#pir^{2}S(r) (1/fm)");
hSource_Dummy->GetYaxis()->SetRangeUser(0,0.45);
//DLM_SubPads Pad_WF(1080,1920);
DLM_SubPads Pad_WF(1080,1440);
Pad_WF.AddSubPad(0,1,0.65,1);
Pad_WF.AddSubPad(0,1,0.35,0.65);
Pad_WF.AddSubPad(0,1,0,0.35);
Pad_WF.SetMargin(0,0.12,0.02,0.0,0.06);
Pad_WF.SetMargin(1,0.12,0.02,0.,0.);
Pad_WF.SetMargin(2,0.12,0.02,0.07,0.0);
Pad_WF.cd(0);
hWFu_Dummy->Draw("axis");
fWFu_base->Draw("same");
gWFref[0].SetLineWidth(3);
gWFref[0].SetLineColor(kGray+1);
gWFref[0].SetLineStyle(4);
grWFref[0].SetLineWidth(3);
grWFref[0].SetLineColor(kGray+1);
grWFref[0].SetLineStyle(4);
gWFref[0].Draw("same");
for(unsigned uPot=0; uPot<NumPot; uPot++){
//gWF[uPot].Draw(uPot?"same":"");
gWF[uPot].SetLineWidth(4.-0.33*double(uPot));
gWF[uPot].SetLineColor(PotColors[uPot]);
gWF[uPot].Draw("same");
grWF[uPot].SetLineWidth(4.-0.33*double(uPot));
grWF[uPot].SetLineColor(PotColors[uPot]);
grWF[uPot].Draw("same");
gWFas[uPot].SetLineWidth(4.-0.33*double(uPot));
gWFas[uPot].SetLineColor(PotColors[uPot]);
gWFas[uPot].SetLineStyle(3);
gWFas[uPot].Draw("same");
grWFas[uPot].SetLineWidth(4.-0.33*double(uPot));
grWFas[uPot].SetLineColor(PotColors[uPot]);
grWFas[uPot].SetLineStyle(3);
grWFas[uPot].Draw("same");
}
//TGaxis *Arho = new TGaxis(0,2,10,2,"f1",510,"-");
TGaxis* Arho = new TGaxis(0,WFu_yMax,WF_rMax,WFu_yMax,0,WF_rhoMax,505,"-");
Arho->SetTitle("#rho=kr");
Arho->SetLabelSize(hWFu_Dummy->GetXaxis()->GetLabelSize());
Arho->SetTitleSize(hWFu_Dummy->GetXaxis()->GetTitleSize());
Arho->SetLabelFont(hWFu_Dummy->GetXaxis()->GetLabelFont());
Arho->SetTitleFont(hWFu_Dummy->GetXaxis()->GetTitleFont());
Arho->Draw("same");
TLegend* lLegend_WF_up = new TLegend(0.65,0.55,0.95,0.80);//lbrt
lLegend_WF_up->SetName(TString::Format("lLegend_WF_up"));
lLegend_WF_up->SetTextSize(0.06);
lLegend_WF_up->AddEntry(&gWFref[0],"Free wave");
TGraph gSFW_Dummy;
gSFW_Dummy.SetLineWidth(3.5);
gSFW_Dummy.SetLineStyle(3);
gSFW_Dummy.SetLineColor(kBlack);
lLegend_WF_up->AddEntry(&gSFW_Dummy,"Shifted free wave");
lLegend_WF_up->Draw("same");
Pad_WF.cd(1);
hWFtot_Dummy->Draw("axis");
for(unsigned uPot=0; uPot<NumPot; uPot++){
//gWFas[uPot].Draw(uPot?"same":"");
gTotWF[uPot].SetLineWidth(4.-0.33*double(uPot));
gTotWF[uPot].SetLineColor(PotColors[uPot]);
fWFtot_base->Draw("same");
gTotWF[uPot].Draw("same");
}
TLegend* lLegend_WF_low = new TLegend(0.8,0.70,0.95,0.95);//lbrt
lLegend_WF_low->SetName(TString::Format("lLegend_WF_low"));
lLegend_WF_low->SetTextSize(0.06);
for(unsigned uPot=0; uPot<NumPot; uPot++){
lLegend_WF_low->AddEntry(&gTotWF[uPot],PotLegend[uPot]);
}
lLegend_WF_low->Draw("same");
Pad_WF.cd(2);
hSource_Dummy->Draw("axis");
for(unsigned uSor=0; uSor<NumRad; uSor++){
gSource[uSor].SetLineColor(kBlue+3);
gSource[uSor].SetLineStyle(uSor+1);
gSource[uSor].SetLineWidth(3.5);
gSource[uSor].Draw("same");
}
TLegend* lLegend_Source = new TLegend(0.6,0.65,0.95,0.95);//lbrt
lLegend_Source->SetName(TString::Format("lLegend_Source"));
lLegend_Source->SetTextSize(0.06);
for(unsigned uSor=0; uSor<NumRad; uSor++){
lLegend_Source->AddEntry(&gSource[uSor],TString::Format("Source size: %.1f fm",RADIUS[uSor]));
}
lLegend_Source->Draw("same");
Pad_WF.GetCanvas()->SaveAs(OutputFolder+"Pad_WF.png");
Pad_WF.GetCanvas()->SaveAs(OutputFolder+"Pad_WF.pdf");
//PHASE SHIFTS
TH1F* hPS_Dummy = new TH1F("hPS_Dummy","hPS_Dummy",NumMomBins,kMin,kMax);
SetStyleAxis_1(hPS_Dummy);
hPS_Dummy->GetXaxis()->SetTitle("k (MeV)");
hPS_Dummy->GetYaxis()->SetTitle("#delta (deg)");
hPS_Dummy->GetYaxis()->SetRangeUser(-90,180);
hPS_Dummy->GetYaxis()->SetNdivisions(510);
TLegend* lLegend_PS = new TLegend(0.75,0.65,0.90,0.90);//lbrt
lLegend_PS->SetName(TString::Format("lLegend_PS"));
lLegend_PS->SetTextSize(0.07);
for(unsigned uPot=0; uPot<NumPot; uPot++){
lLegend_PS->AddEntry(fPot[uPot],PotLegend[uPot]);
}
TF1* fPS_base = new TF1("fWFu_base","0",kMin,kMax);
fPS_base->SetLineColor(kBlack);
fPS_base->SetLineWidth(1.5);
fPS_base->SetLineStyle(2);
TCanvas* cPS = new TCanvas("cPS", "cPS", 1);
cPS->cd(0); cPS->SetCanvasSize(1920, 1080); cPS->SetMargin(0.15,0.05,0.2,0.05);//lrbt
cPS->SetGrid(true);
hPS_Dummy->Draw("axis");
for(unsigned uPot=0; uPot<NumPot; uPot++){
hPhaseShifts[uPot]->SetLineWidth(4.-0.33*double(uPot));
hPhaseShifts[uPot]->SetLineColor(PotColors[uPot]);
hPhaseShifts[uPot]->Draw("C,same");
fPhaseShifts[uPot]->SetLineWidth(4.-0.33*double(uPot));
fPhaseShifts[uPot]->SetLineColor(kBlack);
fPhaseShifts[uPot]->SetLineStyle(4);
fPhaseShifts[uPot]->Draw("C,same");
}
lLegend_PS->Draw("same");
fPS_base->Draw("same");
cPS->SaveAs(OutputFolder+"cPS.png");
cPS->SaveAs(OutputFolder+"cPS.pdf");
//CORR FUN
DLM_SubPads Pad_Ck(1280,1280);
Pad_Ck.AddSubPad(0,1,0.64,1);
Pad_Ck.AddSubPad(0,1,0.36,0.64);
Pad_Ck.AddSubPad(0,1,0,0.36);
Pad_Ck.SetMargin(0,0.12,0.03,0.0,0.06);
Pad_Ck.SetMargin(1,0.12,0.03,0.,0.);
Pad_Ck.SetMargin(2,0.12,0.03,0.08,0.0);
TH1F** hCk_Dummy = new TH1F* [NumRad];
double CkCan_Scale = 1.286;
for(unsigned uSor=0; uSor<NumRad; uSor++){
hCk_Dummy[uSor] = new TH1F(TString::Format("hCk_Dummy_%u",uSor),TString::Format("hCk_Dummy_%u",uSor),NumMomBins,kMin,kMax);
SetStyleAxis_3(hCk_Dummy[uSor]);
hCk_Dummy[uSor]->GetXaxis()->SetTitle("k (MeV)");
hCk_Dummy[uSor]->GetYaxis()->SetTitle("C(k)");
hCk_Dummy[uSor]->GetYaxis()->SetRangeUser(-0.15,3.15);
if(uSor==1) hCk_Dummy[uSor]->GetYaxis()->SetTitleOffset(hCk_Dummy[uSor]->GetYaxis()->GetTitleOffset()/CkCan_Scale);
Pad_Ck.SetLabelSize(uSor, hCk_Dummy[uSor]->GetXaxis(), 14);
Pad_Ck.SetTitleSize(uSor, hCk_Dummy[uSor]->GetXaxis(), 14);
Pad_Ck.SetLabelSize(uSor, hCk_Dummy[uSor]->GetYaxis(), 14);
Pad_Ck.SetTitleSize(uSor, hCk_Dummy[uSor]->GetYaxis(), 14);
//hCk_Dummy->GetYaxis()->SetNdivisions(510);
}
TLegend* lLegend_Ck = new TLegend(0.75,0.55,0.90,0.90);//lbrt
lLegend_Ck->SetName(TString::Format("lLegend_Ck"));
lLegend_Ck->SetTextSize(0.08);
for(unsigned uPot=0; uPot<NumPot; uPot++){
lLegend_Ck->AddEntry(fPot[uPot],PotLegend[uPot]);
}
double PadCk_l = 0.3;
double PadCk_r = 0.5;
//double PadCk_b =
TPaveText** PT_RAD = new TPaveText* [NumRad];
for(unsigned uSor=0; uSor<NumRad; uSor++){
PT_RAD[uSor] = new TPaveText(0.35,0.65,0.65,0.85, "blNDC");//lbrt
PT_RAD[uSor]->SetName(TString::Format("PT_RAD_%u",uSor));
PT_RAD[uSor]->SetBorderSize(1);
//PT_RAD[uSor]->SetTextSize(0.055);
if(uSor==0) PT_RAD[uSor]->SetTextSize(0.065);
else if(uSor==1) PT_RAD[uSor]->SetTextSize(0.08);
else PT_RAD[uSor]->SetTextSize(0.065);
PT_RAD[uSor]->SetFillColor(kWhite);
PT_RAD[uSor]->SetTextFont(22);
PT_RAD[uSor]->AddText(TString::Format("Source size: %.1f fm",RADIUS[uSor]));
}
TF1* fCk_base = new TF1("fCk_base","1",kMin,kMax);
fCk_base->SetLineColor(kBlack);
fCk_base->SetLineWidth(1.5);
fCk_base->SetLineStyle(2);
for(unsigned uSor=0; uSor<NumRad; uSor++){
Pad_Ck.cd(uSor);
hCk_Dummy[uSor]->Draw("axis");
for(unsigned uPot=0; uPot<NumPot; uPot++){
gCk[uPot][uSor].SetLineWidth(4.-0.33*double(uPot));
gCk[uPot][uSor].SetLineColor(PotColors[uPot]);
//gCk[uPot][uSor].SetLineStyle(uSor+1);
gCk[uPot][uSor].Draw("C,same");
}
if(uSor==0){
lLegend_Ck->Draw("same");
}
fCk_base->Draw("same");
PT_RAD[uSor]->Draw("same");
}
Pad_Ck.GetCanvas()->SaveAs(OutputFolder+"Pad_Ck.png");
Pad_Ck.GetCanvas()->SaveAs(OutputFolder+"Pad_Ck.pdf");
TFile fOutput(OutputFolder+"fOutput.root","recreate");
for(unsigned uPot=0; uPot<NumPot; uPot++){
for(unsigned uSor=0; uSor<NumRad; uSor++){
gCk[uPot][uSor].Write();
}
hPhaseShifts[uPot]->Write();
fPhaseShifts[uPot]->Write();
hPhaseShiftsPar[uPot]->Write();
fPhaseShiftsPar[uPot]->Write();
fPot[uPot]->Write();
gWFref[uPot].Write();
gWFas[uPot].Write();
gWF[uPot].Write();
grWFref[uPot].Write();
grWFas[uPot].Write();
grWF[uPot].Write();
gWFd[uPot].Write();
gWFda[uPot].Write();
gTotWF[uPot].Write();
}
for(unsigned uFWF=0; uFWF<NumFreeWF; uFWF++){
gFreeWF[uFWF].Write();
}
for(unsigned uSor=0; uSor<NumRad; uSor++){
gSource[uSor].Write();
}
for(unsigned uPot=0; uPot<NumPot; uPot++){
delete hPhaseShifts[uPot];
delete hPhaseShiftsPar[uPot];
delete fPhaseShiftsPar[uPot];
delete fPot[uPot];
delete [] gCk[uPot];
}
delete [] hPhaseShifts;
delete [] hPhaseShiftsPar;
delete [] fPhaseShiftsPar;
delete [] fPhaseShifts;
delete [] gCk;
delete [] fPot;
delete [] gWFref;
delete [] gWFas;
delete [] gWF;
delete [] grWFref;
delete [] grWFas;
delete [] grWF;
delete [] gWFd;
delete [] gWFda;
delete [] gTotWF;
delete [] gFreeWF;
delete [] gSource;
delete hPot_Dummy;
delete lLegend_Pot;
delete cPotentials;
delete hFWF_Dummy;
delete lLegend_FWF;
delete cFWF;
delete hPS_Dummy;
delete lLegend_PS;
delete fPS_base;
delete cPS;
delete hSource_Dummy;
delete lLegend_Source;
for(unsigned uSor=0; uSor<NumRad; uSor++){
delete PT_RAD[uSor];
delete hCk_Dummy[uSor];
}
delete [] PT_RAD;
delete [] hCk_Dummy;
delete lLegend_Ck;
delete fCk_base;
//delete cCk;
delete hWFu_Dummy;
delete hWFtot_Dummy;
delete hWFda_Dummy;
delete fWFu_base;
delete fWFtot_base;
}
//pi pi plots for the appendix
//pipi interaction (CATS)
//ExpSource==true => use exponential source
//ExpSource==false => use Gaussian source
TGraph* Basics_PiPiCATS(const bool& ExpSource){
//constants related to the number of bins and range (in MeV)
const unsigned NumMomBins = 300;
const double kMin = 0;
const double kMax = 300;
//initialize the CATS object
CATS PionKitty;
//(#bins,min,max) or (#bins,BinRangeArray[] as in ROOT)
PionKitty.SetMomBins(NumMomBins,kMin,kMax);
//object for the parameters to be used by the source function
CATSparameters SOURCE_PARS(CATSparameters::tSource,1,true);
//set the first and only par (source size)
SOURCE_PARS.SetParameter(0,1.5);
//say to CATS which Source function to use, and with which parameter set
PionKitty.SetAnaSource(ExpSource?ExponentialSource:GaussSource,SOURCE_PARS);
//this step is needed, to set up CATS for a source from a function
//there is one more possibility, namely to use the source as a
//direct input from a transport model. This method will not be discussed here
PionKitty.SetUseAnalyticSource(true);
//reduces CPU time, for a source that does not has a momentum or an angular dependence
PionKitty.SetMomentumDependentSource(false);
PionKitty.SetThetaDependentSource(false);
//if true, the source is automatically renormalized in the range 0-64 fm. Nice to dummy proof the source, but problematic for sources with large tails
//for the Gaussian example above, both options should be completely identical
PionKitty.SetAutoNormSource(false);
//standard settings for a CATS object which has no strong interaction potential included
PionKitty.SetNumChannels(1);
//#which channel, how many PWs
PionKitty.SetNumPW(0,0);
//which channel, spin value
PionKitty.SetSpin(0,0);
//which channel, weight
PionKitty.SetChannelWeight(0, 1);
//include the coulomb interaction. Q1Q2 is the multiplied charge numbers of the two particles
PionKitty.SetQ1Q2(1);
//the reduced mass of the two pions
PionKitty.SetRedMass( 0.5*Mass_pic );
//for identical particles, we need to include the quantum statistics
PionKitty.SetQuantumStatistics(true);
//evaluate the correlation function
PionKitty.KillTheCat();
//save the result in a TGraph (ROOT)
TGraph* grCk = new TGraph();
grCk->SetName("grCk");
grCk->Set(NumMomBins);
//iterate over all momentum bins
for(unsigned uMom=0; uMom<NumMomBins; uMom++){
//the GetMomentum() function sets the x-axis
//the GetCorrFun() function evaluates C(k) (y-axis)
grCk->SetPoint(uMom,PionKitty.GetMomentum(uMom),PionKitty.GetCorrFun(uMom));
}
return grCk;
}
//computes the expectation based on quantum statistics only
//the formula used is from chapter 4.1 in Phys. Rev. C 96 (2017) 064908 (ATLAS paper on pipi correlations in p-Pb)
TGraph* Basics_PiPiTheory(const bool& ExpSource){
//load from a Mathematica output file
FILE *InFileCBE;
const TString CBEname = ExpSource?"/home/dmihaylov/Dudek_Ubuntu/Work/Kclus/PhD_Thesis/Mathematica/tab_txCBE_Exp.dat":
"/home/dmihaylov/Dudek_Ubuntu/Work/Kclus/PhD_Thesis/Mathematica/tab_txCBE.dat";
InFileCBE = fopen(CBEname.Data(), "r");
if(!InFileCBE){
printf("\033[1;31mERROR:\033[0m The file\033[0m %s cannot be opened!\n", CBEname.Data());
return NULL;
}
char* cdummy = new char [512];
float kstar;
float ckval;
TGraph gCBE;
gCBE.SetName("gCBE");
unsigned NumPointsCBE=0;
while(!feof(InFileCBE)){
if(!fgets(cdummy, 511, InFileCBE)) continue;
sscanf(cdummy, "%f %f",&kstar, &ckval);
gCBE.SetPoint(NumPointsCBE,kstar,ckval);
NumPointsCBE++;
}
fclose(InFileCBE);
FILE *InFileK;
const TString Kname = ExpSource?"/home/dmihaylov/Dudek_Ubuntu/Work/Kclus/PhD_Thesis/Mathematica/tab_txCoulombSame_Exp.dat":
"/home/dmihaylov/Dudek_Ubuntu/Work/Kclus/PhD_Thesis/Mathematica/tab_txCoulombSame.dat";
InFileK = fopen(Kname.Data(), "r");
TGraph gK;
gK.SetName("gK");
unsigned NumPointsK=0;
if(!InFileK){
printf("\033[1;31mERROR:\033[0m The file\033[0m %s cannot be opened!\n", Kname.Data());
return NULL;
}
while(!feof(InFileK)){
if(!fgets(cdummy, 511, InFileK)) continue;
sscanf(cdummy, "%f %f",&kstar, &ckval);
gK.SetPoint(NumPointsK,kstar,ckval);
NumPointsK++;
}
fclose(InFileK);
TGraph* gCk = new TGraph();
gCk->SetName("gPiPiTheory");
double dkstar,dckval;
for(unsigned uBin=0; uBin<NumPointsCBE; uBin++){
gCBE.GetPoint(uBin,dkstar,dckval);
gCk->SetPoint(uBin,dkstar,dckval*gK.Eval(dkstar));
}
delete [] cdummy;
return gCk;
}
void ComparePionPion(const bool& ExpSource){
TGraph* grCATS = Basics_PiPiCATS(ExpSource);
TGraph* grTheory = Basics_PiPiTheory(ExpSource);
grTheory->SetLineColor(kRed+1);
grTheory->SetLineStyle(2);
grTheory->SetLineWidth(4);
grCATS->SetLineColor(kBlue+1);
grCATS->SetLineWidth(2.5);
TH1F* hAxis = new TH1F("hAxis","hAxis",128,0,300);
SetStyleAxis_1(hAxis);
hAxis->GetYaxis()->SetRangeUser(0.9, 1.85);
hAxis->GetXaxis()->SetTitle("k* (MeV)");
hAxis->GetYaxis()->SetTitle("C(k*)");
TF1* UnitLine = new TF1("UnitLine","1",-20,320);
UnitLine->SetLineColor(kBlack);
UnitLine->SetLineWidth(2);
UnitLine->SetLineStyle(1);
TPaveText* PTinfo = new TPaveText(0.25,0.85,0.5,0.95, "blNDC");//lbrt
PTinfo->SetName("PTinfo");
PTinfo->SetBorderSize(1);
PTinfo->SetTextSize(0.05);
PTinfo->SetFillColor(kWhite);
PTinfo->SetTextFont(22);
PTinfo->AddText(ExpSource?"Cauchy source":"Gaussian source");
TLegend *legend = new TLegend(0.5,0.8,0.95,0.95);
legend->SetTextFont(42);
legend->SetTextSize(0.05);
legend->AddEntry(grTheory, "Bowler-Sinyukov (approx)");
legend->AddEntry(grCATS, "CATS (exact)");
TCanvas* cPiPi = new TCanvas("cPiPi", "cPiPi", 1);
cPiPi->cd(0);
cPiPi->SetCanvasSize(1920, 1080);
cPiPi->SetMargin(0.15,0.05,0.2,0.05);//lrbt
cPiPi->SetGrid();
hAxis->Draw();
UnitLine->Draw("same");
grTheory->Draw("C,same");
grCATS->Draw("C,same");
legend->Draw("same");
PTinfo->Draw("same");
TString OutFileName = "ComparePionPion";
OutFileName += ExpSource?"_Exp":"_Gauss";
TFile* OutputFile = new TFile("/home/dmihaylov/Dudek_Ubuntu/Work/Kclus/PhD_Thesis/Pictures/PionPion/"+OutFileName+".root","recreate");
grCATS->Write();
grTheory->Write();
cPiPi->Write();
cPiPi->SaveAs("/home/dmihaylov/Dudek_Ubuntu/Work/Kclus/PhD_Thesis/Pictures/PionPion/"+OutFileName+".pdf");
delete grCATS;
delete grTheory;
delete UnitLine;
delete hAxis;
delete legend;
delete PTinfo;
delete cPiPi;
delete OutputFile;
}
void Plot_ProtonLambda(TGraph* grCk){
grCk->SetLineColor(kRed+1);
grCk->SetLineWidth(4);
TH1F* hAxis = new TH1F("hAxis","hAxis",128,0,300);
SetStyleAxis_1(hAxis);
hAxis->GetYaxis()->SetRangeUser(0.9, 3.35);
hAxis->GetXaxis()->SetTitle("k* (MeV)");
hAxis->GetYaxis()->SetTitle("C(k*)");
TF1* UnitLine = new TF1("UnitLine","1",-20,320);
UnitLine->SetLineColor(kBlack);
UnitLine->SetLineWidth(2.0);
UnitLine->SetLineStyle(1);
TPaveText* PTinfo = new TPaveText(0.25,0.85,0.5,0.95, "blNDC");//lbrt
PTinfo->SetName("PTinfo");
PTinfo->SetBorderSize(1);
PTinfo->SetTextSize(0.05);
PTinfo->SetFillColor(kWhite);
PTinfo->SetTextFont(22);
PTinfo->AddText("Gaussian source");
TLegend *legend = new TLegend(0.5,0.8,0.95,0.95);
legend->SetTextFont(42);
legend->SetTextSize(0.05);
legend->AddEntry(grCk, "p#minus#Lambda (Usmani)");
TCanvas* cpL = new TCanvas("cpL", "cpL", 10, 10, 1920, 1080);
//cpL->SetCanvasSize(1920, 1080);
cpL->SetMargin(0.15,0.05,0.2,0.05);//lrbt
cpL->SetGrid(1,1);
//cpL->cd(0);
hAxis->Draw();
UnitLine->Draw("same");
grCk->Draw("C,same");
legend->Draw("same");
PTinfo->Draw("same");
//INLET
TH1F* hAxis_Inlet = (TH1F*)hAxis->Clone("hAxis_Inlet");
hAxis_Inlet->GetXaxis()->SetTitleSize(0);
hAxis_Inlet->GetXaxis()->SetLabelSize(0);
hAxis_Inlet->GetXaxis()->SetTitleOffset(0);
hAxis_Inlet->GetXaxis()->SetLabelOffset(0);
hAxis_Inlet->GetXaxis()->SetRangeUser(100, 300);
hAxis_Inlet->GetXaxis()->SetNdivisions(505);
hAxis_Inlet->GetXaxis()->SetTitle("");