-
Notifications
You must be signed in to change notification settings - Fork 0
/
CombineMesonMeasurements7TeVAnd900GeV.C
6207 lines (5148 loc) · 414 KB
/
CombineMesonMeasurements7TeVAnd900GeV.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, *****
****** Ana Marin, marin@physi.uni-heidelberg.de *****
****** Kathrin Koch, kkoch@physi.uni-heidelberg.de *****
****** Friederike Bock, friederike.bock@cern.ch *****
*****************************************************************************************************************************/
#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 "TaskV1/ProduceFinalResults.h"
#include "CommonHeaders/FittingGammaConversion.h"
#include "CommonHeaders/ConversionFunctionsBasicsAndLabeling.h"
#include "CommonHeaders/ConversionFunctions.h"
#include "CommonHeaders/CombinationFunctions.h"
#include "CombineMesonMeasurements7TeVAnd900GeV.h"
extern TRandom* gRandom;
extern TBenchmark* gBenchmark;
extern TSystem* gSystem;
extern TMinuit* gMinuit;
struct SysErrorConversion {
Double_t value;
Double_t error;
// TString name;
};
void CombineMesonMeasurements7TeVAnd900GeV(TString fileNameConversions = "", const char *fileNameConversionsPrelim = "", TString suffix = "eps", TString isMC= "", TString thesisPlots = "", TString bWCorrection="X"){
date = ReturnDateString();
gROOT->Reset();
gROOT->SetStyle("Plain");
StyleSettingsThesis();
SetPlotStyle();
TString dateForOutput = ReturnDateStringForOutput();
cout << dateForOutput.Data() << endl;
//___________________________________ Declaration of files _____________________________________________
collisionSystem7TeV = "pp, #sqrt{#it{s}} = 7 TeV";
collisionSystem2760GeV = "pp, #sqrt{#it{s}} = 2.76 TeV";
collisionSystem900GeV = "pp, #sqrt{#it{s}} = 0.9 TeV";
collisionSystemCombined = "pp, #sqrt{#it{s}} = 0.9 & 7 TeV";
collisionSystemCombinedReallyAll = "pp #sqrt{#it{s}} = 0.9, 2.76, 7 TeV";
fileNameCaloPhos7TeV = "ExternalInput/PHOS/7TeV/PHOS_pi0_7TeV_20111030_BWcorr.root";
fileNameCaloPhosOmega7TeV = "ExternalInput/PHOS/7TeV/PHOS_pp_omega_7TeV_07082012.root";
fileNameCaloEmcal7TeV = "ExternalInput/EMCAL/7TeV/pi0EMCAL_12052011.root";
fileNameCaloEmcalEtaToPi07TeV = "ExternalInput/EMCAL/7TeV/eta2pi0EMCAL_11052011.root";
fileNameCaloPhos7TeVEta = "ExternalInput/PHOS/7TeV/PHOS_eta_7TeV_06052011.root";
fileNameChargedSpectra7TeV = "ExternalInput/IdentifiedCharged/1PtdNdPtSpectra_INEL_LHC10d_7TeV_Final_301110.txt";
fileNameChargedSpectra2760GeV = "ExternalInput/IdentifiedCharged/charged_dNdPt_pp_276.root";
fileNameChargedExpectation7TeV = "ExternalInput/IdentifiedCharged/ChargedPythia22092010.dat";
fileNamePHOSMassData7TeV = "ExternalInput/PHOS/7TeV/PHOS_Pi0MassPosData-CommonBinning-20111109.root";
fileNamePHOSMassMC7TeV = "ExternalInput/PHOS/7TeV/PHOS_Pi0MassPosMC-CommonBinning-20111108.root";
fileNameEMCALMassData7TeVPi0 = "ExternalInput/EMCAL/7TeV/EMCALResults_pp_v2Clusterizer.root";
fileNameEMCALMassData7TeVEta = "ExternalInput/EMCAL/7TeV/EMCAL_DataEtaMassWidth.root";
fileNameEMCALMassMC7TeVPi0 = "ExternalInput/EMCAL/7TeV/EMCAL_SimPi0MassWidth.root";
fileNameEMCALMassMC7TeVEta = "ExternalInput/EMCAL/7TeV/EMCAL_SimEtaMassWidth.root";
fileNamePHOSEtaToPi0 = "ExternalInput/PHOS/7TeV/PHOS_etaPi_ratio_7TeV_20111217.root";
fileNameCaloPhos900GeV = "ExternalInput/PHOS/0.9GeV/PHOS_pp_pi0_900GeV_20110413_K0Scorr.root";
if(bWCorrection.CompareTo("X")==0){
fileNameCaloPhos900GeV = "ExternalInput/PHOS/0.9GeV/PHOS_pp_pi0_900GeV_noBWcorr_K0Scorr_20111206.root";
fileNameCaloPhos7TeV = "ExternalInput/PHOS/7TeV/PHOS_pp_pi0_7TeV_20120515.root";
fileNameCaloPhos7TeVEta = "ExternalInput/PHOS/7TeV/PHOS_pp_eta_7TeV_20120515.root";
}
fileNameCaloPhos2760GeV = "ExternalInput/PHOS/2.76TeV/LHC11a_PHOS_pi0_pp2760_noBWCorr_FDcorr_20140218.root";
cout << "USING PHOS FILE 2.76TeV: " << fileNameCaloPhos2760GeV<< endl;
TString outputDir = Form("%s/%s/CombineMesonMeasurements%s",suffix.Data(),dateForOutput.Data(),bWCorrection.Data());
nameFinalResDat = Form("%s/CombinedResults%s_FitResults.dat",dateForOutput.Data(),bWCorrection.Data());
cout << outputDir.Data() << endl;
cout << fileNameConversions.Data() << endl;
// TString bla = Form("cp %s %s/InputGammaConv.root", fileNameConversions.Data(), outputDir.Data());
// cout << bla.Data() << endl;
gSystem->Exec("mkdir -p "+outputDir);
gSystem->Exec(Form("cp %s %s/InputGammaConv.root", fileNameConversions.Data(), outputDir.Data()));
gSystem->Exec(Form("cp %s %s/InputPHOS900GeV.root", fileNameCaloPhos900GeV, outputDir.Data()));
gSystem->Exec(Form("cp %s %s/InputPHOS7TeV.root", fileNameCaloPhos7TeV, outputDir.Data()));
gSystem->Exec(Form("cp %s %s/InputPHOS7TeVEta.root", fileNameCaloPhos7TeVEta, outputDir.Data()));
gSystem->Exec(Form("cp %s %s/InputPHOS2760GeV.root", fileNameCaloPhos2760GeV, outputDir.Data()));
if(thesisPlots.CompareTo("thesis") == 0){// means we want to plot values for the pi0
thesis = kTRUE;
}
//declaration for printing logo
if (isMC.CompareTo("kTRUE")==0){
prefix2 = "MC";
pictDrawingOptions[1] = kTRUE;
} else {
prefix2 = "data";
pictDrawingOptions[1] = kFALSE;
}
mesonMassExpectPi0 = TDatabasePDG::Instance()->GetParticle(111)->Mass();
mesonMassExpectEta = TDatabasePDG::Instance()->GetParticle(221)->Mass();
//************************** Read data for conversions **************************************************
// File definitions
fileConversions = new TFile(fileNameConversions.Data());
fileConversionsPrelim = new TFile(fileNameConversionsPrelim);
directoryPi07TeV = (TDirectory*)fileConversions->Get("Pi07TeV");
directoryEta7TeV = (TDirectory*)fileConversions->Get("Eta7TeV");
histoNumberOfEvents= (TH1D*)fileConversions->Get("histoNumberOfEvents7TeV");
histoMassMesonPi0 = (TH1D*)directoryPi07TeV->Get("MassPi0");
histoFWHMMesonPi0MeV = (TH1D*)directoryPi07TeV->Get("FWHMPi0MeV");
histoTrueMassMesonPi0 = (TH1D*)directoryPi07TeV->Get("TrueMassPi0");
histoTrueFWHMMesonPi0MeV = (TH1D*)directoryPi07TeV->Get("TrueFWHMPi0MeV");
histoAccPi0 = (TH1D*)directoryPi07TeV->Get("AcceptancePi0");
histoTrueEffPtPi0 = (TH1D*)directoryPi07TeV->Get("EfficiencyPi0");
histoPi0CorrYieldBinShifted = (TH1D*)directoryPi07TeV->Get("CorrectedYieldPi0BinShifted");
histoPi0CorrYieldMtBinShifted = (TH1D*)directoryPi07TeV->Get("CorrectedYieldPi0MtBinShifted");
histoPi0CorrYieldXtBinShifted = (TH1D*)directoryPi07TeV->Get("CorrectedYieldPi0XtBinShifted");
histoInvCrossSectionPi0= (TH1D*)directoryPi07TeV->Get("InvCrossSectionPi0");
graphInvCrossSectionSysPi0= (TGraphAsymmErrors*)directoryPi07TeV->Get("InvCrossSectionPi0Sys");
graphInvCrossSectionSysAPi0= (TGraphAsymmErrors*)directoryPi07TeV->Get("InvCrossSectionPi0SysA");
graphCorrectedYieldPi0SysErr= (TGraphAsymmErrors*)directoryPi07TeV->Get("Pi0SystError");
graphCorrectedYieldPi0SysErrBinShifted= (TGraphAsymmErrors*)directoryPi07TeV->Get("Pi0SystErrorBinShifted");
histoEtaToPi0Phojet7TeV= (TH1D*)directoryPi07TeV->Get("EtaToPi0MCTruthPhojet");
histoEtaToPi0Pythia7TeV= (TH1D*)directoryPi07TeV->Get("EtaToPi0MCTruthPythia");
histoPi0ToChargedPhojet7TeV= (TH1D*)directoryPi07TeV->Get("Pi0ToChargedPhojet");
histoPi0ToChargedPythia7TeV= (TH1D*)directoryPi07TeV->Get("Pi0ToChargedPythia");
cout << "bis hier her geschafft" << endl;
histoCorrectedYieldEta= (TH1D*)directoryEta7TeV->Get("CorrectedYieldEta");
histoUnCorrectedYieldEta= (TH1D*)directoryEta7TeV->Get("RAWYieldPerEventsEta");
histoMassMesonEta= (TH1D*)directoryEta7TeV->Get("MassEta");
histoFWHMMesonEtaMeV = (TH1D*)directoryEta7TeV->Get("FWHMEtaMeV");
histoTrueMassMesonEta = (TH1D*)directoryEta7TeV->Get("TrueMassEta");
histoTrueFWHMMesonEtaMeV = (TH1D*)directoryEta7TeV->Get("TrueFWHMEtaMeV");
histoEtaCorrYieldBinShifted= (TH1D*)directoryEta7TeV->Get("CorrectedYieldEtaBinShifted");
histoEtaCorrYieldMtBinShifted= (TH1D*)directoryEta7TeV->Get("CorrectedYieldEtaMtBinShifted");
histoEtaCorrYieldXtBinShifted= (TH1D*)directoryEta7TeV->Get("CorrectedYieldEtaXtBinShifted");
histoInvCrossSectionEta= (TH1D*)directoryEta7TeV->Get("InvCrossSectionEta");
graphInvCrossSectionSysAEta= (TGraphAsymmErrors*)directoryEta7TeV->Get("InvCrossSectionEtaSysA");
graphInvCrossSectionSysEta= (TGraphAsymmErrors*)directoryEta7TeV->Get("InvCrossSectionEtaSys");
graphCorrectedYieldEtaSysErr= (TGraphAsymmErrors*)directoryEta7TeV->Get("EtaSystError");
graphCorrectedYieldEtaSysErrBinShifted= (TGraphAsymmErrors*)directoryEta7TeV->Get("EtaSystErrorBinShifted");
graphCorrectedYieldEtaSysErrMtBinShifted= (TGraphAsymmErrors*)directoryEta7TeV->Get("EtaSystErrorBinShiftedMt");
histoRatioEtaPi0= (TH1D*)directoryEta7TeV->Get("EtatoPi0RatioConversionBinShifted");
graphSystErrRatio= (TGraphAsymmErrors*)directoryEta7TeV->Get("EtatoPi0RatioConversionBinShiftedSys");
nEvt7TeV = histoNumberOfEvents->GetBinContent(1);
Bool_t kV0ANDConv7TeV = kFALSE;
if (histoNumberOfEvents->GetNbinsX() > 1 && histoNumberOfEvents->GetBinContent(2) > 0) kV0ANDConv7TeV = kTRUE;
cout << "7 TeV data read, kVOAND: " <<kV0ANDConv7TeV <<endl;
directoryPi02760GeV = (TDirectory*)fileConversions->Get("Pi02.76TeV");
if (conference) {
// directoryPi02760GeV = (TDirectory*)fileConversionsPrelim->Get("Pi02.76TeV");
directoryEta2760GeV = (TDirectory*)fileConversionsPrelim->Get("Eta2.76TeV");
cout << "reading preliminary file for 2.76TeV" << endl;
} else {
directoryEta2760GeV = (TDirectory*)fileConversions->Get("Eta2.76TeV");
}
histoNumberOfEvents2760GeV= (TH1D*)fileConversions->Get("histoNumberOfEvents");
histoMassMesonPi02760GeV = (TH1D*)directoryPi02760GeV->Get("MassPi0");
histoFWHMMesonPi0MeV2760GeV = (TH1D*)directoryPi02760GeV->Get("FWHMPi0MeV");
histoTrueMassMesonPi02760GeV = (TH1D*)directoryPi02760GeV->Get("TrueMassPi0");
histoTrueFWHMMesonPi0MeV2760GeV = (TH1D*)directoryPi02760GeV->Get("TrueFWHMPi0MeV");
histoAccPi02760GeV = (TH1D*)directoryPi02760GeV->Get("AcceptancePi0");
histoTrueEffPtPi02760GeV = (TH1D*)directoryPi02760GeV->Get("EfficiencyPi0");
histoPi0CorrYieldBinShifted2760GeV = (TH1D*)directoryPi02760GeV->Get("CorrectedYieldPi0BinShifted");
histoPi0CorrYieldMtBinShifted2760GeV = (TH1D*)directoryPi02760GeV->Get("CorrectedYieldPi0MtBinShifted");
histoInvCrossSectionPi02760GeV= (TH1D*)directoryPi02760GeV->Get("InvCrossSectionPi0");
graphInvCrossSectionSysAPi02760GeV= (TGraphAsymmErrors*)directoryPi02760GeV->Get("InvCrossSectionPi0SysA");
graphInvCrossSectionSysPi02760GeV= (TGraphAsymmErrors*)directoryPi02760GeV->Get("InvCrossSectionPi0Sys");
graphCorrectedYieldPi0SysErr2760GeV= (TGraphAsymmErrors*)directoryPi02760GeV->Get("Pi0SystError");
graphCorrectedYieldPi0SysErrBinShifted2760GeV= (TGraphAsymmErrors*)directoryPi02760GeV->Get("Pi0SystErrorBinShifted");
histoEtaToPi0Phojet2760GeV= (TH1D*)directoryPi02760GeV->Get("EtaToPi0MCTruthPhojet");
histoEtaToPi0Pythia2760GeV= (TH1D*)directoryPi02760GeV->Get("EtaToPi0MCTruthPythia");
histoPi0ToChargedPhojet2760GeV= (TH1D*)directoryPi02760GeV->Get("Pi0ToChargedPhojet");
histoPi0ToChargedPythia2760GeV= (TH1D*)directoryPi02760GeV->Get("Pi0ToChargedPythia");
histoCorrectedYieldEta2760GeV= (TH1D*)directoryEta2760GeV->Get("CorrectedYieldEta");
histoUnCorrectedYieldEta2760GeV= (TH1D*)directoryEta2760GeV->Get("RAWYieldPerEventsEta");
histoMassMesonEta2760GeV= (TH1D*)directoryEta2760GeV->Get("MassEta");
histoFWHMMesonEtaMeV2760GeV = (TH1D*)directoryEta2760GeV->Get("FWHMEtaMeV");
histoTrueMassMesonEta2760GeV = (TH1D*)directoryEta2760GeV->Get("TrueMassEta");
histoTrueFWHMMesonEtaMeV2760GeV = (TH1D*)directoryEta2760GeV->Get("TrueFWHMEtaMeV");
histoEtaCorrYieldBinShifted2760GeV= (TH1D*)directoryEta2760GeV->Get("CorrectedYieldEtaBinShifted");
histoEtaCorrYieldMtBinShifted2760GeV= (TH1D*)directoryEta2760GeV->Get("CorrectedYieldEtaMtBinShifted");
histoInvCrossSectionEta2760GeV= (TH1D*)directoryEta2760GeV->Get("InvCrossSectionEta");
graphInvCrossSectionSysAEta2760GeV= (TGraphAsymmErrors*)directoryEta2760GeV->Get("InvCrossSectionEtaSysA");
graphInvCrossSectionSysEta2760GeV= (TGraphAsymmErrors*)directoryEta2760GeV->Get("InvCrossSectionEtaSys");
graphCorrectedYieldEtaSysErr2760GeV= (TGraphAsymmErrors*)directoryEta2760GeV->Get("EtaSystError");
graphCorrectedYieldEtaSysErrBinShifted2760GeV= (TGraphAsymmErrors*)directoryEta2760GeV->Get("EtaSystErrorBinShifted");
graphCorrectedYieldEtaSysErrMtBinShifted2760GeV= (TGraphAsymmErrors*)directoryEta2760GeV->Get("EtaSystErrorBinShiftedMt");
histoRatioEtaPi02760GeV= (TH1D*)directoryEta2760GeV->Get("EtatoPi0RatioConversionBinShifted");
graphSystErrRatio2760GeV= (TGraphAsymmErrors*)directoryEta2760GeV->Get("EtatoPi0RatioConversionBinShiftedSys");
nEvt2760GeV = histoNumberOfEvents2760GeV->GetBinContent(1);
Bool_t kV0ANDConv2760GeV = kFALSE;
if (histoNumberOfEvents2760GeV->GetNbinsX() > 1 && histoNumberOfEvents2760GeV->GetBinContent(2) > 0) kV0ANDConv2760GeV = kTRUE;
cout << "2.76 TeV eingelesen, kVOAND: " <<kV0ANDConv2760GeV <<endl;
directoryPi0900GeV = (TDirectory*)fileConversions->Get("Pi0900GeV");
if (conference) {
directoryEta900GeV = (TDirectory*)fileConversionsPrelim->Get("Eta900GeV");
cout << "reading preliminary file for eta, 900GeV" << endl;
} else {
directoryEta900GeV = (TDirectory*)fileConversions->Get("Eta900GeV");
}
histoNumberOfEvents900GeV= (TH1D*)fileConversions->Get("histoNumberOfEvents");
histoMassMesonPi0900GeV = (TH1D*)directoryPi0900GeV->Get("MassPi0");
histoFWHMMesonPi0MeV900GeV = (TH1D*)directoryPi0900GeV->Get("FWHMPi0MeV");
histoTrueMassMesonPi0900GeV = (TH1D*)directoryPi0900GeV->Get("TrueMassPi0");
histoTrueFWHMMesonPi0MeV900GeV = (TH1D*)directoryPi0900GeV->Get("TrueFWHMPi0MeV");
histoAccPi0900GeV = (TH1D*)directoryPi0900GeV->Get("AcceptancePi0");
histoTrueEffPtPi0900GeV = (TH1D*)directoryPi0900GeV->Get("EfficiencyPi0");
histoPi0CorrYieldBinShifted900GeV = (TH1D*)directoryPi0900GeV->Get("CorrectedYieldPi0BinShifted");
histoInvCrossSectionPi0900GeV= (TH1D*)directoryPi0900GeV->Get("InvCrossSectionPi0");
graphInvCrossSectionSysAPi0900GeV= (TGraphAsymmErrors*)directoryPi0900GeV->Get("InvCrossSectionPi0SysA");
graphInvCrossSectionSysPi0900GeV= (TGraphAsymmErrors*)directoryPi0900GeV->Get("InvCrossSectionPi0Sys");
graphCorrectedYieldPi0SysErr900GeV= (TGraphAsymmErrors*)directoryPi0900GeV->Get("Pi0SystError");
graphCorrectedYieldPi0SysErrBinShifted900GeV= (TGraphAsymmErrors*)directoryPi0900GeV->Get("Pi0SystErrorBinShifted");
histoEtaToPi0Phojet900GeV= (TH1D*)directoryPi0900GeV->Get("EtaToPi0MCTruthPhojet");
histoEtaToPi0Pythia900GeV= (TH1D*)directoryPi0900GeV->Get("EtaToPi0MCTruthPythia");
histoPi0ToChargedPhojet900GeV= (TH1D*)directoryPi0900GeV->Get("Pi0ToChargedPhojet");
histoPi0ToChargedPythia900GeV= (TH1D*)directoryPi0900GeV->Get("Pi0ToChargedPythia");
histoCorrectedYieldEta900GeV= (TH1D*)directoryEta900GeV->Get("CorrectedYieldEta");
histoUnCorrectedYieldEta900GeV= (TH1D*)directoryEta900GeV->Get("RAWYieldPerEventsEta");
histoMassMesonEta900GeV= (TH1D*)directoryEta900GeV->Get("MassEta");
histoFWHMMesonEtaMeV900GeV = (TH1D*)directoryEta900GeV->Get("FWHMEtaMeV");
histoTrueMassMesonEta900GeV = (TH1D*)directoryEta900GeV->Get("TrueMassEta");
histoTrueFWHMMesonEtaMeV900GeV = (TH1D*)directoryEta900GeV->Get("TrueFWHMEtaMeV");
histoEtaCorrYieldBinShifted900GeV= (TH1D*)directoryEta900GeV->Get("CorrectedYieldEtaBinShifted");
histoInvCrossSectionEta900GeV= (TH1D*)directoryEta900GeV->Get("InvCrossSectionEta");
graphInvCrossSectionSysAEta900GeV= (TGraphAsymmErrors*)directoryEta900GeV->Get("InvCrossSectionEtaSysA");
graphInvCrossSectionSysEta900GeV= (TGraphAsymmErrors*)directoryEta900GeV->Get("InvCrossSectionEtaSys");
graphCorrectedYieldEtaSysErr900GeV= (TGraphAsymmErrors*)directoryEta900GeV->Get("EtaSystError");
graphCorrectedYieldEtaSysErrBinShifted900GeV= (TGraphAsymmErrors*)directoryEta900GeV->Get("EtaSystErrorBinShifted");
histoRatioEtaPi0900GeV= (TH1D*)directoryEta900GeV->Get("EtatoPi0RatioConversion");
graphSystErrRatio900GeV= (TGraphAsymmErrors*)directoryEta900GeV->Get("EtatoPi0RatioConversionSys");
nEvt900GeV = histoNumberOfEvents900GeV->GetBinContent(1);
Bool_t kV0ANDConv900GeV = kFALSE;
if (histoNumberOfEvents900GeV->GetNbinsX() > 1 && histoNumberOfEvents900GeV->GetBinContent(2) > 0) kV0ANDConv900GeV = kTRUE;
cout << "900 GeV eingelesen, kVOAND: " <<kV0ANDConv2760GeV <<endl;
histoMassMesonPi0MinusExp = CalculateMassMinusExpectedMass(histoMassMesonPi0,mesonMassExpectPi0+0.005);
histoTrueMassMesonPi0MinusExp = CalculateMassMinusExpectedMass(histoTrueMassMesonPi0,mesonMassExpectPi0+0.005);
histoMassMesonPi0MinusExp900GeV = CalculateMassMinusExpectedMass(histoMassMesonPi0900GeV,mesonMassExpectPi0+0.005);
histoTrueMassMesonPi0MinusExp900GeV = CalculateMassMinusExpectedMass(histoTrueMassMesonPi0900GeV,mesonMassExpectPi0+0.005);
histoMassMesonPi0MinusExp2760GeV = CalculateMassMinusExpectedMass(histoMassMesonPi02760GeV,mesonMassExpectPi0+0.005);
histoTrueMassMesonPi0MinusExp2760GeV = CalculateMassMinusExpectedMass(histoTrueMassMesonPi02760GeV,mesonMassExpectPi0+0.005);
histoMassMesonPi0->Scale(1000.);
histoTrueMassMesonPi0->Scale(1000.);
histoMassMesonEtaMinusExp= CalculateMassMinusExpectedMass(histoMassMesonEta,mesonMassExpectEta+0.005);
histoTrueMassMesonEtaMinusExp = CalculateMassMinusExpectedMass(histoTrueMassMesonEta,mesonMassExpectEta+0.005);
histoMassMesonEtaMinusExp900GeV= CalculateMassMinusExpectedMass(histoMassMesonEta900GeV,mesonMassExpectEta+0.005);
histoTrueMassMesonEtaMinusExp900GeV = CalculateMassMinusExpectedMass(histoTrueMassMesonEta900GeV,mesonMassExpectEta+0.005);
histoMassMesonEtaMinusExp2760GeV= CalculateMassMinusExpectedMass(histoMassMesonEta2760GeV,mesonMassExpectEta+0.005);
histoTrueMassMesonEtaMinusExp2760GeV = CalculateMassMinusExpectedMass(histoTrueMassMesonEta2760GeV,mesonMassExpectEta+0.005);
histoTrueEffPtPi0->Multiply(histoTrueEffPtPi0,histoAccPi0);
histoTrueEffPtPi0900GeV->Multiply(histoTrueEffPtPi0900GeV,histoAccPi0900GeV);
histoTrueEffPtPi02760GeV->Multiply(histoTrueEffPtPi02760GeV,histoAccPi02760GeV);
// if (patched){
// graphCorrectedYieldPi0SysErr->RemovePoint(0);
// }
relSystErrorPi07TeVDown = ExtractRelErrDownAsymmGraph(graphCorrectedYieldPi0SysErr);
relSystErrorPi07TeVUp = ExtractRelErrUpAsymmGraph(graphCorrectedYieldPi0SysErr);
nPointsPi0 = graphCorrectedYieldPi0SysErr->GetN();
cout << "systematic errors Pi0 Conv 7 TeV" << endl;
for (Int_t i = 0; i < nPointsPi0; i++){
cout << relSystErrorPi07TeVDown[i] << "\t" << relSystErrorPi07TeVUp[i] << endl;
}
relSystErrorPi02760GeVDown = ExtractRelErrDownAsymmGraph(graphCorrectedYieldPi0SysErr2760GeV);
relSystErrorPi02760GeVUp = ExtractRelErrUpAsymmGraph(graphCorrectedYieldPi0SysErr2760GeV);
nPointsPi02760GeV = graphCorrectedYieldPi0SysErr2760GeV->GetN();
cout << "systematic errors Pi0 Conv 2760 GeV" << endl;
for (Int_t i = 0; i < nPointsPi02760GeV; i++){
cout << relSystErrorPi02760GeVDown[i] << "\t" << relSystErrorPi02760GeVUp[i] << endl;
}
relSystErrorPi0900GeVDown = ExtractRelErrDownAsymmGraph(graphCorrectedYieldPi0SysErr900GeV);
relSystErrorPi0900GeVUp = ExtractRelErrUpAsymmGraph(graphCorrectedYieldPi0SysErr900GeV);
nPointsPi0900GeV = graphCorrectedYieldPi0SysErr900GeV->GetN();
cout << "systematic errors Pi0 Conv 900 GeV" << endl;
for (Int_t i = 0; i < nPointsPi0900GeV; i++){
cout << relSystErrorPi0900GeVDown[i] << "\t" << relSystErrorPi0900GeVUp[i] << endl;
}
relSystErrorEta7TeVDown = ExtractRelErrDownAsymmGraph(graphCorrectedYieldEtaSysErr);
relSystErrorEta7TeVUp = ExtractRelErrUpAsymmGraph(graphCorrectedYieldEtaSysErr);
nPointsEta = graphCorrectedYieldEtaSysErr->GetN();
cout << "systematic errors Eta Conv 7TeV" << endl;
for (Int_t i = 0; i < nPointsEta; i++){
cout << relSystErrorEta7TeVDown[i] << "\t" << relSystErrorEta7TeVUp[i] << endl;
}
relSystErrorEta2760GeVDown = ExtractRelErrDownAsymmGraph(graphCorrectedYieldEtaSysErr2760GeV);
relSystErrorEta2760GeVUp = ExtractRelErrUpAsymmGraph(graphCorrectedYieldEtaSysErr2760GeV);
nPointsEta2760GeV = graphCorrectedYieldEtaSysErr2760GeV->GetN();
cout << "systematic errors Eta Conv 2.76TeV" << endl;
for (Int_t i = 0; i < nPointsEta2760GeV; i++){
cout << relSystErrorEta2760GeVDown[i] << "\t" << relSystErrorEta2760GeVUp[i] << endl;
}
// if (patched){
// graphSystErrRatio->RemovePoint(0);
// graphSystErrRatio->RemovePoint(0);
// }
TGraphAsymmErrors* dummyGraphSystErr = (TGraphAsymmErrors*)graphSystErrRatio->Clone("dummyGraphSystErr");
relSystErrorEtaPi07TeVDown = ExtractRelErrDownAsymmGraph(dummyGraphSystErr);
relSystErrorEtaPi07TeVUp = ExtractRelErrUpAsymmGraph(dummyGraphSystErr);
nPointsEtaPi07TeV = dummyGraphSystErr->GetN();
cout << "systematic errors Eta Conv 7TeV" << endl;
for (Int_t i = 0; i < nPointsEtaPi07TeV; i++){
cout << relSystErrorEtaPi07TeVDown[i] << "\t" << relSystErrorEtaPi07TeVUp[i] << endl;
}
cout << "Ratio Eta/pi0 including syst" << endl;
relSystErrorEta900GeVDown = ExtractRelErrDownAsymmGraph(graphCorrectedYieldEtaSysErr900GeV);
relSystErrorEta900GeVUp = ExtractRelErrUpAsymmGraph(graphCorrectedYieldEtaSysErr900GeV);
nPointsEta900GeV = graphCorrectedYieldEtaSysErr900GeV->GetN();
cout << "systematic errors Eta Conv 900GeV" << endl;
for (Int_t i = 0; i < nPointsEta900GeV; i++){
cout << relSystErrorEta900GeVDown[i] << "\t" << relSystErrorEta900GeVUp[i] << endl;
}
dummyGraphSystErr = (TGraphAsymmErrors*)graphSystErrRatio2760GeV->Clone("dummyGraphSystErr");
relSystErrorEtaPi02760GeVDown = ExtractRelErrDownAsymmGraph(dummyGraphSystErr);
relSystErrorEtaPi02760GeVUp = ExtractRelErrUpAsymmGraph(dummyGraphSystErr);
nPointsEta2760GeV = dummyGraphSystErr->GetN();
cout << "systematic errors Eta Conv 2.76TeV" << endl;
for (Int_t i = 0; i < nPointsEta2760GeV; i++){
cout << relSystErrorEtaPi02760GeVDown[i] << "\t" << relSystErrorEtaPi02760GeVUp[i] << endl;
}
graphRatioEtaPi0ComplErr2760GeV = CalculateSysErrFromRelSysHistoComplete( histoRatioEtaPi02760GeV , "EtaPi0ComplError2760GeV",relSystErrorEtaPi02760GeVDown , relSystErrorEtaPi02760GeVDown, 2, nPointsEta2760GeV);
graphRatioEtaPi0StatErr2760GeV = new TGraphAsymmErrors(histoRatioEtaPi02760GeV);
graphRatioEtaPi0StatErr2760GeV->RemovePoint(0);
cout << "stat Eta/Pi0 2.76 TeV" << endl;
graphRatioEtaPi0StatErr2760GeV->Print();
graphRatioEtaPi0SysErr2760GeV = (TGraphAsymmErrors*)graphSystErrRatio2760GeV->Clone("graphRatioEtaPi0SysErr900GeV");
dummyGraphSystErr = (TGraphAsymmErrors*)graphSystErrRatio900GeV->Clone("dummyGraphSystErr");
relSystErrorEtaPi0900GeVDown = ExtractRelErrDownAsymmGraph(dummyGraphSystErr);
relSystErrorEtaPi0900GeVUp = ExtractRelErrUpAsymmGraph(dummyGraphSystErr);
nPointsEta900GeV = dummyGraphSystErr->GetN();
cout << "systematic errors Eta Conv 900GeV" << endl;
for (Int_t i = 0; i < nPointsEta900GeV; i++){
cout << relSystErrorEtaPi0900GeVDown[i] << "\t" << relSystErrorEtaPi0900GeVUp[i] << endl;
}
graphRatioEtaPi0ComplErr900GeV = CalculateSysErrFromRelSysHistoComplete( histoRatioEtaPi0900GeV , "EtaPi0ComplError900GeV",relSystErrorEtaPi0900GeVDown , relSystErrorEtaPi0900GeVDown, 2, nPointsEta900GeV);
graphRatioEtaPi0StatErr900GeV = new TGraphAsymmErrors(histoRatioEtaPi0900GeV);
graphRatioEtaPi0StatErr900GeV->RemovePoint(0);
graphRatioEtaPi0SysErr900GeV = (TGraphAsymmErrors*)graphSystErrRatio900GeV->Clone("graphRatioEtaPi0SysErr900GeV");
TFile* fileTheoryCompilation = new TFile("ExternalInput/Theory/TheoryCompilationPP.root");
TH1F* histoPythia8InvXSection = (TH1F*) fileTheoryCompilation->Get("histoInvSecPythia8Spec2760GeV");
TH1F* histoPythia8InvXSection_VarBinning = (TH1F*) fileTheoryCompilation->Get("histoInvSecPythia8Spec2760GeVVarBinning");
graphNLOCalcMuHalf900GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecPi0MuHalf900GeV");
graphNLOCalcMuOne900GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecPi0MuOne900GeV");
graphNLOCalcMuTwo900GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecPi0MuTwo900GeV");
graphNLOCalcMuHalf2760GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecPi0MuHalf2760GeV");
graphNLOCalcMuOne2760GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecPi0MuOne2760GeV");
graphNLOCalcMuTwo2760GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecPi0MuTwo2760GeV");
graphNLOCalcMuHalf7TeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecPi0MuHalf7000GeV");
graphNLOCalcMuOne7TeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecPi0MuOne7000GeV");
graphNLOCalcMuTwo7TeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecPi0MuTwo7000GeV");
graphNLOCalcEtaMuHalf900GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecEtaMuHalf900GeV");
graphNLOCalcEtaMuOne900GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecEtaMuOne900GeV");
graphNLOCalcEtaMuTwo900GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecEtaMuTwo900GeV");
graphNLOCalcEtaMuHalf2760GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecEtaMuHalf2760GeV");
graphNLOCalcEtaMuOne2760GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecEtaMuOne2760GeV");
graphNLOCalcEtaMuTwo2760GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecEtaMuTwo2760GeV");
graphNLOCalcEtaMuHalf7TeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecEtaMuHalf7000GeV");
graphNLOCalcEtaMuOne7TeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecEtaMuOne7000GeV");
graphNLOCalcEtaMuTwo7TeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcInvSecEtaMuTwo7000GeV");
graphEtaToPi0NLOMuHalf7TeV = (TGraph*)fileTheoryCompilation->Get("graphNLOCalcEtaOverPi0MuHalf7000GeV");
graphEtaToPi0NLOMuOne7TeV = (TGraph*)fileTheoryCompilation->Get("graphNLOCalcEtaOverPi0MuOne7000GeV");
graphEtaToPi0NLOMuTwo7TeV = (TGraph*)fileTheoryCompilation->Get("graphNLOCalcEtaOverPi0MuTwo7000GeV");
graphEtaToPi0NLOMuHalf2760GeV = (TGraph*)fileTheoryCompilation->Get("graphNLOCalcEtaOverPi0MuHalf2760GeV");
graphEtaToPi0NLOMuOne2760GeV = (TGraph*)fileTheoryCompilation->Get("graphNLOCalcEtaOverPi0MuOne2760GeV");
graphEtaToPi0NLOMuTwo2760GeV = (TGraph*)fileTheoryCompilation->Get("graphNLOCalcEtaOverPi0MuTwo2760GeV");
graphNLOBKKCalcMuTwo900GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcBKKInvSecPi0MuTwo900GeV");
graphNLOBKKCalcMuTwo7TeV = (TGraph*)fileTheoryCompilation->Get("graphNLOCalcBKKInvSecPi0MuTwo7000GeV");
graphNLODSSCalcMuTwo900GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcDSSInvSecPi0MuTwo900GeV");
graphNLODSSCalcMuTwo2760GeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcDSSInvSecPi0MuTwo2760GeV");
graphNLODSSCalcMuTwo7TeV= (TGraph*)fileTheoryCompilation->Get("graphNLOCalcDSSInvSecPi0MuTwo7000GeV");
//************************** Read data for PHOS **************************************************
filePhos7TeV = new TFile(fileNameCaloPhos7TeV);
histoPi0Phos7TeV = (TH1D*)filePhos7TeV->Get("hPi07TeVStat");
histoPi0PhosSys7TeV = (TH1D*)filePhos7TeV->Get("hPi07TeVSys");
filePhos7TeVEta = new TFile(fileNameCaloPhos7TeVEta);
histoEtaPhos7TeV = (TH1D*)filePhos7TeVEta->Get("hEta7TeVStat");
histoEtaPhosSys7TeV = (TH1D*)filePhos7TeVEta->Get("hEta7TeVSys");
filePhos900GeV = new TFile(fileNameCaloPhos900GeV);
histoPi0Phos900GeV = (TH1D*)filePhos900GeV->Get("hPi0900GeVStat");
histoPi0PhosSys900GeV = (TH1D*)filePhos900GeV->Get("hPi0900GeVSys");
filePhos2760GeV = new TFile(fileNameCaloPhos2760GeV);
directoryPHOSPi02760GeV = (TDirectory*)filePhos2760GeV->Get("pp2760");
histoPi0Phos2760GeV = (TH1D*)directoryPHOSPi02760GeV->Get("hPi02760GeVStat");
histoPi0PhosSys2760GeV = (TH1D*)directoryPHOSPi02760GeV->Get("hPi02760GeVSys");
histoPi0PhosSysRAA2760GeV = (TH1D*)directoryPHOSPi02760GeV->Get("hPi02760GeVSysTypeB");
for (Int_t i = 0; i < histoPi0Phos2760GeV->GetNbinsX()+1 ; i++){
cout<< histoPi0Phos2760GeV->GetBinCenter(i)<< "\t" << histoPi0Phos2760GeV->GetBinError(i)/histoPi0Phos2760GeV->GetBinContent(i)*100 << "\t" << histoPi0PhosSys2760GeV->GetBinError(i)/histoPi0PhosSys2760GeV->GetBinContent(i)*100 <<"\t"<< TMath::Sqrt(TMath::Power(histoPi0PhosSys2760GeV->GetBinError(i)/histoPi0PhosSys2760GeV->GetBinContent(i)*100,2) + 4*4) << "\t" << histoPi0PhosSysRAA2760GeV->GetBinError(i)/histoPi0PhosSysRAA2760GeV->GetBinContent(i)*100 << endl;
}
filePhosEtaToPi0 = new TFile(fileNamePHOSEtaToPi0);
histoEtaToPi0PHOS = (TH1D*)filePhosEtaToPi0->Get("hEtaPiRatio7TeVStat");
histoEtaToPi0PHOSSys = (TH1D*)filePhosEtaToPi0->Get("hEtaPiRatio7TeVSys");
filePhos7TeVMassData = new TFile(fileNamePHOSMassData7TeV);
filePhos7TeVMassMC = new TFile(fileNamePHOSMassMC7TeV);
histoMassMesonPi0PHOS = (TH1D*)filePhos7TeVMassData->Get("Mix_mr1");
histoFWHMMesonPi0PHOS= (TH1D*)filePhos7TeVMassData->Get("Mix_sr1");
histoTrueMassMesonPi0PHOS= (TH1D*)filePhos7TeVMassMC->Get("mass1_GS");
histoTrueFWHMMesonPi0PHOS= (TH1D*)filePhos7TeVMassMC->Get("width1_GS");
histoMassMesonPi0PHOSMinusExp = CalculateMassMinusExpectedMass(histoMassMesonPi0PHOS,mesonMassExpectPi0+0.010);
histoTrueMassMesonPi0PHOSMinusExp = CalculateMassMinusExpectedMass(histoTrueMassMesonPi0PHOS,mesonMassExpectPi0+0.010);
histoFWHMMesonPi0PHOS->Scale(1000.);
histoTrueFWHMMesonPi0PHOS->Scale(1000.);
histoMassMesonPi0PHOS->Scale(1000.);
histoTrueMassMesonPi0PHOS->Scale(1000.);
cout << "loaded phos" << endl;
nEvtPHOS7TeV =3.181e+8;
nEvtPHOS900GeV = 7.3e+6;
histoForPHOSGraph1 = (TH1D*)histoEtaToPi0PHOSSys->Clone();
graphSysErrEtaToPi0PHOS = new TGraphAsymmErrors(histoForPHOSGraph1);
//************************** Read data for EMCAL **************************************************
// fileEMCAL7TeV = new TFile(fileNameCaloEmcal7TeV);
// histoPi0EMCAL7TeV = (TH1D*)fileEMCAL7TeV->Get("pi0pro");
// histoPi0EMCAL7TeV->SetBinContent(1,NULL);
// histoPi0EMCAL7TeV->SetBinError(1,NULL);
fileEMCAL7TeVMassData = new TFile(fileNameEMCALMassData7TeVPi0);
TDirectory* directoryEMCALPi07TeV = (TDirectory*)fileEMCAL7TeVMassData->Get("Pi07TeV");
histoMassMesonPi0EMCAL = (TH1D*)directoryEMCALPi07TeV->Get("MassPi0");
histoFWHMMesonPi0EMCAL= (TH1D*)directoryEMCALPi07TeV->Get("FWHMPi0MeV");
histoTrueMassMesonPi0EMCAL= (TH1D*)directoryEMCALPi07TeV->Get("TrueMassPi0");
histoTrueFWHMMesonPi0EMCAL= (TH1D*)directoryEMCALPi07TeV->Get("TrueFWHMPi0MeV");
histoMassMesonPi0EMCALMinusExp = CalculateMassMinusExpectedMass(histoMassMesonPi0EMCAL,mesonMassExpectPi0+0.015);
histoTrueMassMesonPi0EMCALMinusExp = CalculateMassMinusExpectedMass(histoTrueMassMesonPi0EMCAL,mesonMassExpectPi0+0.015);
for (Int_t i = 1; i < histoMassMesonPi0EMCAL->GetXaxis()->FindBin(0.8); i++){
histoMassMesonPi0EMCAL->SetBinContent(i,0.);
histoFWHMMesonPi0EMCAL->SetBinContent(i,10000.);
histoTrueFWHMMesonPi0EMCAL->SetBinContent(i,10000.);
histoTrueMassMesonPi0EMCAL->SetBinContent(i,0.);
}
for (Int_t i = histoMassMesonPi0EMCAL->GetXaxis()->FindBin(18.0); i < histoMassMesonPi0EMCAL->GetNbinsX()+1; i++){
histoMassMesonPi0EMCAL->SetBinContent(i,0.);
histoFWHMMesonPi0EMCAL->SetBinContent(i,10000.);
histoTrueFWHMMesonPi0EMCAL->SetBinContent(i,10000.);
histoTrueMassMesonPi0EMCAL->SetBinContent(i,0.);
}
// histoMassMesonPi0EMCAL->Scale(1000.);
// histoTrueMassMesonPi0EMCAL->Scale(1000.);
fileEMCAL7TeVMassDataEta = new TFile(fileNameEMCALMassData7TeVEta);
fileEMCAL7TeVMassMCEta = new TFile(fileNameEMCALMassMC7TeVEta);
histoMassMesonEtaEMCAL = (TH1D*)fileEMCAL7TeVMassDataEta->Get("hEtaMass");
histoFWHMMesonEtaEMCAL= (TH1D*)fileEMCAL7TeVMassDataEta->Get("hEtaWidth");
histoTrueMassMesonEtaEMCAL= (TH1D*)fileEMCAL7TeVMassMCEta->Get("hEtaMass");
histoTrueFWHMMesonEtaEMCAL= (TH1D*)fileEMCAL7TeVMassMCEta->Get("hEtaWidth");
histoMassMesonEtaEMCALMinusExp = CalculateMassMinusExpectedMass(histoMassMesonEtaEMCAL,mesonMassExpectEta+0.015);
histoTrueMassMesonEtaEMCALMinusExp = CalculateMassMinusExpectedMass(histoTrueMassMesonEtaEMCAL,mesonMassExpectEta+0.015);
histoFWHMMesonEtaEMCAL->Scale(1000.);
histoTrueFWHMMesonEtaEMCAL->Scale(1000.);
fileFinalResults.open(nameFinalResDat, ios::out);
cout << "loaded emcal" << endl;
filePhosOmega7TeV = new TFile(fileNameCaloPhosOmega7TeV);
graphOmegaPhos7TeV = (TGraphAsymmErrors*)filePhosOmega7TeV->Get("graphOmegaStat");
graphOmegaPhosSys7TeV = (TGraphAsymmErrors*)filePhosOmega7TeV->Get("graphOmegaSyst");
graphOmegaPhosComb7TeV = (TGraphAsymmErrors*)filePhosOmega7TeV->Get("graphOmegaComb");
maxPtPi0 = histoPi0Phos7TeV->GetXaxis()->GetBinUpEdge(histoPi0Phos7TeV->GetNbinsX());
maxPtEta2760GeV = histoInvCrossSectionEta2760GeV->GetXaxis()->GetBinUpEdge(histoInvCrossSectionEta2760GeV->GetNbinsX());
cout << maxPtPi0 << endl;
maxPtPi0900GeV= histoPi0Phos900GeV->GetXaxis()->GetBinUpEdge(histoPi0Phos900GeV->GetNbinsX());
maxPtEta = histoEtaPhos7TeV->GetXaxis()->GetBinUpEdge(histoEtaPhos7TeV->GetNbinsX());
maxPtEtaPHOS = histoEtaPhos7TeV->GetXaxis()->GetBinUpEdge(histoEtaPhos7TeV->GetNbinsX());
maxPtPi02760GeV = histoPi0Phos2760GeV->GetXaxis()->GetBinUpEdge(histoPi0Phos2760GeV->GetNbinsX()-1);
//----------------------- Pi0 7 TeV NLO mu = pt/2 ------------------------------
graphNLOMuHalfPi07TeV = (TGraph*)graphNLOCalcMuHalf7TeV->Clone();
DrawGammaSetMarkerTGraph(graphNLOMuHalfPi07TeV, styleMarkerNLOMuHalf, sizeMarkerNLO, colorNLOPi07TeVMuHalf, colorNLOPi07TeVMuHalf );
//------------------------- Pi0 7 TeV NLO mu = pt ----------------------------
graphNLOMuOnePi07TeV = (TGraph*)graphNLOCalcMuOne7TeV->Clone();
DrawGammaSetMarkerTGraph(graphNLOMuOnePi07TeV, styleMarkerNLOMuOne, sizeMarkerNLO, colorNLOPi07TeVMuOne, colorNLOPi07TeVMuOne);
//------------------------- Pi0 7 TeV NLO mu = 2pt -----------------------------
graphNLOMuTwoPi07TeV = (TGraph*)graphNLOCalcMuTwo7TeV->Clone();
DrawGammaSetMarkerTGraph(graphNLOMuTwoPi07TeV, styleMarkerNLOMuTwo, sizeMarkerNLO, colorNLOPi07TeVMuTwo, colorNLOPi07TeVMuTwo);
DrawGammaSetMarkerTGraph(graphNLOBKKCalcMuTwo7TeV, styleMarkerNLOMuTwo, sizeMarkerNLO, colorNLOBKKPi07TeVMuTwo, colorNLOBKKPi07TeVMuTwo);
DrawGammaSetMarkerTGraph(graphNLODSSCalcMuTwo7TeV, styleMarkerNLOMuTwo, sizeMarkerNLO, colorNLODSSPi07TeVMuTwo, colorNLODSSPi07TeVMuTwo);
//----------------------- Pi0 900 TeV NLO mu = pt/2 ------------------------------
graphNLOMuHalfPi0900GeV = (TGraph*)graphNLOCalcMuHalf900GeV->Clone();
DrawGammaSetMarkerTGraph(graphNLOMuHalfPi0900GeV, styleMarkerNLOMuHalf, sizeMarkerNLO, colorNLOPi0900GeVMuHalf, colorNLOPi0900GeVMuHalf );
//------------------------- Pi0 900 TeV NLO mu = pt ----------------------------
graphNLOMuOnePi0900GeV = (TGraph*)graphNLOCalcMuOne900GeV->Clone();
DrawGammaSetMarkerTGraph(graphNLOMuOnePi0900GeV, styleMarkerNLOMuOne, sizeMarkerNLO, colorNLOPi0900GeVMuOne, colorNLOPi0900GeVMuOne);
//------------------------- Pi0 900 TeV NLO mu = 2pt -----------------------------
graphNLOMuTwoPi0900GeV = (TGraph*)graphNLOCalcMuTwo900GeV->Clone();
DrawGammaSetMarkerTGraph(graphNLOMuTwoPi0900GeV, styleMarkerNLOMuTwo, sizeMarkerNLO, colorNLOPi0900GeVMuTwo, colorNLOPi0900GeVMuTwo);
Double_t* dummyArrayXValuesNLOBKK = graphNLOBKKCalcMuTwo900GeV->GetX();
Int_t dummyArrayNBKK = graphNLOBKKCalcMuTwo900GeV->GetN();
Int_t numberOfBinsBKK = 0;
Int_t nBKK = 0;
while (nBKK!=dummyArrayNBKK ){
if (dummyArrayXValuesNLOBKK[nBKK] <= 10.5){
nBKK++;
numberOfBinsBKK++;
cout << nBKK << endl;
} else {
nBKK = dummyArrayNBKK;
}
}
DrawGammaSetMarkerTGraph(graphNLOBKKCalcMuTwo900GeV, styleMarkerNLOMuTwo, sizeMarkerNLO, colorNLOBKKPi0900GeVMuTwo, colorNLOBKKPi0900GeVMuTwo);
for (Int_t i = numberOfBinsBKK; i < dummyArrayNBKK; i++){
graphNLOBKKCalcMuTwo900GeV->RemovePoint(numberOfBinsBKK);
}
DrawGammaSetMarkerTGraph(graphNLODSSCalcMuTwo900GeV, styleMarkerNLOMuTwo, sizeMarkerNLO, colorNLODSSPi07TeVMuTwo, colorNLODSSPi07TeVMuTwo);
//----------------------- Pi0 2760 GeV NLO mu = pt/2 ------------------------------
graphNLOMuHalfPi02760GeV = (TGraph*)graphNLOCalcMuHalf2760GeV->Clone();
cout << "hier" << endl;
DrawGammaSetMarkerTGraph(graphNLOMuHalfPi02760GeV, styleMarkerNLOMuHalf, sizeMarkerNLO, colorNLOPi02760GeVMuHalf, colorNLOPi02760GeVMuHalf );
//------------------------- Pi0 2760 GeV NLO mu = pt ----------------------------
graphNLOMuOnePi02760GeV = (TGraph*)graphNLOCalcMuOne2760GeV->Clone();
cout << "hier" << endl;
DrawGammaSetMarkerTGraph(graphNLOMuOnePi02760GeV, styleMarkerNLOMuOne, sizeMarkerNLO, colorNLOPi02760GeVMuOne, colorNLOPi02760GeVMuOne);
//------------------------- Pi0 2760 GeV NLO mu = 2pt -----------------------------
graphNLOMuTwoPi02760GeV = (TGraph*)graphNLOCalcMuTwo2760GeV->Clone();
cout << "hier" << endl;
DrawGammaSetMarkerTGraph(graphNLOMuTwoPi02760GeV, styleMarkerNLOMuTwo, sizeMarkerNLO, colorNLOPi02760GeVMuTwo, colorNLOPi02760GeVMuTwo);
/*
DrawGammaSetMarkerTGraph(graphNLODSSCalcMuTwo2760GeV, styleMarkerNLOMuTwo, sizeMarkerNLO, colorNLODSSPi07TeVMuTwo, colorNLODSSPi07TeVMuTwo);
graphNLODSSCalcMuTwo2760GeV->RemovePoint(0);*/
//----------------------- Eta 7TeV NLO mu = pt/2 ------------------------------
graphNLOMuHalfEta7TeV = (TGraph*)graphNLOCalcEtaMuHalf7TeV->Clone();
Double_t* dummyArrayXValuesNLO = graphNLOMuHalfEta7TeV->GetX();
Int_t dummyArrayN = graphNLOMuHalfEta7TeV->GetN();
Int_t numberOfBins = 0;
Int_t n = 0;
while (n!=dummyArrayN ){
if (dummyArrayXValuesNLO[n] <= 15.5){
n++;
numberOfBins++;
cout << n << endl;
} else {
n = dummyArrayN;
}
}
cout << "Number of bins Eta 7TeV "<<numberOfBins << endl;
DrawGammaSetMarkerTGraph(graphNLOMuHalfEta7TeV, styleMarkerNLOMuHalf, sizeMarkerNLO, colorNLOEta7TeVMuHalf, colorNLOEta7TeVMuHalf );
for (Int_t i = numberOfBins; i < dummyArrayN; i++){
graphNLOMuHalfEta7TeV->RemovePoint(numberOfBins);
}
//------------------------- Eta 7TeV NLO mu = pt ----------------------------
graphNLOMuOneEta7TeV = (TGraph*)graphNLOCalcEtaMuOne7TeV->Clone();
DrawGammaSetMarkerTGraph(graphNLOMuOneEta7TeV, styleMarkerNLOMuOne, sizeMarkerNLO, colorNLOEta7TeVMuOne, colorNLOEta7TeVMuOne);
for (Int_t i = numberOfBins; i < dummyArrayN; i++){
graphNLOMuOneEta7TeV->RemovePoint(numberOfBins);
}
//------------------------- Eta 7TeV NLO mu = 2pt -----------------------------
graphNLOMuTwoEta7TeV = (TGraph*)graphNLOCalcEtaMuTwo7TeV->Clone();
DrawGammaSetMarkerTGraph(graphNLOMuTwoEta7TeV, styleMarkerNLOMuTwo, sizeMarkerNLO, colorNLOEta7TeVMuTwo, colorNLOEta7TeVMuTwo);
for (Int_t i = numberOfBins; i < dummyArrayN; i++){
graphNLOMuTwoEta7TeV->RemovePoint(numberOfBins);
}
//----------------------- Eta 2760GeV NLO mu = pt/2 ------------------------------
graphNLOMuHalfEta2760GeV = (TGraph*)graphNLOCalcEtaMuHalf2760GeV->Clone();
dummyArrayXValuesNLO = graphNLOMuHalfEta2760GeV->GetX();
dummyArrayN = graphNLOMuHalfEta2760GeV->GetN();
numberOfBins = 0;
n = 0;
while (n!=dummyArrayN ){
if (dummyArrayXValuesNLO[n] <= 7.5){
n++;
numberOfBins++;
cout << n << endl;
} else {
n = dummyArrayN;
}
}
cout << "Number of bins Eta 2.76TeV "<<numberOfBins << endl;
graphNLOMuHalfEta2760GeV = ScaleGraph(graphNLOMuHalfEta2760GeV,xSection2760GeV*recalcBarn);
DrawGammaSetMarkerTGraph(graphNLOMuHalfEta2760GeV, styleMarkerNLOMuHalf, sizeMarkerNLO, colorNLOEta2760GeVMuHalf, colorNLOEta2760GeVMuHalf );
for (Int_t i = numberOfBins; i < dummyArrayN; i++){
graphNLOMuHalfEta2760GeV->RemovePoint(numberOfBins);
}
graphNLOMuHalfEta2760GeV->RemovePoint(0);
graphNLOMuHalfEta2760GeV->RemovePoint(0);
//------------------------- Eta 2760GeV NLO mu = pt ----------------------------
graphNLOMuOneEta2760GeV = (TGraph*)graphNLOCalcEtaMuOne2760GeV->Clone();
DrawGammaSetMarkerTGraph(graphNLOMuOneEta2760GeV, styleMarkerNLOMuOne, sizeMarkerNLO, colorNLOEta2760GeVMuOne, colorNLOEta2760GeVMuOne);
for (Int_t i = numberOfBins; i < dummyArrayN; i++){
graphNLOMuOneEta2760GeV->RemovePoint(numberOfBins);
}
//------------------------- Eta 2760GeV NLO mu = 2pt -----------------------------
graphNLOMuTwoEta2760GeV = (TGraph*)graphNLOCalcEtaMuTwo2760GeV->Clone();
DrawGammaSetMarkerTGraph(graphNLOMuTwoEta2760GeV, styleMarkerNLOMuTwo, sizeMarkerNLO, colorNLOEta2760GeVMuTwo, colorNLOEta2760GeVMuTwo);
for (Int_t i = numberOfBins; i < dummyArrayN; i++){
graphNLOMuTwoEta2760GeV->RemovePoint(numberOfBins);
}
//----------------------- Eta 900GeV NLO mu = pt/2 ------------------------------
graphNLOMuHalfEta900GeV = (TGraph*)graphNLOCalcEtaMuHalf900GeV->Clone();
dummyArrayXValuesNLO = graphNLOMuHalfEta900GeV->GetX();
dummyArrayN = graphNLOMuHalfEta900GeV->GetN();
numberOfBins = 0;
n = 0;
while (n!=dummyArrayN ){
if (dummyArrayXValuesNLO[n] <= 4.5){
n++;
numberOfBins++;
cout << n << endl;
} else {
n = dummyArrayN;
}
}
cout << "Number of bins Eta 0.9TeV "<<numberOfBins << endl;
DrawGammaSetMarkerTGraph(graphNLOMuHalfEta900GeV, styleMarkerNLOMuHalf, sizeMarkerNLO, colorNLOEta900GeVMuHalf, colorNLOEta900GeVMuHalf );
for (Int_t i = numberOfBins; i < dummyArrayN; i++){
graphNLOMuHalfEta900GeV->RemovePoint(numberOfBins);
}
//------------------------- Eta 900GeV NLO mu = pt ----------------------------
graphNLOMuOneEta900GeV = (TGraph*)graphNLOCalcEtaMuOne900GeV->Clone();
DrawGammaSetMarkerTGraph(graphNLOMuOneEta900GeV, styleMarkerNLOMuOne, sizeMarkerNLO, colorNLOEta900GeVMuOne, colorNLOEta900GeVMuOne);
for (Int_t i = numberOfBins; i < dummyArrayN; i++){
graphNLOMuOneEta900GeV->RemovePoint(numberOfBins);
}
//------------------------- Eta 900GeV NLO mu = 2pt -----------------------------
graphNLOMuTwoEta900GeV = (TGraph*)graphNLOCalcEtaMuTwo900GeV->Clone();
DrawGammaSetMarkerTGraph(graphNLOMuTwoEta900GeV, styleMarkerNLOMuTwo, sizeMarkerNLO, colorNLOEta900GeVMuTwo, colorNLOEta900GeVMuTwo);
for (Int_t i = numberOfBins; i < dummyArrayN; i++){
graphNLOMuTwoEta900GeV->RemovePoint(numberOfBins);
}
//*********************** Comparison of Measuremnts in ALICE ***************************************************
TCanvas* canvasRatioEtaPi0ALICE = new TCanvas("canvasRatioEtaPi0ALICE","",200,10,1350,900); // gives the page size
DrawGammaCanvasSettings( canvasRatioEtaPi0ALICE, 0.09, 0.01, 0.015, 0.115);
TH2D *histo2DRatioEtaPi0ALICE = new TH2D("histo2DRatioEtaPi0ALICE", "histo2DRatioEtaPi0ALICE", 20,0.,maxPtEta,1000.,-0.4,1.2);
SetStyleHistoTH2ForGraphs(histo2DRatioEtaPi0ALICE, "#it{p}_{T} (GeV/#it{c})","#eta/#pi^{0}", 0.046,0.058, 0.046,0.058, 0.8,0.65, 510, 510);
histo2DRatioEtaPi0ALICE->GetYaxis()->SetRangeUser(0.,1.02);
histo2DRatioEtaPi0ALICE->Draw();
TGraphAsymmErrors *graphSysErrEtaToPi0PHOSNewXError = (TGraphAsymmErrors*)graphSysErrEtaToPi0PHOS->Clone();
ProduceGraphAsymmFixedXErrors(graphSysErrEtaToPi0PHOSNewXError, 0.4);
graphSysErrEtaToPi0PHOSNewXError->SetFillColor(colorPHOSSyst);
graphSysErrEtaToPi0PHOSNewXError->Draw("same,2,p");
TGraphAsymmErrors* graphSystErrRatioNewXError = (TGraphAsymmErrors*)graphSystErrRatio->Clone();
ProduceGraphAsymmFixedXErrors(graphSystErrRatioNewXError, 0.3);
graphSystErrRatioNewXError->SetFillColor(colorConvSyst);
graphSystErrRatioNewXError->Draw("same,2,p");
// DrawGammaSetMarkerTGraphErr(graphEtaToPi0EMCALSys7TeV, markerStyleEMCAL, markerSizeInvYield, colorEMCAL, colorEMCAL);
// graphEtaToPi0EMCALSys7TeV->SetFillColor(colorEMCALSyst);
// graphEtaToPi0EMCALSys7TeV->SetFillStyle(fillStyleEMCAL);
// graphEtaToPi0EMCALSys7TeV->Draw("p,2same");
// DrawGammaSetMarkerTGraphErr(graphEtaToPi0EMCAL7TeV, markerStyleEMCAL,markerSizeInvYield,colorEMCAL,colorEMCAL);
// graphEtaToPi0EMCAL7TeV->Draw("p,same");
DrawGammaSetMarker(histoEtaToPi0Pythia7TeV, markerStyleMCEtaToPi0, markerSizeInvYield, colorPythiaEtaToPi0, colorPythiaEtaToPi0);
//histoEtaToPi0Pythia7TeV->Draw("same");
DrawGammaSetMarker(histoEtaToPi0Phojet7TeV, markerStyleMCEtaToPi0, markerSizeInvYield, colorPhojetEtaToPi0,colorPhojetEtaToPi0);
//histoEtaToPi0Phojet7TeV->Draw("same");
graphEtaToPi0NLOMuHalf7TeV->SetLineColor(colorNLOPi07TeVMuHalf);
graphEtaToPi0NLOMuHalf7TeV->SetLineStyle(styleLineNLOMuHalf);
graphEtaToPi0NLOMuHalf7TeV->SetLineWidth(widthLineNLO);
graphEtaToPi0NLOMuOne7TeV->SetLineColor(colorNLOPi07TeVMuOne);
graphEtaToPi0NLOMuOne7TeV->SetLineStyle(styleLineNLOMuOne);
graphEtaToPi0NLOMuOne7TeV->SetLineWidth(widthLineNLO);
graphEtaToPi0NLOMuTwo7TeV->SetLineColor(colorNLOPi07TeVMuTwo);
graphEtaToPi0NLOMuTwo7TeV->SetLineStyle(styleLineNLOMuTwo);
graphEtaToPi0NLOMuTwo7TeV->SetLineWidth(widthLineNLO);
DrawGammaSetMarker(histoRatioEtaPi0, markerStyleConv, markerSizeInvYield, colorConv, colorConv);
histoRatioEtaPi0->DrawCopy("e1,x0,same");
TGraphErrors *graphhistoEtaToPi0PHOS = new TGraphErrors(histoEtaToPi0PHOS);
TGraphErrors *graphhistoEtaToPi0PHOSDisplacedX = (TGraphErrors*)graphhistoEtaToPi0PHOS->Clone();
ProduceGraphErrDisplacedX(graphhistoEtaToPi0PHOSDisplacedX,0.02);
DrawGammaSetMarkerTGraphErr(graphhistoEtaToPi0PHOSDisplacedX, markerStylePHOS, markerSizeInvYield, colorPHOS, colorPHOS);
graphhistoEtaToPi0PHOSDisplacedX->Draw("same,p");
TLegend* legendRatioALICE = new TLegend(0.8,0.16,0.977,0.28);
legendRatioALICE->SetTextSize(0.05);
legendRatioALICE->SetFillColor(0);
legendRatioALICE->SetBorderSize(0);
legendRatioALICE->AddEntry(histoRatioEtaPi0,Form("PCM"),"p");
legendRatioALICE->AddEntry(graphhistoEtaToPi0PHOSDisplacedX,Form("PHOS"),"pe");
legendRatioALICE->Draw();
canvasRatioEtaPi0ALICE->Update();
canvasRatioEtaPi0ALICE->SaveAs(Form("%s/%s_Pi0EtaRatioALICE_7TeV_Paper.%s",outputDir.Data(), prefix2.Data(), suffix.Data()));
if(!thesis)DrawAliceLogoCombinedPreliminary(pictDrawingCoordinatesPi0Eta[0], pictDrawingCoordinatesPi0Eta[1], pictDrawingCoordinatesPi0Eta[2], pictDrawingCoordinatesPi0Eta[3], pictDrawingCoordinatesPi0Eta[4], pictDrawingCoordinatesPi0Eta[5], pictDrawingCoordinatesPi0Eta[6], pictDrawingCoordinatesPi0Eta[7], pictDrawingCoordinates[8],collisionSystem7TeV, pictDrawingOptions[1], pictDrawingOptions[2], pictDrawingOptions[3],1350,900);
canvasRatioEtaPi0ALICE->Update();
canvasRatioEtaPi0ALICE->SaveAs(Form("%s/%s_Pi0EtaRatioALICE_7TeV.%s",outputDir.Data(), prefix2.Data(), suffix.Data()));
delete canvasRatioEtaPi0ALICE;
delete legendRatioALICE;
graphCombinedEtaToPi0 = CombinePtPointsSpectra( histoRatioEtaPi0, graphSystErrRatio,
histoEtaToPi0PHOS, graphSysErrEtaToPi0PHOS,
graphStatErrCombinedEtaToPi0, graphSysErrCombinedEtaToPi0,
xPtLimitsEta7TeV, 14, 1, 0,2);
TCanvas* canvasRatioEtaPi0NLO = new TCanvas("canvasRatioEtaPi0NLO","",200,10,1350,900); // gives the page size
DrawGammaCanvasSettings( canvasRatioEtaPi0NLO, 0.09, 0.01, 0.015, 0.115);
TH2D *histo2DRatioEtaPi0Theory = new TH2D("histo2DRatioEtaPi0Theory", "histo2DRatioEtaPi0Theory", 20,0.,maxPtEta,1000.,-0.4,1.2);
SetStyleHistoTH2ForGraphs(histo2DRatioEtaPi0Theory, "#it{p}_{T} (GeV/#it{c})","#eta/#pi^{0}", 0.046,0.058, 0.046,0.058, 0.8,0.65, 510, 510);
histo2DRatioEtaPi0Theory->GetYaxis()->SetRangeUser(0.,1.02);
histo2DRatioEtaPi0Theory->Draw();
TGraphAsymmErrors* graphCombinedEtaToPi0NewXError = (TGraphAsymmErrors*)graphCombinedEtaToPi0->Clone();
ProduceGraphAsymmFixedXErrors(graphCombinedEtaToPi0NewXError, 0.3);
DrawGammaSetMarkerTGraphAsym(graphCombinedEtaToPi0NewXError, markerStyleConv,markerSizeInvYield, colorCommonSpectrumPi07TeV, colorCommonSpectrumPi07TeVBox);
graphCombinedEtaToPi0NewXError->SetFillColor(colorCommonSpectrumPi07TeVBox);
graphCombinedEtaToPi0NewXError->SetFillStyle(1001);
graphCombinedEtaToPi0NewXError->Draw("p,E2same");
DrawGammaSetMarker(histoEtaToPi0Pythia900GeV, markerStyleMCEtaToPi0, markerSizeInvYield-0.2, colorPythiaEtaToPi0900GeV, colorPythiaEtaToPi0900GeV);
DrawGammaSetMarker(histoEtaToPi0Phojet900GeV, markerStyleMCEtaToPi0, markerSizeInvYield-0.2, colorPhojetEtaToPi0900GeV, colorPhojetEtaToPi0900GeV);
graphEtaToPi0NLOMuHalf7TeV->Draw("same,c");
graphEtaToPi0NLOMuOne7TeV->Draw("same,c");
graphEtaToPi0NLOMuTwo7TeV->Draw("same,c");
histo2DRatioEtaPi0Theory->Draw("AXIS,same");
TLegend* legendRatioEtaToPi0Theory = new TLegend(0.2,0.16,0.65,0.33);
legendRatioEtaToPi0Theory->SetTextSize(0.04);
legendRatioEtaToPi0Theory->SetFillColor(0);
legendRatioEtaToPi0Theory->SetBorderSize(0);
legendRatioEtaToPi0Theory->AddEntry(graphCombinedEtaToPi0NewXError,Form("stat + syst, PCM, PHOS, #sqrt{#it{s}} = 7 TeV "),"fp");
legendRatioEtaToPi0Theory->AddEntry(graphEtaToPi0NLOMuHalf7TeV,"NLO #mu = 0.5 #it{p}_{T}","l");
legendRatioEtaToPi0Theory->AddEntry(graphEtaToPi0NLOMuOne7TeV,"NLO #mu = #it{p}_{T}","l");
legendRatioEtaToPi0Theory->AddEntry(graphEtaToPi0NLOMuTwo7TeV,"NLO #mu = 2 #it{p}_{T}","l");
legendRatioEtaToPi0Theory->Draw();
canvasRatioEtaPi0NLO->Update();
canvasRatioEtaPi0NLO->SaveAs(Form("%s/%s_Pi0EtaRatioTheory_Paper.%s",outputDir.Data(), prefix2.Data(), suffix.Data()));
canvasRatioEtaPi0NLO->SetLogx(0);
DrawAliceLogoSimple(pictDrawingCoordinatesPi0Eta[4], pictDrawingCoordinatesPi0Eta[5], pictDrawingCoordinatesPi0Eta[6],1350,900);
canvasRatioEtaPi0NLO->Update();
canvasRatioEtaPi0NLO->SaveAs(Form("%s/%s_Pi0EtaRatioTheory.%s",outputDir.Data(), prefix2.Data(), suffix.Data()));
TCanvas* canvasRatioEtaPi0NLOSep = new TCanvas("canvasRatioEtaPi0NLOSep","",200,10,1350,900); // gives the page size
DrawGammaCanvasSettings( canvasRatioEtaPi0NLOSep, 0.09, 0.01, 0.015, 0.115);
histo2DRatioEtaPi0Theory->Draw();
TGraphAsymmErrors* graphStatCombinedEtaToPi0NewXError = (TGraphAsymmErrors*)graphStatErrCombinedEtaToPi0->Clone();
ProduceGraphAsymmFixedXErrors(graphStatCombinedEtaToPi0NewXError, 0.);
DrawGammaSetMarkerTGraphAsym(graphStatCombinedEtaToPi0NewXError, markerStyleConv,markerSizeInvYield, colorCommonSpectrumPi07TeV, colorCommonSpectrumPi07TeV);
TGraphAsymmErrors* graphSysCombinedEtaToPi0NewXError = (TGraphAsymmErrors*)graphSysErrCombinedEtaToPi0->Clone();
ProduceGraphAsymmFixedXErrors(graphSysCombinedEtaToPi0NewXError, 0.3);
DrawGammaSetMarkerTGraphAsym(graphSysCombinedEtaToPi0NewXError, markerStyleConv,markerSizeInvYield, colorCommonSpectrumPi07TeV, colorCommonSpectrumPi07TeVBox);
graphSysCombinedEtaToPi0NewXError->SetFillColor(colorCommonSpectrumPi07TeVBox);
graphSysCombinedEtaToPi0NewXError->SetFillStyle(1001);
graphSysCombinedEtaToPi0NewXError->Draw("2same");
graphStatCombinedEtaToPi0NewXError->Draw("p,same");
graphEtaToPi0NLOMuHalf7TeV->Draw("same,c");
graphEtaToPi0NLOMuOne7TeV->Draw("same,c");
graphEtaToPi0NLOMuTwo7TeV->Draw("same,c");
histo2DRatioEtaPi0Theory->Draw("AXIS,same");
TLegend* legendRatioEtaToPi0TheorySep = new TLegend(0.2,0.16,0.65,0.33);
legendRatioEtaToPi0TheorySep->SetTextSize(0.04);
legendRatioEtaToPi0TheorySep->SetFillColor(0);
legendRatioEtaToPi0TheorySep->SetBorderSize(0);
legendRatioEtaToPi0TheorySep->AddEntry(graphCombinedEtaToPi0NewXError,Form("ALICE, #sqrt{#it{s}} = 7 TeV"),"fp");
legendRatioEtaToPi0TheorySep->AddEntry(graphEtaToPi0NLOMuHalf7TeV,"NLO #mu = 0.5 #it{p}_{T}","l");
legendRatioEtaToPi0TheorySep->AddEntry(graphEtaToPi0NLOMuOne7TeV,"NLO #mu = #it{p}_{T}","l");
legendRatioEtaToPi0TheorySep->AddEntry(graphEtaToPi0NLOMuTwo7TeV,"NLO #mu = 2 #it{p}_{T}","l");
legendRatioEtaToPi0TheorySep->Draw();
canvasRatioEtaPi0NLOSep->Update();
canvasRatioEtaPi0NLOSep->SaveAs(Form("%s/%s_Pi0EtaRatioTheorySep_Paper.%s",outputDir.Data(), prefix2.Data(), suffix.Data()));
canvasRatioEtaPi0NLOSep->SetLogx(0);
DrawAliceLogoSimple(pictDrawingCoordinatesPi0Eta[4], pictDrawingCoordinatesPi0Eta[5], pictDrawingCoordinatesPi0Eta[6],1350,900);
canvasRatioEtaPi0NLOSep->Update();
canvasRatioEtaPi0NLOSep->SaveAs(Form("%s/%s_Pi0EtaRatioTheorySep.%s",outputDir.Data(), prefix2.Data(), suffix.Data()));
TCanvas* canvasRatioEtaPi0DiffEnergies = new TCanvas("canvasRatioEtaPi0DiffEnergies","",200,10,1350,900); // gives the page size
DrawGammaCanvasSettings( canvasRatioEtaPi0DiffEnergies,0.09, 0.01, 0.015, 0.115);
TH2D *histo2DRatioEtaPi0DiffEnergies = new TH2D("histo2DRatioEtaPi0DiffEnergies", "histo2DRatioEtaPi0DiffEnergies", 20,0.,maxPtEta,1000.,-0.4,1.2);
SetStyleHistoTH2ForGraphs(histo2DRatioEtaPi0DiffEnergies, "#it{p}_{T} (GeV/#it{c})","#eta/#pi^{0}", 0.05,0.064, 0.05,0.064, 0.8,0.65, 510, 510);
histo2DRatioEtaPi0DiffEnergies->GetYaxis()->SetRangeUser(0.,1.02);
histo2DRatioEtaPi0DiffEnergies->Draw();
TGraphAsymmErrors* graphRatioEtaPi0ComplErr900GeVNewXError = (TGraphAsymmErrors*)graphRatioEtaPi0ComplErr900GeV->Clone();
ProduceGraphAsymmFixedXErrors(graphRatioEtaPi0ComplErr900GeVNewXError, 0.5);
DrawGammaSetMarkerTGraphAsym(graphRatioEtaPi0ComplErr900GeVNewXError, markerStyleConv, markerSizeInvYield, colorCommonSpectrumPi0900GeV, colorCommonSpectrumPi0900GeVBox);
graphRatioEtaPi0ComplErr900GeVNewXError->SetFillColor(colorCommonSpectrumPi0900GeVBox);
graphRatioEtaPi0ComplErr900GeVNewXError->SetFillStyle(1001);
graphRatioEtaPi0ComplErr900GeVNewXError->Draw("p,E2same");
TGraphAsymmErrors* graphRatioEtaPi0ComplErr2760GeVNewXError = (TGraphAsymmErrors*)graphRatioEtaPi0ComplErr2760GeV->Clone();
ProduceGraphAsymmFixedXErrors(graphRatioEtaPi0ComplErr2760GeVNewXError, 0.4);
DrawGammaSetMarkerTGraphAsym(graphRatioEtaPi0ComplErr2760GeVNewXError, markerStyleConv, markerSizeInvYield, colorCommonSpectrumPi02760GeV, colorCommonSpectrumPi02760GeVBox);
graphRatioEtaPi0ComplErr2760GeVNewXError->SetFillColor(colorCommonSpectrumPi02760GeVBox);
graphRatioEtaPi0ComplErr2760GeVNewXError->SetFillStyle(1001);
graphRatioEtaPi0ComplErr2760GeVNewXError->Draw("p,E2same");
graphCombinedEtaToPi0NewXError->Draw("p,E2same");
TGraphAsymmErrors* graphRatioEtaPi0ComplErr900GeVNoError = (TGraphAsymmErrors*)graphRatioEtaPi0ComplErr900GeV->Clone();
ProduceGraphAsymmWithoutXYErrors(graphRatioEtaPi0ComplErr900GeVNoError);
DrawGammaSetMarkerTGraphAsym(graphRatioEtaPi0ComplErr900GeVNoError, markerStyleConv, markerSizeInvYield, colorCommonSpectrumPi0900GeV, colorCommonSpectrumPi0900GeV);
TGraphAsymmErrors* graphRatioEtaPi0ComplErr2760GeVNoError = (TGraphAsymmErrors*)graphRatioEtaPi0ComplErr2760GeV->Clone();
ProduceGraphAsymmWithoutXYErrors(graphRatioEtaPi0ComplErr2760GeVNoError);
DrawGammaSetMarkerTGraphAsym(graphRatioEtaPi0ComplErr2760GeVNoError, markerStyleConv, markerSizeInvYield, colorCommonSpectrumPi02760GeV, colorCommonSpectrumPi02760GeV);
TGraphAsymmErrors* graphCombinedEtaToPi0NoError = (TGraphAsymmErrors*)graphCombinedEtaToPi0->Clone();
ProduceGraphAsymmWithoutXYErrors(graphCombinedEtaToPi0NoError);
DrawGammaSetMarkerTGraphAsym(graphCombinedEtaToPi0NoError, markerStyleConv,markerSizeInvYield, colorCommonSpectrumPi07TeV, colorCommonSpectrumPi07TeV);
graphCombinedEtaToPi0NoError->Draw("p,same");
graphRatioEtaPi0ComplErr2760GeVNoError->Draw("p,same");
graphRatioEtaPi0ComplErr900GeVNoError->Draw("p,same");
TLegend* legendRatioEtaToPi0DiffEnergies = new TLegend(0.27,0.15,0.7,0.29);
legendRatioEtaToPi0DiffEnergies->SetTextSize(0.04);
legendRatioEtaToPi0DiffEnergies->SetFillColor(0);
legendRatioEtaToPi0DiffEnergies->SetBorderSize(0);
legendRatioEtaToPi0DiffEnergies->AddEntry(graphCombinedEtaToPi0NewXError,Form("stat + syst, ALICE, #sqrt{#it{s}} = 7 TeV (PLB 717 (2012) 162-172)"),"fp");
legendRatioEtaToPi0DiffEnergies->AddEntry(graphRatioEtaPi0ComplErr2760GeVNewXError,Form("stat + syst, ALICE (PCM), #sqrt{#it{s}} = 2.76 TeV"),"fp");
legendRatioEtaToPi0DiffEnergies->AddEntry(graphRatioEtaPi0ComplErr900GeVNewXError,Form("stat + syst, ALICE (PCM), #sqrt{#it{s}} = 0.9 TeV"),"fp");
legendRatioEtaToPi0DiffEnergies->Draw();
canvasRatioEtaPi0DiffEnergies->Update();
canvasRatioEtaPi0DiffEnergies->SaveAs(Form("%s/%s_Pi0EtaRatioDiffEnergiesALICE_Paper.%s",outputDir.Data(), prefix2.Data(), suffix.Data()));
TCanvas* canvasRatioEtaPi0DiffEnergiesSep = new TCanvas("canvasRatioEtaPi0DiffEnergiesSep","",200,10,1350,900); // gives the page size
DrawGammaCanvasSettings( canvasRatioEtaPi0DiffEnergiesSep,0.09, 0.01, 0.015, 0.115);
TH2D *histo2DRatioEtaPi0DiffEnergiesSep = new TH2D("histo2DRatioEtaPi0DiffEnergiesSep", "histo2DRatioEtaPi0DiffEnergiesSep", 20,0.,maxPtEta,1000.,-0.4,1.2);
SetStyleHistoTH2ForGraphs(histo2DRatioEtaPi0DiffEnergiesSep, "#it{p}_{T} (GeV/#it{c})","#eta/#pi^{0}", 0.05,0.064, 0.05,0.064, 0.8,0.65, 510, 510);
histo2DRatioEtaPi0DiffEnergiesSep->GetYaxis()->SetRangeUser(0.,1.02);
histo2DRatioEtaPi0DiffEnergiesSep->Draw();
TGraphAsymmErrors* graphRatioEtaPi0SysErr900GeVNewXError = (TGraphAsymmErrors*)graphRatioEtaPi0SysErr900GeV->Clone();
ProduceGraphAsymmFixedXErrors(graphRatioEtaPi0SysErr900GeVNewXError, 0.5);
DrawGammaSetMarkerTGraphAsym(graphRatioEtaPi0SysErr900GeVNewXError, markerStyleConv, markerSizeInvYield, colorCommonSpectrumPi0900GeV, colorCommonSpectrumPi0900GeVBox);
graphRatioEtaPi0SysErr900GeVNewXError->SetFillColor(colorCommonSpectrumPi0900GeVBox);
graphRatioEtaPi0SysErr900GeVNewXError->SetFillStyle(1001);
graphRatioEtaPi0SysErr900GeVNewXError->Draw("2same");
TGraphAsymmErrors* graphRatioEtaPi0SysErr2760GeVNewXError = (TGraphAsymmErrors*)graphRatioEtaPi0SysErr2760GeV->Clone();
ProduceGraphAsymmFixedXErrors(graphRatioEtaPi0SysErr2760GeVNewXError, 0.4);
DrawGammaSetMarkerTGraphAsym(graphRatioEtaPi0SysErr2760GeVNewXError, markerStyleConv, markerSizeInvYield, colorCommonSpectrumPi02760GeV, colorCommonSpectrumPi02760GeVBox);
graphRatioEtaPi0SysErr2760GeVNewXError->SetFillColor(colorCommonSpectrumPi02760GeVBox);
graphRatioEtaPi0SysErr2760GeVNewXError->SetFillStyle(1001);
graphRatioEtaPi0SysErr2760GeVNewXError->Draw("2same");
graphSysCombinedEtaToPi0NewXError->Draw("2same");
TGraphAsymmErrors* graphRatioEtaPi0StatErr900GeVNewXError = (TGraphAsymmErrors*)graphRatioEtaPi0StatErr900GeV->Clone();
ProduceGraphAsymmFixedXErrors(graphRatioEtaPi0StatErr900GeVNewXError, 0.);
DrawGammaSetMarkerTGraphAsym(graphRatioEtaPi0StatErr900GeVNewXError, markerStyleConv, markerSizeInvYield, colorCommonSpectrumPi0900GeV, colorCommonSpectrumPi0900GeV);
graphRatioEtaPi0StatErr900GeVNewXError->Draw("p,same");
TGraphAsymmErrors* graphRatioEtaPi0StatErr2760GeVNewXError = (TGraphAsymmErrors*)graphRatioEtaPi0StatErr2760GeV->Clone();
ProduceGraphAsymmFixedXErrors(graphRatioEtaPi0StatErr2760GeVNewXError, 0.);
DrawGammaSetMarkerTGraphAsym(graphRatioEtaPi0StatErr2760GeVNewXError, markerStyleConv, markerSizeInvYield, colorCommonSpectrumPi02760GeV, colorCommonSpectrumPi02760GeV);
graphRatioEtaPi0StatErr2760GeVNewXError->Draw("p,same");
graphStatCombinedEtaToPi0NewXError->Draw("p,same");
TLegend* legendRatioEtaToPi0DiffEnergiesSep = new TLegend(0.27,0.15,0.7,0.29);
legendRatioEtaToPi0DiffEnergiesSep->SetTextSize(0.04);
legendRatioEtaToPi0DiffEnergiesSep->SetFillColor(0);
legendRatioEtaToPi0DiffEnergiesSep->SetBorderSize(0);
legendRatioEtaToPi0DiffEnergiesSep->AddEntry(graphCombinedEtaToPi0NewXError,Form("ALICE, #sqrt{#it{s}} = 7 TeV (PLB 717 (2012) 162-172)"),"fp");
legendRatioEtaToPi0DiffEnergiesSep->AddEntry(graphRatioEtaPi0ComplErr2760GeVNewXError,Form("ALICE (PCM), #sqrt{#it{s}} = 2.76 TeV"),"fp");
legendRatioEtaToPi0DiffEnergiesSep->AddEntry(graphRatioEtaPi0ComplErr900GeVNewXError,Form("ALICE (PCM), #sqrt{#it{s}} = 0.9 TeV"),"fp");
legendRatioEtaToPi0DiffEnergiesSep->Draw();
canvasRatioEtaPi0DiffEnergiesSep->Update();
canvasRatioEtaPi0DiffEnergiesSep->SaveAs(Form("%s/%s_Pi0EtaRatioDiffEnergiesSepALICE_Paper.%s",outputDir.Data(), prefix2.Data(), suffix.Data()));
if(!thesis)DrawAliceLogoCombinedPreliminary(pictDrawingCoordinatesPi0Eta[0], pictDrawingCoordinatesPi0Eta[1], pictDrawingCoordinatesPi0Eta[2], pictDrawingCoordinatesPi0Eta[3], pictDrawingCoordinatesPi0Eta[4], pictDrawingCoordinatesPi0Eta[5], pictDrawingCoordinatesPi0Eta[6], pictDrawingCoordinatesPi0Eta[7], pictDrawingCoordinates[8], collisionSystemCombinedReallyAll, pictDrawingOptions[1], pictDrawingOptions[2], pictDrawingOptions[3],1350,900);
canvasRatioEtaPi0DiffEnergiesSep->Update();
canvasRatioEtaPi0DiffEnergiesSep->SaveAs(Form("%s/%s_Pi0EtaRatioDiffEnergiesSepALICE.%s",outputDir.Data(), prefix2.Data(), suffix.Data()));
delete canvasRatioEtaPi0DiffEnergiesSep;
delete legendRatioEtaToPi0DiffEnergiesSep;
TCanvas* canvasRatioEtaPi0NLO2760GeV = new TCanvas("canvasRatioEtaPi0NLO2760GeV","",200,10,1350,900); // gives the page size
DrawGammaCanvasSettings( canvasRatioEtaPi0NLO2760GeV,0.09, 0.01, 0.015, 0.115);
TH2D *histo2DRatioEtaPi0Theory2760GeV = new TH2D("histo2DRatioEtaPi0Theory2760GeV", "histo2DRatioEtaPi0Theory2760GeV", 20,0.,maxPtEta2760GeV,1000.,-0.4,1.2);
SetStyleHistoTH2ForGraphs(histo2DRatioEtaPi0Theory2760GeV, "#it{p}_{T} (GeV/#it{c})","#eta/#pi^{0}", 0.046,0.058, 0.046,0.058, 0.8,0.65, 510, 510);
histo2DRatioEtaPi0Theory2760GeV->GetYaxis()->SetRangeUser(0.,1.02);
histo2DRatioEtaPi0Theory2760GeV->Draw();
graphRatioEtaPi0ComplErr2760GeVNewXError->Draw("p,E2same");
DrawGammaNLOTGraph(graphEtaToPi0NLOMuHalf2760GeV, widthLineNLO, styleLineNLOMuHalf, colorNLOPi02760GeVMuHalf);
DrawGammaNLOTGraph(graphEtaToPi0NLOMuOne2760GeV, widthLineNLO, styleLineNLOMuOne, colorNLOPi02760GeVMuOne);
DrawGammaNLOTGraph(graphEtaToPi0NLOMuTwo2760GeV, widthLineNLO, styleLineNLOMuTwo, colorNLOPi02760GeVMuTwo);
graphEtaToPi0NLOMuHalf2760GeV->Draw("same,c");
graphEtaToPi0NLOMuOne2760GeV->Draw("same,c");
graphEtaToPi0NLOMuTwo2760GeV->Draw("same,c");
histo2DRatioEtaPi0Theory2760GeV->Draw("AXIS,same");
TLegend* legendRatioEtaToPi0Theory2760GeV = new TLegend(0.5,0.16,0.977,0.34);
legendRatioEtaToPi0Theory2760GeV->SetTextSize(0.036);
legendRatioEtaToPi0Theory2760GeV->SetFillColor(0);
legendRatioEtaToPi0Theory2760GeV->SetBorderSize(0);
legendRatioEtaToPi0Theory2760GeV->AddEntry(graphRatioEtaPi0ComplErr2760GeVNewXError,Form("stat + syst, PCM, #sqrt{#it{s}} = 2.76 TeV "),"fp");
legendRatioEtaToPi0Theory2760GeV->AddEntry(graphEtaToPi0NLOMuHalf2760GeV,"NLO #mu = 0.5 #it{p}_{T}","l");
legendRatioEtaToPi0Theory2760GeV->AddEntry(graphEtaToPi0NLOMuOne2760GeV,"NLO #mu = #it{p}_{T}","l");
legendRatioEtaToPi0Theory2760GeV->AddEntry(graphEtaToPi0NLOMuTwo2760GeV,"NLO #mu = 2 #it{p}_{T}","l");