-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrunglauber_v3.2.C
2520 lines (2363 loc) · 98.4 KB
/
runglauber_v3.2.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
/*F
$Id: runglauber.C 186 2019-01-13 17:33:43Z loizides $
-------------------------------------------------------------------------------------
Latest documentation: https://arxiv.org/abs/1710.07098
-------------------------------------------------------------------------------------
To run the code, you need to have the ROOT (http://root.cern.ch/drupal/)
environment. On the root prompt, then enter
root [0] gSystem->Load("libMathMore")
root [1] .L runglauber_X.Y.C+
(where X.Y denotes the version number).
If you do not have libMathMore comment out "#define HAVE_MATHMORE" below.
See the documentation for more information.
-------------------------------------------------------------------------------------
v3.2: Incorporates changes from v2.7
-------------------------------------------------------------------------------------
v3.1:
Fixes related to spherical nuclei, as well as consistent set of reweighted profiles
for Cu, Au and Xe, see https://arxiv.org/abs/1710.07098v2
-------------------------------------------------------------------------------------
v3.0:
Major update to include separate profile for protons and neutrons, placement of nucleon
dof on lattice, as well as reweighted profiles for recentering,
see https://arxiv.org/abs/1710.07098v1
-------------------------------------------------------------------------------------
v2.7:
New macro "runAndOutputLemonTree" for IP-Jazma input (1808.01276), as well as nucleon
configurations for He4, C, and O from wavefunction calculations, clarified use of Hulthen
for deuteron, harmonic oscillator param for O, and new mode to use GlauberGribov also
in AA (enable with SetCalcAAGG)
-------------------------------------------------------------------------------------
v2.6:
Includes runAndCalcDens macro, as well as definition for Al, and fixes beta4 for Si2,
see https://arxiv.org/abs/1408.2549v8
-------------------------------------------------------------------------------------
v2.5:
Include core/corona determination in Npart, and if requested for area from mc and eccentricity,
as well as various Xe parameterizations including deformation,
see https://arxiv.org/abs/1408.2549v7
-------------------------------------------------------------------------------------
v2.4:
Minor update to include Xenon and fix of the TGlauberMC::Draw function,
see https://arxiv.org/abs/1408.2549v4
-------------------------------------------------------------------------------------
v2.3:
Small bugfixes, see https://arxiv.org/abs/1408.2549v3
-------------------------------------------------------------------------------------
v2.2:
Minor update to provide higher harmonic eccentricities up to n=5, and the average
nucleon--nucleon impact parameter (bNN) in tree output.
-------------------------------------------------------------------------------------
v2.1:
Minor update to include more proton pdfs, see https://arxiv.org/abs/1408.2549v2
-------------------------------------------------------------------------------------
v2.0:
First major update with inclusion of Tritium, Helium-3, and Uranium, as well as the
treatment of deformed nuclei and Glauber-Gribov fluctuations of the proton in p+A
collisions, see https://arxiv.org/abs/1408.2549v1
-------------------------------------------------------------------------------------
v1.1:
First public release of the PHOBOS MC Glauber, see https://arxiv.org/abs/0805.4411
-------------------------------------------------------------------------------------
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#define HAVE_MATHMORE
#if !defined(__CINT__) || defined(__MAKECINT__)
#include <Riostream.h>
#include <TBits.h>
#include <TCanvas.h>
#include <TEllipse.h>
#include <TF1.h>
#include <TF2.h>
#include <TFile.h>
#include <TH2.h>
#include <TLine.h>
#include <TMath.h>
#include <TNamed.h>
#include <TNtuple.h>
#include <TObjArray.h>
#include <TRandom.h>
#include <TRotation.h>
#include <TString.h>
#include <TSystem.h>
#include <TVector3.h>
#ifdef HAVE_MATHMORE
#include <Math/SpecFuncMathMore.h>
#endif
using namespace std;
#endif
#ifndef _runglauber_
#if !defined(__CINT__) || defined(__MAKECINT__)
#define _runglauber_ 3
#endif
//---------------------------------------------------------------------------------
TF1 *getNNProf(Double_t snn=67.6, Double_t omega=0.4, Double_t G=1);
//---------------------------------------------------------------------------------
void runAndSaveNtuple(const Int_t n,
const char *sysA = "Pb",
const char *sysB = "Pb",
const Double_t signn = 67.6,
const Double_t sigwidth = -1,
const Double_t mind = 0.4,
const Double_t omega = -1,
const Double_t noded = -1,
const char *fname = 0);
//---------------------------------------------------------------------------------
void runAndSaveNucleons(const Int_t n,
const char *sysA = "Pb",
const char *sysB = "Pb",
const Double_t signn = 67.6,
const Double_t sigwidth = -1,
const Double_t mind = 0.4,
const Bool_t verbose = 0,
const Double_t bmin = 0.0,
const Double_t bmax = 20.0,
const char *fname = 0);
//---------------------------------------------------------------------------------
void runAndSmearNtuple(const Int_t n,
const Double_t sigs = 0.4,
const char *sysA = "p",
const char *sysB = "Pb",
const Double_t signn = 67.6,
const Double_t mind = 0.4,
const Double_t bmin = 0.0,
const Double_t bmax = 20.0,
const char *fname = 0);
//---------------------------------------------------------------------------------
void runAndOutputLemonTree(const Int_t n,
const Double_t sigs = 0.4,
const char *sysA = "p",
const char *sysB = "Pb",
const Double_t signn = 67.6,
const Double_t mind = 0.4,
const Double_t bmin = 0.0,
const Double_t bmax = 20.0,
const Bool_t ogrid = 0,
const char *fname = 0);
//---------------------------------------------------------------------------------
void runAndCalcDens(const Int_t n,
const Double_t alpha = 0.1,
const char *sysA = "Pb",
const char *sysB = "Pb",
const Double_t signn = 67.6,
const Double_t mind = 0.4,
const char *fname = "glau_dens_hists.root");
//---------------------------------------------------------------------------------
class TGlauNucleon : public TObject
{
protected:
Double32_t fX; //Position of nucleon
Double32_t fY; //Position of nucleon
Double32_t fZ; //Position of nucleon
Int_t fType; //0 = neutron, 1 = proton
Bool_t fInNucleusA; //=1 from nucleus A, =0 from nucleus B
Int_t fNColl; //Number of binary collisions
Double32_t fEn; //Energy
public:
TGlauNucleon() : fX(0), fY(0), fZ(0), fInNucleusA(0), fNColl(0), fEn(0) {}
virtual ~TGlauNucleon() {}
void Collide() {++fNColl;}
Double_t Get2CWeight(Double_t x) const {return 2.*(0.5*(1-x)+0.5*x*fNColl);}
Double_t GetEnergy() const {return fEn;}
Int_t GetNColl() const {return fNColl;}
Int_t GetType() const {return fType;}
Double_t GetX() const {return fX;}
Double_t GetY() const {return fY;}
Double_t GetZ() const {return fZ;}
Bool_t IsNeutron() const {return (fType==0);}
Bool_t IsInNucleusA() const {return fInNucleusA;}
Bool_t IsInNucleusB() const {return !fInNucleusA;}
Bool_t IsProton() const {return (fType==1);}
Bool_t IsSpectator() const {return !fNColl;}
Bool_t IsWounded() const {return fNColl>0;}
void Reset() {fNColl=0;}
void RotateXYZ(Double_t phi, Double_t theta);
void RotateXYZ_3D(Double_t psiX, Double_t psiY, Double_t psiZ);
void SetEnergy(Double_t en) {fEn = en;}
void SetInNucleusA() {fInNucleusA=1;}
void SetInNucleusB() {fInNucleusA=0;}
void SetNColl(Int_t nc) {fNColl = nc;}
void SetType(Bool_t b) {fType = b;}
void SetXYZ(Double_t x, Double_t y, Double_t z) {fX=x; fY=y; fZ=z;}
ClassDef(TGlauNucleon,4) // TGlauNucleon class
};
//---------------------------------------------------------------------------------
ClassImp(TGlauNucleon)
//---------------------------------------------------------------------------------
void TGlauNucleon::RotateXYZ(Double_t phi, Double_t theta)
{
TVector3 v(fX,fY,fZ);
TVector3 vr;
vr.SetMagThetaPhi(1,theta,phi);
v.RotateUz(vr);
fX = v.X();
fY = v.Y();
fZ = v.Z();
}
void TGlauNucleon::RotateXYZ_3D(Double_t psiX, Double_t psiY, Double_t psiZ)
{
TVector3 v(fX,fY,fZ);
v.RotateX(psiX);
v.RotateY(psiY);
v.RotateZ(psiZ);
fX = v.X();
fY = v.Y();
fZ = v.Z();
}
//---------------------------------------------------------------------------------
class TGlauNucleus : public TNamed
{
private:
Int_t fN; //Number of nucleons
Int_t fZ; //Number of protons
Double_t fR; //Parameters of function
Double_t fA; //Parameters of function (fA+fZ=fN)
Double_t fW; //Parameters of function
Double_t fR2; //Parameters of function (for p and n separately)
Double_t fA2; //Parameters of function (for p and n separately)
Double_t fW2; //Parameters of function (for p and n separately)
Double_t fBeta2; //Beta2 (deformed nuclei)
Double_t fBeta4; //Beta4 (deformed nuclei)
Double_t fMinDist; //Minimum separation distance
Double_t fNodeDist; //Average node distance (set to <=0 if you do not want the "crystal lattice")
Double_t fSmearing; //Node smearing (relevant if fNodeDist>0)
Int_t fRecenter; //=1 by default (0=no recentering, 1=recenter all, 2=recenter displacing only one nucleon, 3=recenter by rotation)
Int_t fLattice; //=0 use HCP by default (1=PCS, 2=BCC, 3=FCC)
Double_t fSmax; //Maximum magnitude of cms shift tolerated (99, ie all by default)
Int_t fF; //Type of radial distribution
Int_t fTrials; //Store trials needed to complete nucleus
Int_t fNonSmeared; //Store number of non-smeared-node nucleons
TF1* fFunc1; //!Probability density function rho(r)
TF1* fFunc2; //!Probability density function rho(r) -> if set 1 is for p, 2 is for n
TF2* fFunc3; //!Probability density function rho(r,theta) for deformed nuclei
TObjArray* fNucleons; //!Array of nucleons
Double_t fPhiRot; //!Angle phi for nucleus
Double_t fThetaRot; //!Angle theta for nucleus
Double_t fXRot; //!Angle around X axis for nucleus
Double_t fYRot; //!Angle around Y axis for nucleus
Double_t fZRot; //!Angle around Z axis for nucleus
Double_t fNucArr[6000][20][3]; //!Array of events (max 6000), up to 20 nucleons (only for small nuclei), 3 coordinates
Int_t fNucCounter; //!Event counter
TBits *fIsUsed; //!Bits for lattice use
Double_t fMaxR; //!maximum radius (15fm)
void Lookup(const char* name);
Bool_t TestMinDist(Int_t n, Double_t x, Double_t y, Double_t z) const;
public:
TGlauNucleus(const char* iname="Pb", Int_t iN=0, Double_t iR=0, Double_t ia=0, Double_t iw=0, TF1* ifunc=0);
virtual ~TGlauNucleus();
using TObject::Draw;
void Draw(Double_t xs, Int_t colp, Int_t cols);
Double_t GetA() const {return fA;}
Int_t GetZ() const {return fZ;}
TF1* GetFunc1() const {return GetFuncP();}
TF1* GetFunc2() const {return GetFuncN();}
TF2* GetFunc3() const {return GetFuncDef();}
TF1* GetFuncP() const {return fFunc1;}
TF1* GetFuncN() const {return fFunc2;}
TF2* GetFuncDef() const {return fFunc3;}
Double_t GetMinDist() const {return fMinDist;}
Int_t GetN() const {return fN;}
Double_t GetNodeDist() const {return fNodeDist;}
TObjArray *GetNucleons() const {return fNucleons;}
Int_t GetRecenter() const {return fRecenter;}
Double_t GetR() const {return fR;}
Double_t GetPhiRot() const {return fPhiRot;}
Double_t GetThetaRot() const {return fThetaRot;}
Int_t GetTrials() const {return fTrials;}
Int_t GetNonSmeared() const {return fNonSmeared;}
Double_t GetShiftMax() const {return fSmax;}
Double_t GetW() const {return fW;}
Double_t GetXRot() const {return fXRot;}
Double_t GetYRot() const {return fYRot;}
Double_t GetZRot() const {return fZRot;}
void SetA(Double_t ia, Double_t ia2=-1);
void SetBeta(Double_t b2, Double_t b4);
void SetLattice(Int_t i) {fLattice=i;}
void SetMinDist(Double_t min) {fMinDist=min;}
void SetN(Int_t in) {fN=in;}
void SetNodeDist(Double_t nd) {fNodeDist=nd;}
void SetR(Double_t ir, Double_t ir2=-1);
void SetRecenter(Int_t b) {fRecenter=b;}
void SetShiftMax(Double_t s) {fSmax=s;}
void SetSmearing(Double_t s) {fSmearing=s;}
void SetW(Double_t iw);
TVector3 &ThrowNucleons(Double_t xshift=0.);
ClassDef(TGlauNucleus,6) // TGlauNucleus class
};
//---------------------------------------------------------------------------------
class TGlauberMC : public TNamed
{
public:
class Event {
public:
Float_t Npart; //Number of wounded (participating) nucleons in current event
Float_t Ncoll; //Number of binary collisions in current event
Float_t Nhard; //Number of hard collisions in current event (based on fHardFrac)
Float_t B; //[0,0,16] Impact parameter (b)
Float_t BNN; //[0,0,16] Average NN impact parameter
Float_t Ncollpp; //Ncoll pp
Float_t Ncollpn; //Ncoll pn
Float_t Ncollnn; //Ncoll nn
Float_t VarX; //[0,0,16] Variance of x of wounded nucleons
Float_t VarY; //[0,0,16] Variance of y of wounded nucleons
Float_t VarXY; //[0,0,16] Covariance of x and y of wounded nucleons
Float_t NpartA; //Number of wounded (participating) nucleons in Nucleus A
Float_t NpartB; //Number of wounded (participating) nucleons in Nucleus B
Float_t Npart0; //Number of singly-wounded (participating) nucleons
Float_t AreaW; //[0,0,16] area defined by width of participants
Float_t Psi1; //[0,0,16] psi1
Float_t Ecc1; //[0,0,16] eps1
Float_t Psi2; //[0,0,16] psi2
Float_t Ecc2; //[0,0,16] eps2
Float_t Psi3; //[0,0,16] psi3
Float_t Ecc3; //[0,0,16] eps3
Float_t Psi4; //[0,0,16] psi4
Float_t Ecc4; //[0,0,16] eps4
Float_t Psi5; //[0,0,16] psi5
Float_t Ecc5; //[0,0,16] eps5
Float_t AreaA; //[0,0,16] area defined by "and" of participants
Float_t AreaO; //[0,0,16] area defined by "or" of participants
Float_t X0; //[0,0,16] production point in x
Float_t Y0; //[0,0,16] production point in y
Float_t Phi0; //[0,0,16] direction in phi
Float_t Length; //[0,0,16] length in phi0
Float_t MeanX; //[0,0,16] <x> of wounded nucleons
Float_t MeanY; //[0,0,16] <y> of wounded nucleons
Float_t MeanX2; //[0,0,16] <x^2> of wounded nucleons
Float_t MeanY2; //[0,0,16] <y^2> of wounded nucleons
Float_t MeanXY; //[0,0,16] <xy> of wounded nucleons
Float_t MeanXSystem; //[0,0,16] <x> of all nucleons
Float_t MeanYSystem; //[0,0,16] <y> of all nucleons
Float_t MeanXA; //[0,0,16] <x> of nucleons in nucleus A
Float_t MeanYA; //[0,0,16] <y> of nucleons in nucleus A
Float_t MeanXB; //[0,0,16] <x> of nucleons in nucleus B
Float_t MeanYB; //[0,0,16] <y> of nucleons in nucleus B
Float_t PhiA; //[0,0,16] phi angle nucleus A
Float_t ThetaA; //[0,0,16] theta angle nucleus B
Float_t PhiB; //[0,0,16] phi angle nucleus B
Float_t ThetaB; //[0,0,16] theta angle nucleus B
void Reset() {Npart=0;Ncoll=0;Nhard=0;B=0;BNN=0;Ncollpp=0;Ncollpn=0;Ncollnn=0;VarX=0;VarY=0;VarXY=0;NpartA=0;NpartB=0;Npart0=0;AreaW=0;
Psi1=0;Ecc1=0;Psi2=0;Ecc2=0;Psi3=0;Ecc3=0;Psi4=0;Ecc4=0;Psi5=0;Ecc5=0;
AreaA=0;AreaO=0;X0=0;Y0=0;Phi0=0;Length=0;
MeanX=0;MeanY=0;MeanX2=0;MeanY2=0;MeanXY=0;MeanXSystem=0;MeanYSystem=0;MeanXA=0;MeanYA=0;MeanXB=0;MeanYB=0;
PhiA=0;ThetaA=0;PhiB=0;ThetaB=0;} // order must match that given in vars below
ClassDef(TGlauberMC::Event, 1)
};
public:
TGlauNucleus fANucleus; //Nucleus A
TGlauNucleus fBNucleus; //Nucleus B
protected:
Double_t fXSect; //Nucleon-nucleon cross section
Double_t fXSectOmega; //StdDev of Nucleon-nucleon cross section
Double_t fXSectLambda; //Jacobian from tot to inelastic (Strikman)
Double_t fXSectEvent; //Event value of Nucleon-nucleon cross section
TObjArray* fNucleonsA; //Array of nucleons in nucleus A
TObjArray* fNucleonsB; //Array of nucleons in nucleus B
TObjArray* fNucleons; //Array which joins Nucleus A & B
Int_t fAN; //Number of nucleons in nucleus A
Int_t fBN; //Number of nucleons in nucleus B
TNtuple* fNt; //Ntuple for results (created, but not deleted)
Int_t fEvents; //Number of events with at least one collision
Int_t fTotalEvents; //All events within selected impact parameter range
Double_t fBmin; //Minimum impact parameter to be generated
Double_t fBmax; //Maximum impact parameter to be generated
Double_t fHardFrac; //Fraction of cross section used for Nhard (def=0.65)
Int_t fDetail; //Detail to store (99=all by default)
Bool_t fCalcArea; //If true calculate overlap area via grid (slow, off by default)
Bool_t fCalcLength; //If true calculate path length (slow, off by default)
Bool_t fDoCore; //If true calculate area and eccentricy only for core participants (off by default)
Bool_t fDoAAGG; //If true do Glauber Gribov also for AA
Int_t fMaxNpartFound; //Largest value of Npart obtained
Double_t fPsiN[10]; //Psi N
Double_t fEccN[10]; //Ecc N
Double_t f2Cx; //Two-component x
TF1 *fPTot; //Cross section distribution
TF1 *fNNProf; //NN profile (hard-sphere == 0 by default)
Event fEv; //Glauber event (results of calculation stored in tree)
Bool_t fBC[999][999]; //Array to record binary collision
Bool_t CalcResults(Double_t bgen);
Bool_t CalcEvent(Double_t bgen);
public:
TGlauberMC(const char* NA = "Pb", const char* NB = "Pb", Double_t xsect = 42, Double_t xsectsigma=0);
virtual ~TGlauberMC() {delete fNt; fNt=0;}
Double_t CalcDens(TF1 &prof, Double_t xval, Double_t yval) const;
void Draw(Option_t* option="");
Double_t GetB() const {return fEv.B;}
Double_t GetBNN() const {return fEv.BNN;}
Double_t GetBmax() const {return fBmax;}
Double_t GetBmin() const {return fBmin;}
Double_t GetEcc(Int_t i=2) const {return fEccN[i];}
Double_t GetHardFrac() const {return fHardFrac;}
Double_t GetMeanX() const {return fEv.MeanX;}
Double_t GetMeanXParts() const {return fEv.MeanX;}
Double_t GetMeanXSystem() const {return fEv.MeanXSystem;}
Double_t GetMeanY() const {return fEv.MeanY;}
Double_t GetMeanYParts() const {return fEv.MeanY;}
Double_t GetMeanYSystem() const {return fEv.MeanYSystem;}
Double_t GetPsi(Int_t i=2) const {return fPsiN[i];}
Double_t GetSx2() const {return fEv.VarX;}
Double_t GetSxy() const {return fEv.VarXY;}
Double_t GetSy2() const {return fEv.VarY;}
Double_t GetTotXSect() const;
Double_t GetTotXSectErr() const;
Double_t GetXSectEvent() const {return fXSectEvent;}
Int_t GetNcoll() const {return fEv.Ncoll;}
Int_t GetNcollnn() const {return fEv.Ncollnn;}
Int_t GetNcollpn() const {return fEv.Ncollpn;}
Int_t GetNcollpp() const {return fEv.Ncollpp;}
Int_t GetNpart() const {return fEv.Npart;}
Int_t GetNpart0() const {return fEv.Npart0;}
Int_t GetNpartA() const {return fEv.NpartA;}
Int_t GetNpartB() const {return fEv.NpartB;}
Int_t GetNpartFound() const {return fMaxNpartFound;}
TF1* GetXSectDist() const {return fPTot;}
TGlauNucleus* GetNucleusA() {return &fANucleus;}
TGlauNucleus* GetNucleusB() {return &fBNucleus;}
TNtuple* GetNtuple() const {return fNt;}
TObjArray *GetNucleons();
const Event &GetEvent() const {return fEv;}
const Event *GetEvent() {return &fEv;}
const TGlauNucleus* GetNucleusA() const {return &fANucleus;}
const TGlauNucleus* GetNucleusB() const {return &fBNucleus;}
Bool_t IsBC(Int_t i, Int_t j) const {return fBC[i][j];}
Bool_t NextEvent(Double_t bgen=-1);
void Reset() {delete fNt; fNt=0; }
Bool_t ReadNextEvent(Bool_t calc=1, const char *fname=0);
void Run(Int_t nevents,Double_t b=-1);
void Set2Cx(Double_t x) {f2Cx = x;}
void SetBmax(Double_t bmax) {fBmax = bmax;}
void SetBmin(Double_t bmin) {fBmin = bmin;}
void SetCalcAAGG(Bool_t b) {fDoAAGG = b;}
void SetCalcArea(Bool_t b) {fCalcArea = b;}
void SetCalcCore(Bool_t b) {fDoCore = b;}
void SetCalcLength(Bool_t b) {fCalcLength = b;}
void SetDetail(Int_t d) {fDetail = d;}
void SetHardFrac(Double_t f) {fHardFrac=f;}
void SetLattice(Int_t i) {fANucleus.SetLattice(i); fBNucleus.SetLattice(i);}
void SetMinDistance(Double_t d) {fANucleus.SetMinDist(d); fBNucleus.SetMinDist(d);}
void SetNNProf(TF1 *f1) {fNNProf = f1;}
void SetNodeDistance(Double_t d) {fANucleus.SetNodeDist(d); fBNucleus.SetNodeDist(d);}
void SetRecenter(Int_t b) {fANucleus.SetRecenter(b); fBNucleus.SetRecenter(b);}
void SetShiftMax(Double_t s) {fANucleus.SetShiftMax(s); fBNucleus.SetShiftMax(s);}
void SetSmearing(Double_t s) {fANucleus.SetSmearing(s); fBNucleus.SetSmearing(s);}
const char *Str() const {return Form("gmc-%s%s-snn%.1f-md%.1f-nd%.1f-rc%d-smax%.1f",fANucleus.GetName(),fBNucleus.GetName(),fXSect,fBNucleus.GetMinDist(),fBNucleus.GetNodeDist(),fBNucleus.GetRecenter(),fBNucleus.GetShiftMax());}
static void PrintVersion() {cout << "TGlauberMC " << Version() << endl;}
static const char *Version() {return "v3.2";}
ClassDef(TGlauberMC,6) // TGlauberMC class
};
//---------------------------------------------------------------------------------
TH1F* SetBDhist(double p, float Nspec, int fZ); // for HADES_FW
//---------------------------------------------------------------------------------
double BD(float n, double p, float Nspec); // for HADES_FW
//---------------------------------------------------------------------------------
TF1 *getNNProf(Double_t snn, Double_t omega, Double_t G)
{ // NN collisoin profile from https://arxiv.org/abs/1307.0636
if ((omega<0) || (omega>1))
return 0;
Double_t R2 = snn/10./TMath::Pi();
TF1 *nnprof = new TF1("nnprofgamma","[2]*(1-TMath::Gamma([0],[1]*x^2))",0,3);
nnprof->SetParameters(1./omega,G/omega/R2,G);
return nnprof;
}
//---------------------------------------------------------------------------------
void runAndSaveNtuple(const Int_t n,
const char *sysA,
const char *sysB,
const Double_t signn,
const Double_t sigwidth,
const Double_t mind,
const Double_t omega,
const Double_t noded,
const char *fname)
{
TGlauberMC *mcg=new TGlauberMC(sysA,sysB,signn,sigwidth);
mcg->SetMinDistance(mind);
mcg->SetNodeDistance(noded);
mcg->SetCalcLength(0);
mcg->SetCalcArea(0);
mcg->SetCalcCore(0);
mcg->SetDetail(99);
TString om;
if ((omega>=0) && (omega<=1)) {
TF1 *f1 = getNNProf(signn, omega);
mcg->SetNNProf(f1);
om=Form("-om%.1f",omega);
}
TString name;
if (fname)
name = fname;
else {
TString nd;
if (noded>0)
nd=Form("-nd%.1f",noded);
name = Form("%s%s%s.root",mcg->Str(),om.Data(),nd.Data());
}
mcg->Run(n);
TFile out(name,"recreate",name,9);
TNtuple *nt=mcg->GetNtuple();
/* TTree *HADES_FW=new TTree("HADES_FW", "HADES_FW");
Float_t NprotonsA, NprotonsB, NneutronsA, NneutronsB, NpartA, NpartB, NspecA, NspecB;
Int_t event;
TH1F *htemp;
HADES_FW->Branch("NspecA", &NspecA);
HADES_FW->Branch("NspecB", &NspecB);
HADES_FW->Branch("NprotonsA", &NprotonsA);
HADES_FW->Branch("NprotonsB", &NprotonsB);
HADES_FW->Branch("NneutronsA", &NneutronsA);
HADES_FW->Branch("NneutronsB", &NneutronsB);
HADES_FW->Branch("event", &event);
Int_t entries=(Int_t)nt->GetEntries();
cout<<entries<<endl;
nt->SetBranchAddress("NpartA", &NpartA);
nt->SetBranchAddress("NpartB", &NpartB);
double fNA=((mcg->fANucleus).GetN());
double fNB=((mcg->fBNucleus).GetN());
double fZA=((mcg->fANucleus).GetZ());
double fZB=((mcg->fBNucleus).GetZ());
double pA=fZA/fNA;
double pB=fZB/fNB;
for (int i = 0; i < entries; i++) {
nt->GetEntry(i);
event = i;
cout<<i<<endl;
NspecA=((mcg->fANucleus).GetN())-NpartA;
NspecB=((mcg->fBNucleus).GetN())-NpartB;
htemp=SetBDhist(pA, NspecA, ((mcg->fANucleus).GetZ()));
NprotonsA=(int(SetBDhist(pA, NspecA, ((mcg->fANucleus).GetZ()))->GetRandom()));
NneutronsA=NspecA-NprotonsA;
htemp=SetBDhist(pB, NspecB, ((mcg->fBNucleus).GetZ()));
NprotonsB=(int(SetBDhist(pB, NspecB, ((mcg->fBNucleus).GetZ()))->GetRandom()));
NneutronsB=NspecB-NprotonsB;
HADES_FW->Fill();
}*/
nt->Write();
// HADES_FW->Write();
out.Close();
}
//---------------------------------------------------------------------------------
/**
* Populates histogram BD with values of binomial distribution for HADES_FW
* @param p argument
* @param Nspec argument of amount of spectators
*/
TH1F* SetBDhist(double p, float Nspec, int fZ)
{
// Interface for TH1F.
const int nBins = Nspec+1;
TH1F *BDHisto =new TH1F ("BD_Histo", "", nBins, 0, nBins);
BDHisto->SetName("BD");
for (int i=0; i<nBins; ++i)
{
double val = BD(i, p, Nspec);
// std::cout<<"i="<<i<<" val="<<val<<std::endl;
if (i<=fZ) BDHisto->SetBinContent(i+1, val);
// std::cout << "val " << val << std::endl;
}
BDHisto->Scale(1/(BDHisto->Integral(1,nBins)));
// std::cout << "S=" << fFWHisto.Integral(1,nBins) << std::endl;
return BDHisto;
}
//---------------------------------------------------------------------------------
/**
* Binomial Distribution for HADES_FW
* @param n argument
* @param p argument
* @param Nspec argument of amount of spectators
* @return BD for a given parameters
*/
double BD(float n, double p, float Nspec)
{
// Compute BD.
double F = TMath::Binomial(Nspec, n) * TMath::Power(p, n) * TMath::Power((1-p), (Nspec-n));
// std::cout<<"1"<<" ="<<TMath::Binomial(Nancestors(f), n)<<std::endl;
// std::cout<<"2"<<" ="<<TMath::Power(k, n)<<std::endl;
// std::cout<<"3"<<" ="<<TMath::Power((1-k), (Nancestors(f)-n))<<std::endl;
return F;
}
//---------------------------------------------------------------------------------
void runAndSaveNucleons(const Int_t n,
const char *sysA,
const char *sysB,
const Double_t signn,
const Double_t sigwidth,
const Double_t mind,
const Bool_t verbose,
const Double_t bmin,
const Double_t bmax,
const char *fname)
{
TGlauberMC *mcg=new TGlauberMC(sysA,sysB,signn,sigwidth);
mcg->SetMinDistance(mind);
mcg->SetBmin(bmin);
mcg->SetBmax(bmax);
TFile *out=0;
if (fname)
out=new TFile(fname,"recreate",fname,9);
for (Int_t ievent=0; ievent<n; ++ievent) {
//get an event with at least one collision
mcg->Run(1);
if (ievent%100==0)
cout << "\r" << 100.*ievent/n << "% done" << flush;
//access, save and (if wanted) print out nucleons
TObjArray* nucleons=mcg->GetNucleons();
if (!nucleons)
continue;
if (out)
nucleons->Write(Form("nucleonarray%d",ievent),TObject::kSingleKey);
if (verbose) {
cout<<endl<<endl<<"EVENT NO: "<<ievent<<endl;
cout<<"B = "<<mcg->GetB()<<" Npart = "<<mcg->GetNpart()<<endl<<endl;
printf("Nucleus\t X\t Y\t Z\tNcoll\n");
Int_t nNucls=nucleons->GetEntries();
for (Int_t iNucl=0; iNucl<nNucls; ++iNucl) {
TGlauNucleon *nucl=(TGlauNucleon *)nucleons->At(iNucl);
Char_t nucleus='A';
if (nucl->IsInNucleusB())
nucleus='B';
Double_t x=nucl->GetX();
Double_t y=nucl->GetY();
Double_t z=nucl->GetZ();
Int_t ncoll=nucl->GetNColl();
printf(" %c\t%2.2f\t%2.2f\t%2.2f\t%3d\n",nucleus,x,y,z,ncoll);
}
}
}
cout << endl << "Done!" << endl;
if (out) {
TNtuple *nt = mcg->GetNtuple();
nt->Write();
if (verbose)
out->ls();
delete out;
}
}
//---------------------------------------------------------------------------------
void runAndSmearNtuple(const Int_t n,
const Double_t sigs,
const char *sysA,
const char *sysB,
const Double_t signn,
const Double_t mind,
const Double_t bmin,
const Double_t bmax,
const char *fname)
{
// Run Glauber and store ntuple with smeared eccentricities in file.
TGlauberMC *mcg = new TGlauberMC(sysA,sysB,signn);
mcg->SetMinDistance(mind);
mcg->SetBmin(bmin);
mcg->SetBmax(bmax);
TFile *out = TFile::Open(fname,"recreate",fname,9);
if (!out)
return;
TNtuple *nt = new TNtuple("nt","nt",
"Npart:Ncoll:B:Psi1P:Ecc1P:Psi2P:Ecc2P:Psi3P:Ecc3P:Psi4P:Ecc4P:Psi5P:Ecc5P:Psi1G:Ecc1G:Psi2G:Ecc2G:Psi3G:Ecc3G:Psi4G:Ecc4G:Psi5G:Ecc5G:Sx2P:Sy2P:Sx2G:Sy2G");
nt->SetDirectory(out);
const Int_t NSAMP = 100;
TF1 *rad = new TF1("rad","x*TMath::Exp(-x*x/(2.*[0]*[0]))",0.0,3*sigs);
rad->SetParameter(0,sigs);
for (Int_t ievent=0; ievent<n; ++ievent) {
while (!mcg->NextEvent()) {}
const TGlauNucleus *nucA = mcg->GetNucleusA();
const TObjArray *nucleonsA = nucA->GetNucleons();
const Int_t AN = nucA->GetN();
const TGlauNucleus *nucB = mcg-> GetNucleusB();
const TObjArray *nucleonsB = nucB->GetNucleons();
const Int_t BN = nucB->GetN();
Double_t sinphi[10] = {0};
Double_t cosphi[10] = {0};
Double_t rn[10] = {0};
Double_t ecc[10] = {0};
Double_t psi[10] = {0};
Double_t sx2g = 0;
Double_t sy2g = 0;
for (Int_t s=0; s<NSAMP; ++s) {
Int_t ni = 0;
Double_t xvals[1000] = {0};
Double_t yvals[1000] = {0};
for (Int_t i = 0; i<AN; ++i) {
TGlauNucleon *nucleonA=(TGlauNucleon*)(nucleonsA->At(i));
if (!nucleonA->IsWounded())
continue;
Double_t sr = rad->GetRandom();
Double_t sp = gRandom->Uniform(-TMath::Pi(), +TMath::Pi());
xvals[ni] = nucleonA->GetX() + sr*TMath::Cos(sp);
yvals[ni] = nucleonA->GetY() + sr*TMath::Sin(sp);
++ni;
}
for (Int_t i = 0; i<BN; ++i) {
TGlauNucleon *nucleonB=(TGlauNucleon*)(nucleonsB->At(i));
if (!nucleonB->IsWounded())
continue;
Double_t sr = rad->GetRandom();
Double_t sp = gRandom->Uniform(-TMath::Pi(), +TMath::Pi());
xvals[ni] = nucleonB->GetX() + sr*TMath::Cos(sp);
yvals[ni] = nucleonB->GetY() + sr*TMath::Sin(sp);
++ni;
}
Double_t MeanX = 0;
Double_t MeanY = 0;
Double_t MeanX2 = 0;
Double_t MeanY2 = 0;
for (Int_t i = 0; i<ni; ++i) {
MeanX += xvals[i];
MeanY += yvals[i];
MeanX2 += xvals[i]*xvals[i];
MeanY2 += yvals[i]*yvals[i];
}
MeanX /= ni;
MeanY /= ni;
MeanX2 /= ni;
MeanY2 /= ni;
sx2g += MeanX2-MeanX*MeanX;
sy2g += MeanY2-MeanY*MeanY;
for (Int_t j = 1; j<9; ++j) {
for (Int_t i = 0; i<ni; ++i) {
Double_t x = xvals[i] - MeanX;
Double_t y = yvals[i] - MeanY;
Double_t r = TMath::Sqrt(x*x+y*y);
Double_t phi = TMath::ATan2(y,x);
Double_t w = j;
if (j==1)
w = 3; // use r^3 weighting for Ecc1/Psi1
cosphi[j] += TMath::Power(r,w)*TMath::Cos(j*phi);
sinphi[j] += TMath::Power(r,w)*TMath::Sin(j*phi);
rn[j] += TMath::Power(r,w);
}
}
}
for (Int_t j = 1; j<9; ++j) {
psi[j] = (TMath::ATan2(sinphi[j],cosphi[j]) + TMath::Pi())/j;
ecc[j] = TMath::Sqrt(sinphi[j]*sinphi[j] + cosphi[j]*cosphi[j]) / rn[j];
}
Float_t v[27]; Int_t i=0;
v[i++] = mcg->GetNpart();
v[i++] = mcg->GetNcoll();
v[i++] = mcg->GetB();
v[i++] = mcg->GetPsi(1); // point-like calculation values
v[i++] = mcg->GetEcc(1);
v[i++] = mcg->GetPsi(2);
v[i++] = mcg->GetEcc(2);
v[i++] = mcg->GetPsi(3);
v[i++] = mcg->GetEcc(3);
v[i++] = mcg->GetPsi(4);
v[i++] = mcg->GetEcc(4);
v[i++] = mcg->GetPsi(5);
v[i++] = mcg->GetEcc(5);
v[i++] = psi[1]; // Gaussian smeared values
v[i++] = ecc[1];
v[i++] = psi[2];
v[i++] = ecc[2];
v[i++] = psi[3];
v[i++] = ecc[3];
v[i++] = psi[4];
v[i++] = ecc[4];
v[i++] = psi[5];
v[i++] = ecc[5];
v[i++] = mcg->GetSx2();
v[i++] = mcg->GetSy2();
v[i++] = sx2g/NSAMP;
v[i++] = sy2g/NSAMP;
nt->Fill(v);
}
out->Write();
out->Close();
delete out;
}
//---------------------------------------------------------------------------------
void runAndOutputLemonTree(const Int_t n,
const Double_t sigs,
const char *sysA,
const char *sysB,
const Double_t signn,
const Double_t mind,
const Double_t bmin,
const Double_t bmax,
const Bool_t ogrid,
const char *fname)
{
// Run Glauber and store Lemon TTree in format needed for IP-Jazma input
TGlauberMC *mcg = new TGlauberMC(sysA,sysB,signn);
mcg->SetMinDistance(mind);
mcg->SetBmin(bmin);
mcg->SetBmax(bmax);
TFile *out = TFile::Open(fname,"recreate",fname,9);
if (!out) return;
// create new TTree with MC Glauber information for input to IP-Jazma
const Int_t lemonmaxNucleons = 500;
Int_t lemonnpart;
Int_t lemonncoll;
Int_t lemonnparta;
Int_t lemonnpartb;
Float_t lemonb; // collision impact parameter
Float_t lemoneccgaus[10];
Float_t lemoneccpoint[10];
Int_t lemonnproj;
Int_t lemonntarg;
Float_t lemonxproj[lemonmaxNucleons]; // x,y,z coordinates for all nucleons
Float_t lemonyproj[lemonmaxNucleons]; // note these must be in the global coordinate frame
Float_t lemonzproj[lemonmaxNucleons];
Float_t lemonxtarg[lemonmaxNucleons]; // x,y,z coordinates for all nucleons
Float_t lemonytarg[lemonmaxNucleons]; // note these must be in the global coordinate frame
Float_t lemonztarg[lemonmaxNucleons];
TTree *lemon = new TTree("lemon","lemon");
lemon->Branch("npart",&lemonnpart,"npart/I");
lemon->Branch("nparta",&lemonnparta,"nparta/I");
lemon->Branch("npartb",&lemonnpartb,"npartb/I");
lemon->Branch("ncoll",&lemonncoll,"ncoll/I");
lemon->Branch("b",&lemonb,"b/F");
lemon->Branch("eccgaus",lemoneccgaus,"eccgaus[10]/F");
lemon->Branch("eccpoint",lemoneccpoint,"eccpoint[10]/F");
lemon->Branch("nproj",&lemonnproj,"nproj/I");
lemon->Branch("ntarg",&lemonntarg,"ntarg/I");
lemon->Branch("xproj",lemonxproj,"xproj[500]/F");
lemon->Branch("yproj",lemonyproj,"yproj[500]/F");
lemon->Branch("zproj",lemonyproj,"zproj[500]/F");
lemon->Branch("xtarg",lemonxtarg,"xtarg[500]/F");
lemon->Branch("ytarg",lemonytarg,"ytarg[500]/F");
lemon->Branch("ztarg",lemonytarg,"ztarg[500]/F");
lemon->SetDirectory(out);
const Int_t NSAMP = 100;
TF1 *rad = new TF1("rad","x*TMath::Exp(-x*x/(2.*[0]*[0]))",0.0,3*sigs);
rad->SetParameter(0,sigs);
TF2* smearing_function = new TF2("smear_tf2", "TMath::Exp(-(x*x+y*y)/(2.*[0]*[0]))/(2*TMath::Pi()*[0]*[0])", 0, 10*sigs, 0, 10*sigs);
smearing_function->SetParameter(0,sigs);
for (Int_t ievent=0; ievent<n; ++ievent) {
while (!mcg->NextEvent()) {}
const TGlauNucleus *nucA = mcg->GetNucleusA();
const TObjArray *nucleonsA = nucA->GetNucleons();
const Int_t AN = nucA->GetN();
const TGlauNucleus *nucB = mcg-> GetNucleusB();
const TObjArray *nucleonsB = nucB->GetNucleons();
const Int_t BN = nucB->GetN();
Double_t sinphi[10] = {0};
Double_t cosphi[10] = {0};
Double_t rn[10] = {0};
Double_t ecc[10] = {0};
Double_t psi[10] = {0};
Double_t sx2g = 0;
Double_t sy2g = 0;
for (Int_t s=0; s<NSAMP; ++s) {
Int_t ni = 0;
Double_t xvals[1000] = {0};
Double_t yvals[1000] = {0};
for (Int_t i = 0; i<AN; ++i) {
TGlauNucleon *nucleonA=(TGlauNucleon*)(nucleonsA->At(i));
if (!nucleonA->IsWounded())
continue;
Double_t sr = rad->GetRandom();
Double_t sp = gRandom->Uniform(-TMath::Pi(), +TMath::Pi());
xvals[ni] = nucleonA->GetX() + sr*TMath::Cos(sp);
yvals[ni] = nucleonA->GetY() + sr*TMath::Sin(sp);
++ni;
}
for (Int_t i = 0; i<BN; ++i) {
TGlauNucleon *nucleonB=(TGlauNucleon*)(nucleonsB->At(i));
if (!nucleonB->IsWounded())
continue;
Double_t sr = rad->GetRandom();
Double_t sp = gRandom->Uniform(-TMath::Pi(), +TMath::Pi());
xvals[ni] = nucleonB->GetX() + sr*TMath::Cos(sp);
yvals[ni] = nucleonB->GetY() + sr*TMath::Sin(sp);
++ni;
}
Double_t MeanX = 0;
Double_t MeanY = 0;
Double_t MeanX2 = 0;
Double_t MeanY2 = 0;
for (Int_t i = 0; i<ni; ++i) {
MeanX += xvals[i];
MeanY += yvals[i];
MeanX2 += xvals[i]*xvals[i];
MeanY2 += yvals[i]*yvals[i];
}
MeanX /= ni;
MeanY /= ni;
MeanX2 /= ni;
MeanY2 /= ni;
sx2g += MeanX2-MeanX*MeanX;
sy2g += MeanY2-MeanY*MeanY;
for (Int_t j = 1; j<9; ++j) {
for (Int_t i = 0; i<ni; ++i) {
Double_t x = xvals[i] - MeanX;
Double_t y = yvals[i] - MeanY;
Double_t r = TMath::Sqrt(x*x+y*y);
Double_t phi = TMath::ATan2(y,x);
Double_t w = j;
if (j==1)
w = 3; // use r^3 weighting for Ecc1/Psi1
cosphi[j] += TMath::Power(r,w)*TMath::Cos(j*phi);
sinphi[j] += TMath::Power(r,w)*TMath::Sin(j*phi);
rn[j] += TMath::Power(r,w);
}
}
}
for (Int_t j = 1; j<9; ++j) {
psi[j] = (TMath::ATan2(sinphi[j],cosphi[j]) + TMath::Pi())/j;
ecc[j] = TMath::Sqrt(sinphi[j]*sinphi[j] + cosphi[j]*cosphi[j]) / rn[j];
}
// fill lemon TTree variables for this event
lemonnpart = mcg->GetNpart();
lemonnparta = mcg->GetNpartA();
lemonnpartb = mcg->GetNpartB();
lemonncoll = mcg->GetNcoll();
lemonb = mcg->GetB();
lemoneccpoint[0] = 0.0;
lemoneccpoint[1] = mcg->GetEcc(1);
lemoneccpoint[2] = mcg->GetEcc(2);
lemoneccpoint[3] = mcg->GetEcc(3);
lemoneccpoint[4] = mcg->GetEcc(4);
lemoneccpoint[5] = mcg->GetEcc(5);
lemoneccpoint[6] = mcg->GetEcc(6);
lemoneccpoint[7] = mcg->GetEcc(7);
lemoneccpoint[8] = mcg->GetEcc(8);
lemoneccpoint[9] = mcg->GetEcc(9);
lemoneccgaus[0] = 0.0;
lemoneccgaus[1] = ecc[1];
lemoneccgaus[2] = ecc[2];
lemoneccgaus[3] = ecc[3];
lemoneccgaus[4] = ecc[4];
lemoneccgaus[5] = ecc[5];
lemoneccgaus[6] = ecc[6];
lemoneccgaus[7] = ecc[7];
lemoneccgaus[8] = ecc[8];
lemoneccgaus[9] = ecc[9];
for (Int_t i = 0; i<AN; ++i) {
TGlauNucleon *nucleonA=(TGlauNucleon*)(nucleonsA->At(i));
lemonxproj[i] = nucleonA->GetX();