Skip to content
Merged
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
7 changes: 7 additions & 0 deletions MC/config/PWGHF/ini/GeneratorHFTrigger_LambdaBToNuclei.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### The external generator derives from GeneratorPythia8.
[GeneratorExternal]
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/external/generator/generator_pythia8_hfhadron_to_nuclei.C
funcName=generateHFHadToNuclei(3, {5122}, {1000020030, 1000010030}, true, 0.5)

[GeneratorPythia8]
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_lambdab_with_decays_Mode2.cfg
56 changes: 56 additions & 0 deletions MC/config/PWGHF/ini/tests/GeneratorHFTrigger_LambdaBToNuclei.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
int External()
{
std::string path{"o2sim_Kine.root"};
std::vector<int> checkPdgHadron{5122}; // Lambda_b
std::vector<int> nucleiDauPdg{1000020030, 1000010030}; // 3He, 3H

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<o2::MCTrack> *tracks{};
tree->SetBranchAddress("MCTrack", &tracks);

int nSignals{}, nSignalGoodDecay{};
auto nEvents = tree->GetEntries();

for (int i = 0; i < nEvents; i++)
{
tree->GetEntry(i);
for (auto &track : *tracks)
{
auto pdg = track.GetPdgCode();
if (std::find(checkPdgHadron.begin(), checkPdgHadron.end(), std::abs(pdg)) != checkPdgHadron.end()) // found signal
{
// count signal PDG
if(std::abs(track.GetRapidity()) > 1.5) continue; // skip if outside rapidity window
nSignals++;
for (int j{track.getFirstDaughterTrackId()}; j <= track.getLastDaughterTrackId(); ++j)
{
auto pdgDau = tracks->at(j).GetPdgCode();
if (std::find(nucleiDauPdg.begin(), nucleiDauPdg.end(), std::abs(pdgDau)) != nucleiDauPdg.end())
{
nSignalGoodDecay++;
}
}
}
}
}
std::cout << "--------------------------------\n";
std::cout << "# Events: " << nEvents << "\n";
std::cout <<"# signal hadrons: " << nSignals << "\n";
std::cout <<"# signal hadrons decaying into nuclei: " << nSignalGoodDecay << "\n";

float fracForcedDecays = float(nSignalGoodDecay) / nSignals;
if (fracForcedDecays < 0.8) // we put some tolerance (lambdaB in MB events do not coalesce)
{
std::cerr << "Fraction of signals decaying into nuclei: " << fracForcedDecays << ", lower than expected\n";
return 1;
}

return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
### authors: Fabrizio Grosa (fabrizio.grosa@cern.ch)
### Cristina Terrevoli (cristina.terrevoli@cern.ch)
### Fabio Catalano (fabio.catalano@cern.ch)
### last update: November 2023

### beams
Beams:idA 2212 # proton
Beams:idB 2212 # proton
Beams:eCM 13600. # GeV

### processes
SoftQCD:inelastic on # all inelastic processes

### decays
ParticleDecays:limitTau0 on
ParticleDecays:tau0Max 10.

### switching on Pythia Mode2
ColourReconnection:mode 1
ColourReconnection:allowDoubleJunRem off
ColourReconnection:m0 0.3
ColourReconnection:allowJunctions on
ColourReconnection:junctionCorrection 1.20
ColourReconnection:timeDilationMode 2
ColourReconnection:timeDilationPar 0.18
StringPT:sigma 0.335
StringZ:aLund 0.36
StringZ:bLund 0.56
StringFlav:probQQtoQ 0.078
StringFlav:ProbStoUD 0.2
StringFlav:probQQ1toQQ0join 0.0275,0.0275,0.0275,0.0275
MultiPartonInteractions:pT0Ref 2.15
BeamRemnants:remnantMode 1
BeamRemnants:saturation 5

# Correct decay lengths (wrong in PYTHIA8 decay table)
# Lb
5122:tau0 = 0.4390
# Xic0
4132:tau0 = 0.0455
# OmegaC
4332:tau0 = 0.0803

## Lb decay modes
5122:onMode = off
5122:oneChannel = 1 9.03e-05 0 2212 2212 -2212 -2212 2112
5122:addChannel = 1 0.00181 0 2212 2212 -2212 -2212 2112 111
5122:addChannel = 1 0.0181 0 2212 2212 -2212 -2212 2112 111 111
5122:addChannel = 1 0.0271 0 2212 2212 -2212 -2212 2112 211 -211
5122:addChannel = 1 0.0181 0 2212 2212 -2212 -2212 2112 211 211 -211 -211
5122:addChannel = 1 0.181 0 2212 2212 -2212 -2212 2112 211 -211 111
5122:addChannel = 1 0.199 0 2212 2212 -2212 -2212 2112 211 -211 111 111
5122:addChannel = 1 0.0271 0 2212 2212 -2212 -2212 2112 211 211 -211 -211 111
5122:addChannel = 1 0.00452 0 2212 2212 -2212 -2212 2112 211 111
5122:addChannel = 1 0.0361 0 2212 2212 2112 -2212 -2112 -211 111
5122:addChannel = 1 0.0452 0 2212 2212 2112 -2212 -2112 -211 111 111
5122:addChannel = 1 0.0542 0 2212 2212 2112 -2212 -2112 -211 -211 211
5122:addChannel = 1 0.361 0 2212 2212 2112 -2212 -2112 -211 -211 211 111
5122:addChannel = 1 0.0271 0 2212 2212 2112 -2212 -2112 -211 -211 211 111 111
5122:onIfMatch = 2212 2212 2212 2212 2112
5122:onIfMatch = 2212 2212 2212 2212 2112 111
5122:onIfMatch = 2212 2212 2212 2212 2112 111 111
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211 211 211
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211 111
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211 111 111
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211 211 211 111
5122:onIfMatch = 2212 2212 2212 2212 2112 211 111
5122:onIfMatch = 2212 2212 2112 2212 2112 211 111
5122:onIfMatch = 2212 2212 2112 2212 2112 211 111 111
5122:onIfMatch = 2212 2212 2112 2212 2112 211 211 211
5122:onIfMatch = 2212 2212 2112 2212 2112 211 211 211 111
5122:onIfMatch = 2212 2212 2112 2212 2112 211 211 211 111 111