Skip to content

Commit 3ebb575

Browse files
author
Ionut Cristian Arsene
committed
Adding a generator for combined inclusive jpsi and psi2S via hadron triggered pythia
1 parent b5303c1 commit 3ebb575

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

MC/config/PWGDQ/external/generator/generator_pythia8_HadronTriggered_withGap.C

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,42 @@ FairGenerator*
173173
// print debug
174174
// gen->PrintDebug();
175175

176+
return gen;
177+
178+
}
179+
180+
// Predefined generators:
181+
FairGenerator*
182+
GeneratorInclusiveJpsiPsi2S_EvtGenMidY(int triggerGap, double rapidityMin = -1.5, double rapidityMax = 1.5, bool verbose = false)
183+
{
184+
auto gen = new o2::eventgen::GeneratorEvtGen<o2::eventgen::GeneratorPythia8HadronTriggeredWithGap>();
185+
gen->setTriggerGap(triggerGap);
186+
gen->setRapidityRange(rapidityMin, rapidityMax);
187+
gen->addHadronPDGs(443);
188+
gen->addHadronPDGs(100443);
189+
gen->setVerbose(verbose);
190+
191+
TString pathO2table = gSystem->ExpandPathName("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGDQ/pythia8/decayer/switchOffJpsi.cfg");
192+
gen->readFile(pathO2table.Data());
193+
gen->setConfigMBdecays(pathO2table);
194+
gen->PrintDebug(true);
195+
196+
gen->SetSizePdg(2);
197+
gen->AddPdg(443, 0);
198+
gen->AddPdg(100443, 1);
199+
200+
gen->SetForceDecay(kEvtDiElectron);
201+
202+
// set random seed
203+
gen->readString("Random:setSeed on");
204+
uint random_seed;
205+
unsigned long long int random_value = 0;
206+
ifstream urandom("/dev/urandom", ios::in|ios::binary);
207+
urandom.read(reinterpret_cast<char*>(&random_value), sizeof(random_seed));
208+
gen->readString(Form("Random:seed = %llu", random_value % 900000001));
209+
210+
// print debug
211+
// gen->PrintDebug();
212+
176213
return gen;
177214
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### The external generator derives from GeneratorPythia8.
2+
[GeneratorExternal]
3+
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGDQ/external/generator/generator_pythia8_HadronTriggered_withGap.C
4+
funcName=GeneratorInclusiveJpsiPsi2S_EvtGenMidY(5,-1.5,1.5)
5+
6+
[GeneratorPythia8]
7+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGDQ/pythia8/generator/pythia8_inel_triggerGap.cfg
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#switch off jpsi decays
22

33
443:mayDecay off # J/psi
4+
100443:mayDecay off # psi(2S)

0 commit comments

Comments
 (0)