|
12 | 12 | /// `o2-sim -g external --configKeyValues 'GeneratorExternal.fileName=generator_pythia8_LF_rapidity.C;GeneratorExternal.funcName=generateLFRapidity({{1000010020, 10, 0.5, 10, -1.0, 1.0}, {1000010030, 10, 0.5, 10, -1.0, 1.0}})'` |
13 | 13 | /// Here PDG, Number injected, pT limits, rapidity limits are divided per particle |
14 | 14 | /// or: |
15 | | -/// `o2-sim -g external --configKeyValues 'GeneratorExternal.fileName=generator_pythia8_LF_rapidity.C;GeneratorExternal.funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/nuclei_rapidity.gun")'` |
| 15 | +/// `o2-sim -g external --configKeyValues 'GeneratorExternal.fileName=generator_pythia8_LF_rapidity.C;GeneratorExternal.funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/exotic_nuclei_pp.gun")'` |
16 | 16 | /// Here PDG, Number injected, pT limits, rapidity limits are provided via an intermediate configuration file |
17 | 17 | /// |
18 | 18 |
|
|
51 | 51 | #endif |
52 | 52 | #pragma cling load("libO2Generators") |
53 | 53 | #endif |
54 | | -#include "Generators/GeneratorPythia8.h" |
| 54 | +// #include "Generators/GeneratorPythia8.h" |
| 55 | +#include "generator_pythia8_longlived.C" |
55 | 56 | #include <nlohmann/json.hpp> |
56 | 57 |
|
57 | 58 | using namespace Pythia8; |
58 | 59 | using namespace o2::mcgenstatus; |
59 | 60 |
|
60 | | -// Helper function to get mass from PDG code (copied from generator_pythia8_longlived.C to avoid include issues) |
61 | | -namespace { |
62 | | -double getMassFromPDG(int input_pdg) |
63 | | -{ |
64 | | - double mass = 0; |
65 | | - if (TDatabasePDG::Instance()) |
66 | | - { |
67 | | - TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(input_pdg); |
68 | | - if (particle) { |
69 | | - mass = particle->Mass(); |
70 | | - } else { |
71 | | - LOG(warning) << "Unknown particle requested with PDG " << input_pdg << ", mass set to 0"; |
72 | | - } |
73 | | - } |
74 | | - return mass; |
75 | | -} |
76 | | -} |
| 61 | +// // Helper function to get mass from PDG code (copied from generator_pythia8_longlived.C to avoid include issues) |
| 62 | +// namespace { |
| 63 | +// double getMassFromPDG(int input_pdg) |
| 64 | +// { |
| 65 | +// double mass = 0; |
| 66 | +// if (TDatabasePDG::Instance()) |
| 67 | +// { |
| 68 | +// TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(input_pdg); |
| 69 | +// if (particle) { |
| 70 | +// mass = particle->Mass(); |
| 71 | +// } else { |
| 72 | +// LOG(warning) << "Unknown particle requested with PDG " << input_pdg << ", mass set to 0"; |
| 73 | +// } |
| 74 | +// } |
| 75 | +// return mass; |
| 76 | +// } |
| 77 | +// } |
77 | 78 |
|
78 | 79 | class GeneratorPythia8LFRapidity : public o2::eventgen::GeneratorPythia8 |
79 | 80 | { |
@@ -362,7 +363,8 @@ class GeneratorPythia8LFRapidity : public o2::eventgen::GeneratorPythia8 |
362 | 363 | mRapidityMin{rapidityMin}, |
363 | 364 | mRapidityMax{rapidityMax} |
364 | 365 | { |
365 | | - mMass = getMassFromPDG(mPdg); |
| 366 | + // mMass = getMassFromPDG(mPdg); |
| 367 | + mMass = GeneratorPythia8LongLivedGun::getMass(mPdg); |
366 | 368 | if (mMass <= 0) { |
367 | 369 | LOG(fatal) << "Could not find mass for mPdg " << mPdg; |
368 | 370 | } |
@@ -533,7 +535,7 @@ FairGenerator* generateLFRapidity(std::vector<GeneratorPythia8LFRapidity::Config |
533 | 535 |
|
534 | 536 | ///___________________________________________________________ |
535 | 537 | /// Create generator via input file |
536 | | -FairGenerator* generateLFRapidity(std::string configuration = "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/nuclei_rapidity.gun", |
| 538 | +FairGenerator* generateLFRapidity(std::string configuration = "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/exotic_nuclei_pp.gun", |
537 | 539 | bool injectOnePDGPerEvent = true, |
538 | 540 | int gapBetweenInjection = 0, |
539 | 541 | bool useTrigger = false, |
@@ -587,7 +589,7 @@ FairGenerator* generateLFRapidity(std::string configuration = "${O2DPG_MC_CONFIG |
587 | 589 |
|
588 | 590 | ///___________________________________________________________ |
589 | 591 | /// Create generator via input file for the triggered mode |
590 | | -FairGenerator* generateLFRapidityTriggered(std::string configuration = "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/nuclei_rapidity.gun", |
| 592 | +FairGenerator* generateLFRapidityTriggered(std::string configuration = "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/exotic_nuclei_pp.gun", |
591 | 593 | int gapBetweenInjection = 0, |
592 | 594 | std::string pythiaCfgMb = "", |
593 | 595 | std::string pythiaCfgSignal = "") |
|
0 commit comments