-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfitcompare7v4.cpp
1655 lines (1477 loc) · 60.5 KB
/
fitcompare7v4.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/// evolved from fitBESData_4_1.cpp
// added centrality column in output file : DONE
// corresponding change in code to retreive centrality information from root file: DONE
// changed all functions (esp the fitting function funcBGBW) to have 6 parameters
// otherwise the cov. matrix in later functions, with 5 parameters, is not consistent
// added // h->SetMaximum(5*(h->GetMaximum()));
#include <iostream>
#include <string>
#include "TKey.h"
#include <sstream>
#include <fstream>
#include "fitBESData10.h"
using namespace std;
// forward declarations for methods in fitBESData.h:
Double_t getdNdptOverptIntegrand(Double_t* rad, Double_t* par);// not used
Double_t getdNdpt(Double_t* pT, Double_t* params);
string concatenateHistoname(string,string,string,string);
Double_t* getIntegralsAndErrorsFromData(TH1D*, Double_t, Double_t);
/////Double_t* getIntegralsAndErrorsFromFit(Double_t* myPt, Double_t* par);
Double_t getdNdpt(Double_t* pT, Double_t* params);
Double_t getdETdEtaIntegrand(Double_t* myPt, Double_t* par);
Double_t getdETdyIntegrand(Double_t* myPt, Double_t* par);
Double_t getdNdEtaIntegrand(Double_t* myPt, Double_t* par);
Double_t getdNdyIntegrand(Double_t* myPt, Double_t* par);
Int_t* getNpartAndErr(Double_t collisionEnergy, string centrality);
//-------------------------HAGE
Double_t getdNdptHAGE(Double_t* pT, Double_t* params);
Double_t getdETdEtaIntegrandHAGE(Double_t* myPt, Double_t* par);
Double_t getdETdyIntegrandHAGE(Double_t* myPt, Double_t* par);
Double_t getdNdEtaIntegrandHAGE(Double_t* myPt, Double_t* par);
Double_t getdNdyIntegrandHAGE(Double_t* myPt, Double_t* par);
//--------------------expo
Double_t getdNdptEXPO(Double_t* pT, Double_t* params);
Double_t getdETdEtaIntegrandEXPO(Double_t* myPt, Double_t* par);
Double_t getdETdyIntegrandEXPO(Double_t* myPt, Double_t* par);
Double_t getdNdEtaIntegrandEXPO(Double_t* myPt, Double_t* par);
Double_t getdNdyIntegrandEXPO(Double_t* myPt, Double_t* par);
//---------------------expo2
Double_t getdNdptEXPO2(Double_t* pT, Double_t* params);
Double_t getdETdEtaIntegrandEXPO2(Double_t* myPt, Double_t* par);
Double_t getdETdyIntegrandEXPO2(Double_t* myPt, Double_t* par);
Double_t getdNdEtaIntegrandEXPO2(Double_t* myPt, Double_t* par);
Double_t getdNdyIntegrandEXPO2(Double_t* myPt, Double_t* par);
// main function:
int fitcompare7v4(){
std::ofstream datFile ("compfitResults.dat", std::ofstream::app);
/* datFile << "FIT"<< "\t" << "CollEn"<< "\t"
<< "particle" << "\t"
<< "centrality" << "\t"
<< "mass" << "\t"
<< "beta" <<"\t"
<< "betaErr" <<"\t"
<< "temp" <<"\t"
<< "tempErr" <<"\t"
<< "n-v_prof" <<"\t"
<< "nErr" <<"\t"
<< "norm" <<"\t"
<< "normErr" <<"\t"
<< "dETdEta_data" << "\t" //dETdEta_d
<< "dETdEta_d_err"<< "\t" //dETdEta_d_err
<< "dETdEtaLeft" << "\t"
<< "dETdEtaLErr" << "\t"
<< "dETdEtaRight" << "\t"
<< "dETdEtaRErr" << "\t"
<< "dETdEtaTotal" << "\t" // dETdEtaTotal
<< "dETdEtaTErr" << "\t"
<< "dETdy_d" << "\t" //dETdy_d
<< "dETdy_d_err"<< "\t" //dETdy_d_err
<< "dETdyLeft" << "\t"
<< "dETdyLErr" << "\t"
<< "dETdyRight" << "\t"
<< "dETdyRErr" << "\t"
<< "dETdyTotal" << "\t" // dETdyTotal
<< "dETdyTErr" << "\t"
<< "dNdEta_d" << "\t" //dNdEta_d
<< "dNdEta_d_err"<< "\t" //dNdEta_d_err
<< "dNdEtaLeft" << "\t"
<< "dNdEtaLErr" << "\t"
<< "dNdEtaRight" << "\t"
<< "dNdEtaRErr" << "\t"
<< "dNdEtaTotal" << "\t" // dNdEtaTotal
<< "dNdEtaTErr" << "\t"
<< "dNdy_d" << "\t" //dNdy_d
<< "dNdy_d_err"<< "\t" //dNdy_d_err
<< "dNdyLeft" << "\t"
<< "dNdyLErr" << "\t"
<< "dNdyRight" << "\t"
<< "dNdyRErr" << "\t"
<< "dNdyTotal" << "\t" // dNdyTotal
<< "dNdyTErr" << "\t"
<< "Npart" << "\t"
<< "NpartErr" << "\n";
*/
TFile* myFile = new TFile("ALLSTAR.root");
TIter next(myFile->GetListOfKeys());
TKey* mikey;
TH1D* h;
TH1D* h1;
TH1D* h2;
TH1D* h3;
TH1D* h4;
TH1D* g;
TCanvas* c1;
TClass* class1;
TF1* funcBGBW;
TF1* funcBGBW2;
TF1* dETdEtaIntegrandFunc;
TF1* dETdyIntegrandFunc;
TF1* dNdEtaIntegrandFunc;
TF1* dNdyIntegrandFunc;
//Constrained
TF1* dETdEtaIntegrandFunc2;
TF1* dETdyIntegrandFunc2;
TF1* dNdEtaIntegrandFunc2;
TF1* dNdyIntegrandFunc2;
//hagedorn
TF1* HAGE;
TF1* dETdEtaIntegrandFuncHAGE;
TF1* dETdyIntegrandFuncHAGE;
TF1* dNdEtaIntegrandFuncHAGE;
TF1* dNdyIntegrandFuncHAGE;
//exponential
TF1* EXPO;
TF1* dETdEtaIntegrandFuncEXPO;
TF1* dETdyIntegrandFuncEXPO;
TF1* dNdEtaIntegrandFuncEXPO;
TF1* dNdyIntegrandFuncEXPO;
//expontial soren
TF1* EXPO2;
TF1* dETdEtaIntegrandFuncEXPO2;
TF1* dETdyIntegrandFuncEXPO2;
TF1* dNdEtaIntegrandFuncEXPO2;
TF1* dNdyIntegrandFuncEXPO2;
int breakOutForTesting =0;
int stop =325; // breakOut after this many iterations (if achieved); default: 140
cout << "Flag" << endl;
while((mikey=(TKey*)next())){
breakOutForTesting++;
if (breakOutForTesting<300) continue;// 140 histograms already analyzed
///cout << "Histo iter: " << breakOutForTesting+1 << endl;
class1 = gROOT->GetClass(mikey->GetClassName());
if(!class1->InheritsFrom("TH1")){
delete class1;
mikey->DeleteBuffer();
continue;
}
c1 = new TCanvas(); // a la Rademakers
funcBGBW = new TF1("getdNdpt",getdNdpt,0.00000000000001,10.,6); // actually has 5 parameters
funcBGBW2 = new TF1("getdNdpt2",getdNdpt,0.00000000000001,10.,6); // second blastwave for alternate starting parms
HAGE = new TF1("getdNdptHAGE",getdNdptHAGE,0.0000000000001,10.,5); // HAGEDORN Function
EXPO = new TF1("getdNdptEXPO", getdNdptEXPO,0.000000000001,10.,4);
EXPO2 = new TF1("getdNdptEXPO2", getdNdptEXPO2,0.000000000001,10.,5);
dETdEtaIntegrandFunc = new TF1("dETdEtaIntegrand",getdETdEtaIntegrand,0, 10, 6 );// function goes from 0 to 10
// and has 6 parameters"
// mass, beta, temp, n, norm, type
dETdyIntegrandFunc = new TF1("dETdyIntegrand", getdETdyIntegrand,0,10,6);
dNdEtaIntegrandFunc = new TF1("dETdyIntegrand",
getdNdEtaIntegrand,
0,10,6); // 5 parameters:m,b,t,n,norm, 6th is type*0
dNdyIntegrandFunc = new TF1("dETdyIntegrand",
getdNdEtaIntegrand,
0,10,6);// 5 parameters:m,b,t,n,norm, 6th is type*0
dETdEtaIntegrandFunc2 = new TF1("dETdEtaIntegrand2",
getdETdEtaIntegrand,
0, 10, 6 );// function goes from 0 to 10
// and has 6 parameters"
// mass, beta, temp, n, norm, type
dETdyIntegrandFunc2 = new TF1("dETdyIntegrand2",
getdETdyIntegrand,
0,10,6);
dNdEtaIntegrandFunc2 = new TF1("dETdyIntegrand2",
getdNdEtaIntegrand,
0,10,6); // 5 parameters:m,b,t,n,norm, 6th is type*0
dNdyIntegrandFunc2 = new TF1("dETdyIntegrand2",
getdNdEtaIntegrand,
0,10,6);//
//Function definitions for hagedorn fitting
dETdEtaIntegrandFuncHAGE = new TF1("dETdEtaIntegrandHAGE",
getdETdEtaIntegrandHAGE,
0, 10, 5 );// function goes from 0 to 10
// and has 6 parameters"
// mass, pt,
dETdyIntegrandFuncHAGE = new TF1("dETdyIntegrandHAGE",
getdETdyIntegrandHAGE,
0,10,5);
dNdEtaIntegrandFuncHAGE = new TF1("dETdyIntegrandHAGE",
getdNdEtaIntegrandHAGE,
0,10,5); // 5 parameters:m, 6th is type*0
dNdyIntegrandFuncHAGE = new TF1("dETdyIntegrandHAGE",
getdNdEtaIntegrandHAGE,
0,10,5);// 5 parameters:m, 6th is type*0
dETdEtaIntegrandFuncEXPO = new TF1("dETdEtaIntegrandEXPO",
getdETdEtaIntegrandEXPO,
0, 10, 4 );// function goes from 0 to 10
// and has 6 parameters"
// mass, pt,
dETdyIntegrandFuncEXPO = new TF1("dETdyIntegrandEXPO",
getdETdyIntegrandEXPO,
0,10,4);
dNdEtaIntegrandFuncEXPO = new TF1("dETdyIntegrandEXPO",
getdNdEtaIntegrandEXPO,
0,10,4); // 5 parameters:m, 6th is type*0
dNdyIntegrandFuncEXPO = new TF1("dETdyIntegrandEXPO",
getdNdEtaIntegrandEXPO,
0,10,4);// 5 parameters:m, 6th is type*0
dETdEtaIntegrandFuncEXPO2 = new TF1("dETdEtaIntegrandEXPO2",
getdETdEtaIntegrandEXPO2,
0, 10, 5 );// function goes from 0 to 10
// and has 6 parameters"
// mass, pt,
dETdyIntegrandFuncEXPO2 = new TF1("dETdyIntegrandEXPO2",
getdETdyIntegrandEXPO2,
0,10,5);
dNdEtaIntegrandFuncEXPO2 = new TF1("dETdyIntegrandEXPO2",
getdNdEtaIntegrandEXPO2,
0,10,5); // 5 parameters:m, 6th is type*0
dNdyIntegrandFuncEXPO2 = new TF1("dETdyIntegrandEXPO2",
getdNdEtaIntegrandEXPO2,
0,10,5);// 5 parameters:m, 6th is type*0
//gPad->SetLogy();
//gStyle->SetOptFit(1111);// display fit parameters; customizable
// gStyle->SetOptDate();// display date (at bottom left)
gROOT-> SetBatch(kTRUE);// save canvases without displaying them
c1->Update();
// read histogram object for current iteration of key:
h = (TH1D*)mikey->ReadObj();
h1 = (TH1D*)mikey->ReadObj();
h2 = (TH1D*)mikey->ReadObj();
h3 = (TH1D*)mikey->ReadObj();
g = (TH1D*)mikey->ReadObj();
string histoName = h->GetName();
Double_t collEn = 0.;// initialize
//cent8_ka+_Au+Au_7.7 // sample histo name
if(histoName.substr( histoName.length() - 4 ) == "_7.7") collEn = 7.7;
else if(histoName.substr( histoName.length() - 4 ) == "11.5") collEn = 11.5;
else if(histoName.substr( histoName.length() - 4 ) == "19.6") collEn = 19.6;
else if(histoName.substr( histoName.length() - 4 ) == "u_27") collEn = 27;
else if(histoName.substr( histoName.length() - 4 ) == "u_39") collEn = 39;
else if(histoName.substr( histoName.length() - 4 ) == "62.4") collEn = 62.4;
else if(histoName.substr( histoName.length() - 4 ) == "_130") collEn = 130;
else if(histoName.substr( histoName.length() - 4 ) == "_200") collEn = 200;
//get first three characters of particle name from histoName:
string particleID = histoName.substr(6,3);// starting position in array:6, 3 chars total
string centrality = histoName.substr(4,1);// starting position in array:4, 1 char total
//------------ Assign mass & type to particle -----------------//
Double_t mass; // in GeV
// type Double_t instead of Int_t
//to use as argument in TF1 method SetParameters()
Double_t type;// 0 for mesons, -1 for baryons, 1 for antibaryons
if (particleID=="pi-"||particleID=="pi+")
{mass = 0.13957; type = 0.;}
else if (particleID=="ka-"||particleID=="ka+")
{mass = 0.49368; type = 0.;}
else if (particleID=="pro")
{mass = 0.93827; type = -1.;}
else if (particleID=="pba")
{mass = 0.93827; type = 1.;}
else if (particleID=="pi0")
{mass = 0.13497; type = 0.;}
else if (particleID=="eta")
{mass = 0.54786; type = 0.;}
else {cout << "Check particle: "
<< particleID<<endl;return 1;}
Double_t* integralDataPtr;
// TODO : need to fix what function this should be:
integralDataPtr = getIntegralsAndErrorsFromData(h,type,mass);
// ^ method verified!!!
/*
Double_t* integralDataPtr2;
integralDataPtr2 = getIntegralsAndErrorsFromData(h1,type,mass);
Double_t* integralDataPtr3;
integralDataPtr3 = getIntegralsAndErrorsFromData(h2,type,mass);
Double_t* integralDataPtr4;
integralDataPtr4 = getIntegralsAndErrorsFromData(h3,type,mass);
Double_t* integralDataPtr5;
integralDataPtr5 = getIntegralsAndErrorsFromData(g,type,mass);
*/
//------------- Begin BGBW fit --------------------------//
//FIXME when you delete, use the "C"? option to delete all the inherited objects as well
if ( histoName == "cent7_ka-_Au+Au_7.7"
|| histoName == "cent7_ka-_Au+Au_11.5"
|| histoName == "cent7_pi+_Au+Au_7.7"
|| histoName == "cent4_pi-_Au+Au_19.6"
|| histoName == "cent5_ka+_Au+Au_27"
|| histoName == "cent5_ka-_Au+Au_7.7"
|| histoName == "cent6_pi+_Au+Au_11.5"
|| histoName == "cent3_pi-_Au+Au_7.7"
|| histoName == "cent4_pi-_Au+Au_7.7"
|| histoName == "cent5_pi-_Au+Au_7.7"
|| histoName == "cent7_pi-_Au+Au_7.7"
|| histoName == "cent1_pbar_Au+Au_7.7" // NOT POS-DEF
|| histoName == "cent3_pbar_Au+Au_7.7"
|| histoName == "cent4_pbar_Au+Au_7.7"
|| histoName == "cent6_pbar_Au+Au_7.7"
|| histoName == "cent7_pbar_Au+Au_7.7"
|| histoName == "cent8_ka+_Au+Au_7.7"
|| histoName == "cent8_ka-_Au+Au_7.7"
|| histoName == "cent6_pi-_Au+Au_11.5"
|| histoName == "cent0_pi+_Au+Au_11.5"
|| histoName == "cent7_pi+_Au+Au_11.5"
|| histoName == "cent8_proton_Au+Au_19.6"
|| histoName == "cent5_proton_Au+Au_7.7"
|| histoName == "cent6_pi+_Au+Au_27"
|| histoName == "cent2_ka-_Au+Au_27"
|| histoName == "cent3_ka+_Au+Au_27"
|| histoName == "cent7_pbar_Au+Au_27"
|| histoName == "cent8_pi+_Au+Au_39"
|| histoName == "cent8_ka-_Au+Au_62.4"
|| histoName == "cent8_ka+_Au+Au_62.4"
|| histoName == "cent7_pi+_Au+Au_130"
)
{
funcBGBW->SetParameters(mass,0.9,0.03,0.01,10000.,type);
cout << "alternate init pars: 0.9,0.03,0.01,10000." << endl; //find final param pion //should look like average
}
else if(collEn == 62.4 &&( particleID =="pi-"||particleID=="pi+")){
cout << "histoname is: " << histoName << endl;
funcBGBW->SetParameters(mass,0.9,0.03,.01,10000.,type);
}
else{
cout << "histoname is: " << histoName << endl;
funcBGBW->SetParameters(mass,0.95,0.05,0.1,1000000.,type);
// funcBGBW2->SetParameters(mass,0.6,0.05,0.1,10000.,type);
}
funcBGBW->SetParNames("mass","beta (c)","temp","n","norm","type");
funcBGBW->SetParLimits(1,0.5,0.999999999999999999999);//param 1
funcBGBW->FixParameter(0,mass);// mass in GeV
funcBGBW->FixParameter(5,type);
//fixing bgbw2
funcBGBW2->SetParameters(mass,0.3,.08,.01,10000.,type);
funcBGBW2->SetParLimits(1,0.3,0.8);//beta
funcBGBW2->SetParLimits(2,.08,.2);//temp
funcBGBW2->SetParLimits(3,0.01,5);//n
funcBGBW2->SetParNames("mass","beta (c)","temp","n","norm","type");
//funcBGBW2->SetParLimits(1,0.5,0.999999999999999999999);//param 1
funcBGBW2->FixParameter(0,mass);// mass in GeV
funcBGBW2->FixParameter(5,type);
funcBGBW2->SetLineColor(kBlue);
//HAGEDORN
if(particleID=="pro"){
HAGE->SetParameters(mass,1.,1.,5.,type);
HAGE->SetParNames("mass","A","temp","n","type");
HAGE->FixParameter(0,mass);// mass in GeV
HAGE->FixParameter(4,type);
HAGE->SetLineColor(kCyan+2);
}
else{
HAGE->SetParameters(mass,1.,1.,5.,type);
HAGE->SetParNames("mass","A","temp","n","type");
HAGE->SetLineColor(kCyan);
HAGE->SetParLimits(2,50.,200.); // temp
HAGE->SetParLimits(3,5.,15.); // norm
HAGE->FixParameter(0,mass);// mass in GeV
HAGE->FixParameter(4,type);
}
//EXPOS
if(particleID == "pi+"||particleID == "pi-"){
EXPO->SetParameters(10000.,.01,mass,type);
EXPO->SetParNames("Ae","Be","mass","type");
//EXPO->SetParLimits(0,300,1000);
//EXPO->SetParLimits(1,.01,1.);
EXPO->SetLineColor(kBlack);
EXPO->FixParameter(3,type);
EXPO->FixParameter(2,mass);
EXPO2->SetParameters(1.,1.,1.,mass,type);
EXPO2->SetParNames("A2","B2","C2","mass","type");
// EXPO2->SetParLimits(0,.1,1);
//EXPO2->SetParLimits(1,-4,0);
//EXPO2->SetParLimits(2,.3,2);
EXPO2->SetLineColor(kViolet);
EXPO2->FixParameter(4,type);
EXPO2->FixParameter(3,mass);
}
else if(particleID=="ka-"||particleID == "ka+"){
EXPO->SetParameters(.1,.1,mass,type);
EXPO->SetParNames("Ae","Be","mass","type");
//EXPO->SetParLimits(0,400,500);
//EXPO->SetParLimits(1,.01,1);
EXPO->SetLineColor(kBlack);
EXPO->FixParameter(3,type);
EXPO->FixParameter(2,mass);
EXPO2->SetParameters(.01,0.01,0.01,mass,type);
EXPO2->SetParNames("A2","B2","C2","mass","type");
//EXPO2->SetParLimits(0,.1,1);
//EXPO2->SetParLimits(1,-4,0);
//EXPO2->SetParLimits(2,.3,2);
EXPO2->SetLineColor(kViolet);
EXPO2->FixParameter(4,type);
EXPO2->FixParameter(3,mass);
}
else{
EXPO->SetParameters(.1,.1,mass,type);
EXPO->SetParNames("Ae","Be","mass","type");
//EXPO->SetParLimits(0,400,500);
//EXPO->SetParLimits(1,.01,1);
EXPO->SetLineColor(kBlack);
EXPO->FixParameter(3,type);
EXPO->FixParameter(2,mass);
EXPO2->SetParameters(0.01,0.01,0.01,mass,type);
EXPO2->SetParNames("A2","B2","C2","mass","type");
// EXPO2->SetParLimits(0,.1,1);
//EXPO2->SetParLimits(1,-4,0);
//EXPO2->SetParLimits(2,.3,2);
EXPO2->SetLineColor(kViolet);
EXPO2->FixParameter(4,type);
EXPO2->FixParameter(3,mass);
}
ROOT::Math::MinimizerOptions::SetDefaultMaxFunctionCalls(20000);
TFitResultPtr r = h->Fit("getdNdpt","S","",0.00000000000001,10.);
Double_t meanpt1= funcBGBW->GetHistogram()->GetMean();
TFitResultPtr l = h->Fit("getdNdpt2","S+","",0.00000000000001,10.);
//g->Fit("getdNdpt2","S","",0.00000000000001,10.);
Double_t meanpt2 = funcBGBW2->GetHistogram()->GetMean();
TFitResultPtr p = h->Fit("getdNdptHAGE","S+","",0.000000000001,10.);
Double_t meanpt3= HAGE->GetHistogram()->GetMean();
//EXPO
TFitResultPtr v = h->Fit("getdNdptEXPO","S+","M",0.000000000001,10.);
Double_t meanpt4= EXPO->GetHistogram()->GetMean();
TFitResultPtr w = h->Fit("getdNdptEXPO2","S+","M",0.000000000001,10.);
Double_t meanpt5= EXPO2->GetHistogram()->GetMean();
Double_t chi2Prob = r->Prob();
Double_t chi2prob2 = l->Prob();
Double_t chi3prob3 = p->Prob();
Double_t chi4prob4 = v->Prob();
Double_t chi5prob5 = w->Prob();
cout << "chi-sq prob: " << chi2Prob << "\t" << chi2prob2 << "\t" << chi3prob3 << "\t" << chi4prob4 << "\t" << chi5prob5 << endl;
h->SetMaximum(5*(h->GetMaximum()));
//h-> GetYaxis()->SetRangeUser(0.,maxY);
//TMatrixDSym cov = r->GetCovarianceMatrix();
h-> GetXaxis()->SetRangeUser(0.,10.);
TString xlabel = "p_{T}";
TString ylabel = "#frac{d^{2}N}{dydp_{T}}";
h-> SetXTitle(xlabel);
h-> SetYTitle(ylabel);
Double_t beta2 = funcBGBW2->GetParameter(1);
Double_t temp2 = funcBGBW2->GetParameter(2);
Double_t n2 = funcBGBW2->GetParameter(3);
Double_t norm2 = funcBGBW2->GetParameter(4);
Double_t betaErr2 = funcBGBW2->GetParError(1);
Double_t tempErr2 = funcBGBW2->GetParError(2);
Double_t nErr2 = funcBGBW2->GetParError(3);
Double_t normErr2 = funcBGBW2->GetParError(4);
Double_t beta = funcBGBW->GetParameter(1);
Double_t temp = funcBGBW->GetParameter(2);
Double_t n = funcBGBW->GetParameter(3);
Double_t norm = funcBGBW->GetParameter(4);
Double_t betaErr = funcBGBW->GetParError(1);
Double_t tempErr = funcBGBW->GetParError(2);
Double_t nErr = funcBGBW->GetParError(3);
Double_t normErr = funcBGBW->GetParError(4);
//------------- end BGBW fit ----------------------------
//-------------hagedorn varibles-------------------------
Double_t A = HAGE->GetParameter(1);
Double_t tempH = HAGE->GetParameter(2);
Double_t nH = HAGE->GetParameter(3);
Double_t AErr = HAGE->GetParError(1);
Double_t tempHErr = HAGE->GetParError(2);
Double_t nHErr = HAGE->GetParError(3);
//------------------------------------expoparms-----------
Double_t Ae = EXPO->GetParameter(0);
Double_t Be = EXPO->GetParameter(1);
Double_t AeErr = EXPO->GetParError(0);
Double_t BeErr = EXPO->GetParError(1);
//---------------------------------------------------expo2---------------
Double_t A2 = EXPO2->GetParameter(0);
Double_t B2 = EXPO2->GetParameter(1);
Double_t C2 = EXPO2->GetParameter(2);
Double_t A2Err = EXPO2->GetParError(0);
Double_t B2Err = EXPO2->GetParError(1);
Double_t C2Err = EXPO2->GetParError(2);
//-------- Find integrals left and right of data points -------//
funcBGBW -> SetParameters(mass,beta,temp,n,norm,type);
dETdEtaIntegrandFunc -> SetParameters(mass,beta,temp,n,norm,type);
dETdEtaIntegrandFunc -> FixParameter(5,type);
dETdEtaIntegrandFunc -> FixParameter(0,mass);
dETdyIntegrandFunc -> SetParameters(mass,beta,temp,n,norm,type);
dETdyIntegrandFunc -> FixParameter(5,type);
dETdyIntegrandFunc -> FixParameter(0,mass);
dNdEtaIntegrandFunc -> SetParameters(mass,beta,temp,n,norm,type);
dNdEtaIntegrandFunc -> FixParameter(0,mass);
dNdEtaIntegrandFunc -> FixParameter(5,type);
dNdyIntegrandFunc -> SetParameters(mass,beta,temp,n,norm,type);
dNdyIntegrandFunc -> FixParameter(0,mass);
dNdyIntegrandFunc -> FixParameter(5,type);
Int_t totBins = h->GetNbinsX();
Int_t binx1 = 0;
Int_t binx2 = totBins+1;
Double_t leftCut = h->GetXaxis()->GetBinLowEdge(binx1+2);
Double_t rightCut = h->GetXaxis()->GetBinUpEdge(binx2-1);
Double_t dETdEtaLeft = dETdEtaIntegrandFunc -> Integral(0.,leftCut);
Double_t dETdEtaRight = dETdEtaIntegrandFunc -> Integral(rightCut,10.);
Double_t dETdyLeft = dETdyIntegrandFunc -> Integral(0.,leftCut);
Double_t dETdyRight = dETdyIntegrandFunc -> Integral(rightCut,10.);
Double_t dNdEtaLeft = dNdEtaIntegrandFunc -> Integral(0.,leftCut);
Double_t dNdEtaRight = dNdEtaIntegrandFunc -> Integral(rightCut,10.);
Double_t dNdyLeft = dNdyIntegrandFunc -> Integral(0.,leftCut);
Double_t dNdyRight = dNdyIntegrandFunc -> Integral(rightCut,10.);
// Errors:
Double_t dETdEtaLErr =
dETdEtaIntegrandFunc->IntegralError(0.,leftCut,
r->GetParams(),
r->GetCovarianceMatrix().GetMatrixArray());
Double_t dETdEtaRErr =
dETdEtaIntegrandFunc->IntegralError(rightCut,10.,
r->GetParams(),
r->GetCovarianceMatrix().GetMatrixArray());
Double_t dETdyLErr =
dETdyIntegrandFunc->IntegralError(0.,leftCut,
r->GetParams(),
r->GetCovarianceMatrix().GetMatrixArray());
Double_t dETdyRErr =
dETdyIntegrandFunc->IntegralError(rightCut,10.,
r->GetParams(),
r->GetCovarianceMatrix().GetMatrixArray());
Double_t dNdEtaLErr =
dNdEtaIntegrandFunc->IntegralError(0.,leftCut,
r->GetParams(),
r->GetCovarianceMatrix().GetMatrixArray());
Double_t dNdEtaRErr =
dETdEtaIntegrandFunc->IntegralError(rightCut,10.,
r->GetParams(),
r->GetCovarianceMatrix().GetMatrixArray());
Double_t dNdyLErr =
dNdyIntegrandFunc->IntegralError(0.,leftCut,
r->GetParams(),
r->GetCovarianceMatrix().GetMatrixArray());
Double_t dNdyRErr =
dNdyIntegrandFunc->IntegralError(rightCut,10.,
r->GetParams(),
r->GetCovarianceMatrix().GetMatrixArray());
Double_t dETdEta_d = *(integralDataPtr+0);
Double_t dETdEta_d_err = *(integralDataPtr+1);
Double_t dETdEtaTotal = dETdEtaLeft+dETdEta_d+dETdEtaRight;
Double_t dETdEtaTErr = dETdEtaLErr+dETdEta_d_err+dETdEtaRErr;
Double_t dETdy_d = *(integralDataPtr+2);
Double_t dETdy_d_err = *(integralDataPtr+3);
Double_t dETdyTotal = dETdyLeft+dETdy_d+dETdyRight;
Double_t dETdyTErr = dETdyLErr+dETdy_d_err+dETdyRErr;
Double_t dNdEta_d = *(integralDataPtr+4);
Double_t dNdEta_d_err = *(integralDataPtr+5);
Double_t dNdEtaTotal = dNdEtaLeft+dNdEta_d+dNdEtaRight;
Double_t dNdEtaTErr = dNdEtaLErr+dNdEta_d_err+dNdEtaRErr;
Double_t dNdy_d = *(integralDataPtr+6);
Double_t dNdy_d_err = *(integralDataPtr+7);
Double_t dNdyTotal = dNdyLeft+dNdy_d+dNdyRight;
Double_t dNdyTErr = dNdyLErr+dNdy_d_err+dNdyRErr;
cout <<"Integral from data for histo "<<breakOutForTesting+1<<": "<<*(integralDataPtr+0)<<endl;// 357.633 for pi minus cent 0
cout<<"-----------------------------------"<<endl;
//------ end Find integrals left and right of data points ----//
//------ begin - assign Npart and errors from BES paper -----//
Int_t* NpartAndArrPtr;
Int_t Npart;
Int_t NpartErr;
NpartAndArrPtr = getNpartAndErr(collEn,centrality);
Npart = *(NpartAndArrPtr+0);
NpartErr = *(NpartAndArrPtr+1);
//------ end - assign Npart and errors from BES paper -------//
//-- Output results to file-----------------------------
datFile <<"bis\t" <<collEn << "\t"
<< particleID << "\t"
<< centrality << "\t"
<< mass << "\t"
<< beta <<"\t"
<< betaErr <<"\t"
<< temp <<"\t"
<< tempErr <<"\t"
<< n <<"\t"
<< nErr <<"\t"
<< norm <<"\t"
<< normErr <<"\t"
<< dETdEta_d << "\t" //dETdEta_d
<< dETdEta_d_err<< "\t" //dETdEta_d_err
<< dETdEtaLeft << "\t"
<< dETdEtaLErr << "\t"
<< dETdEtaRight << "\t"
<< dETdEtaRErr << "\t"
<< dETdEtaTotal<< "\t" // dETdEtaTotal
<< dETdEtaTErr << "\t"
<< dETdy_d << "\t" //dETdy_d
<< dETdy_d_err<< "\t" //dETdy_d_err
<< dETdyLeft << "\t"
<< dETdyLErr << "\t"
<< dETdyRight << "\t"
<< dETdyRErr << "\t"
<< dETdyTotal<< "\t" // dETdyTotal
<< dETdyTErr << "\t"
<< dNdEta_d << "\t" //dNdEta_d
<< dNdEta_d_err<< "\t" //dNdEta_d_err
<< dNdEtaLeft << "\t"
<< dNdEtaLErr << "\t"
<< dNdEtaRight << "\t"
<< dNdEtaRErr << "\t"
<< dNdEtaTotal << "\t" // dNdEtaTotal
<< dNdEtaTErr << "\t"
<< dNdy_d << "\t" //dNdy_d
<< dNdy_d_err<< "\t" //dNdy_d_err
<< dNdyLeft << "\t"
<< dNdyLErr << "\t"
<< dNdyRight << "\t"
<< dNdyRErr << "\t"
<< dNdyTotal << "\t" // dNdyTotal
<< dNdyTErr << "\t"
<< Npart << "\t"
<< NpartErr << "\n";
//-- end- output results to file------------------------
c1->Update();
Double_t chi2BGBW = funcBGBW->GetChisquare();
Double_t nDFBGBW = funcBGBW->GetNDF();
Double_t p2 = funcBGBW->GetParameter(2);
Double_t e2 = funcBGBW->GetParError(2);
funcBGBW2 -> SetParameters(mass,beta2,temp2,n2,norm2,type);
dETdEtaIntegrandFunc2 -> SetParameters(mass,beta2,temp2,n2,norm2,type);
dETdEtaIntegrandFunc2 -> FixParameter(5,type);
dETdEtaIntegrandFunc2 -> FixParameter(0,mass);
dETdyIntegrandFunc2 -> SetParameters(mass,beta2,temp2,n2,norm2,type);
dETdyIntegrandFunc2 -> FixParameter(5,type);
dETdyIntegrandFunc2 -> FixParameter(0,mass);
dNdEtaIntegrandFunc2 -> SetParameters(mass,beta2,temp2,n2,norm2,type);
dNdEtaIntegrandFunc2 -> FixParameter(0,mass);
dNdEtaIntegrandFunc2 -> FixParameter(5,type);
dNdyIntegrandFunc2 -> SetParameters(mass,beta2,temp2,n2,norm2,type);
dNdyIntegrandFunc2 -> FixParameter(0,mass);
dNdyIntegrandFunc2 -> FixParameter(5,type);
Int_t totBins2 = h->GetNbinsX();
Int_t binx12 = 0;
Int_t binx22 = totBins+1;
Double_t leftCut2 = h->GetXaxis()->GetBinLowEdge(binx12+2);
Double_t rightCut2 = h->GetXaxis()->GetBinUpEdge(binx22-1);
Double_t dETdEtaLeft2 = dETdEtaIntegrandFunc2 -> Integral(0.,leftCut2);
Double_t dETdEtaRight2 = dETdEtaIntegrandFunc2 -> Integral(rightCut2,10.);
Double_t dETdyLeft2 = dETdyIntegrandFunc2 -> Integral(0.,leftCut2);
Double_t dETdyRight2 = dETdyIntegrandFunc2 -> Integral(rightCut2,10.);
Double_t dNdEtaLeft2 = dNdEtaIntegrandFunc2 -> Integral(0.,leftCut2);
Double_t dNdEtaRight2 = dNdEtaIntegrandFunc2 -> Integral(rightCut2,10.);
Double_t dNdyLeft2 = dNdyIntegrandFunc2 -> Integral(0.,leftCut2);
Double_t dNdyRight2 = dNdyIntegrandFunc2 -> Integral(rightCut2,10.);
// Errors:
Double_t dETdEtaLErr2 =
dETdEtaIntegrandFunc2->IntegralError(0.,leftCut2,
l->GetParams(),
l->GetCovarianceMatrix().GetMatrixArray());
Double_t dETdEtaRErr2 =
dETdEtaIntegrandFunc2->IntegralError(rightCut2,10.,
l->GetParams(),
l->GetCovarianceMatrix().GetMatrixArray());
Double_t dETdyLErr2 =
dETdyIntegrandFunc2->IntegralError(0.,leftCut2,
l->GetParams(),
l->GetCovarianceMatrix().GetMatrixArray());
Double_t dETdyRErr2 =
dETdyIntegrandFunc2->IntegralError(rightCut2,10.,
l->GetParams(),
l->GetCovarianceMatrix().GetMatrixArray());
Double_t dNdEtaLErr2 =
dNdEtaIntegrandFunc2->IntegralError(0.,leftCut2,
l->GetParams(),
l->GetCovarianceMatrix().GetMatrixArray());
Double_t dNdEtaRErr2 =
dETdEtaIntegrandFunc2->IntegralError(rightCut2,10.,
l->GetParams(),
l->GetCovarianceMatrix().GetMatrixArray());
Double_t dNdyLErr2 =
dNdyIntegrandFunc2->IntegralError(0.,leftCut2,
l->GetParams(),
l->GetCovarianceMatrix().GetMatrixArray());
Double_t dNdyRErr2 =
dNdyIntegrandFunc2->IntegralError(rightCut2,10.,
l->GetParams(),
l->GetCovarianceMatrix().GetMatrixArray());
Double_t dETdEta_d2 = *(integralDataPtr+0);
Double_t dETdEta_d_err2 = *(integralDataPtr+1);
Double_t dETdEtaTotal2 = dETdEtaLeft2+dETdEta_d2+dETdEtaRight2;
Double_t dETdEtaTErr2 = dETdEtaLErr2+dETdEta_d_err2+dETdEtaRErr2;
Double_t dETdy_d2 = *(integralDataPtr+2);
Double_t dETdy_d_err2 = *(integralDataPtr+3);
Double_t dETdyTotal2 = dETdyLeft2+dETdy_d2+dETdyRight2;
Double_t dETdyTErr2 = dETdyLErr2+dETdy_d_err2+dETdyRErr2;
Double_t dNdEta_d2 = *(integralDataPtr+4);
Double_t dNdEta_d_err2 = *(integralDataPtr+5);
Double_t dNdEtaTotal2 = dNdEtaLeft2+dNdEta_d2+dNdEtaRight2;
Double_t dNdEtaTErr2 = dNdEtaLErr2+dNdEta_d_err2+dNdEtaRErr2;
Double_t dNdy_d2 = *(integralDataPtr+6);
Double_t dNdy_d_err2 = *(integralDataPtr+7);
Double_t dNdyTotal2 = dNdyLeft2+dNdy_d2+dNdyRight2;
Double_t dNdyTErr2 = dNdyLErr2+dNdy_d_err2+dNdyRErr2;
cout <<"Integral from data for histo "<<breakOutForTesting+1<<": "<<*(integralDataPtr+0)<<endl;// 357.633 for pi minus cent 0
cout<<"-----------------------------------"<<endl;
//------ end Find integrals left and right of data points ----//
//------ begin - assign Npart and errors from BES paper -----//
Int_t* NpartAndArrPtr2;
Int_t Npart2;
Int_t NpartErr2;
NpartAndArrPtr2 = getNpartAndErr(collEn,centrality);
Npart2 = *(NpartAndArrPtr2+0);
NpartErr2 = *(NpartAndArrPtr2+1);
//------ end - assign Npart and errors from BES paper -------//
//-- Output results to file-----------------------------
datFile << "tan\t"<<collEn << "\t"
<< particleID << "\t"
<< centrality << "\t"
<< mass << "\t"
<< beta2 <<"\t"
<< betaErr2 <<"\t"
<< temp2 <<"\t"
<< tempErr2 <<"\t"
<< n2 <<"\t"
<< nErr2 <<"\t"
<< norm2 <<"\t"
<< normErr2 <<"\t"
<< dETdEta_d2 << "\t" //dETdEta_d
<< dETdEta_d_err2<< "\t" //dETdEta_d_err
<< dETdEtaLeft2 << "\t"
<< dETdEtaLErr2 << "\t"
<< dETdEtaRight2 << "\t"
<< dETdEtaRErr2 << "\t"
<< dETdEtaTotal2<< "\t" // dETdEtaTotal
<< dETdEtaTErr2 << "\t"
<< dETdy_d2 << "\t" //dETdy_d
<< dETdy_d_err2<< "\t" //dETdy_d_err
<< dETdyLeft2 << "\t"
<< dETdyLErr2 << "\t"
<< dETdyRight2 << "\t"
<< dETdyRErr2 << "\t"
<< dETdyTotal2<< "\t" // dETdyTotal
<< dETdyTErr2 << "\t"
<< dNdEta_d2 << "\t" //dNdEta_d
<< dNdEta_d_err2<< "\t" //dNdEta_d_err
<< dNdEtaLeft2 << "\t"
<< dNdEtaLErr2 << "\t"
<< dNdEtaRight2 << "\t"
<< dNdEtaRErr2 << "\t"
<< dNdEtaTotal2 << "\t" // dNdEtaTotal
<< dNdEtaTErr2 << "\t"
<< dNdy_d2 << "\t" //dNdy_d
<< dNdy_d_err2<< "\t" //dNdy_d_err
<< dNdyLeft2 << "\t"
<< dNdyLErr2 << "\t"
<< dNdyRight2 << "\t"
<< dNdyRErr2 << "\t"
<< dNdyTotal2 << "\t" // dNdyTotal
<< dNdyTErr2 << "\t"
<< Npart2 << "\t"
<< NpartErr2 << "\n";
//-- end- output results to file------------------------
c1->Update();
Double_t chi2BGBW2 = funcBGBW2->GetChisquare();
Double_t nDFBGBW2 = funcBGBW2->GetNDF();
Double_t p22 = funcBGBW2->GetParameter(2);
Double_t e22 = funcBGBW2->GetParError(2);
HAGE -> SetParameters(mass,A,tempH,nH,type);
dETdEtaIntegrandFuncHAGE -> SetParameters(mass,A,tempH,nH,type);
dETdEtaIntegrandFuncHAGE -> FixParameter(4,type);
dETdEtaIntegrandFuncHAGE -> FixParameter(0,mass);
dETdyIntegrandFuncHAGE -> SetParameters(mass,A,tempH,nH,type);
dETdyIntegrandFuncHAGE -> FixParameter(4,type);
dETdyIntegrandFuncHAGE -> FixParameter(0,mass);
dNdEtaIntegrandFuncHAGE -> SetParameters(mass,A,tempH,nH,type);
dNdEtaIntegrandFuncHAGE -> FixParameter(0,mass);
dNdEtaIntegrandFuncHAGE -> FixParameter(4,type);
dNdyIntegrandFuncHAGE -> SetParameters(mass,A,tempH,nH,type);
dNdyIntegrandFuncHAGE -> FixParameter(0,mass);
dNdyIntegrandFuncHAGE -> FixParameter(4,type);
Int_t totBinsH = h->GetNbinsX();
Int_t binx1H = 0;
Int_t binx2H = totBins+1;
Double_t leftCutH = h->GetXaxis()->GetBinLowEdge(binx1H+2);
Double_t rightCutH = h->GetXaxis()->GetBinUpEdge(binx2H-1);
Double_t dETdEtaLeftH = dETdEtaIntegrandFuncHAGE -> Integral(0.,leftCutH);
Double_t dETdEtaRightH = dETdEtaIntegrandFuncHAGE -> Integral(rightCutH,10.);
Double_t dETdyLeftH = dETdyIntegrandFuncHAGE -> Integral(0.,leftCutH);
Double_t dETdyRightH = dETdyIntegrandFuncHAGE -> Integral(rightCutH,10.);
Double_t dNdEtaLeftH = dNdEtaIntegrandFuncHAGE -> Integral(0.,leftCutH);
Double_t dNdEtaRightH = dNdEtaIntegrandFuncHAGE -> Integral(rightCutH,10.);
Double_t dNdyLeftH = dNdyIntegrandFuncHAGE -> Integral(0.,leftCutH);
Double_t dNdyRightH = dNdyIntegrandFuncHAGE -> Integral(rightCutH,10.);
// Errors:
Double_t dETdEtaLErrH =
dETdEtaIntegrandFuncHAGE->IntegralError(0.,leftCutH,
p->GetParams(),
p->GetCovarianceMatrix().GetMatrixArray());
Double_t dETdEtaRErrH =
dETdEtaIntegrandFuncHAGE->IntegralError(rightCutH,10.,
p->GetParams(),
p->GetCovarianceMatrix().GetMatrixArray());
Double_t dETdyLErrH =
dETdyIntegrandFuncHAGE->IntegralError(0.,leftCutH,
p->GetParams(),
p->GetCovarianceMatrix().GetMatrixArray());
Double_t dETdyRErrH =
dETdyIntegrandFuncHAGE->IntegralError(rightCutH,10.,
p->GetParams(),
p->GetCovarianceMatrix().GetMatrixArray());
Double_t dNdEtaLErrH =
dNdEtaIntegrandFuncHAGE->IntegralError(0.,leftCutH,
p->GetParams(),
p->GetCovarianceMatrix().GetMatrixArray());
Double_t dNdEtaRErrH =
dETdEtaIntegrandFuncHAGE->IntegralError(rightCutH,10.,
p->GetParams(),
p->GetCovarianceMatrix().GetMatrixArray());
Double_t dNdyLErrH =
dNdyIntegrandFuncHAGE->IntegralError(0.,leftCutH,
p->GetParams(),
p->GetCovarianceMatrix().GetMatrixArray());
Double_t dNdyRErrH =
dNdyIntegrandFuncHAGE->IntegralError(rightCutH,10.,
p->GetParams(),
p->GetCovarianceMatrix().GetMatrixArray());
Double_t dETdEta_dH = *(integralDataPtr+0);
Double_t dETdEta_d_errH = *(integralDataPtr+1);
Double_t dETdEtaTotalH = dETdEtaLeftH+dETdEta_dH+dETdEtaRightH;
Double_t dETdEtaTErrH = dETdEtaLErrH+dETdEta_d_errH+dETdEtaRErrH;
Double_t dETdy_dH = *(integralDataPtr+2);
Double_t dETdy_d_errH = *(integralDataPtr+3);
Double_t dETdyTotalH = dETdyLeftH+dETdy_dH+dETdyRightH;
Double_t dETdyTErrH = dETdyLErrH+dETdy_d_errH+dETdyRErrH;
Double_t dNdEta_dH = *(integralDataPtr+4);
Double_t dNdEta_d_errH = *(integralDataPtr+5);
Double_t dNdEtaTotalH = dNdEtaLeftH+dNdEta_dH+dNdEtaRightH;
Double_t dNdEtaTErrH = dNdEtaLErrH+dNdEta_d_errH+dNdEtaRErrH;
Double_t dNdy_dH = *(integralDataPtr+6);
Double_t dNdy_d_errH = *(integralDataPtr+7);
Double_t dNdyTotalH = dNdyLeftH+dNdy_dH+dNdyRightH;
Double_t dNdyTErrH = dNdyLErrH+dNdy_d_errH+dNdyRErrH;
cout <<"Integral from data for histo "<<breakOutForTesting+1<<": "<<*(integralDataPtr+0)<<endl;// 357.633 for pi minus cent 0
cout<<"-----------------------------------"<<endl;
//------ end Find integrals left and right of data points ----//
//------ begin - assign Npart and errors from BES paper -----//
Int_t* NpartAndArrPtrH;
Int_t NpartH;
Int_t NpartErrH;
NpartAndArrPtrH = getNpartAndErr(collEn,centrality);
NpartH = *(NpartAndArrPtrH+0);
NpartErrH = *(NpartAndArrPtrH+1);
//------ end - assign Npart and errors from BES paper -------//
//-- Output results to file-----------------------------
datFile << "hag\t"<<collEn << "\t"
<< particleID << "\t"
<< centrality << "\t"
<< mass << "\t"
<< A <<"\t"
<< AErr <<"\t"
<< tempH <<"\t"
<< tempHErr <<"\t"
<< nH <<"\t"
<< nHErr <<"\t"
<< dETdEta_dH << "\t" //dETdEta_d
<< dETdEta_d_errH<< "\t" //dETdEta_d_err
<< dETdEtaLeftH << "\t"
<< dETdEtaLErrH << "\t"
<< dETdEtaRightH << "\t"
<< dETdEtaRErrH << "\t"
<< dETdEtaTotalH<< "\t" // dETdEtaTotal
<< dETdEtaTErrH << "\t"
<< dETdy_dH << "\t" //dETdy_d
<< dETdy_d_errH<< "\t" //dETdy_d_err
<< dETdyLeftH<< "\t"
<< dETdyLErrH << "\t"
<< dETdyRightH << "\t"
<< dETdyRErrH << "\t"
<< dETdyTotalH<< "\t" // dETdyTotal
<< dETdyTErrH << "\t"
<< dNdEta_dH << "\t" //dNdEta_d
<< dNdEta_d_errH<< "\t" //dNdEta_d_err
<< dNdEtaLeftH << "\t"
<< dNdEtaLErrH << "\t"
<< dNdEtaRightH << "\t"
<< dNdEtaRErrH << "\t"
<< dNdEtaTotalH << "\t" // dNdEtaTotal
<< dNdEtaTErrH << "\t"
<< dNdy_dH << "\t" //dNdy_d
<< dNdy_d_errH<< "\t" //dNdy_d_err
<< dNdyLeftH << "\t"
<< dNdyLErrH << "\t"
<< dNdyRightH << "\t"
<< dNdyRErrH << "\t"
<< dNdyTotalH << "\t" // dNdyTotal
<< dNdyTErrH << "\t"
<< NpartH << "\t"