55#include "FairPrimaryGenerator.h"
66#include "Generators/GeneratorPythia8.h"
77#include "TRandom3.h"
8+ #include "TF1.h"
89#include "TParticlePDG.h"
910#include "TDatabasePDG.h"
1011
@@ -37,6 +38,22 @@ public:
3738 xProd = 0. ; yProd = 0. ; zProd = 0. ;
3839
3940 fLVHelper = std ::make_unique < TLorentzVector > ( );
41+
42+ fSpectrumXi = std ::make_unique < TF1 > ("fSpectrumXi" , this , & GeneratorPythia8ExtraStrangeness ::boltzPlusPower , 0. , genMaxPt , 5 , "GeneratorPythia8ExtraStrangeness" , "boltzPlusPower" );
43+
44+ fSpectrumXi -> FixParameter (0 , 1.32171 );
45+ fSpectrumXi -> FixParameter (1 , 4.84e-1 );
46+ fSpectrumXi -> FixParameter (2 , 111.9 );
47+ fSpectrumXi -> FixParameter (3 , -2.56511e+00 );
48+ fSpectrumXi -> FixParameter (4 , 1.14011e-04 );
49+
50+ fSpectrumOm = std ::make_unique < TF1 > ("fSpectrumOm" , this , & GeneratorPythia8ExtraStrangeness ::boltzPlusPower , 0. , genMaxPt , 5 , "GeneratorPythia8ExtraStrangeness" , "boltzPlusPower" );
51+
52+ fSpectrumOm -> FixParameter (0 , 1.67245e+00 );
53+ fSpectrumOm -> FixParameter (1 , 5.18174e-01 );
54+ fSpectrumOm -> FixParameter (2 , 1.73747e+01 );
55+ fSpectrumOm -> FixParameter (3 , -2.56681e+00 );
56+ fSpectrumOm -> FixParameter (4 , 1.87513e-04 );
4057 }
4158
4259 Double_t y2eta (Double_t pt , Double_t mass , Double_t y ){
@@ -85,7 +102,7 @@ public:
85102 ranGenerator -> SetSeed (0 );
86103
87104 // generate transverse momentum
88- const double gen_pT = ranGenerator -> Uniform ( 0 , 5 );
105+ const double gen_pT = fSpectrumXi -> GetRandom ( genMinPt , genMaxPt );
89106
90107 //Actually could be something else without loss of generality but okay
91108 const double gen_phi = ranGenerator -> Uniform (0 ,2 * TMath ::Pi ());
@@ -111,7 +128,7 @@ public:
111128 ranGenerator -> SetSeed (0 );
112129
113130 // generate transverse momentum
114- const double gen_pT = ranGenerator -> Uniform ( 0 , 5 );
131+ const double gen_pT = fSpectrumOm -> GetRandom ( genMinPt , genMaxPt );
115132
116133 //Actually could be something else without loss of generality but okay
117134 const double gen_phi = ranGenerator -> Uniform (0 ,2 * TMath ::Pi ());
@@ -129,6 +146,26 @@ public:
129146 set4momentum (fLVHelper -> Px (),fLVHelper -> Py (),fLVHelper -> Pz ());
130147 }
131148
149+ Double_t boltzPlusPower (const Double_t * x , const Double_t * p )
150+ {
151+ // a plain parametrization. not meant to be physics worthy.
152+ // adjusted to match preliminary 5 TeV shape.
153+
154+ Double_t pt = x [0 ];
155+ Double_t mass = p [0 ];
156+ Double_t mt = TMath ::Sqrt (pt * pt + mass * mass );
157+ Double_t T = p [1 ];
158+ Double_t norm = p [2 ];
159+
160+ Double_t lowptpart = mt * TMath ::Exp (- mt / T );
161+ Double_t highptpart = p [4 ]* TMath ::Power (x [0 ], p [3 ]);
162+
163+ Double_t mixup = 1. /(1. + TMath ::Exp ((x [0 ]- 4.5 )/.1 ));
164+
165+ //return pt * norm * (mixup * mt * TMath::Exp(-mt / T) + (1.-mixup)*highptpart) ;
166+ return pt * norm * (mt * TMath ::Exp (- mt / T ) + (1. - mixup )* highptpart ) ;
167+ }
168+
132169 //__________________________________________________________________
133170 Bool_t generateEvent () override {
134171
@@ -235,6 +272,8 @@ private:
235272 double zProd ; /// z-coordinate position production vertex [cm]
236273
237274 std ::unique_ptr < TLorentzVector > fLVHelper ;
275+ std ::unique_ptr < TF1 > fSpectrumXi ;
276+ std ::unique_ptr < TF1 > fSpectrumOm ;
238277};
239278
240279 FairGenerator * generator_extraStrangeness ()
0 commit comments