Skip to content

Commit d141d5d

Browse files
[PWGGAJE] Param Model: better multiplicity model
1 parent e956bae commit d141d5d

1 file changed

Lines changed: 65 additions & 11 deletions

File tree

‎MC/config/PWGGAJE/external/generator/parametrisedJetModel/generator_pythia8_box_parametrisedModel_pythia6Fragmentation.C‎

Lines changed: 65 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ using namespace Pythia8;
2626
// #include "SimulationDataFormat/MCEventHeader.h"
2727

2828
// Input to simulation:
29-
// inputFilePathName file is expected to be a json file with the structure like so:
29+
// inputFilePathName file is expected to be a json file with the structure like
30+
// so:
3031
// {
3132
// "simLog": false,
3233
// "sglGenRAA": 0.45,
@@ -37,7 +38,10 @@ using namespace Pythia8;
3738
// "fallSpecterAffinePowerConstantTerm": -5.476804,
3839
// "fallSpecterAffinePowerSlope": 0.001110,
3940
// "bkgAveragePt": 0.670,
40-
// "collTotalMultWithBkg": 2000
41+
// "collMultPowerLawAmplitude": ?,
42+
// "collMultPowerLawExponent": ?,
43+
// "collMultMin": ?,
44+
// "collMultMax": ?
4145
// }
4246
// can be uploaded to grid using for example: alien.py cp
4347
// file:/local/path/parametrisedModel_PbPb_5p36TeV_cent0010.json
@@ -120,7 +124,14 @@ public:
120124
mFallSpecterAffinePowerConstantTerm = jsonDocument[mConfigurableSimParameterNames.at(5).c_str()].GetDouble();
121125
mFallSpecterAffinePowerSlope = jsonDocument[mConfigurableSimParameterNames.at(6).c_str()].GetDouble();
122126
mBkgAveragePt = jsonDocument[mConfigurableSimParameterNames.at(7).c_str()].GetDouble();
123-
mCollTotalMultWithBkg = jsonDocument[mConfigurableSimParameterNames.at(8).c_str()].GetDouble();
127+
mCollMultPowerLawAmplitude =
128+
jsonDocument[mConfigurableSimParameterNames.at(8).c_str()].GetDouble();
129+
mCollMultPowerLawExponent =
130+
jsonDocument[mConfigurableSimParameterNames.at(9).c_str()].GetDouble();
131+
mCollMultMin =
132+
jsonDocument[mConfigurableSimParameterNames.at(10).c_str()].GetInt();
133+
mCollMultMax =
134+
jsonDocument[mConfigurableSimParameterNames.at(11).c_str()].GetInt();
124135

125136
// clean up
126137
std::fclose(fjson);
@@ -133,13 +144,24 @@ public:
133144
cout << "param retrieved: mFallSpecterAffinePowerConstantTerm = " << mFallSpecterAffinePowerConstantTerm << endl;
134145
cout << "param retrieved: mFallSpecterAffinePowerSlope = " << mFallSpecterAffinePowerSlope << endl;
135146
cout << "param retrieved: mBkgAveragePt = " << mBkgAveragePt << endl;
136-
cout << "param retrieved: mCollTotalMultWithBkg = " << mCollTotalMultWithBkg << endl;
137-
138-
// thermal background function
147+
cout << "param retrieved: mCollMultPowerLawAmplitude = "
148+
<< mCollMultPowerLawAmplitude << endl;
149+
cout << "param retrieved: mCollMultPowerLawExponent = "
150+
<< mCollMultPowerLawExponent << endl;
151+
cout << "param retrieved: mcollMultMin = " << mCollMultMin << endl;
152+
cout << "param retrieved: mcollMultMax = " << mCollMultMax << endl;
153+
154+
// thermal background pdf
139155
mBoltzmannPDF = new TF1("f1", "[0]*[0]*x*exp(-[0]*x)", mBkgGenPtMin, mPtInfinity);
140156
mBoltzmannPDF->SetParameter(0, 2. / mBkgAveragePt);
141157

142-
// jet signal function
158+
// collision multiplicity pdf
159+
mCollisionMultPDF =
160+
new TF1("f1", "exp([0])*pow(x,[1])", mCollMultMin, mCollMultMax);
161+
mCollisionMultPDF->SetParameter(0, mCollMultPowerLawAmplitude);
162+
mCollisionMultPDF->SetParameter(1, mCollMultPowerLawExponent);
163+
164+
// jet signal pdf
143165
// this thesis says that the jet distrib used to sample parton pt is
144166
// actually full jet -> solves neutral particle fragments issue (better than
145167
// scaling) https://drupal.star.bnl.gov/STAR/files/phd_thesis_rusnak.pdf for
@@ -295,7 +317,24 @@ public:
295317
if (mDebug) {
296318
cout << "####################### Adding Thermal Background #######################" << endl;
297319
}
298-
for (int iBkg{0}; iBkg < mCollTotalMultWithBkg - nHardParticles; ++iBkg) {
320+
321+
int mCollTotalMultWithBkg = 0;
322+
if (std::abs(mCollMultMax - mCollMultMin) == 0) {
323+
mCollTotalMultWithBkg = mCollMultMin;
324+
} else {
325+
mCollTotalMultWithBkg =
326+
mCollisionMultPDF->GetRandom(mCollMultMin, mCollMultMax);
327+
}
328+
329+
if (mDebug) {
330+
cout << "mCollTotalMultWithBkg = " << mCollTotalMultWithBkg << endl;
331+
}
332+
333+
int nBkgParticles = (mCollTotalMultWithBkg - nHardParticles) > 0
334+
? mCollTotalMultWithBkg - nHardParticles
335+
: 0;
336+
337+
for (int iBkg{0}; iBkg < nBkgParticles; ++iBkg) {
299338
const double bkgPt = mBoltzmannPDF->GetRandom(mBkgGenPtMin, mPtInfinity);
300339
const double bkgEta = gRandom->Uniform(mGenMinEta, mGenMaxEta);
301340
const double bkgPhi = gRandom->Uniform(0, o2::constants::math::TwoPI);
@@ -347,8 +386,20 @@ private:
347386

348387
const double mPtInfinity = 300; // maximum pt (in GeV/c) for generated particles, and upper pT limit for integral and TF1 purposes; too high and GetRandom struggles
349388
const double mGenMinEta = -0.9; /// minimum pseudorapidity for generated particles
350-
const double mGenMaxEta = +0.9; /// maximum pseudorapidity for generated particles
351-
int mCollTotalMultWithBkg; /// total multiplicity of the collision
389+
const double mGenMaxEta =
390+
+0.9; /// maximum pseudorapidity for generated particles
391+
392+
TF1 *mCollisionMultPDF; /// TF1 to store pdf function from which collision
393+
/// multiplicity is drawn
394+
double mCollMultPowerLawAmplitude; /// collision total multiplicity: power law
395+
/// amplitude of the PDF
396+
double mCollMultPowerLawExponent; /// collision total multiplicity: power law
397+
/// exponent of the PDF
398+
int mCollMultMin; /// collision total multiplicity: minimum abscissa of the
399+
/// PDF
400+
int mCollMultMax; /// collision total multiplicity: maximum abscissa of the
401+
/// PDF
402+
352403
bool mGenerateSignal = true; /// boolean to request (or not) the generation of the jet signal
353404
bool mGenerateUE = false; /// boolean to request (or not) embedding of the jet signal inside underlying event modelled by a thermal background; if mGenerateSignal = false, only the UE is generated
354405
const std::vector<std::string> mConfigurableSimParameterNames = {
@@ -360,7 +411,10 @@ private:
360411
"fallSpecterAffinePowerConstantTerm",
361412
"fallSpecterAffinePowerSlope",
362413
"bkgAveragePt",
363-
"collTotalMultWithBkg"};
414+
"collMultPowerLawAmplitude",
415+
"collMultPowerLawExponent",
416+
"collMultMin",
417+
"collMultMax"};
364418

365419
/////////////////////////////////////////////
366420
/////// Thermal background parameters ///////

0 commit comments

Comments
 (0)