Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions MC/config/PWGLF/ini/GeneratorLF_Resonances_pp900.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[GeneratorExternal]
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C
funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun.json", true, 4, true, false, "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp900gev.cfg", "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp900gev.cfg")
funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun.json", true, 4, false, false, "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp900gev.cfg", "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp900gev.cfg")

# [GeneratorPythia8] # if triggered then this will be used as the background event
# config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp900gev.cfg
[GeneratorPythia8] # if triggered then this will be used as the background event
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp900gev.cfg

[DecayerPythia8] # after for transport code!
config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg
config[1]=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonances.cfg
config[1]=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonances.cfg
10 changes: 10 additions & 0 deletions MC/config/PWGLF/pythia8/generator/lambda1520.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Define resonance
ProcessLevel:all = off # will not look for the 'process'

# id::all = name antiName spinType chargeType colType m0 mWidth mMin mMax tau0
102134:all = Lambda1520 Lambda1520bar 4 0 0 1.51950 0.01560 1.47 1.60 0

### add Resonance decays absent in PYTHIA8 decay table and set BRs from PDG for other
102134:oneChannel = 1 1.000 0 2212 -321
102134:onMode = off
102134:onIfMatch = 2212 -321
24 changes: 24 additions & 0 deletions MC/config/PWGLF/pythia8/generator/lambda1520gun_inj.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"Lambda(1520)0" : {
"pdg": 102134,
"n": 5,
"ptMin": 0.0,
"ptMax": 15,
"etaMin": -1.0,
"etaMax": 1.0,
"rapidityMin": -1.0,
"rapidityMax": 1.0,
"genDecayed": true
},
"anti-Lambda(1520)0" : {
"pdg": -102134,
"n": 5,
"ptMin": 0.0,
"ptMax": 15,
"etaMin": -1.0,
"etaMax": 1.0,
"rapidityMin": -1.0,
"rapidityMax": 1.0,
"genDecayed": true
}
}
50 changes: 28 additions & 22 deletions MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
///

#if !defined(__CLING__) || defined(__ROOTCLING__)
#include "Pythia8/Pythia.h"
#include "FairGenerator.h"
#include "Generators/GeneratorPythia8.h"
#include "TRandom3.h"
#include "TParticlePDG.h"

#include "TDatabasePDG.h"
#include "TMath.h"
#include "TParticlePDG.h"
#include "TRandom3.h"

#include "Generators/GeneratorPythia8.h"
#include "Pythia8/Pythia.h"
#if __has_include("SimulationDataFormat/MCGenStatus.h")
#include "SimulationDataFormat/MCGenStatus.h"
#else
Expand All @@ -32,11 +34,13 @@
#if __has_include("SimulationDataFormat/MCUtils.h")
#include "SimulationDataFormat/MCUtils.h"
#endif
#include "fairlogger/Logger.h"
#include "TSystem.h"
#include <fstream>

#include "Generators/GeneratorPythia8Param.h"
#include "fairlogger/Logger.h"

#include <cmath>
#include <fstream>
#endif
// DecayerPythia8Param needs to be included after the #endif to work with Cling
#include "Generators/DecayerPythia8Param.h"
Expand All @@ -53,6 +57,7 @@
#endif
// #include "Generators/GeneratorPythia8.h"
#include "generator_pythia8_longlived.C"

#include <nlohmann/json.hpp>

using namespace Pythia8;
Expand All @@ -66,12 +71,12 @@ class GeneratorPythia8LFRapidity : public o2::eventgen::GeneratorPythia8
int gapBetweenInjection = 0,
bool useTrigger = false,
bool useRapidity = false,
std::string pythiaCfgMb = "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/pythia8_inel_minbias.cfg",
std::string pythiaCfgMb = "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg",
std::string pythiaCfgSignal = "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/pythia8_inel_signal.cfg") : GeneratorPythia8{},
mOneInjectionPerEvent{injOnePerEvent},
mGapBetweenInjection{gapBetweenInjection},
mUseTriggering{useTrigger},
mUseRapidity{useRapidity}
mOneInjectionPerEvent{injOnePerEvent},
mGapBetweenInjection{gapBetweenInjection},
mUseTriggering{useTrigger},
mUseRapidity{useRapidity}
{
LOG(info) << "GeneratorPythia8LFRapidity constructor";
LOG(info) << "++ mOneInjectionPerEvent: " << mOneInjectionPerEvent;
Expand Down Expand Up @@ -127,7 +132,7 @@ class GeneratorPythia8LFRapidity : public o2::eventgen::GeneratorPythia8
}
// FIX: Fallback if still empty to default minbias
if (pythiaCfgMb == "") {
pythiaCfgMb = "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/pythia8_inel_minbias.cfg";
pythiaCfgMb = "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg";
}
pythiaCfgMb = gSystem->ExpandPathName(pythiaCfgMb.c_str());
if (!pythiaObjectMinimumBias.readFile(pythiaCfgMb)) {
Expand All @@ -143,11 +148,11 @@ class GeneratorPythia8LFRapidity : public o2::eventgen::GeneratorPythia8
mPythiaGun.readString("ProcessLevel:all off");

/** config **/
auto& paramGen = o2::eventgen::GeneratorPythia8Param::Instance();
/* auto& paramGen = o2::eventgen::GeneratorPythia8Param::Instance();
if (!paramGen.config.empty()) {
LOG(fatal) << "Configuration file provided for \'GeneratorPythia8\' should be empty for this injection scheme";
return;
}
} */
auto& param = o2::eventgen::DecayerPythia8Param::Instance();
LOG(info) << "Init \'GeneratorPythia8LFRapidity\' with following parameters";
LOG(info) << param;
Expand Down Expand Up @@ -191,11 +196,12 @@ class GeneratorPythia8LFRapidity : public o2::eventgen::GeneratorPythia8
if (!mUseTriggering) { // Injected mode: Embedding into MB
// 1. Generate Background (MB)
// LOG(info) << "Generating background event " << mEventCounter;

bool lGenerationOK = false;
while (!lGenerationOK) {
lGenerationOK = pythiaObjectMinimumBias.next();
}
mPythia.event = pythiaObjectMinimumBias.event; // Copy MB event to main event
mPythia.event = pythiaObjectMinimumBias.event;

// 2. Determine if we inject specific particles (Gap logic)
bool doInjection = true;
Expand Down Expand Up @@ -232,7 +238,7 @@ class GeneratorPythia8LFRapidity : public o2::eventgen::GeneratorPythia8
}
LOG(info) << "Using config container ";
cfg.print();
if (mUseTriggering) { // Do the triggering
if (mUseTriggering) { // Do the triggering
bool doSignal{mEventCounter % (mGapBetweenInjection + 1) == 0}; // Do signal or gap

if (doSignal) {
Expand Down Expand Up @@ -475,13 +481,13 @@ class GeneratorPythia8LFRapidity : public o2::eventgen::GeneratorPythia8
}
}
};
ConfigContainer(TString line) : ConfigContainer(line.Tokenize(" ")){};
ConfigContainer(TString line) : ConfigContainer(line.Tokenize(" ")) {};
ConfigContainer(const nlohmann::json& jsonParams, bool useRapidity = false) : ConfigContainer(jsonParams["pdg"],
jsonParams["n"],
jsonParams["ptMin"],
jsonParams["ptMax"],
(useRapidity && jsonParams.contains("rapidityMin")) ? jsonParams["rapidityMin"] : (jsonParams.contains("min") ? jsonParams["min"] : jsonParams["etaMin"]),
(useRapidity && jsonParams.contains("rapidityMax")) ? jsonParams["rapidityMax"] : (jsonParams.contains("max") ? jsonParams["max"] : jsonParams["etaMax"])){};
jsonParams["n"],
jsonParams["ptMin"],
jsonParams["ptMax"],
(useRapidity && jsonParams.contains("rapidityMin")) ? jsonParams["rapidityMin"] : (jsonParams.contains("min") ? jsonParams["min"] : jsonParams["etaMin"]),
(useRapidity && jsonParams.contains("rapidityMax")) ? jsonParams["rapidityMax"] : (jsonParams.contains("max") ? jsonParams["max"] : jsonParams["etaMax"])) {};

// Data Members
const int mPdg = 0;
Expand Down