Skip to content

Commit 889354c

Browse files
[PWGGAJE] jet param model: add bkg-only, fix eta
1 parent 04450fa commit 889354c

13 files changed

Lines changed: 188 additions & 98 deletions

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

Lines changed: 102 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ using namespace Pythia8;
4646
class GeneratorParametrisedJetModel : public o2::eventgen::GeneratorPythia8 {
4747
public:
4848
/// constructor
49-
GeneratorParametrisedJetModel(std::string inputSimParametersPath, std::string inputSimParametersFileName, bool generateUE = true) : mInputSimParametersPath{inputSimParametersPath}, mInputSimParametersFileName{inputSimParametersFileName}, mGenerateUE{generateUE} {
49+
GeneratorParametrisedJetModel(std::string inputSimParametersPath, std::string inputSimParametersFileName, bool generateUE, bool generateSignal = true) : mInputSimParametersPath{inputSimParametersPath}, mInputSimParametersFileName{inputSimParametersFileName}, mGenerateUE{generateUE}, mGenerateSignal{generateSignal} {
50+
51+
if (!generateUE && !generateSignal) {
52+
cout << "Both the UE and the signal generation should not be off at the same time" << endl;
53+
exit(1);
54+
}
5055

5156
std::string inputFilePathName = "alien://" + inputSimParametersPath + inputSimParametersFileName;
5257
if (!gGrid) {
@@ -182,100 +187,102 @@ public:
182187
////////////////// Jet signal /////////////////
183188
///////////////////////////////////////////////
184189

185-
int nJets = gRandom->Poisson(mNJetsAverage);
186-
187-
if (mDebug) {
188-
cout << "####################### creating partons signal #######################" << endl;
189-
cout << "signal: count " << nJets << " for mNJetsAverage = " << mNJetsAverage << "" << endl;
190-
}
191-
192-
TClonesArray *genParticlesArray = new TClonesArray("TParticle", 1000);
193-
194-
int particleCountCurrent = 1; // counts the system fake particle pdg 90
195-
for (int iJet{0}; iJet < nJets; ++iJet) {
196-
genParticlesArray->Delete();
197-
198-
const bool isQuark = gRandom->Uniform(0, 1) > 1. / 3 ? true : false; // ratio quarks:gluons = 2:1
199-
const int pdgQuark = gRandom->Uniform(0, 1) > 1. / 2 ? mPdgQuarkU : mPdgQuarkD; // half and half for u and d quarks
200-
const int pdgJet = (int)isQuark * pdgQuark + (1 - (int)isQuark) * mPdgGluon;
201-
const double sglMass = TDatabasePDG::Instance()->GetParticle(pdgJet)->Mass();
202-
const double sglPt = mJetYieldFit->GetRandom(mSglCutoffAbscissa, mPtInfinity);
203-
const double sglEta = gRandom->Uniform(mGenMinEta, mGenMaxEta);
204-
const double sglPhi = gRandom->Uniform(0, o2::constants::math::TwoPI);
205-
const double sglPx{sglPt * std::cos(sglPhi)};
206-
const double sglPy{sglPt * std::sin(sglPhi)};
207-
const double sglPz{sglPt * std::sinh(sglEta)};
208-
const double sglEt{std::hypot(std::hypot(sglPt, sglPz), sglMass)};
209-
210-
Particle myJet;
211-
myJet.id(pdgJet);
212-
myJet.status(23);
213-
myJet.px(sglPx);
214-
myJet.py(sglPy);
215-
myJet.pz(sglPz);
216-
myJet.e(sglEt);
217-
myJet.m(sglMass);
218-
myJet.xProd(0);
219-
myJet.yProd(0);
220-
myJet.zProd(0);
221-
int jetCol = 101 + 2 * iJet; // each jet gets a different colour and acolour value,
222-
// so that the pythia knows they're distinct colour
223-
// lines, i.e. different strings
224-
int jetACol = 101 + 2 * iJet + 1;
190+
if (mGenerateUE) {
191+
int nJets = gRandom->Poisson(mNJetsAverage);
225192

226193
if (mDebug) {
227-
cout << "-- || jet parton #" << iJet
228-
<< ", index=" << mPythia.event.back().index() + 1
229-
<< ": isQuark = " << isQuark << ", pdg = " << pdgJet
230-
<< ", pt = " << sglPt << ", mass = " << sglMass << endl;
194+
cout << "####################### creating partons signal #######################" << endl;
195+
cout << "signal: count " << nJets << " for mNJetsAverage = " << mNJetsAverage << "" << endl;
231196
}
232197

233-
auto pythia6Event = TPythia6::Instance();
234-
235-
int lineNumber = 0; // line number seems to be index of particle in array; set to 0 in
236-
// PM code? but doc says it runs Pyexec() right after; iJet doesn't
237-
// work for ijet=1+; set to 0 and it seems to work
238-
double sglTheta = 2.0 * std::atan(std::exp(-1 * sglEta));
239-
pythia6Event->Py1ent(lineNumber, pdgJet, sglEt, sglTheta, sglPhi);
240-
241-
int final = pythia6Event->ImportParticles(genParticlesArray, "Final"); // only saves final state particles; "All" would instead give all the particles
242-
int nConstituents = genParticlesArray->GetEntries();
243-
244-
mPythia.event.append(myJet);
245-
for (int iParticle = 0; iParticle < nConstituents; ++iParticle) {
246-
TParticle *tParticle = (TParticle *)genParticlesArray->At(iParticle);
247-
248-
Particle pythiaParticle;
249-
pythiaParticle.id(tParticle->GetPdgCode());
250-
pythiaParticle.status(tParticle->GetStatusCode()); // in pythia6 all the particles that are not
251-
// the initial partons have status code 1;
252-
// this is because apparently pythia6 does
253-
// not decay them automatically yet; they
254-
// are by no means all stable particles; but
255-
// we do not care for this study
256-
pythiaParticle.px(tParticle->Px());
257-
pythiaParticle.py(tParticle->Py());
258-
pythiaParticle.pz(tParticle->Pz());
259-
pythiaParticle.e(tParticle->Energy());
260-
pythiaParticle.m(tParticle->GetMass());
261-
pythiaParticle.xProd(tParticle->Vx());
262-
pythiaParticle.yProd(tParticle->Vy());
263-
pythiaParticle.zProd(tParticle->Vz());
264-
pythiaParticle.mother1(particleCountCurrent); // particleCountCurrent is the offset to account for existing IDs of constituents of previous jets.
265-
// Not saving the actual mother ID because ImportParticles(genParticlesArray, "Final") only saves the final
266-
// particles, and the mother id still refer to particles not saved in
267-
// genParticlesArray a priori the mother-daughter links aren't needed
268-
// for the closure test this will be used for; keeping the initial
269-
// parton as mother for now
270-
271-
mPythia.event.append(pythiaParticle);
198+
TClonesArray *genParticlesArray = new TClonesArray("TParticle", 1000);
199+
200+
int particleCountCurrent = 1; // counts the system fake particle pdg 90
201+
for (int iJet{0}; iJet < nJets; ++iJet) {
202+
genParticlesArray->Delete();
203+
204+
const bool isQuark = gRandom->Uniform(0, 1) > 1. / 3 ? true : false; // ratio quarks:gluons = 2:1
205+
const int pdgQuark = gRandom->Uniform(0, 1) > 1. / 2 ? mPdgQuarkU : mPdgQuarkD; // half and half for u and d quarks
206+
const int pdgJet = (int)isQuark * pdgQuark + (1 - (int)isQuark) * mPdgGluon;
207+
const double sglMass = TDatabasePDG::Instance()->GetParticle(pdgJet)->Mass();
208+
const double sglPt = mJetYieldFit->GetRandom(mSglCutoffAbscissa, mPtInfinity);
209+
const double sglEta = gRandom->Uniform(mGenMinEta, mGenMaxEta);
210+
const double sglPhi = gRandom->Uniform(0, o2::constants::math::TwoPI);
211+
const double sglPx{sglPt * std::cos(sglPhi)};
212+
const double sglPy{sglPt * std::sin(sglPhi)};
213+
const double sglPz{sglPt * std::sinh(sglEta)};
214+
const double sglEt{std::hypot(std::hypot(sglPt, sglPz), sglMass)};
215+
216+
Particle myJet;
217+
myJet.id(pdgJet);
218+
myJet.status(23);
219+
myJet.px(sglPx);
220+
myJet.py(sglPy);
221+
myJet.pz(sglPz);
222+
myJet.e(sglEt);
223+
myJet.m(sglMass);
224+
myJet.xProd(0);
225+
myJet.yProd(0);
226+
myJet.zProd(0);
227+
int jetCol = 101 + 2 * iJet; // each jet gets a different colour and acolour value,
228+
// so that the pythia knows they're distinct colour
229+
// lines, i.e. different strings
230+
int jetACol = 101 + 2 * iJet + 1;
231+
232+
if (mDebug) {
233+
cout << "-- || jet parton #" << iJet
234+
<< ", index=" << mPythia.event.back().index() + 1
235+
<< ": isQuark = " << isQuark << ", pdg = " << pdgJet
236+
<< ", pt = " << sglPt << ", mass = " << sglMass << endl;
237+
}
238+
239+
auto pythia6Event = TPythia6::Instance();
240+
241+
int lineNumber = 0; // line number seems to be index of particle in array; set to 0 in
242+
// PM code? but doc says it runs Pyexec() right after; iJet doesn't
243+
// work for ijet=1+; set to 0 and it seems to work
244+
double sglTheta = 2.0 * std::atan(std::exp(-1 * sglEta));
245+
pythia6Event->Py1ent(lineNumber, pdgJet, sglEt, sglTheta, sglPhi);
246+
247+
int final = pythia6Event->ImportParticles(genParticlesArray, "Final"); // only saves final state particles; "All" would instead give all the particles
248+
int nConstituents = genParticlesArray->GetEntries();
249+
250+
mPythia.event.append(myJet);
251+
for (int iParticle = 0; iParticle < nConstituents; ++iParticle) {
252+
TParticle *tParticle = (TParticle *)genParticlesArray->At(iParticle);
253+
254+
Particle pythiaParticle;
255+
pythiaParticle.id(tParticle->GetPdgCode());
256+
pythiaParticle.status(tParticle->GetStatusCode()); // in pythia6 all the particles that are not
257+
// the initial partons have status code 1;
258+
// this is because apparently pythia6 does
259+
// not decay them automatically yet; they
260+
// are by no means all stable particles; but
261+
// we do not care for this study
262+
pythiaParticle.px(tParticle->Px());
263+
pythiaParticle.py(tParticle->Py());
264+
pythiaParticle.pz(tParticle->Pz());
265+
pythiaParticle.e(tParticle->Energy());
266+
pythiaParticle.m(tParticle->GetMass());
267+
pythiaParticle.xProd(tParticle->Vx());
268+
pythiaParticle.yProd(tParticle->Vy());
269+
pythiaParticle.zProd(tParticle->Vz());
270+
pythiaParticle.mother1(particleCountCurrent); // particleCountCurrent is the offset to account for existing IDs of constituents of previous jets.
271+
// Not saving the actual mother ID because ImportParticles(genParticlesArray, "Final") only saves the final
272+
// particles, and the mother id still refer to particles not saved in
273+
// genParticlesArray a priori the mother-daughter links aren't needed
274+
// for the closure test this will be used for; keeping the initial
275+
// parton as mother for now
276+
277+
mPythia.event.append(pythiaParticle);
278+
}
279+
particleCountCurrent += nConstituents + 1; // +1 is for the jet parton itself, which is not in the final state
272280
}
273-
particleCountCurrent += nConstituents + 1; // +1 is for the jet parton itself, which is not in the final state
274-
}
275-
delete genParticlesArray;
281+
delete genParticlesArray;
276282

277-
if (mDebug) {
278-
mPythia.event.list();
283+
if (mDebug) {
284+
mPythia.event.list();
285+
}
279286
}
280287

281288
///////////////////////////////////////////////
@@ -339,10 +346,11 @@ private:
339346
////////////////////////////////////////////////
340347

341348
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
342-
const double mGenMinEta = -1.; /// minimum pseudorapidity for generated particles
343-
const double mGenMaxEta = +1.; /// maximum pseudorapidity for generated particles
349+
const double mGenMinEta = -0.9; /// minimum pseudorapidity for generated particles
350+
const double mGenMaxEta = +0.9; /// maximum pseudorapidity for generated particles
344351
int mCollTotalMultWithBkg; /// total multiplicity of the collision
345-
bool mGenerateUE = false; /// boolean to request (or not) embedding of the jet signal inside underlying event modelled by a thermal background
352+
bool mGenerateSignal = true; /// boolean to request (or not) the generation of the jet signal
353+
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
346354
const std::vector<std::string> mConfigurableSimParameterNames = {
347355
"sglGenRAA",
348356
"sglGenTAA",
@@ -392,6 +400,6 @@ private:
392400
///___________________________________________________________
393401
FairGenerator *generateParametrisedJetModel(std::string inputSimParametersPath,
394402
std::string inputSimParametersFileName,
395-
bool generateUE = true) {
396-
return new GeneratorParametrisedJetModel(inputSimParametersPath, inputSimParametersFileName, generateUE);
403+
bool generateUE, bool generateSignal = true) {
404+
return new GeneratorParametrisedJetModel(inputSimParametersPath, inputSimParametersFileName, generateUE, generateSignal);
397405
}

MC/config/PWGGAJE/ini/GeneratorPythia8Box_parametrisedModel_pythia6Fragmentation_PbPb_cent5080_noBkg.ini renamed to MC/config/PWGGAJE/ini/GeneratorPythia8Box_parametrisedModel_pythia6Fragmentation_PbPb_cent0010_Bkg.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### bkg production using pythia8 box generator, to embed jet-jet production into
22
[GeneratorExternal]
33
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/external/generator/parametrisedJetModel/generator_pythia8_box_parametrisedModel_pythia6Fragmentation.C
4-
funcName = generateParametrisedJetModel("/alice/cern.ch/user/a/alandou/Analysis/PWGJE/simSettings/combinatorialBkgClosure/", "parametrisedModel_PbPb_5p36TeV_cent5080.json", false)
4+
funcName = generateParametrisedJetModel("/alice/cern.ch/user/a/alandou/Analysis/PWGJE/simSettings/combinatorialBkgClosure/", "parametrisedModel_PbPb_5p36TeV_cent0010.json", true, false)
55

66
[GeneratorPythia8]
77
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/pythia8/generator/pythia8box_parametrisedModel.cfg

MC/config/PWGGAJE/ini/GeneratorPythia8Box_parametrisedModel_pythia6Fragmentation_PbPb_cent5080_withBkg.ini renamed to MC/config/PWGGAJE/ini/GeneratorPythia8Box_parametrisedModel_pythia6Fragmentation_PbPb_cent0010_Sgl.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### bkg production using pythia8 box generator, to embed jet-jet production into
22
[GeneratorExternal]
33
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/external/generator/parametrisedJetModel/generator_pythia8_box_parametrisedModel_pythia6Fragmentation.C
4-
funcName = generateParametrisedJetModel("/alice/cern.ch/user/a/alandou/Analysis/PWGJE/simSettings/combinatorialBkgClosure/", "parametrisedModel_PbPb_5p36TeV_cent5080.json", true)
4+
funcName = generateParametrisedJetModel("/alice/cern.ch/user/a/alandou/Analysis/PWGJE/simSettings/combinatorialBkgClosure/", "parametrisedModel_PbPb_5p36TeV_cent0010.json", false, true)
55

66
[GeneratorPythia8]
77
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/pythia8/generator/pythia8box_parametrisedModel.cfg

MC/config/PWGGAJE/ini/GeneratorPythia8Box_parametrisedModel_pythia6Fragmentation_PbPb_cent0010_noBkg.ini renamed to MC/config/PWGGAJE/ini/GeneratorPythia8Box_parametrisedModel_pythia6Fragmentation_PbPb_cent0010_SglBkg.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### bkg production using pythia8 box generator, to embed jet-jet production into
22
[GeneratorExternal]
33
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/external/generator/parametrisedJetModel/generator_pythia8_box_parametrisedModel_pythia6Fragmentation.C
4-
funcName = generateParametrisedJetModel("/alice/cern.ch/user/a/alandou/Analysis/PWGJE/simSettings/combinatorialBkgClosure/", "parametrisedModel_PbPb_5p36TeV_cent0010.json", false)
4+
funcName = generateParametrisedJetModel("/alice/cern.ch/user/a/alandou/Analysis/PWGJE/simSettings/combinatorialBkgClosure/", "parametrisedModel_PbPb_5p36TeV_cent0010.json", true, true)
55

66
[GeneratorPythia8]
77
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/pythia8/generator/pythia8box_parametrisedModel.cfg
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### bkg production using pythia8 box generator, to embed jet-jet production into
2+
[GeneratorExternal]
3+
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/external/generator/parametrisedJetModel/generator_pythia8_box_parametrisedModel_pythia6Fragmentation.C
4+
funcName = generateParametrisedJetModel("/alice/cern.ch/user/a/alandou/Analysis/PWGJE/simSettings/combinatorialBkgClosure/", "parametrisedModel_PbPb_5p36TeV_cent5080.json", true, false)
5+
6+
[GeneratorPythia8]
7+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/pythia8/generator/pythia8box_parametrisedModel.cfg
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### bkg production using pythia8 box generator, to embed jet-jet production into
2+
[GeneratorExternal]
3+
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/external/generator/parametrisedJetModel/generator_pythia8_box_parametrisedModel_pythia6Fragmentation.C
4+
funcName = generateParametrisedJetModel("/alice/cern.ch/user/a/alandou/Analysis/PWGJE/simSettings/combinatorialBkgClosure/", "parametrisedModel_PbPb_5p36TeV_cent5080.json", false, true)
5+
6+
[GeneratorPythia8]
7+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/pythia8/generator/pythia8box_parametrisedModel.cfg

MC/config/PWGGAJE/ini/GeneratorPythia8Box_parametrisedModel_pythia6Fragmentation_PbPb_cent0010_withBkg.ini renamed to MC/config/PWGGAJE/ini/GeneratorPythia8Box_parametrisedModel_pythia6Fragmentation_PbPb_cent5080_SglBkg.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### bkg production using pythia8 box generator, to embed jet-jet production into
22
[GeneratorExternal]
33
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/external/generator/parametrisedJetModel/generator_pythia8_box_parametrisedModel_pythia6Fragmentation.C
4-
funcName = generateParametrisedJetModel("/alice/cern.ch/user/a/alandou/Analysis/PWGJE/simSettings/combinatorialBkgClosure/", "parametrisedModel_PbPb_5p36TeV_cent0010.json", true)
4+
funcName = generateParametrisedJetModel("/alice/cern.ch/user/a/alandou/Analysis/PWGJE/simSettings/combinatorialBkgClosure/", "parametrisedModel_PbPb_5p36TeV_cent5080.json", true, true)
55

66
[GeneratorPythia8]
77
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/pythia8/generator/pythia8box_parametrisedModel.cfg

MC/config/PWGGAJE/ini/tests/GeneratorPythia8Box_parametrisedModel_pythia6Fragmentation_PbPb_cent0010_noBkg.C renamed to MC/config/PWGGAJE/ini/tests/GeneratorPythia8Box_parametrisedModel_pythia6Fragmentation_PbPb_cent0010_Bkg.C

File renamed without changes.

MC/config/PWGGAJE/ini/tests/GeneratorPythia8Box_parametrisedModel_pythia6Fragmentation_PbPb_cent0010_withBkg.C renamed to MC/config/PWGGAJE/ini/tests/GeneratorPythia8Box_parametrisedModel_pythia6Fragmentation_PbPb_cent0010_Sgl.C

File renamed without changes.

MC/config/PWGGAJE/ini/tests/GeneratorPythia8Box_parametrisedModel_pythia6Fragmentation_PbPb_cent5080_noBkg.C renamed to MC/config/PWGGAJE/ini/tests/GeneratorPythia8Box_parametrisedModel_pythia6Fragmentation_PbPb_cent0010_SglBkg.C

File renamed without changes.

0 commit comments

Comments
 (0)