forked from alisw/AliRoot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAliFastGlauber.cxx
More file actions
1885 lines (1733 loc) · 52.3 KB
/
Copy pathAliFastGlauber.cxx
File metadata and controls
1885 lines (1733 loc) · 52.3 KB
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
/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
* Author: The ALICE Off-line Project. *
* Contributors are mentioned in the code where appropriate. *
* *
* Permission to use, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
* without fee, provided that the above copyright notice appears in all *
* copies and that both the copyright notice and this permission notice *
* appear in the supporting documentation. The authors make no claims *
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
/* $Id$ */
//
// Utility class to make simple Glauber type calculations
// for SYMMETRIC collision geometries (AA):
// Impact parameter, production points, reaction plane dependence
//
// The SimulateTrigger method can be used for simple MB and hard-process
// (binary scaling) trigger studies.
//
// Some basic quantities can be visualized directly.
//
// The default set-up for PbPb or AUAu collisions can be read from a file
// calling Init(1) or Init(2) if you want to read Almonds too.
//
// ***** If you change settings dont forget to call init afterwards, *****
// ***** in order to update the formulas with the new parameters. *****
//
// Author: andreas.morsch@cern.ch
//=================== Added by A. Dainese 11/02/04 ===========================
// Calculate path length for a parton with production point (x0,y0)
// and propagation direction (ux=cos(phi0),uy=sin(phi0))
// in a collision with impact parameter b and functions that make use
// of it.
//=================== Added by A. Dainese 05/03/04 ===========================
// Calculation of line integrals I0 and I1
// integral0 = \int_0^ellCut dl*(T_A*T_B)(x0+l*ux,y0+l*uy)
// integral1 = \int_0^ellCut dl*l*(T_A*T_B)(x0+l*ux,y0+l*uy)
// mostly for use in the Quenching class
//=================== Added by C. Loizdes 27/03/04 ===========================
// Handling of AuAu collisions
// More get/set functions
// Comments, units and clearing of code
//
// from AliRoot
#include "AliFastGlauber.h"
// from root
#include <TCanvas.h>
#include <TF1.h>
#include <TF2.h>
#include <TFile.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TLegend.h>
#include <TMath.h>
#include <TRandom.h>
#include <TStyle.h>
ClassImp(AliFastGlauber)
Float_t AliFastGlauber::fgBMax = 0.;
TF1* AliFastGlauber::fgWSb = NULL;
TF1* AliFastGlauber::fgRWSb = NULL;
TF2* AliFastGlauber::fgWSbz = NULL;
TF1* AliFastGlauber::fgWSz = NULL;
TF1* AliFastGlauber::fgWSta = NULL;
TF2* AliFastGlauber::fgWStarfi = NULL;
TF2* AliFastGlauber::fgWAlmond = NULL;
TF1* AliFastGlauber::fgWStaa = NULL;
TF1* AliFastGlauber::fgWSgeo = NULL;
TF1* AliFastGlauber::fgWSbinary = NULL;
TF1* AliFastGlauber::fgWSN = NULL;
TF1* AliFastGlauber::fgWPathLength0 = NULL;
TF1* AliFastGlauber::fgWPathLength = NULL;
TF1* AliFastGlauber::fgWEnergyDensity = NULL;
TF1* AliFastGlauber::fgWIntRadius = NULL;
TF2* AliFastGlauber::fgWKParticipants = NULL;
TF1* AliFastGlauber::fgWParticipants = NULL;
TF2* AliFastGlauber::fgWAlmondCurrent = NULL;
TF2* AliFastGlauber::fgWAlmondFixedB[40];
const Int_t AliFastGlauber::fgkMCInts = 100000;
AliFastGlauber* AliFastGlauber::fgGlauber = NULL;
AliFastGlauber::AliFastGlauber():
fWSr0(0.),
fWSd(0.),
fWSw(0.),
fWSn(0.),
fSigmaHard(0.),
fSigmaNN(0.),
fA(0),
fBmin(0.),
fBmax(0.),
fEllDef(0),
fName()
{
// Default Constructor
// Defaults for Pb
SetMaxImpact();
SetLengthDefinition();
SetPbPbLHC();
fXY[0] = fXY[1] = 0;
fI0I1[0] = fI0I1[1] = 0;
}
AliFastGlauber::AliFastGlauber(const AliFastGlauber & gl)
:TObject(gl),
fWSr0(0.),
fWSd(0.),
fWSw(0.),
fWSn(0.),
fSigmaHard(0.),
fSigmaNN(0.),
fA(0),
fBmin(0.),
fBmax(0.),
fEllDef(0),
fName()
{
// Copy constructor
gl.Copy(*this);
fXY[0] = fXY[1] = 0;
fI0I1[0] = fI0I1[1] = 0;
}
AliFastGlauber* AliFastGlauber::Instance()
{
// Set random number generator
if (fgGlauber) {
return fgGlauber;
} else {
fgGlauber = new AliFastGlauber();
return fgGlauber;
}
}
AliFastGlauber::~AliFastGlauber()
{
// Destructor
for(Int_t k=0; k<40; k++) delete fgWAlmondFixedB[k];
}
void AliFastGlauber::SetAuAuRhic()
{
//Set all parameters for RHIC
SetWoodSaxonParametersAu();
SetHardCrossSection();
SetNNCrossSection(42);
SetNucleus(197);
SetFileName("$(ALICE_ROOT)/FASTSIM/data/glauberAuAu.root");
}
void AliFastGlauber::SetPbPbLHC()
{
//Set all parameters for LHC
SetWoodSaxonParametersPb();
SetHardCrossSection();
SetNNCrossSection();
SetNucleus();
SetFileName();
}
void AliFastGlauber::Init(Int_t mode)
{
// Initialisation
// mode = 0; all functions are calculated
// mode = 1; overlap function is read from file (for Pb-Pb only)
// mode = 2; interaction almond functions are read from file
// USE THIS FOR PATH LENGTH CALC.!
//
//
Reset();
//
//
// Wood-Saxon
//
fgWSb = new TF1("WSb", WSb, 0, fgBMax, 4);
fgWSb->SetParameter(0, fWSr0);
fgWSb->SetParameter(1, fWSd);
fgWSb->SetParameter(2, fWSw);
fgWSb->SetParameter(3, fWSn);
fgRWSb = new TF1("RWSb", RWSb, 0, fgBMax, 4);
fgRWSb->SetParameter(0, fWSr0);
fgRWSb->SetParameter(1, fWSd);
fgRWSb->SetParameter(2, fWSw);
fgRWSb->SetParameter(3, fWSn);
fgWSbz = new TF2("WSbz", WSbz, 0, fgBMax, 0, fgBMax, 4);
fgWSbz->SetParameter(0, fWSr0);
fgWSbz->SetParameter(1, fWSd);
fgWSbz->SetParameter(2, fWSw);
fgWSbz->SetParameter(3, fWSn);
fgWSz = new TF1("WSz", WSz, 0, fgBMax, 5);
fgWSz->SetParameter(0, fWSr0);
fgWSz->SetParameter(1, fWSd);
fgWSz->SetParameter(2, fWSw);
fgWSz->SetParameter(3, fWSn);
//
// Thickness
//
fgWSta = new TF1("WSta", WSta, 0., fgBMax, 0);
//
// Overlap Kernel
//
fgWStarfi = new TF2("WStarfi", WStarfi, 0., fgBMax, 0., TMath::Pi(), 1);
fgWStarfi->SetParameter(0, 0.);
fgWStarfi->SetNpx(200);
fgWStarfi->SetNpy(20);
//
// Participants Kernel
//
fgWKParticipants = new TF2("WKParticipants", WKParticipants, 0., fgBMax, 0., TMath::Pi(), 3);
fgWKParticipants->SetParameter(0, 0.);
fgWKParticipants->SetParameter(1, fSigmaNN);
fgWKParticipants->SetParameter(2, fA);
fgWKParticipants->SetNpx(200);
fgWKParticipants->SetNpy(20);
//
// Overlap and Participants
//
if (!mode) {
fgWStaa = new TF1("WStaa", WStaa, 0., fgBMax, 1);
fgWStaa->SetNpx(100);
fgWStaa->SetParameter(0,fA);
fgWStaa->SetNpx(100);
fgWParticipants = new TF1("WParticipants", WParticipants, 0., fgBMax, 2);
fgWParticipants->SetParameter(0, fSigmaNN);
fgWParticipants->SetParameter(1, fA);
fgWParticipants->SetNpx(100);
} else {
Info("Init","Reading overlap function from file %s",fName.Data());
TFile* f = new TFile(fName.Data());
if(!f->IsOpen()){
Fatal("Init", "Could not open file %s",fName.Data());
}
fgWStaa = (TF1*) f->Get("WStaa");
fgWParticipants = (TF1*) f->Get("WParticipants");
delete f;
}
//
// Energy Density
//
fgWEnergyDensity = new TF1("WEnergyDensity", WEnergyDensity, 0., 2. * fWSr0, 1);
fgWEnergyDensity->SetParameter(0, fWSr0 + 1.);
//
// Geometrical Cross-Section
//
fgWSgeo = new TF1("WSgeo", WSgeo, 0., fgBMax, 1);
fgWSgeo->SetParameter(0,fSigmaNN); //mbarn
fgWSgeo->SetNpx(100);
//
// Hard cross section (binary collisions)
//
fgWSbinary = new TF1("WSbinary", WSbinary, 0., fgBMax, 1);
fgWSbinary->SetParameter(0, fSigmaHard); //mbarn
fgWSbinary->SetNpx(100);
//
// Hard collisions per event
//
fgWSN = new TF1("WSN", WSN, 0.01, fgBMax, 1);
fgWSN->SetNpx(100);
//
// Almond shaped interaction region
//
fgWAlmond = new TF2("WAlmond", WAlmond, -fgBMax, fgBMax, -fgBMax, fgBMax, 1);
fgWAlmond->SetParameter(0, 0.);
fgWAlmond->SetNpx(200);
fgWAlmond->SetNpy(200);
if(mode==2) {
Info("Init","Reading interaction almonds from file: %s",fName.Data());
Char_t almondName[100];
TFile* ff = new TFile(fName.Data());
for(Int_t k=0; k<40; k++) {
snprintf(almondName,100, "WAlmondFixedB%d",k);
fgWAlmondCurrent = (TF2*)ff->Get(almondName);
fgWAlmondFixedB[k] = fgWAlmondCurrent;
}
delete ff;
}
fgWIntRadius = new TF1("WIntRadius", WIntRadius, 0., fgBMax, 1);
fgWIntRadius->SetParameter(0, 0.);
//
// Path Length as a function of Phi
//
fgWPathLength0 = new TF1("WPathLength0", WPathLength0, -TMath::Pi(), TMath::Pi(), 2);
fgWPathLength0->SetParameter(0, 0.);
fgWPathLength0->SetParameter(1, 0.); //Pathlength definition
fgWPathLength = new TF1("WPathLength", WPathLength, -TMath::Pi(), TMath::Pi(), 3);
fgWPathLength->SetParameter(0, 0.); //Impact Parameter
fgWPathLength->SetParameter(1, 1000.); //Number of interactions used for average
fgWPathLength->SetParameter(2, 0); //Pathlength definition
}
void AliFastGlauber::Reset() const
{
//
// Reset dynamic allocated formulas
// in case init is called twice
if(fgWSb) delete fgWSb;
if(fgRWSb) delete fgRWSb;
if(fgWSbz) delete fgWSbz;
if(fgWSz) delete fgWSz;
if(fgWSta) delete fgWSta;
if(fgWStarfi) delete fgWStarfi;
if(fgWAlmond) delete fgWAlmond;
if(fgWStaa) delete fgWStaa;
if(fgWSgeo) delete fgWSgeo;
if(fgWSbinary) delete fgWSbinary;
if(fgWSN) delete fgWSN;
if(fgWPathLength0) delete fgWPathLength0;
if(fgWPathLength) delete fgWPathLength;
if(fgWEnergyDensity) delete fgWEnergyDensity;
if(fgWIntRadius) delete fgWIntRadius;
if(fgWKParticipants) delete fgWKParticipants;
if(fgWParticipants) delete fgWParticipants;
}
void AliFastGlauber::DrawWSb() const
{
//
// Draw Wood-Saxon Nuclear Density Function
//
TCanvas *c1 = new TCanvas("c1","Wood Saxon",400,10,600,700);
c1->cd();
Double_t max=fgWSb->GetMaximum(0.,fgBMax)*1.01;
TH2F *h2f=new TH2F("h2fwsb","Wood Saxon: #rho(r) = n (1-#omega(r/r_{0})^2)/(1+exp((r-r_{0})/d)) [fm^{-3}]",2,0,fgBMax,2,0,max);
h2f->SetStats(0);
h2f->GetXaxis()->SetTitle("r [fm]");
h2f->GetYaxis()->SetNoExponent(kTRUE);
h2f->GetYaxis()->SetTitle("#rho [fm^{-3}]");
h2f->Draw();
fgWSb->Draw("same");
TLegend *l1a = new TLegend(0.45,0.6,.90,0.8);
l1a->SetFillStyle(0);
l1a->SetBorderSize(0);
Char_t label[100];
snprintf(label,100, "r_{0} = %.2f fm",fWSr0);
l1a->AddEntry(fgWSb,label,"");
snprintf(label,100, "d = %.2f fm",fWSd);
l1a->AddEntry(fgWSb,label,"");
snprintf(label,100, "n = %.2e fm^{-3}",fWSn);
l1a->AddEntry(fgWSb,label,"");
snprintf(label,100, "#omega = %.2f",fWSw);
l1a->AddEntry(fgWSb,label,"");
l1a->Draw();
c1->Update();
}
void AliFastGlauber::DrawOverlap() const
{
//
// Draw Overlap Function
//
TCanvas *c2 = new TCanvas("c2","Overlap",400,10,600,700);
c2->cd();
Double_t max=fgWStaa->GetMaximum(0,fgBMax)*1.01;
TH2F *h2f=new TH2F("h2ftaa","Overlap function: T_{AB} [mbarn^{-1}]",2,0,fgBMax,2,0, max);
h2f->SetStats(0);
h2f->GetXaxis()->SetTitle("b [fm]");
h2f->GetYaxis()->SetTitle("T_{AB} [mbarn^{-1}]");
h2f->Draw();
fgWStaa->Draw("same");
}
void AliFastGlauber::DrawParticipants() const
{
//
// Draw Number of Participants Npart
//
TCanvas *c3 = new TCanvas("c3","Participants",400,10,600,700);
c3->cd();
Double_t max=fgWParticipants->GetMaximum(0,fgBMax)*1.01;
TH2F *h2f=new TH2F("h2fpart","Number of Participants",2,0,fgBMax,2,0,max);
h2f->SetStats(0);
h2f->GetXaxis()->SetTitle("b [fm]");
h2f->GetYaxis()->SetTitle("N_{part}");
h2f->Draw();
fgWParticipants->Draw("same");
TLegend *l1a = new TLegend(0.50,0.75,.90,0.9);
l1a->SetFillStyle(0);
l1a->SetBorderSize(0);
Char_t label[100];
snprintf(label,100, "#sigma^{inel.}_{NN} = %.1f mbarn",fSigmaNN);
l1a->AddEntry(fgWParticipants,label,"");
l1a->Draw();
c3->Update();
}
void AliFastGlauber::DrawThickness() const
{
//
// Draw Thickness Function
//
TCanvas *c4 = new TCanvas("c4","Thickness",400,10,600,700);
c4->cd();
Double_t max=fgWSta->GetMaximum(0,fgBMax)*1.01;
TH2F *h2f=new TH2F("h2fta","Thickness function: T_{A} [fm^{-2}]",2,0,fgBMax,2,0,max);
h2f->SetStats(0);
h2f->GetXaxis()->SetTitle("b [fm]");
h2f->GetYaxis()->SetTitle("T_{A} [fm^{-2}]");
h2f->Draw();
fgWSta->Draw("same");
}
void AliFastGlauber::DrawGeo() const
{
//
// Draw Geometrical Cross-Section
//
TCanvas *c5 = new TCanvas("c5","Geometrical Cross-Section",400,10,600,700);
c5->cd();
Double_t max=fgWSgeo->GetMaximum(0,fgBMax)*1.01;
TH2F *h2f=new TH2F("h2fgeo","Differential Geometrical Cross-Section: d#sigma^{geo}_{AB}/db [fm]",2,0,fgBMax,2,0,max);
h2f->SetStats(0);
h2f->GetXaxis()->SetTitle("b [fm]");
h2f->GetYaxis()->SetTitle("d#sigma^{geo}_{AB}/db [fm]");
h2f->Draw();
fgWSgeo->Draw("same");
TLegend *l1a = new TLegend(0.10,0.8,.40,0.9);
l1a->SetFillStyle(0);
l1a->SetBorderSize(0);
Char_t label[100];
snprintf(label,100, "#sigma_{NN}^{inel.} = %.1f mbarn",fSigmaNN);
l1a->AddEntry(fgWSgeo,label,"");
l1a->Draw();
c5->Update();
}
void AliFastGlauber::DrawBinary() const
{
//
// Draw Binary Cross-Section
//
TCanvas *c6 = new TCanvas("c6","Binary Cross-Section",400,10,600,700);
c6->cd();
Double_t max=fgWSbinary->GetMaximum(0,fgBMax)*1.01;
TH2F *h2f=new TH2F("h2fbinary","Differential Binary Cross-Section: #sigma^{hard}_{NN} dT_{AB}/db [fm]",2,0,fgBMax,2,0,max);
h2f->SetStats(0);
h2f->GetXaxis()->SetTitle("b [fm]");
h2f->GetYaxis()->SetTitle("d#sigma^{hard}_{AB}/db [fm]");
h2f->Draw();
fgWSbinary->Draw("same");
TLegend *l1a = new TLegend(0.50,0.8,.90,0.9);
l1a->SetFillStyle(0);
l1a->SetBorderSize(0);
Char_t label[100];
snprintf(label,100, "#sigma_{NN}^{hard} = %.1f mbarn",fSigmaHard);
l1a->AddEntry(fgWSb,label,"");
l1a->Draw();
c6->Update();
}
void AliFastGlauber::DrawN() const
{
//
// Draw Binaries per event (Ncoll)
//
TCanvas *c7 = new TCanvas("c7","Binaries per event",400,10,600,700);
c7->cd();
Double_t max=fgWSN->GetMaximum(0.01,fgBMax)*1.01;
TH2F *h2f=new TH2F("h2fhardcols","Number of hard collisions: T_{AB} #sigma^{hard}_{NN}/#sigma_{AB}^{geo}",2,0,fgBMax,2,0,max);
h2f->SetStats(0);
h2f->GetXaxis()->SetTitle("b [fm]");
h2f->GetYaxis()->SetTitle("N_{coll}");
h2f->Draw();
fgWSN->Draw("same");
TLegend *l1a = new TLegend(0.50,0.75,.90,0.9);
l1a->SetFillStyle(0);
l1a->SetBorderSize(0);
Char_t label[100];
snprintf(label,100, "#sigma^{hard}_{NN} = %.1f mbarn",fSigmaHard);
l1a->AddEntry(fgWSN,label,"");
snprintf(label,100, "#sigma^{inel.}_{NN} = %.1f mbarn",fSigmaNN);
l1a->AddEntry(fgWSN,label,"");
l1a->Draw();
c7->Update();
}
void AliFastGlauber::DrawKernel(Double_t b) const
{
//
// Draw Kernel
//
TCanvas *c8 = new TCanvas("c8","Kernel",400,10,600,700);
c8->cd();
fgWStarfi->SetParameter(0, b);
TH2F *h2f=new TH2F("h2fkernel","Kernel of Overlap function: d^{2}T_{AB}/dr/d#phi [fm^{-3}]",2,0,fgBMax,2,0,TMath::Pi());
h2f->SetStats(0);
h2f->GetXaxis()->SetTitle("r [fm]");
h2f->GetYaxis()->SetTitle("#phi [rad]");
h2f->Draw();
fgWStarfi->Draw("same");
TLegend *l1a = new TLegend(0.65,0.8,.90,0.9);
l1a->SetFillStyle(0);
l1a->SetBorderSize(0);
Char_t label[100];
snprintf(label, 100, "b = %.1f fm",b);
l1a->AddEntry(fgWStarfi,label,"");
l1a->Draw();
c8->Update();
}
void AliFastGlauber::DrawAlmond(Double_t b) const
{
//
// Draw Interaction Almond
//
TCanvas *c9 = new TCanvas("c9","Almond",400,10,600,700);
c9->cd();
fgWAlmond->SetParameter(0, b);
TH2F *h2f=new TH2F("h2falmond","Interaction Almond [fm^{-4}]",2,-fgBMax, fgBMax, 2, -fgBMax, fgBMax);
h2f->SetStats(0);
h2f->GetXaxis()->SetTitle("x [fm]");
h2f->GetYaxis()->SetTitle("y [fm]");
h2f->Draw("");
gStyle->SetPalette(1);
fgWAlmond->Draw("colzsame");
TLegend *l1a = new TLegend(0.65,0.8,.90,0.9);
l1a->SetFillStyle(0);
l1a->SetBorderSize(0);
Char_t label[100];
snprintf(label, 100, "b = %.1f fm",b);
l1a->AddEntry(fgWAlmond,label,"");
l1a->Draw();
c9->Update();
}
void AliFastGlauber::DrawEnergyDensity() const
{
//
// Draw energy density
//
TCanvas *c10 = new TCanvas("c10","Energy Density",400, 10, 600, 700);
c10->cd();
fgWEnergyDensity->SetMinimum(0.);
Double_t max=fgWEnergyDensity->GetMaximum(0,fgWEnergyDensity->GetParameter(0))*1.01;
TH2F *h2f=new TH2F("h2fenergydens","Energy density",2,0,fgBMax,2,0,max);
h2f->SetStats(0);
h2f->GetXaxis()->SetTitle("b [fm]");
h2f->GetYaxis()->SetTitle("fm^{-4}");
h2f->Draw();
fgWEnergyDensity->Draw("same");
c10->Update();
}
void AliFastGlauber::DrawPathLength0(Double_t b, Int_t iopt) const
{
//
// Draw Path Length
//
TCanvas *c11 = new TCanvas("c11","Path Length",400,10,600,700);
c11->cd();
fgWPathLength0->SetParameter(0, b);
fgWPathLength0->SetParameter(1, Double_t(iopt));
fgWPathLength0->SetMinimum(0.);
fgWPathLength0->SetMaximum(10.);
TH2F *h2f=new TH2F("h2fpathlength0","Path length",2,-TMath::Pi(), TMath::Pi(),2,0,10.);
h2f->SetStats(0);
h2f->GetXaxis()->SetTitle("#phi [rad]");
h2f->GetYaxis()->SetTitle("l [fm]");
h2f->Draw();
fgWPathLength0->Draw("same");
}
void AliFastGlauber::DrawPathLength(Double_t b , Int_t ni, Int_t iopt) const
{
//
// Draw Path Length
//
TCanvas *c12 = new TCanvas("c12","Path Length",400,10,600,700);
c12->cd();
fgWAlmond->SetParameter(0, b);
fgWPathLength->SetParameter(0, b);
fgWPathLength->SetParameter(1, Double_t (ni));
fgWPathLength->SetParameter(2, Double_t (iopt));
fgWPathLength->SetMinimum(0.);
fgWPathLength->SetMaximum(10.);
TH2F *h2f=new TH2F("h2fpathlength","Path length",2,-TMath::Pi(), TMath::Pi(),2,0,10.);
h2f->SetStats(0);
h2f->GetXaxis()->SetTitle("#phi [rad]");
h2f->GetYaxis()->SetTitle("l [fm]");
h2f->Draw();
fgWPathLength->Draw("same");
}
void AliFastGlauber::DrawIntRadius(Double_t b) const
{
//
// Draw Interaction Radius
//
TCanvas *c13 = new TCanvas("c13","Interaction Radius",400,10,600,700);
c13->cd();
fgWIntRadius->SetParameter(0, b);
fgWIntRadius->SetMinimum(0);
Double_t max=fgWIntRadius->GetMaximum(0,fgBMax)*1.01;
TH2F *h2f=new TH2F("h2fintradius","Interaction Density",2,0.,fgBMax,2,0,max);
h2f->SetStats(0);
h2f->GetXaxis()->SetTitle("r [fm]");
h2f->GetYaxis()->SetTitle("[fm^{-3}]");
h2f->Draw();
fgWIntRadius->Draw("same");
}
Double_t AliFastGlauber::WSb(const Double_t* x, const Double_t* par)
{
//
// Woods-Saxon Parameterisation
// as a function of radius (xx)
//
const Double_t kxx = x[0]; //fm
const Double_t kr0 = par[0]; //fm
const Double_t kd = par[1]; //fm
const Double_t kw = par[2]; //no units
const Double_t kn = par[3]; //fm^-3 (used to normalize integral to one)
Double_t y = kn * (1.+kw*(kxx/kr0)*(kxx/kr0))/(1.+TMath::Exp((kxx-kr0)/kd));
return y; //fm^-3
}
Double_t AliFastGlauber::RWSb(const Double_t* x, const Double_t* par)
{
//
// Woods-Saxon Parameterisation
// as a function of radius (xx)
// times r**2
const Double_t kxx = x[0]; //fm
const Double_t kr0 = par[0]; //fm
const Double_t kd = par[1]; //fm
const Double_t kw = par[2]; //no units
const Double_t kn = par[3]; //fm^-3 (used to normalize integral to one)
Double_t y = kxx * kxx * kn * (1.+kw*(kxx/kr0)*(kxx/kr0))/(1.+TMath::Exp((kxx-kr0)/kd));
return y; //fm^-1
}
Double_t AliFastGlauber::WSbz(const Double_t* x, const Double_t* par)
{
//
// Wood Saxon Parameterisation
// as a function of z and b
//
const Double_t kbb = x[0]; //fm
const Double_t kzz = x[1]; //fm
const Double_t kr0 = par[0]; //fm
const Double_t kd = par[1]; //fm
const Double_t kw = par[2]; //no units
const Double_t kn = par[3]; //fm^-3 (used to normalize integral to one)
const Double_t kxx = TMath::Sqrt(kbb*kbb+kzz*kzz);
Double_t y = kn * (1.+kw*(kxx/kr0)*(kxx/kr0))/(1.+TMath::Exp((kxx-kr0)/kd));
return y; //fm^-3
}
Double_t AliFastGlauber::WSz(const Double_t* x, const Double_t* par)
{
//
// Wood Saxon Parameterisation
// as a function of z for fixed b
//
const Double_t kzz = x[0]; //fm
const Double_t kr0 = par[0]; //fm
const Double_t kd = par[1]; //fm
const Double_t kw = par[2]; //no units
const Double_t kn = par[3]; //fm^-3 (used to normalize integral to one)
const Double_t kbb = par[4]; //fm
const Double_t kxx = TMath::Sqrt(kbb*kbb+kzz*kzz);
Double_t y = kn * (1.+kw*(kxx/kr0)*(kxx/kr0))/(1.+TMath::Exp((kxx-kr0)/kd));
return y; //fm^-3
}
Double_t AliFastGlauber::WSta(const Double_t* x, const Double_t* /*par*/)
{
//
// Thickness function T_A
// as a function of b
//
const Double_t kb = x[0];
fgWSz->SetParameter(4, kb);
Double_t y = 2. * fgWSz->Integral(0., fgBMax);
return y; //fm^-2
}
Double_t AliFastGlauber::WStarfi(const Double_t* x, const Double_t* par)
{
//
// Kernel for overlap function: T_A(s)*T_A(s-b)
// as a function of r and phi
const Double_t kr1 = x[0];
const Double_t kphi = x[1];
const Double_t kb = par[0];
const Double_t kr2 = TMath::Sqrt(kr1*kr1 + kb*kb - 2.*kr1*kb*TMath::Cos(kphi));
Double_t y = kr1 * fgWSta->Eval(kr1) * fgWSta->Eval(kr2);
return y; //fm^-3
}
Double_t AliFastGlauber::WStaa(const Double_t* x, const Double_t* par)
{
//
// Overlap function
// T_{AB}=Int d2s T_A(s)*T_B(s-b)
// as a function of b
// (normalized to fA*fB)
//
const Double_t kb = x[0];
const Double_t ka = par[0];
fgWStarfi->SetParameter(0, kb);
// root integration seems to fail
/*
Double_t al[2];
Double_t bl[2];
al[0] = 1e-6;
al[1] = fgBMax;
bl[0] = 0.;
bl[1] = TMath::Pi();
Double_t err;
Double_t y = 2. * 208. * 208. * fgWStarfi->IntegralMultiple(2, al, bl, 0.001, err);
printf("WStaa: %.5e %.5e %.5e\n", b, y, err);
*/
//
// MC Integration
//
Double_t y = 0;
for (Int_t i = 0; i < fgkMCInts; i++)
{
const Double_t kphi = TMath::Pi() * gRandom->Rndm();
const Double_t kb1 = fgBMax * gRandom->Rndm();
y += fgWStarfi->Eval(kb1, kphi);
}
y *= 2. * TMath::Pi() * fgBMax / fgkMCInts; //fm^-2
y *= ka * ka * 0.1; //mbarn^-1
return y;
}
Double_t AliFastGlauber::WKParticipants(const Double_t* x, const Double_t* par)
{
//
// Kernel for number of participants
// as a function of r and phi
//
const Double_t kr1 = x[0];
const Double_t kphi = x[1];
const Double_t kb = par[0]; //fm
const Double_t ksig = par[1]; //mbarn
const Double_t ka = par[2]; //mass number
const Double_t kr2 = TMath::Sqrt(kr1*kr1 +kb*kb - 2.*kr1*kb*TMath::Cos(kphi));
const Double_t kxsi = fgWSta->Eval(kr2) * ksig * 0.1; //no units
/*
Double_t y=(1-TMath::Power((1-xsi),aa))
*/
Double_t a = ka;
Double_t sum = ka * kxsi;
Double_t y = sum;
for (Int_t i = 1; i <= ka; i++)
{
a--;
sum *= (-kxsi) * a / Float_t(i+1);
y += sum;
}
y *= kr1 * fgWSta->Eval(kr1);
return y; //fm^-1
}
Double_t AliFastGlauber::WParticipants(const Double_t* x, const Double_t* par)
{
//
// Number of Participants as
// a function of b
//
const Double_t kb = x[0];
const Double_t ksig = par[0]; //mbarn
const Double_t ka = par[1]; //mass number
fgWKParticipants->SetParameter(0, kb);
fgWKParticipants->SetParameter(1, ksig);
fgWKParticipants->SetParameter(2, ka);
//
// MC Integration
//
Double_t y = 0;
for (Int_t i = 0; i < fgkMCInts; i++)
{
const Double_t kphi = TMath::Pi() * gRandom->Rndm();
const Double_t kb1 = fgBMax * gRandom->Rndm();
y += fgWKParticipants->Eval(kb1, kphi);
}
y *= 2. * ka * 2. * TMath::Pi() * fgBMax / fgkMCInts;
return y; //no units
}
Double_t AliFastGlauber::WSgeo(const Double_t* x, const Double_t* par)
{
//
// Geometrical Cross-Section
// as a function of b
//
const Double_t kb = x[0]; //fm
const Double_t ksigNN = par[0]; //mbarn
const Double_t ktaa = fgWStaa->Eval(kb); //mbarn^-1
Double_t y = 2. * TMath::Pi() * kb * (1. - TMath::Exp(- ksigNN * ktaa));
return y; //fm
}
Double_t AliFastGlauber::WSbinary(const Double_t* x, const Double_t* par)
{
//
// Number of binary hard collisions
// as a function of b
//
const Double_t kb = x[0]; //fm
const Double_t ksig = par[0]; //mbarn
const Double_t ktaa = fgWStaa->Eval(kb); //mbarn^-1
Double_t y = 2. * TMath::Pi() * kb * ksig * ktaa;
return y; //fm
}
Double_t AliFastGlauber::WSN(const Double_t* x, const Double_t* /*par*/)
{
//
// Number of hard processes per event
// as a function of b
const Double_t kb = x[0];
Double_t y = fgWSbinary->Eval(kb)/fgWSgeo->Eval(kb);
return y; //no units
}
Double_t AliFastGlauber::WEnergyDensity(const Double_t* x, const Double_t* par)
{
//
// Initial energy density
// as a function of the impact parameter
//
const Double_t kb = x[0];
const Double_t krA = par[0];
//
// Attention: area of transverse reaction zone in hard-sphere approximation !
const Double_t krA2=krA*krA;
const Double_t kb2=kb*kb;
const Double_t ksaa = (TMath::Pi() - 2. * TMath::ASin(kb/ 2./ krA)) * krA2
- kb * TMath::Sqrt(krA2 - kb2/ 4.); //fm^2
const Double_t ktaa = fgWStaa->Eval(kb); //mbarn^-1
Double_t y=ktaa/ksaa*10;
return y; //fm^-4
}
Double_t AliFastGlauber::WAlmond(const Double_t* x, const Double_t* par)
{
//
// Almond shaped interaction region
// as a function of cartesian x,y.
//
const Double_t kb = par[0];
const Double_t kxx = x[0] + kb/2.;
const Double_t kyy = x[1];
const Double_t kr1 = TMath::Sqrt(kxx*kxx + kyy*kyy);
const Double_t kphi = TMath::ATan2(kyy,kxx);
const Double_t kr2 = TMath::Sqrt(kr1*kr1 + kb*kb - 2.*kr1*kb*TMath::Cos(kphi));
//
// Interaction probability calculated as product of thicknesses
//
Double_t y = fgWSta->Eval(kr1) * fgWSta->Eval(kr2);
return y; //fm^-4
}
Double_t AliFastGlauber::WIntRadius(const Double_t* x, const Double_t* par)
{
//
// Average interaction density over radius
// at which interaction takes place
// as a function of radius
//
const Double_t kr = x[0];
const Double_t kb = par[0];
fgWAlmond->SetParameter(0, kb);
// Average over phi in small steps
const Double_t kdphi = 2. * TMath::Pi() / 100.;
Double_t phi = 0.;
Double_t y = 0.;
for (Int_t i = 0; i < 100; i++) {
const Double_t kxx = kr * TMath::Cos(phi);
const Double_t kyy = kr * TMath::Sin(phi);
y += fgWAlmond->Eval(kxx,kyy);
phi += kdphi;
} // phi loop
// Result multiplied by Jacobian (2 pi r)
y *= 2. * TMath::Pi() * kr / 100.;
return y; //fm^-3
}
Double_t AliFastGlauber::WPathLength0(const Double_t* x, const Double_t* par)
{
//
// Path Length as a function of phi
// for interaction point fixed at (0,0)
// as a function of phi-direction
//
// Phi direction in Almond
const Double_t kphi0 = x[0];
const Double_t kb = par[0];
// Path Length definition
const Int_t kiopt = Int_t(par[1]);
// Step along radial direction phi
const Int_t kNp = 100; // Steps in r
const Double_t kDr = fgBMax/kNp;
Double_t r = 0.;
Double_t rw = 0.;
Double_t w = 0.;
for (Int_t i = 0; i < kNp; i++) {
//
// Transform into target frame
//
const Double_t kxx = r * TMath::Cos(kphi0) + kb / 2.;
const Double_t kyy = r * TMath::Sin(kphi0);
const Double_t kphi = TMath::ATan2(kyy, kxx);
const Double_t kr1 = TMath::Sqrt(kxx*kxx + kyy*kyy);
// Radius in projectile frame
const Double_t kr2 = TMath::Sqrt(kr1*kr1 + kb*kb - 2.*kr1*kb*TMath::Cos(kphi));
const Double_t ky = fgWSta->Eval(kr1) * fgWSta->Eval(kr2);
rw += ky * r;
w += ky;
r += kDr;
} // radial steps
Double_t y=0.;
if (!kiopt) { // My length definition (is exact for hard disk)
if(w) y= 2. * rw / w;
} else {
const Double_t knorm=fgWSta->Eval(1e-4);
if(knorm) y = TMath::Sqrt(2. * rw * kDr / knorm / knorm);
}
return y; //fm
}
Double_t AliFastGlauber::WPathLength(const Double_t* x, const Double_t* par)
{
//
// Path Length as a function of phi
// Interaction point from random distribution
// as a function of the phi-direction
const Double_t kphi0 = x[0];
const Double_t kb = par[0];
fgWAlmond->SetParameter(0, kb);
const Int_t kNpi = Int_t (par[1]); //Number of interactions
const Int_t kiopt = Int_t(par[2]); //Path Length definition
//
// r-steps
//
const Int_t kNp = 100;
const Double_t kDr = fgBMax/Double_t(kNp);
Double_t l = 0.; // Path length
for (Int_t in = 0; in < kNpi; in ++) {
Double_t rw = 0.;
Double_t w = 0.;
// Interaction point
Double_t x0, y0;
fgWAlmond->GetRandom2(x0, y0);
// Initial radius
const Double_t kr0 = TMath::Sqrt(x0*x0 + y0*y0);
const Int_t knps = Int_t ((fgBMax - kr0)/kDr) - 1;
// Radial steps
Double_t r = 0.;
for (Int_t i = 0; (i < knps ); i++) {
// Transform into target frame
const Double_t kxx = x0 + r * TMath::Cos(kphi0) + kb / 2.;
const Double_t kyy = y0 + r * TMath::Sin(kphi0);
const Double_t kphi = TMath::ATan2(kyy, kxx);
const Double_t kr1 = TMath::Sqrt(kxx*kxx + kyy*kyy);
// Radius in projectile frame
const Double_t kr2 = TMath::Sqrt(kr1*kr1 + kb*kb - 2.*kr1*kb*TMath::Cos(kphi));