diff --git a/MC/config/PWGEM/ini/Pythia8_Beauty_Cocktail_pp536_fixMEmode.ini b/MC/config/PWGEM/ini/Pythia8_Beauty_Cocktail_pp536_fixMEmode.ini new file mode 100644 index 000000000..1de490707 --- /dev/null +++ b/MC/config/PWGEM/ini/Pythia8_Beauty_Cocktail_pp536_fixMEmode.ini @@ -0,0 +1,13 @@ +[GeneratorExternal] +fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/Generator_pythia8_forcedDecays.C +funcName=GeneratePythia8ForcedDecays("411;421;431;4122;4232;4132;4332") + +[GeneratorPythia8] +config = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/pythia8/generator/pythia8_hf_cocktail_pp536.cfg +hooksFileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/hooks/pythia8_userhooks_qqbar.C +hooksFuncName = pythia8_userhooks_bbbar(-12.,12.) +includePartonEvent=true + +[DecayerPythia8] +config[0] = ${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg +config[1] = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/pythia8/decayer/force_semileptonic_charm.cfg diff --git a/MC/config/PWGEM/ini/Pythia8_Charm_Cocktail_pp536_fixMEmode.ini b/MC/config/PWGEM/ini/Pythia8_Charm_Cocktail_pp536_fixMEmode.ini new file mode 100644 index 000000000..bddbf92c2 --- /dev/null +++ b/MC/config/PWGEM/ini/Pythia8_Charm_Cocktail_pp536_fixMEmode.ini @@ -0,0 +1,13 @@ +[GeneratorExternal] +fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/Generator_pythia8_forcedDecays.C +funcName=GeneratePythia8ForcedDecays("411;421;431;4122;4232;4132;4332") + +[GeneratorPythia8] +config = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/pythia8/generator/pythia8_hf_cocktail_pp536.cfg +hooksFileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/hooks/pythia8_userhooks_qqbar.C +hooksFuncName = pythia8_userhooks_ccbar(-12.,12.) +includePartonEvent=true + +[DecayerPythia8] +config[0] = ${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg +config[1] = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/pythia8/decayer/force_semileptonic_charm_fixMEmode.cfg diff --git a/MC/config/PWGEM/ini/tests/Pythia8_Beauty_Cocktail_pp536_fixMEmode.C b/MC/config/PWGEM/ini/tests/Pythia8_Beauty_Cocktail_pp536_fixMEmode.C new file mode 100644 index 000000000..ef3c3929e --- /dev/null +++ b/MC/config/PWGEM/ini/tests/Pythia8_Beauty_Cocktail_pp536_fixMEmode.C @@ -0,0 +1,61 @@ +int External() +{ + + std::string path{"o2sim_Kine.root"}; + TFile file(path.c_str(), "READ"); + if (file.IsZombie()) { + std::cerr << "Cannot open ROOT file " << path << "\n"; + return 1; + } + + auto tree = (TTree*)file.Get("o2sim"); + std::vector* tracks{}; + tree->SetBranchAddress("MCTrack", &tracks); + auto nEvents = tree->GetEntries(); + for (int i = 0; i < nEvents; i++) { + tree->GetEntry(i); + bool found_b = false; + bool found_bbar = false; + for (auto& track : *tracks) { + int pdg = track.GetPdgCode(); + if (pdg == 5){ + found_b = true; + } + if (pdg == -5){ + found_bbar = true; + } + if ( abs(pdg) == 411 || abs(pdg) == 421 || abs(pdg) == 431 || abs(pdg) == 4122 || abs(pdg) == 4232 || abs(pdg) == 4132 || abs(pdg) == 4332){ + int ifirstdaughter = track.getFirstDaughterTrackId(); + int ilastdaughter = track.getLastDaughterTrackId(); + if (ifirstdaughter == -1 || ilastdaughter == -1){ + std::cerr << "Found charm hadron that does not have daughters" << "\n"; + return 1; + } + bool found_electron = false; + for (int j = ifirstdaughter; j<= ilastdaughter; j++){ + auto track2 = (*tracks)[j]; + if ( abs(track2.GetPdgCode())==11){ + found_electron = true; + if (!(track2.getWeight() < 0.999)){ + std::cerr << "Found electron from forced decay with weight 1" << "\n"; + return 1; + } + if (!track2.getToBeDone()){ + std::cerr << "Found electron from forced decay that is not transported" << "\n"; + return 1; + } + } + } + if (!found_electron){ + std::cerr << "Found charm hadron that does not decay to electron" << "\n"; + return 1; + } + } + } + if ((!found_b) || (!found_bbar)){ + std::cerr << "Found event without b-bbar pair" << "\n"; + return 1; + } + } + return 0; +} diff --git a/MC/config/PWGEM/ini/tests/Pythia8_Charm_Cocktail_pp536_fixMEmode.C b/MC/config/PWGEM/ini/tests/Pythia8_Charm_Cocktail_pp536_fixMEmode.C new file mode 100644 index 000000000..1d4b785e3 --- /dev/null +++ b/MC/config/PWGEM/ini/tests/Pythia8_Charm_Cocktail_pp536_fixMEmode.C @@ -0,0 +1,61 @@ +int External() +{ + + std::string path{"o2sim_Kine.root"}; + TFile file(path.c_str(), "READ"); + if (file.IsZombie()) { + std::cerr << "Cannot open ROOT file " << path << "\n"; + return 1; + } + + auto tree = (TTree*)file.Get("o2sim"); + std::vector* tracks{}; + tree->SetBranchAddress("MCTrack", &tracks); + auto nEvents = tree->GetEntries(); + for (int i = 0; i < nEvents; i++) { + tree->GetEntry(i); + bool found_c = false; + bool found_cbar = false; + for (auto& track : *tracks) { + int pdg = track.GetPdgCode(); + if (pdg == 4){ + found_c = true; + } + if (pdg == -4){ + found_cbar = true; + } + if ( abs(pdg) == 411 || abs(pdg) == 421 || abs(pdg) == 431 || abs(pdg) == 4122 || abs(pdg) == 4232 || abs(pdg) == 4132 || abs(pdg) == 4332){ + int ifirstdaughter = track.getFirstDaughterTrackId(); + int ilastdaughter = track.getLastDaughterTrackId(); + if (ifirstdaughter == -1 || ilastdaughter == -1){ + std::cerr << "Found charm hadron that does not have daughters" << "\n"; + return 1; + } + bool found_electron = false; + for (int j = ifirstdaughter; j<= ilastdaughter; j++){ + auto track2 = (*tracks)[j]; + if ( abs(track2.GetPdgCode())==11){ + found_electron = true; + if (!(track2.getWeight() < 0.999)){ + std::cerr << "Found electron from forced decay with weight 1" << "\n"; + return 1; + } + if (!track2.getToBeDone()){ + std::cerr << "Found electron from forced decay that is not transported" << "\n"; + return 1; + } + } + } + if (!found_electron){ + std::cerr << "Found charm hadron that does not decay to electron" << "\n"; + return 1; + } + } + } + if ((!found_c) || (!found_cbar)){ + std::cerr << "Found event without c-cbar pair" << "\n"; + return 1; + } + } + return 0; +} diff --git a/MC/config/PWGEM/pythia8/decayer/force_semileptonic_charm_fixMEmode.cfg b/MC/config/PWGEM/pythia8/decayer/force_semileptonic_charm_fixMEmode.cfg new file mode 100644 index 000000000..78c5152a2 --- /dev/null +++ b/MC/config/PWGEM/pythia8/decayer/force_semileptonic_charm_fixMEmode.cfg @@ -0,0 +1,26 @@ +### only semileptonic decays for charm +### D+ +411:oneChannel = 1 0.087 22 -311 -11 12 +411:addChannel = 1 0.040 22 -321 211 -11 12 +411:addChannel = 1 0.037 22 -313 -11 12 +### D0 +421:oneChannel = 1 0.035 22 -321 -11 12 +421:addChannel = 1 0.022 22 -323 -11 12 +421:addChannel = 1 0.016 22 -321 111 -11 12 +421:addChannel = 1 0.014 22 -311 -211 -11 12 +### Ds +431:oneChannel = 1 0.025 22 333 -11 12 +431:addChannel = 1 0.027 22 221 -11 12 +### Lambdac +4122:oneChannel = 1 0.036 22 3122 -11 12 +### chi_{c}^{+} +4232:oneChannel = 1 0.07 22 3322 -11 12 +### chi_{c}^{0} +4132:oneChannel = 1 0.014 22 3312 -11 12 +### Omega_{c} +4332:oneChannel = 1 0.01224 22 3334 -11 12 + +# Correct OmegaC decay length (wrong in PYTHIA8 decay table) (mm/c) +4332:tau0 = 0.08000000000 +# Correct Lb decay length (wrong in PYTHIA8 decay table) +5122:tau0 = 4.41000e-01 \ No newline at end of file