-
Notifications
You must be signed in to change notification settings - Fork 0
/
CombineMesonMeasurementsPiPlPiMiPiZero.C
3568 lines (2873 loc) · 217 KB
/
CombineMesonMeasurementsPiPlPiMiPiZero.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
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
/****************************************************************************************************************************
****** provided by Gamma Conversion Group, PWG4, *****
****** Friederike Bock, [email protected] *****
*****************************************************************************************************************************/
#include <Riostream.h>
#include "TMath.h"
#include <stdlib.h>
#include <fstream>
#include <math.h>
#include <TROOT.h>
#include <TApplication.h>
#include <TPaveLabel.h>
#include <TSystem.h>
#include <TFrame.h>
#include <TStyle.h>
#include <TString.h>
#include "TGaxis.h"
#include "TFile.h"
#include "TH1F.h"
#include "TH1D.h"
#include "TH2F.h"
#include "TF1.h"
#include "TVirtualFitter.h"
#include "TObject.h"
#include "TCanvas.h"
#include "TMultiGraph.h"
#include "TLegend.h"
#include "TDatabasePDG.h"
#include "TMinuit.h"
#include "TBenchmark.h"
#include "TRandom.h"
#include "TLatex.h"
#include "TASImage.h"
#include "TPostScript.h"
#include "TGraphErrors.h"
#include "TArrow.h"
#include "TGraphAsymmErrors.h"
#include "TGaxis.h"
#include "TMarker.h"
#include "Math/WrappedTF1.h"
#include "Math/BrentRootFinder.h"
#include "TFitResultPtr.h"
#include "TFitResult.h"
#include "CommonHeaders/PlottingGammaConversionHistos.h"
#include "CommonHeaders/PlottingGammaConversionAdditional.h"
#include "CommonHeaders/FittingGammaConversion.h"
#include "CommonHeaders/ConversionFunctionsBasicsAndLabeling.h"
#include "CommonHeaders/ConversionFunctions.h"
#include "CommonHeaders/CombinationFunctions.h"
extern TRandom* gRandom;
extern TBenchmark* gBenchmark;
extern TSystem* gSystem;
extern TMinuit* gMinuit;
struct SysErrorConversion {
Double_t value;
Double_t error;
// TString name;
};
/*void drawLatexAdd(TString latextext, Double_t textcolumn, Double_t textrow, Double_t textSizePixel,Bool_t setFont = kFALSE, Bool_t setFont2 = kFALSE, Bool_t alignRight = kFALSE, Color_t textcolor = kBlack){
TLatex *latexDummy = new TLatex(textcolumn ,textrow,latextext);
SetStyleTLatex( latexDummy, textSizePixel,4);
if(setFont)
latexDummy->SetTextFont(62);
if(setFont2)
latexDummy->SetTextFont(43);
if(alignRight)
latexDummy->SetTextAlign(31);
latexDummy->SetTextColor(textcolor);
latexDummy->Draw();
}*/
void CombineMesonMeasurementsPiPlPiMiPiZero( TString fileNamePCM = "",
TString fileNamePHOS = "",
TString fileNameEMCal = "/home/nschmidt/AnalysisSoftware/pdf/5TeV/2017_08_19/FinalResultsTriggersPatched_EMC/data_EMCAL-EMCALResultsFullCorrection_PP.root",
TString fileNamePCMPHOS = "",
TString fileNamePCMEMCal= "/home/nschmidt/AnalysisSoftware/pdf/5TeV/2017_08_20/FinalResultsTriggersPatched/data_PCM-EMCALResultsFullCorrection_PP.root",
TString bWCorrection = "",
TString suffix = "pdf",
Int_t numbersofmeas = 5,
Bool_t useDanielThesis = kFALSE
){
TString date = ReturnDateString();
gROOT->Reset();
gROOT->SetStyle("Plain");
StyleSettingsThesis();
SetPlotStyle();
TString dateForOutput = ReturnDateStringForOutput();
cout << dateForOutput.Data() << endl;
//___________________________________ Declaration of files _____________________________________________
TString collisionSystem7TeV = "pp, #sqrt{#it{s}} = 7 TeV";
TString outputDir = Form("%s/%s/CombineMesonMeasurements7TeV",suffix.Data(),dateForOutput.Data());
cout << outputDir.Data() << endl;
cout << fileNamePCM.Data() << endl;
TString fileNameTheory = "ExternalInput/Theory/Pythia/pythia8_7TeV_compilation_poppenborg.root";
// Theory file for eta in correct binning
TString fileNameTheoryEtaBinning = "/media/florianjonas/dataslave/data/alice/pp7TeV/ThesisExternal/pythia8_compilation_7tev_monash_etaBinning.root";
TString fileNamePHOSExternal = "/media/florianjonas/dataslave/data/alice/pp7TeV/ThesisExternal/om_spectrum.root";
TString fileNamePHOSExternalRatio = "/media/florianjonas/dataslave/data/alice/pp7TeV/ThesisExternal/om_pi_ratio.root";
TString fileNameCombPi07TeVPublished = "ExternalInput/CombNeutralMesons/CombinedResultsPP_ShiftedX_PaperRAA_16_May_2014_including7TeVand900GeVpublished.root";
TString fileNameCombPi07TevDanielThesis = "/media/florianjonas/dataslave/data/alice/pp7TeV/ThesisExternal/CombinedResultsPaperPP7TeV_2018_08_07.root";
TString fileNameSysCorrelation = "/media/florianjonas/dataslave/data/alice/pp7TeV/ThesisSystematics/Correlations/ComputeCorrelationFactors_pp7TeV/pp7TeV.root";
gSystem->Exec("mkdir -p "+outputDir);
if(fileNamePCM.CompareTo(""))
gSystem->Exec(Form("cp %s %s/InputPCM.root", fileNamePCM.Data(), outputDir.Data()));
if(fileNamePHOS.CompareTo(""))
gSystem->Exec(Form("cp %s %s/InputPHOS.root", fileNamePHOS.Data(), outputDir.Data()));
if(fileNameEMCal.CompareTo(""))
gSystem->Exec(Form("cp %s %s/InputEMCal.root", fileNameEMCal.Data(), outputDir.Data()));
if(fileNamePCMPHOS.CompareTo(""))
gSystem->Exec(Form("cp %s %s/InputPCMPHOS.root", fileNamePCMPHOS.Data(), outputDir.Data()));
if(fileNamePCMEMCal.CompareTo(""))
gSystem->Exec(Form("cp %s %s/InputPCMEMCal.root", fileNamePCMEMCal.Data(), outputDir.Data()));
if(fileNameTheory.CompareTo(""))
gSystem->Exec(Form("cp %s %s/InputTheory.root", fileNameTheory.Data(), outputDir.Data()));
if(fileNamePHOSExternal.CompareTo(""))
gSystem->Exec(Form("cp %s %s/InputPHOSExternal.root", fileNamePHOSExternal.Data(), outputDir.Data()));
if(fileNameCombPi07TeVPublished.CompareTo(""))
gSystem->Exec(Form("cp %s %s/InputPi07TeVPublished.root", fileNameCombPi07TeVPublished.Data(), outputDir.Data()));
if(fileNameCombPi07TevDanielThesis.CompareTo("") && useDanielThesis)
gSystem->Exec(Form("cp %s %s/InputPi07TeVDanielThesis.root", fileNameCombPi07TevDanielThesis.Data(), outputDir.Data()));
fstream fLog;
fLog.open(Form("%s/CombineMeson7TeV.log",outputDir.Data()), ios::out);
fLog << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
fLog << dateForOutput.Data() << endl;
Double_t mesonMassExpectOmega = TDatabasePDG::Instance()->GetParticle(223)->Mass();
Double_t mesonMassExpectEta = TDatabasePDG::Instance()->GetParticle(221)->Mass();
Width_t widthLinesBoxes = 1.4;
// Definition of colors, styles and markers sizes
Color_t colorComb = kBlue+2;
Style_t markerStyleComb = 20;
Size_t markerSizeComb = 2;
TString nameMeasGlobal[11] = {"PCM", "PHOS", "EMCal", "PCM-PHOS", "PCM-EMCal", "PCM-Dalitz", "PHOS-Dalitz", "EMCal-Dalitz", "EMCal high pT", "EMCal merged", "PCMOtherDataset"};
Color_t colorDet[11];
Color_t colorDetMC[11];
Style_t markerStyleDet[11];
Style_t markerStyleDetMC[11];
Size_t markerSizeDet[11];
Size_t markerSizeDetMC[11];
Size_t sizeMarkerNLO = 1;
Width_t widthLineNLO = 2.;
TString localOutputQuantity = "#frac{1}{N_{ev}} #frac{1}{2#pi#it{p}_{T}} #frac{d#it{N}^{2}}{d#it{p}_{T}dy} ((GeV/#it{c})^{-2})";
// load external files
TFile* fFileOmegaMesonPHOS7TeV = new TFile(fileNamePHOSExternal);
TFile* fFileOmegaMesonRatioPHOS7TeV = new TFile(fileNamePHOSExternalRatio);
TFile* fFileOmegaMesonSim7TeV = new TFile(fileNameTheory);
TFile* fFileEtaMesonSim7TeV = new TFile(fileNameTheoryEtaBinning);
TFile* fFilePi0Comb7TeV = new TFile(fileNameCombPi07TeVPublished);
TFile* fFilePi0Comb7TeVDanielThesis = new TFile(fileNameCombPi07TevDanielThesis);
// load external histos
TGraphErrors* graphOmegaXSecPHOS7TeVStat = (TGraphErrors*)fFileOmegaMesonPHOS7TeV->Get("gr_om");
TGraphAsymmErrors* graphOmegaXSecPHOS7TeVSys = (TGraphAsymmErrors*)fFileOmegaMesonPHOS7TeV->Get("gr_om_sys");
TGraphAsymmErrors* graphOmegaToPi0PHOS7TeVStat = (TGraphAsymmErrors*)fFileOmegaMesonPHOS7TeV->Get("omega_to_pi0_stat_err");
TH1F* histoOmegaXSecSim7TeV = (TH1F*) fFileOmegaMesonSim7TeV->Get("h_invXsec_omega_yDefault");
TH1F* histoPi0XSecSim7TeV = (TH1F*) fFileOmegaMesonSim7TeV->Get("h_invXsec_pi0primary_yDefault");
TH1F* histoPi0XSecSim7TeVEtaBinning = (TH1F*) fFileEtaMesonSim7TeV->Get("h_invXsec_pi0primary_yDefault");
TH1F* histoEtaXSecSim7TeV = (TH1F*) fFileEtaMesonSim7TeV->Get("h_invXsec_eta_yDefault");
TGraphAsymmErrors* graphPi0XSecComb7TeVStat = NULL;
TGraphAsymmErrors* graphPi0XSecComb7TeVSys = NULL;
TGraphAsymmErrors* graphPi0XSecComb7TeVTot = NULL;
TGraphAsymmErrors* graphEtaXSecComb7TeVStat = NULL;
TGraphAsymmErrors* graphEtaXSecComb7TeVSys = NULL;
TGraphAsymmErrors* graphEtaXSecComb7TeVTot = NULL;
TGraphAsymmErrors* graphEtaToPi0Comb7TeVStat = NULL;
TGraphAsymmErrors* graphEtaToPi0Comb7TeVSys = NULL;
TGraphAsymmErrors* graphEtaToPi0Comb7TeVTot = NULL;
graphPi0XSecComb7TeVStat = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphInvCrossSectionPi0Comb7TeVStatErr");
graphPi0XSecComb7TeVSys = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphInvCrossSectionPi0Comb7TeVSysErr");
graphPi0XSecComb7TeVTot = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphInvCrossSectionPi0Comb7TeV");
graphEtaXSecComb7TeVStat = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphInvCrossSectionEtaComb7TeVStatErr");
graphEtaXSecComb7TeVSys = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphInvCrossSectionEtaComb7TeVSysErr");
graphEtaXSecComb7TeVTot = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphInvCrossSectionEtaComb7TeV");
// Load Daniel thesis histos, or from ExternalInput folder
TF1* fitTsallisPi0XSecComb7TeVThesis = NULL;
TF1* fitTsallisEtaXSecComb7TeVThesis = NULL;
if(useDanielThesis){
graphPi0XSecComb7TeVStat = (TGraphAsymmErrors*)( (TDirectory*) fFilePi0Comb7TeVDanielThesis->Get("Pi07TeV"))->Get("graphInvCrossSectionPi0Comb7TeVStatErr_yShifted");
graphPi0XSecComb7TeVSys = (TGraphAsymmErrors*)( (TDirectory*) fFilePi0Comb7TeVDanielThesis->Get("Pi07TeV"))->Get("graphInvCrossSectionPi0Comb7TeVSysErr_yShifted");
graphPi0XSecComb7TeVTot = (TGraphAsymmErrors*)( (TDirectory*) fFilePi0Comb7TeVDanielThesis->Get("Pi07TeV"))->Get("graphInvCrossSectionPi0Comb7TeV_yShifted");
fitTsallisPi0XSecComb7TeVThesis = (TF1*)( (TDirectory*) fFilePi0Comb7TeVDanielThesis->Get("Pi07TeV"))->Get("TsallisFitPi0");
graphEtaXSecComb7TeVStat = (TGraphAsymmErrors*)( (TDirectory*) fFilePi0Comb7TeVDanielThesis->Get("Eta7TeV"))->Get("graphInvCrossSectionEtaComb7TeVStatErr_yShifted");
graphEtaXSecComb7TeVSys = (TGraphAsymmErrors*)( (TDirectory*) fFilePi0Comb7TeVDanielThesis->Get("Eta7TeV"))->Get("graphInvCrossSectionEtaComb7TeVSysErr_yShifted");
graphEtaXSecComb7TeVTot = (TGraphAsymmErrors*)( (TDirectory*) fFilePi0Comb7TeVDanielThesis->Get("Eta7TeV"))->Get("graphInvCrossSectionEtaComb7TeV_yShifted");
fitTsallisEtaXSecComb7TeVThesis = (TF1*)( (TDirectory*) fFilePi0Comb7TeVDanielThesis->Get("Eta7TeV"))->Get("TsallisFitEta");
graphEtaToPi0Comb7TeVStat = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphRatioEtaToPi0Comb7TeVStatErr");
graphEtaToPi0Comb7TeVSys = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphRatioEtaToPi0Comb7TeVSysErr");
graphEtaToPi0Comb7TeVTot = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphRatioEtaToPi0Comb7TeVTotErr");
} else{
graphPi0XSecComb7TeVStat = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphInvCrossSectionPi0Comb7TeVStatErr");
graphPi0XSecComb7TeVSys = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphInvCrossSectionPi0Comb7TeVSysErr");
graphPi0XSecComb7TeVTot = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphInvCrossSectionPi0Comb7TeV");
graphEtaXSecComb7TeVStat = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphInvCrossSectionEtaComb7TeVStatErr");
graphEtaXSecComb7TeVSys = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphInvCrossSectionEtaComb7TeVSysErr");
graphEtaXSecComb7TeVTot = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphInvCrossSectionEtaComb7TeV");
graphEtaToPi0Comb7TeVStat = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphEtaToPi0Comb7TeVStat");
graphEtaToPi0Comb7TeVSys = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphEtaToPi0Comb7TeVSys");
graphEtaToPi0Comb7TeVTot = (TGraphAsymmErrors*)fFilePi0Comb7TeV->Get("graphEtaToPi0Comb7TeV");
}
TGraphErrors* graphOmegaToPi0PHOSPublic7TeVStat = (TGraphErrors*)fFileOmegaMesonRatioPHOS7TeV->Get("gr_om_rat");
TGraphAsymmErrors* graphOmegaToPi0PHOSPublic7TeVSys = (TGraphAsymmErrors*)fFileOmegaMesonRatioPHOS7TeV->Get("gr_om_rat_sys");
// Manually load PHENIX 200 GeV omega/pi0 ratios: taken from https://www.phenix.bnl.gov/phenix/WWW/info/data/ppg118_data.html
Double_t xValue200GeVee[9] ={0.125,0.375,0.625,0.875,1.125,1.375,1.75,2.5,3.5};
Double_t yValue200GeVee[9] ={0.0274625,0.0775713,0.209742,0.277281,0.418289,0.47334, 0.54105,0.612235,0.714046 };
Double_t yStatError200GeVee[9] ={0.00874824,0.0145487,0.022483, 0.0365503,0.0550088,0.073987,0.091216,0.115561,0.247288 };
Double_t xStatError200GeVee[9] ={0,0,0,0,0,0,0,0,0};
Double_t ySysError200GeVee[9] ={0.0062165,0.0157521,0.0346946,0.0469135,0.0706437,0.0788823,0.088133,0.110047,0.130358 };
Double_t xSysError200GeVee[9] ={0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1};
Double_t xValue200GeVpipipi[20] ={2.25,2.75,3.25,3.75,4.25,4.75,5.25,5.75,6.25,6.75,7.25,7.75,8.25,8.75,9.25,9.75,10.25,10.75,11.25,12.00};
Double_t yValue200GeVpipipi[20] ={0.877423,0.994651,0.945003,0.903472,0.742332,0.788344,0.814015,0.71074, 0.69682,0.761297,0.863745,0.652674,0.775114,0.64524, 1.1310, 1.0159, 0.89945,0.85533, 1.07303,0.860426};
Double_t yStatError200GeVpipipi[20] ={0.209278, 0.103237, 0.0693594, 0.0462791, 0.0430213, 0.069176, 0.0553398, 0.0609064, 0.103044, 0.150899, 0.15363, 0.107463, 0.174188, 0.146433, 0.206244, 0.284549, 0.277659, 0.257244, 0.292399, 0.284385};
Double_t ySysError200GeVpipipi[20] ={0.196965, 0.204638, 0.186131, 0.161472, 0.126264, 0.134575, 0.139265, 0.121728, 0.106482, 0.12334, 0.147959, 0.124096, 0.154794, 0.14128, 0.269633, 0.252251, 0.2236, 0.212935, 0.267555, 0.18234};
Double_t xStatError200GeVpipipi[20] ={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
Double_t xSysError200GeVpipipi[20] ={0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1};
Double_t xValue200GeVpi0Gamma[8] ={2.5,3.5,4.5,5.5,6.5,7.5,9.0,11.0};
Double_t yValue200GeVpi0Gamma[8] ={0.760013, 0.898841, 0.686148, 0.762621, 0.862995, 0.638679, 0.718389, 0.918832};
Double_t yStatError200GeVpi0Gamma[8] ={0.06456, 0.038146, 0.0558147, 0.117929, 0.107197, 0.1618, 0.231785, 0.304524};
Double_t ySysError200GeVpi0Gamma[8] ={0.148646, 0.16022, 0.11694, 0.12346, 0.15594, 0.121424, 0.157363, 0.220082};
Double_t xStatError200GeVpi0Gamma[8] ={0,0,0,0,0,0,0,0};
Double_t xSysError200GeVpi0Gamma[8] ={0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1};
Double_t xValue62GeVpi0Gamma[2] ={3.,6.};
Double_t yValue62GeVpi0Gamma[2] ={0.87,0.90};
Double_t yStatError62GeVpi0Gamma[2] ={0.17,0.18};
Double_t xStatError62GeVpi0Gamma[2] ={0,0};
Double_t xSysError62GeVpi0Gamma[2] ={0.1,0.1};
TGraphAsymmErrors* graphOmegaeeToPi0200GeVStat = new TGraphAsymmErrors(9,xValue200GeVee,yValue200GeVee,xStatError200GeVee,xStatError200GeVee,yStatError200GeVee,yStatError200GeVee);
TGraphAsymmErrors* graphOmegaeeToPi0200GeVSys = new TGraphAsymmErrors(9,xValue200GeVee,yValue200GeVee,xSysError200GeVee,xSysError200GeVee,ySysError200GeVee,ySysError200GeVee);
TGraphAsymmErrors* graphOmegapipipiToPi0200GeVStat = new TGraphAsymmErrors(20,xValue200GeVpipipi,yValue200GeVpipipi,xStatError200GeVpipipi,xStatError200GeVpipipi,yStatError200GeVpipipi,yStatError200GeVpipipi);
TGraphAsymmErrors* graphOmegapipipiToPi0200GeVSys = new TGraphAsymmErrors(20,xValue200GeVpipipi,yValue200GeVpipipi,xSysError200GeVpipipi,xSysError200GeVpipipi,ySysError200GeVpipipi,ySysError200GeVpipipi);
TGraphAsymmErrors* graphOmegapi0GammaToPi0200GeVStat = new TGraphAsymmErrors(8,xValue200GeVpi0Gamma,yValue200GeVpi0Gamma,xStatError200GeVpi0Gamma,xStatError200GeVpi0Gamma,yStatError200GeVpi0Gamma,yStatError200GeVpi0Gamma);
TGraphAsymmErrors* graphOmegapi0GammaToPi0200GeVSys = new TGraphAsymmErrors(8,xValue200GeVpi0Gamma,yValue200GeVpi0Gamma,xSysError200GeVpi0Gamma,xSysError200GeVpi0Gamma,ySysError200GeVpi0Gamma,ySysError200GeVpi0Gamma);
TGraphAsymmErrors* graphOmegapi0GammaToPi062GeVStat = new TGraphAsymmErrors(2,xValue62GeVpi0Gamma,yValue62GeVpi0Gamma,xStatError62GeVpi0Gamma,xStatError62GeVpi0Gamma,yStatError62GeVpi0Gamma,yStatError62GeVpi0Gamma);
for (Int_t i = 0; i < 11; i++){
colorDet[i] = GetDefaultColorDiffDetectors(nameMeasGlobal[i].Data(), kFALSE, kFALSE, kTRUE);
colorDetMC[i] = GetDefaultColorDiffDetectors(nameMeasGlobal[i].Data(), kTRUE, kFALSE, kTRUE);
markerStyleDet[i] = GetDefaultMarkerStyleDiffDetectors(nameMeasGlobal[i].Data(), kFALSE);
markerStyleDetMC[i] = GetDefaultMarkerStyleDiffDetectors(nameMeasGlobal[i].Data(), kTRUE);
markerSizeDet[i] = GetDefaultMarkerSizeDiffDetectors(nameMeasGlobal[i].Data(), kFALSE)*2;
markerSizeDetMC[i] = GetDefaultMarkerSizeDiffDetectors(nameMeasGlobal[i].Data(), kTRUE)*2;
}
TFile* inputFile[10];
TFile* inputFilePi0[10];
inputFile[0] = new TFile(fileNamePCM.Data());
inputFile[1] = new TFile(fileNamePHOS.Data());
inputFile[2] = new TFile(fileNameEMCal.Data());
inputFile[3] = new TFile(fileNamePCMPHOS.Data());
inputFile[4] = new TFile(fileNamePCMEMCal.Data());
TDirectory* directoryOmega[10];
TDirectory* directoryEta[10];
for(Int_t i=0;i<numbersofmeas;i++){
if(!inputFile[i]->IsZombie()){
cout << "loading directories for " << nameMeasGlobal[i] << endl;
directoryOmega[i] = (TDirectory*)inputFile[i]->Get("Omega7TeV");
directoryEta[i] = (TDirectory*)inputFile[i]->Get("Eta7TeV");
}
}
cout << __LINE__<<endl;
TH1D* histoOmegaMass[10];
TH1D* histoOmegaFWHMMeV[10];
TH1D* histoOmegaTrueMass[10];
TH1D* histoOmegaTrueFWHMMeV[10];
TH1D* histoEtaMass[10];
TH1D* histoEtaFWHMMeV[10];
TH1D* histoEtaTrueMass[10];
TH1D* histoEtaTrueFWHMMeV[10];
TH1D* histoOmegaAcc[10];
TH1D* histoOmegaTrueEffPt[10];
TH1D* histoOmegaAccTimesEff[10];
TH1D* histoEtaAcc[10];
TH1D* histoEtaTrueEffPt[10];
TH1D* histoEtaAccTimesEff[10];
TH1D* histoEtaAccTimesEffBR[10];
TH1D* histoOmegaInvCrossSection[10];
TH1D* histoEtaInvCrossSection[10];
TGraphAsymmErrors* graphOmegaInvCrossSectionSys[10];
TGraphAsymmErrors* graphOmegaInvCrossSectionStat[10];
TGraphAsymmErrors* graphEtaInvCrossSectionStat[10];
TGraphAsymmErrors* graphEtaInvCrossSectionSys[10];
TGraphAsymmErrors* graphEtaToOmegaPCMStat;
TGraphAsymmErrors* graphEtaToOmegaPCMSys;
// Get combined Eta crosssection
TGraphAsymmErrors* graphInvCrossSectionEtaComb7TeVA = NULL;
TGraphAsymmErrors* graphInvCrossSectionEtaComb7TeVAStatErr = NULL;
TGraphAsymmErrors* graphInvCrossSectionEtaComb7TeVASysErr = NULL;
Double_t branchingEtaGG = 0.3941;
Double_t branchingEtaPiPiPi = 0.2292;
Double_t rapidityMeas[10] = {0.85*2, 0.85*2,0.85*2, 0.85*2,0.85*2,0.85*2,0.85*2};
Double_t availableMeas[10] = {kFALSE,kFALSE,kFALSE,kFALSE,kFALSE,kFALSE,kFALSE};
Int_t nMeasSet = 0;
for (Int_t i = 0; i < 5; i++){
if(inputFile[i]->IsZombie())
continue;
else
cout << "loading histos for " << nameMeasGlobal[i] << endl;
//______________________________ Omega cross section
graphOmegaInvCrossSectionSys[i] = (TGraphAsymmErrors*)directoryOmega[i]->Get("InvCrossSectionOmegaSys");
histoOmegaInvCrossSection[i] = (TH1D*)directoryOmega[i]->Get("InvCrossSectionOmega");
graphOmegaInvCrossSectionStat[i] = new TGraphAsymmErrors(histoOmegaInvCrossSection[i]);
if(!graphOmegaInvCrossSectionSys[i] || !histoOmegaInvCrossSection[i]){
cout << "missing invariant cross section histograms of Omega... returning!" << endl;
return;
} else {
availableMeas[i] = kTRUE;
nMeasSet++;
cout << "loaded " << nameMeasGlobal[i] << " Omega invariant cross section" << endl;
}
//______________________________ Omega invariant mass peak pos and FWHM
histoOmegaMass[i] = (TH1D*)directoryOmega[i]->Get("Omega_Mass_data_INT1");
histoOmegaFWHMMeV[i] = (TH1D*)directoryOmega[i]->Get("Omega_Width_data_INT1");
histoOmegaTrueMass[i] = (TH1D*)directoryOmega[i]->Get("Omega_Mass_MC_INT1");
histoOmegaTrueFWHMMeV[i] = (TH1D*)directoryOmega[i]->Get("Omega_Width_MC_INT1");
if(!histoOmegaMass[i] || !histoOmegaFWHMMeV[i] || !histoOmegaFWHMMeV[i] || !histoOmegaFWHMMeV[i]){
cout << "missing mass or width histograms... returning!" << endl;
return;
} else {
// scaling peak pos and FWHM to go from GeV/c2 to MeV/c2
histoOmegaMass[i] ->Scale(1000);
histoOmegaFWHMMeV[i] ->Scale(1000);
histoOmegaTrueMass[i] ->Scale(1000);
histoOmegaTrueFWHMMeV[i] ->Scale(1000);
cout << "loaded " << nameMeasGlobal[i] << " mass and width" << endl;
}
//______________________________ Omega acceptance and efficiency and calculate acc*eff*y*2pi
histoOmegaAcc[i] = (TH1D*)directoryOmega[i]->Get("AcceptanceOmega_INT1");
histoOmegaTrueEffPt[i] = (TH1D*)directoryOmega[i]->Get("EfficiencyOmega_INT1");
// calculating for pi0 for later comparison
if(!histoOmegaAcc[i] || !histoOmegaTrueEffPt[i]){
cout << "missing acceptance or efficiency histograms... returning!" << endl;
return;
} else {
// calculating acceptance times efficiency
histoOmegaAccTimesEff[i] = (TH1D*)histoOmegaTrueEffPt[i]->Clone(Form("histoOmegaAccTimesEff%s",nameMeasGlobal[i].Data()));
histoOmegaAccTimesEff[i]->Multiply(histoOmegaAcc[i]);
histoOmegaAccTimesEff[i]->Scale(2*TMath::Pi()*rapidityMeas[i]);
cout << "loaded " << nameMeasGlobal[i] << "acceptance and efficiency" << endl;
}
//______________________________ Eta meson invariant cross section
histoEtaInvCrossSection[i] = (TH1D*)directoryEta[i]->Get("InvCrossSectionEta");
graphEtaInvCrossSectionStat[i] = (TGraphAsymmErrors*)directoryEta[i]->Get("graphInvCrossSectionEta");
graphEtaInvCrossSectionSys[i] = (TGraphAsymmErrors*)directoryEta[i]->Get("InvCrossSectionEtaSys");
graphEtaToOmegaPCMStat = (TGraphAsymmErrors*)directoryEta[i]->Get("graphEtaToOmegaStatError");
graphEtaToOmegaPCMSys = (TGraphAsymmErrors*)directoryEta[i]->Get("EtaToOmegaSystError");
if(!graphEtaInvCrossSectionSys[i] || !histoEtaInvCrossSection[i]){
cout << "missing invariant cross section histograms of eta... returning!" << endl;
return;
} else {
cout << "loaded " << nameMeasGlobal[i] << " eta invariant cross section" << endl;
}
//______________________________ Eta meson invariant mass peak pos and FWHM
histoEtaMass[i] = (TH1D*)directoryEta[i]->Get("Eta_Mass_data_INT1");
histoEtaFWHMMeV[i] = (TH1D*)directoryEta[i]->Get("Eta_Width_data_INT1");
histoEtaTrueMass[i] = (TH1D*)directoryEta[i]->Get("Eta_Mass_MC_INT1");
histoEtaTrueFWHMMeV[i] = (TH1D*)directoryEta[i]->Get("Eta_Width_MC_INT1");
if(!histoEtaMass[i] || !histoEtaFWHMMeV[i] || !histoEtaFWHMMeV[i] || !histoEtaFWHMMeV[i]){
cout << "missing mass or width histograms... returning!" << endl;
return;
} else {
// scaling peak pos and FWHM to go from GeV/c2 to MeV/c2
histoEtaMass[i] ->Scale(1000);
histoEtaFWHMMeV[i] ->Scale(1000);
histoEtaTrueMass[i] ->Scale(1000);
histoEtaTrueFWHMMeV[i] ->Scale(1000);
cout << "loaded " << nameMeasGlobal[i] << " mass and width" << endl;
}
//______________________________ Neutral pion acceptance and efficiency and calculate acc*eff*y*2pi
histoEtaAcc[i] = (TH1D*)directoryEta[i]->Get("AcceptanceEta_INT1");
histoEtaTrueEffPt[i] = (TH1D*)directoryEta[i]->Get("EfficiencyEta_INT1");
if(!histoEtaAcc[i] || !histoEtaTrueEffPt[i]){
cout << "missing acceptance or efficiency histograms... returning!" << endl;
return;
} else {
// calculating acceptance times efficiency
histoEtaAccTimesEff[i] = (TH1D*)histoEtaTrueEffPt[i]->Clone(Form("histoEtaAccTimesEff%s",nameMeasGlobal[i].Data()));
histoEtaAccTimesEffBR[i] = (TH1D*)histoEtaTrueEffPt[i]->Clone(Form("histoEtaAccTimesEffBR%s",nameMeasGlobal[i].Data()));
histoEtaAccTimesEff[i]->Multiply(histoEtaAcc[i]);
histoEtaAccTimesEffBR[i]->Multiply(histoEtaAcc[i]);
histoEtaAccTimesEff[i]->Scale(2*TMath::Pi()*rapidityMeas[i]);
histoEtaAccTimesEffBR[i]->Scale(2*TMath::Pi()*rapidityMeas[i]*branchingEtaPiPiPi);
cout << "loaded " << nameMeasGlobal[i] << "acceptance and efficiency" << endl;
}
}
// calculation of relative statistical and systematic uncertainties
// FOR Omega:
TH1D* statErrorCollection[11];
TGraphAsymmErrors* sysErrorCollection[11];
TH1D* statErrorRelCollection[11];
TGraphAsymmErrors* sysErrorRelCollection[11];
for (Int_t i = 0; i< 11; i++){
// initialize all histograms and graphs as NULL
statErrorCollection[i] = NULL;
sysErrorCollection[i] = NULL;
statErrorRelCollection[i] = NULL;
sysErrorRelCollection[i] = NULL;
// add available measurements to the collection
if(i<numbersofmeas && availableMeas[i]){
statErrorCollection[i] = (TH1D*)histoOmegaInvCrossSection[i]->Clone(Form("statErr%sOmega",nameMeasGlobal[i].Data()));
sysErrorCollection[i] = (TGraphAsymmErrors*)graphOmegaInvCrossSectionSys[i]->Clone(Form("sysErr%sOmega",nameMeasGlobal[i].Data()));
cout << "calculating Omega relative uncertainties for " << nameMeasGlobal[i] << endl;
}
// calculate relative errors for the available measurements
if (statErrorCollection[i]) statErrorRelCollection[i] = CalculateRelErrUpTH1D( statErrorCollection[i], Form("relativeStatErrorOmega_%s", nameMeasGlobal[i].Data()));
if (sysErrorCollection[i]) sysErrorRelCollection[i] = CalculateRelErrUpAsymmGraph( sysErrorCollection[i], Form("relativeSysErrorOmega_%s", nameMeasGlobal[i].Data()));
}
statErrorCollection[0]->Print();
// FOR eta:
TH1D* statErrorCollectionEta[11];
TGraphAsymmErrors* sysErrorCollectionEta[11];
TH1D* statErrorRelCollectionEta[11];
TGraphAsymmErrors* sysErrorRelCollectionEta[11];
TH1D* statErrorCollectionEtaGG[11];
TGraphAsymmErrors* sysErrorCollectionEtaGG[11];
TH1D* statErrorRelCollectionEtaGG[11];
TGraphAsymmErrors* sysErrorRelCollectionEtaGG[11];
for (Int_t i = 0; i< 11; i++){
// initialize all histograms and graphs as NULL
statErrorCollectionEta[i] = NULL;
sysErrorCollectionEta[i] = NULL;
statErrorRelCollectionEta[i] = NULL;
sysErrorRelCollectionEta[i] = NULL;
// add available measurements to the collection
if(i<numbersofmeas && availableMeas[i]){
statErrorCollectionEta[i] = (TH1D*)histoEtaInvCrossSection[i]->Clone(Form("statErr%sEta",nameMeasGlobal[i].Data()));
sysErrorCollectionEta[i] = (TGraphAsymmErrors*)graphEtaInvCrossSectionSys[i]->Clone(Form("sysErr%sEta",nameMeasGlobal[i].Data()));
}
// calculate relative errors for the available measurements
if (statErrorCollectionEta[i]) statErrorRelCollectionEta[i] = CalculateRelErrUpTH1D( statErrorCollectionEta[i], Form("relativeStatErrorEta_%s", nameMeasGlobal[i].Data()));
if (sysErrorCollectionEta[i]) sysErrorRelCollectionEta[i] = CalculateRelErrUpAsymmGraph( sysErrorCollectionEta[i], Form("relativeSysErrorEta_%s", nameMeasGlobal[i].Data()));
}
// *******************************************************************************************************
// ************************** Combination of different measurements **************************************
// *******************************************************************************************************
Int_t nBinsOmega = 14;
Double_t xPtLimits[15] = {0,1,1.4,1.6, 1.8, 2.0, 2.5,3.0,3.5,4,5.,6.,8.
,12,16};
Int_t nBinsEta = 13;
Double_t xPtLimitsEta[14] = { 0.0,1., 1.2,1.4, 1.5, 2.0, 2.5, 3.0,
3.5, 4.0, 5.0, 6.0, 8.0, 12.0};
// Double_t xPtLimitsOmegaToPi0[49] = { 0.0, 0.4, 0.6, 0.8, 1.0,
// 1.4, 1.8, 2.2, 2.6, 3.0,
// 3.5, 4.0, 5.0, 6.0, 8.0,
// 10.0, 12.0, 14.0, 15.0, 16.0,
// 18.0, 20.0, 25.0, 35.0
// };
// *******************************************************************************************************
// ************************** Combination of different measurements **************************************
// *******************************************************************************************************
// REMARKS:
// - order of measurements defined in CombinePtPointsSpectraFullCorrMat from CombinationFunctions.h
// - correlations are defined in CombinePtPointsSpectraFullCorrMat from CombinationFunctions.h
// - currently only PCM-EMCAL vs others fully implemeted energy independent
// - extendable to other energies
// - offsets have to be determined manually, see cout's in shell from combination function
// Definition of offsets for stat & sys see output of function in shell, make sure pt bins match
// PCM,PHOS,EMC,PCMPHOS,PCMEMC, EMC
Int_t offSets[11] = {0, 2, 2, 0, 2, 0,0,0, 6,0,0};
Int_t offSetsSys[11] = {4, 6, 10, 5, 8, 0,0,0, 6,0,0};
// needed for later binshifting
Int_t offSetOmegaShifting[11] = { 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0 };
Int_t nComBinsOmegaShifting[11] = { 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0 };
// PCM,PHOS,EMC,PCMPHOS,PCMEMC, EMC
Int_t offSetsEta[11] = {0, 2, 2, 0, 2, 0,0,0, 6,0,0};
Int_t offSetsSysEta[11] = {4, 6, 10, 5, 9, 0,0,0, 6,0,0};
Int_t offSetEtaShifting[11] = { 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0 };
Int_t nComBinsEtaShifting[11] = { 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0 };
// PCM,PHOS,EMC,PCMPHOS,PCMEMC, EMC
//Int_t offSetsOmegaToPi0[11] = {0, 4, 1, 2, 1, 0,0,0, 4,0,0};
//Int_t offSetsSysOmegaToPi0[11] = {1, 4, 7, 3, 4, 0,0,0, 9,0,0};
//**********************************************************************************************************************
//**********************************************************************************************************************
//**********************************************************************************************************************
TGraph* graphWeights[11];
TGraph* graphWeightsEta[11];
// TGraph* graphWeightsOmgeaToPi0[11];
for (Int_t i = 0; i< 11; i++){
graphWeights[i] = NULL;
graphWeightsEta[i] = NULL;
// graphWeightsEtaToPi0[i] = NULL;
}
// Declaration & calculation of combined spectrum
TString fileNameOutputWeighting = Form("%s/Weighting.dat",outputDir.Data());
TString fileNameOutputWeightingEta = Form("%s/WeightingEta.dat",outputDir.Data());
//TString fileNameOutputWeightingEtaToPi0 = Form("%s/WeightingEtaToPi0.dat",outputDir.Data());
TGraphAsymmErrors* graphCombOmegaInvXSectionStat= NULL;
TGraphAsymmErrors* graphCombOmegaInvXSectionSys = NULL;
TGraphAsymmErrors* graphCombOmegaInvXSectionTot = CombinePtPointsSpectraFullCorrMat( statErrorCollection, sysErrorCollection,
xPtLimits, nBinsOmega,
offSets, offSetsSys,
graphCombOmegaInvXSectionStat, graphCombOmegaInvXSectionSys,
fileNameOutputWeighting,"7TeV", "Omega", kTRUE,
0x0, fileNameSysCorrelation,"",40
);
graphCombOmegaInvXSectionStat->RemovePoint(0);
graphCombOmegaInvXSectionStat->RemovePoint(0);
graphCombOmegaInvXSectionStat->RemovePoint(0);
graphCombOmegaInvXSectionSys->RemovePoint(0);
graphCombOmegaInvXSectionSys->RemovePoint(0);
graphCombOmegaInvXSectionSys->RemovePoint(0);
graphCombOmegaInvXSectionTot->RemovePoint(0);
graphCombOmegaInvXSectionTot->RemovePoint(0);
graphCombOmegaInvXSectionTot->RemovePoint(0);
//return;
graphCombOmegaInvXSectionStat->Print();
TGraphAsymmErrors* graphCombEtaInvXSectionStat= NULL;
TGraphAsymmErrors* graphCombEtaInvXSectionSys = NULL;
TGraphAsymmErrors* graphCombEtaInvXSectionTot = CombinePtPointsSpectraFullCorrMat( statErrorCollectionEta, sysErrorCollectionEta,
xPtLimitsEta, nBinsEta,
offSetsEta, offSetsSysEta,
graphCombEtaInvXSectionStat, graphCombEtaInvXSectionSys,
fileNameOutputWeightingEta,"7TeV", "Eta", kTRUE,
0x0, fileNameSysCorrelation,"",40
);
graphCombEtaInvXSectionStat->RemovePoint(0);
graphCombEtaInvXSectionStat->RemovePoint(0);
graphCombEtaInvXSectionStat->RemovePoint(0);
graphCombEtaInvXSectionSys->RemovePoint(0);
graphCombEtaInvXSectionSys->RemovePoint(0);
graphCombEtaInvXSectionSys->RemovePoint(0);
graphCombEtaInvXSectionTot->RemovePoint(0);
graphCombEtaInvXSectionTot->RemovePoint(0);
graphCombEtaInvXSectionTot->RemovePoint(0);
// //return;
graphCombEtaInvXSectionStat->Print();
// TGraphAsymmErrors* graphCombEtaToPi0Stat= NULL;
// TGraphAsymmErrors* graphCombEtaToPi0Sys = NULL;
// TGraphAsymmErrors* graphCombEtaToPi0Tot = CombinePtPointsSpectraFullCorrMat( statErrorCollectionEtaToPi0, sysErrorCollectionEtaToPi0,
// xPtLimitsEtaToPi0, nBinsEta-1,
// offSetsEtaToPi0, offSetsSysEtaToPi0,
// graphCombEtaToPi0Stat, graphCombEtaToPi0Sys,
// fileNameOutputWeightingEtaToPi0,"7TeV", "EtaToPi0", kTRUE,
// 0x0, ""
// );
// //return;
// if(doOutput) graphCombEtaToPi0Stat->Print();
Double_t minX = 1.5;
Double_t maxX = 20.5;
Double_t minPtOmega = 1.3;
Double_t maxPtOmega = 20.5;
Double_t minXSectionOmega = 1e3;
Double_t maxXSectionOmega = 9e8;
Double_t minPtEta = 1.3;
Double_t maxPtEta = 20.5;
Double_t minXSectionEta = 1e3;
Double_t maxXSectionEta = 9e8;
//**********************************************************************************************************************
//**********************************************************************************************************************
//**********************************************************************************************************************
// plot weights + unc. for Omega
//**********************************************************************************************************************
//**********************************************************************************************************************
//**********************************************************************************************************************
// Reading weights from output file for plotting
ifstream fileWeightsRead;
fileWeightsRead.open(fileNameOutputWeighting,ios_base::in);
cout << "reading" << fileNameOutputWeighting << endl;
Double_t xValuesRead[50];
Double_t weightsRead[11][50];
Int_t availableMeasWeight[11] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
Int_t nPtBinsRead = 0;
while(!fileWeightsRead.eof() && nPtBinsRead < 50){
TString garbage = "";
if (nPtBinsRead == 0){
fileWeightsRead >> garbage ;
for (Int_t i = 0; i < nMeasSet; i++){
fileWeightsRead >> availableMeasWeight[i] ;
}
cout << "read following measurements: ";
for (Int_t i = 0; i < 11; i++){
cout << availableMeasWeight[i] << "\t" ;
}
cout << endl;
} else {
fileWeightsRead >> xValuesRead[nPtBinsRead-1];
for (Int_t i = 0; i < nMeasSet; i++){
fileWeightsRead >> weightsRead[availableMeasWeight[i]][nPtBinsRead-1] ;
}
cout << "read: "<< nPtBinsRead << "\t"<< xValuesRead[nPtBinsRead-1] << "\t" ;
for (Int_t i = 0; i < nMeasSet; i++){
cout << weightsRead[availableMeasWeight[i]][nPtBinsRead-1] << "\t";
}
cout << endl;
}
nPtBinsRead++;
}
nPtBinsRead = nPtBinsRead-2 ;
fileWeightsRead.close();
for (Int_t i = 0; i < nMeasSet; i++){
graphWeights[availableMeasWeight[i]] = new TGraph(nPtBinsRead,xValuesRead,weightsRead[availableMeasWeight[i]]);
Int_t bin = 0;
for (Int_t n = 0; n< nPtBinsRead; n++){
if (graphWeights[availableMeasWeight[i]]->GetY()[bin] == 0) graphWeights[availableMeasWeight[i]]->RemovePoint(bin);
else bin++;
}
}
//**********************************************************************************************************************
//******************************************* Plotting weights for Omega ************************************************
//**********************************************************************************************************************
Int_t textSizeLabelsPixel = 900*0.04;
Double_t textSizeLabelsRel = 50./1200;
TCanvas* canvasWeights = new TCanvas("canvasWeights","",200,10,1350,900); // gives the page size
DrawGammaCanvasSettings( canvasWeights, 0.08, 0.02, 0.035, 0.09);
canvasWeights->SetLogx();
TH2F * histo2DWeights = new TH2F("histo2DWeights","histo2DWeights",11000,minPtOmega,maxPtOmega,1000,-0.5,1.1);
SetStyleHistoTH2ForGraphs(histo2DWeights, "#it{p}_{T} (GeV/#it{c})","#omega_{a} for BLUE",0.035,0.04, 0.035,0.04, 1.,1.);
histo2DWeights->GetXaxis()->SetMoreLogLabels();
histo2DWeights->GetXaxis()->SetNoExponent();
canvasWeights->cd();
histo2DWeights->Draw("copy");
TLegend* legendAccWeights = GetAndSetLegend2(0.12, 0.14, 0.45, 0.14+(0.035*nMeasSet*1.35), 32);
for (Int_t i = 0; i < nMeasSet; i++){
DrawGammaSetMarkerTGraph(graphWeights[availableMeasWeight[i]],
markerStyleDet[availableMeasWeight[i]],
markerSizeDet[availableMeasWeight[i]]*0.5,
colorDet[availableMeasWeight[i]] ,
colorDet[availableMeasWeight[i]]);
graphWeights[availableMeasWeight[i]]->Draw("p,same,e1");
legendAccWeights->AddEntry(graphWeights[availableMeasWeight[i]],nameMeasGlobal[availableMeasWeight[i]],"p");
}
legendAccWeights->Draw();
drawLatexAdd("ALICE this thesis",0.93,0.16+(2*0.05),textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
drawLatexAdd(collisionSystem7TeV,0.93,0.16+0.05,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
drawLatexAdd("#omega #rightarrow #pi^{+}#pi^{-}#pi^{0}",0.93,0.16,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
// DrawGammaLines(0.23, 70. , 0.5, 0.5,0.1, kGray, 7);
// DrawGammaLines(0.23, 70. , 0.4, 0.4,0.1, kGray, 1);
// DrawGammaLines(0.23, 70. , 0.3, 0.3,0.1, kGray, 7);
// DrawGammaLines(0.23, 70. , 0.2, 0.2,0.1, kGray, 3);
canvasWeights->SaveAs(Form("%s/Omega_WeightsMethods.%s",outputDir.Data(),suffix.Data()));
//*********************************************************************************************************************
//************************************ Visualize relative errors ******************************************************
//*********************************************************************************************************************
TCanvas* canvasRelSysErr = new TCanvas("canvasRelSysErr","",200,10,1350,900); // gives the page size
DrawGammaCanvasSettings( canvasRelSysErr, 0.08, 0.02, 0.035, 0.09);
canvasRelSysErr->SetLogx();
TH2F * histo2DRelSysErr = new TH2F("histo2DRelSysErr","histo2DRelSysErr",11000,minPtOmega,maxPtOmega,1000,0,80.5);
SetStyleHistoTH2ForGraphs(histo2DRelSysErr, "#it{p}_{T} (GeV/#it{c})","Systematic uncertainty (%)",0.035,0.04, 0.035,0.04, 1.,1.);
histo2DRelSysErr->GetXaxis()->SetMoreLogLabels();
histo2DRelSysErr->GetXaxis()->SetNoExponent();
histo2DRelSysErr->GetYaxis()->SetRangeUser(0,45.5);
histo2DRelSysErr->Draw("copy");
TLegend* legendRelSysErr = GetAndSetLegend2(0.62, 0.94-(0.035*nMeasSet*1.35), 0.95, 0.94, 32);
for (Int_t i = 0; i < nMeasSet; i++){
DrawGammaSetMarkerTGraph(sysErrorRelCollection[availableMeasWeight[i]], markerStyleDet[availableMeasWeight[i]], markerSizeDet[availableMeasWeight[i]]*0.5, colorDet[availableMeasWeight[i]],
colorDet[availableMeasWeight[i]]);
sysErrorRelCollection[availableMeasWeight[i]]->Draw("p,same,e1");
legendRelSysErr->AddEntry(sysErrorRelCollection[availableMeasWeight[i]],nameMeasGlobal[availableMeasWeight[i]],"p");
}
legendRelSysErr->Draw();
drawLatexAdd("ALICE this thesis",0.93,0.92,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
drawLatexAdd(collisionSystem7TeV,0.93,0.87,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
drawLatexAdd("#omega #rightarrow #pi^{+}#pi^{-}#pi^{0}",0.93,0.82,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
canvasRelSysErr->SaveAs(Form("%s/Omega_RelSysErr.%s",outputDir.Data(),suffix.Data()));
//*********************************************************************************************************************
//************************************ Visualize relative errors ******************************************************
//*********************************************************************************************************************
TCanvas* canvasRelStatErr = new TCanvas("canvasRelStatErr","",200,10,1350,900); // gives the page size
DrawGammaCanvasSettings( canvasRelStatErr, 0.08, 0.02, 0.035, 0.09);
canvasRelStatErr->SetLogx();
TH2F * histo2DRelStatErr = new TH2F("histo2DRelStatErr","histo2DRelStatErr",11000,minPtOmega,maxPtOmega,1000,0,80.5);
SetStyleHistoTH2ForGraphs(histo2DRelStatErr, "#it{p}_{T} (GeV/#it{c})","Statistical uncertainty (%)",0.035,0.04, 0.035,0.04, 1.,1.);
histo2DRelStatErr->GetXaxis()->SetMoreLogLabels();
histo2DRelStatErr->GetXaxis()->SetNoExponent();
histo2DRelStatErr->GetYaxis()->SetRangeUser(0,47.5);
histo2DRelStatErr->Draw("copy");
TLegend* legendRelStatErr = GetAndSetLegend2(0.10, 0.4-(0.035*nMeasSet*1.35), 0.41, 0.4, 32);
for (Int_t i = 0; i < nMeasSet; i++){
DrawGammaSetMarker(statErrorRelCollection[availableMeasWeight[i]], markerStyleDet[availableMeasWeight[i]], markerSizeDet[availableMeasWeight[i]]*0.5, colorDet[availableMeasWeight[i]] ,
colorDet[availableMeasWeight[i]]);
TGraphAsymmErrors* graphDummy = new TGraphAsymmErrors(statErrorRelCollection[availableMeasWeight[i]]);
DrawGammaSetMarkerTGraphAsym(graphDummy, markerStyleDet[availableMeasWeight[i]], markerSizeDet[availableMeasWeight[i]]*0.5, colorDet[availableMeasWeight[i]],
colorDet[availableMeasWeight[i]]);
graphDummy->Draw("same,p,e1");
legendRelStatErr->AddEntry(graphDummy,nameMeasGlobal[availableMeasWeight[i]],"p");
}
legendRelStatErr->Draw();
drawLatexAdd("ALICE this thesis",0.93,0.89,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
drawLatexAdd(collisionSystem7TeV,0.93,0.84,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
drawLatexAdd("#omega #rightarrow #pi^{+}#pi^{-}#pi^{0}",0.93,0.79,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
canvasRelStatErr->SaveAs(Form("%s/Omega_RelStatErr.%s",outputDir.Data(),suffix.Data()));
//**********************************************************************************************************************
//**********************************************************************************************************************
TGraphAsymmErrors* graphCombOmegaInvXSectionRelStat = CalculateRelErrUpAsymmGraph( graphCombOmegaInvXSectionStat, "graphCombOmegaInvXSectionRelStat");
TGraphAsymmErrors* graphCombOmegaInvXSectionRelSys = CalculateRelErrUpAsymmGraph( graphCombOmegaInvXSectionSys, "graphCombOmegaInvXSectionRelSys");
TGraphAsymmErrors* graphCombOmegaInvXSectionRelTot = CalculateRelErrUpAsymmGraph( graphCombOmegaInvXSectionTot, "graphCombOmegaInvXSectionRelTot");
TCanvas* canvasRelTotErr = new TCanvas("canvasRelTotErr","",200,10,1350,900); // gives the page size
DrawGammaCanvasSettings( canvasRelTotErr, 0.08, 0.02, 0.035, 0.09);
canvasRelTotErr->SetLogx();
TH2F * histo2DRelTotErr;
histo2DRelTotErr = new TH2F("histo2DRelTotErr","histo2DRelTotErr",11000,minPtOmega,maxPtOmega,1000,0,67.5);
SetStyleHistoTH2ForGraphs(histo2DRelTotErr, "#it{p}_{T} (GeV/#it{c})","Total uncertainty (%)",0.035,0.04, 0.035,0.04, 1.,1.);
histo2DRelTotErr->GetXaxis()->SetMoreLogLabels();
histo2DRelTotErr->GetXaxis()->SetNoExponent();
histo2DRelTotErr->GetYaxis()->SetRangeUser(0,65.5);
histo2DRelTotErr->GetYaxis()->SetTitle("Uncertainty (%)");
histo2DRelTotErr->Draw("copy");
DrawGammaSetMarkerTGraphAsym(graphCombOmegaInvXSectionRelTot, markerStyleComb, markerSizeComb, colorComb , colorComb);
graphCombOmegaInvXSectionRelTot->Draw("p,same,e1");
DrawGammaSetMarkerTGraphAsym(graphCombOmegaInvXSectionRelStat, markerStyleComb, markerSizeComb, colorComb-6 , colorComb-6);
graphCombOmegaInvXSectionRelStat->Draw("l,x0,same,e1");
DrawGammaSetMarkerTGraphAsym(graphCombOmegaInvXSectionRelSys, markerStyleComb, markerSizeComb, colorComb+2, colorComb+2);
graphCombOmegaInvXSectionRelSys->SetLineStyle(7);
graphCombOmegaInvXSectionRelSys->Draw("l,x0,same,e1");
TLegend* legendRelTotErr2 = GetAndSetLegend2(0.14, 0.94-(0.035*3*1.35), 0.45, 0.94, 32);
legendRelTotErr2->AddEntry(graphCombOmegaInvXSectionRelTot,"Total","p");
legendRelTotErr2->AddEntry(graphCombOmegaInvXSectionRelStat,"Statistical","l");
legendRelTotErr2->AddEntry(graphCombOmegaInvXSectionRelSys,"Systematic","l");
legendRelTotErr2->Draw();
drawLatexAdd("ALICE this thesis",0.93,0.90,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
drawLatexAdd(collisionSystem7TeV,0.93,0.85,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
drawLatexAdd("#omega #rightarrow #pi^{+}#pi^{-}#pi^{0}",0.93,0.8,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
canvasRelTotErr->SaveAs(Form("%s/Omega_Reldecomp.%s",outputDir.Data(),suffix.Data()));
//**********************************************************************************************************************
//**********************************************************************************************************************
//**********************************************************************************************************************
// plot weights + unc. for eta
//**********************************************************************************************************************
//**********************************************************************************************************************
//**********************************************************************************************************************
// Reading weights from output file for plotting
ifstream fileWeightsReadEta;
fileWeightsReadEta.open(fileNameOutputWeightingEta,ios_base::in);
cout << "reading" << fileNameOutputWeightingEta << endl;
Double_t xValuesReadEta[50];
Double_t weightsReadEta[11][50];
Int_t availableMeasWeightEta[11] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
Int_t nPtBinsReadEta = 0;
while(!fileWeightsReadEta.eof() && nPtBinsReadEta < 50){
TString garbage = "";
if (nPtBinsReadEta == 0){
fileWeightsReadEta >> garbage ;
for (Int_t i = 0; i < nMeasSet; i++){
fileWeightsReadEta >> availableMeasWeightEta[i] ;
}
cout << "read following measurements: ";
for (Int_t i = 0; i < 11; i++){
cout << availableMeasWeightEta[i] << "\t" ;
}
cout << endl;
} else {
fileWeightsReadEta >> xValuesReadEta[nPtBinsReadEta-1];
for (Int_t i = 0; i < nMeasSet; i++){
fileWeightsReadEta >> weightsReadEta[availableMeasWeightEta[i]][nPtBinsReadEta-1] ;
}
cout << "read: "<< nPtBinsReadEta << "\t"<< xValuesReadEta[nPtBinsReadEta-1] << "\t" ;
for (Int_t i = 0; i < nMeasSet; i++){
cout << weightsReadEta[availableMeasWeightEta[i]][nPtBinsReadEta-1] << "\t";
}
cout << endl;
}
nPtBinsReadEta++;
}
nPtBinsReadEta = nPtBinsReadEta-2 ;
fileWeightsReadEta.close();
for (Int_t i = 0; i < nMeasSet; i++){
graphWeightsEta[availableMeasWeightEta[i]] = new TGraph(nPtBinsReadEta,xValuesReadEta,weightsReadEta[availableMeasWeightEta[i]]);
Int_t bin = 0;
for (Int_t n = 0; n< nPtBinsReadEta; n++){
if (graphWeightsEta[availableMeasWeightEta[i]]->GetY()[bin] == 0) graphWeightsEta[availableMeasWeightEta[i]]->RemovePoint(bin);
else bin++;
}
}
//**********************************************************************************************************************
//******************************************* Plotting weights for Eta ************************************************
//**********************************************************************************************************************
TCanvas* canvasWeightsEta = new TCanvas("canvasWeightsEta","",200,10,1350,900); // gives the page size
DrawGammaCanvasSettings( canvasWeightsEta, 0.08, 0.02, 0.035, 0.09);
canvasWeightsEta->SetLogx();
TH2F * histo2DWeightsEta;
histo2DWeightsEta = new TH2F("histo2DWeightsEta","histo2DWeightsEta",11000,minPtEta,maxPtEta,1000,-0.5,1.1);
SetStyleHistoTH2ForGraphs(histo2DWeightsEta, "#it{p}_{T} (GeV/#it{c})","#omega_{a} for BLUE",0.035,0.04, 0.035,0.04, 1.,1.);
histo2DWeightsEta->GetXaxis()->SetMoreLogLabels();
histo2DWeightsEta->GetXaxis()->SetNoExponent();
canvasWeightsEta->cd();
histo2DWeightsEta->Draw("copy");
TLegend* legendAccWeightsEta = GetAndSetLegend2(0.12, 0.14, 0.45, 0.14+(0.035*nMeasSet*1.35), 32);
for (Int_t i = 0; i < nMeasSet; i++){
DrawGammaSetMarkerTGraph(graphWeightsEta[availableMeasWeightEta[i]],
markerStyleDet[availableMeasWeightEta[i]],
markerSizeDet[availableMeasWeightEta[i]]*0.5,
colorDet[availableMeasWeightEta[i]] ,
colorDet[availableMeasWeightEta[i]]);
graphWeightsEta[availableMeasWeightEta[i]]->Draw("p,same,e1");
legendAccWeightsEta->AddEntry(graphWeightsEta[availableMeasWeightEta[i]],nameMeasGlobal[availableMeasWeightEta[i]],"p");
}
legendAccWeightsEta->Draw();
drawLatexAdd("ALICE this thesis",0.93,0.16+(2*0.05),textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
drawLatexAdd(collisionSystem7TeV,0.93,0.16+0.05,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
drawLatexAdd("#eta #rightarrow #pi^{+}#pi^{-}#pi^{0}",0.93,0.16,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
// DrawGammaLines(0.23, 70. , 0.5, 0.5,0.1, kGray, 7);
// DrawGammaLines(0.23, 70. , 0.4, 0.4,0.1, kGray, 1);
// DrawGammaLines(0.23, 70. , 0.3, 0.3,0.1, kGray, 7);
// DrawGammaLines(0.23, 70. , 0.2, 0.2,0.1, kGray, 3);
canvasWeightsEta->SaveAs(Form("%s/Eta_WeightsMethods.%s",outputDir.Data(),suffix.Data()));
//*********************************************************************************************************************
//************************************ Visualize relative errors ******************************************************
//*********************************************************************************************************************
TCanvas* canvasRelSysErrEta = new TCanvas("canvasRelSysErrEta","",200,10,1350,900); // gives the page size
DrawGammaCanvasSettings( canvasRelSysErrEta, 0.08, 0.02, 0.035, 0.09);
canvasRelSysErrEta->SetLogx();
TH2F * histo2DRelSysErrEta = new TH2F("histo2DRelSysErrEta","histo2DRelSysErrEta",11000,minPtEta,maxPtEta,1000,0,80.5);
SetStyleHistoTH2ForGraphs(histo2DRelSysErrEta, "#it{p}_{T} (GeV/#it{c})","Systematic uncertainty (%)",0.035,0.04, 0.035,0.04, 1.,1.);
histo2DRelSysErr->GetXaxis()->SetMoreLogLabels();
histo2DRelSysErr->GetXaxis()->SetNoExponent();
histo2DRelSysErr->GetYaxis()->SetRangeUser(0,55.5);
histo2DRelSysErr->Draw("copy");
TLegend* legendRelSysErrEta = GetAndSetLegend2(0.62, 0.94-(0.035*nMeasSet*1.35), 0.95, 0.94, 32);
for (Int_t i = 0; i < nMeasSet; i++){
DrawGammaSetMarkerTGraph(sysErrorRelCollectionEta[availableMeasWeightEta[i]], markerStyleDet[availableMeasWeightEta[i]], markerSizeDet[availableMeasWeightEta[i]]*0.5, colorDet[availableMeasWeightEta[i]],
colorDet[availableMeasWeightEta[i]]);
sysErrorRelCollectionEta[availableMeasWeightEta[i]]->Draw("p,same,e1");
legendRelSysErrEta->AddEntry(sysErrorRelCollectionEta[availableMeasWeightEta[i]],nameMeasGlobal[availableMeasWeightEta[i]],"p");
}
legendRelSysErrEta->Draw();
drawLatexAdd("ALICE this thesis",0.93,0.92,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
drawLatexAdd(collisionSystem7TeV,0.93,0.87,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
drawLatexAdd("#eta #rightarrow #pi^{+}#pi^{-}#pi^{0}",0.93,0.82,textSizeLabelsRel,kFALSE,kFALSE,kTRUE);
canvasRelSysErrEta->SaveAs(Form("%s/Eta_RelSysErr.%s",outputDir.Data(),suffix.Data()));
//*********************************************************************************************************************
//************************************ Visualize relative errors ******************************************************
//*********************************************************************************************************************
TCanvas* canvasRelStatErrEta = new TCanvas("canvasRelStatErrEta","",200,10,1350,900); // gives the page size
DrawGammaCanvasSettings( canvasRelStatErrEta, 0.08, 0.02, 0.035, 0.09);
canvasRelStatErrEta->SetLogx();
TH2F * histo2DRelStatErrEta = new TH2F("histo2DRelStatErrEta","histo2DRelStatErrEta",11000,minPtEta,maxPtEta,1000,0,80.5);
SetStyleHistoTH2ForGraphs(histo2DRelStatErrEta, "#it{p}_{T} (GeV/#it{c})","Statistical uncertainty (%)",0.035,0.04, 0.035,0.04, 1.,1.);
histo2DRelStatErrEta->GetXaxis()->SetMoreLogLabels();
histo2DRelStatErrEta->GetXaxis()->SetNoExponent();
histo2DRelStatErrEta->GetYaxis()->SetRangeUser(0,55.5);
histo2DRelStatErrEta->Draw("copy");
TLegend* legendRelStatErrEta = GetAndSetLegend2(0.14, 0.94-(0.035*nMeasSet*1.35), 0.45, 0.94, 32);
for (Int_t i = 0; i < nMeasSet; i++){
DrawGammaSetMarker(statErrorRelCollectionEta[availableMeasWeightEta[i]], markerStyleDet[availableMeasWeightEta[i]], markerSizeDet[availableMeasWeightEta[i]]*0.5, colorDet[availableMeasWeightEta[i]] ,
colorDet[availableMeasWeightEta[i]]);
TGraphAsymmErrors* graphDummy = new TGraphAsymmErrors(statErrorRelCollectionEta[availableMeasWeightEta[i]]);
DrawGammaSetMarkerTGraphAsym(graphDummy, markerStyleDet[availableMeasWeightEta[i]], markerSizeDet[availableMeasWeightEta[i]]*0.5, colorDet[availableMeasWeightEta[i]],
colorDet[availableMeasWeightEta[i]]);
graphDummy->Draw("same,p,e1");
legendRelStatErrEta->AddEntry(graphDummy,nameMeasGlobal[availableMeasWeightEta[i]],"p");