diff --git a/MC/config/ALICE3/ini/tests/xi_PbPb.C b/MC/config/ALICE3/ini/tests/xi_PbPb.C new file mode 100644 index 000000000..5d55db370 --- /dev/null +++ b/MC/config/ALICE3/ini/tests/xi_PbPb.C @@ -0,0 +1,46 @@ +int External() +{ + std::string path{"o2sim_Kine.root"}; + int pdgToCheck = 3312; + + TFile file(path.c_str(), "read"); + if (file.IsZombie()) { + std::cerr << "Cannot open ROOT file " << path << std::endl; + return 1; + } + + int nInjectedParticles = 0; + TTree* tree = (TTree*)file.Get("o2sim"); + + if (!tree) { + std::cerr << "Cannot find tree o2sim in file " << path << std::endl; + return 1; + } + + std::vector *tracks{}; + tree->SetBranchAddress("MCTrack", &tracks); + + int nEvents = tree->GetEntries(); + for (int i = 0; i < nEvents; i++) { + tree->GetEntry(i); + for (auto& track : *tracks) { + auto pdgCode = track.GetPdgCode(); + if (pdgCode == pdgToCheck) { + // not injecting anti-particle + nInjectedParticles++; + } + } + } + + if (nInjectedParticles < nEvents) { + // Check that we are correctly injecting 15 + // particle per event + return 1; + } + + return 0; +} + + + + diff --git a/MC/config/ALICE3/ini/tests/xi_pp.C b/MC/config/ALICE3/ini/tests/xi_pp.C new file mode 100644 index 000000000..9a09b788e --- /dev/null +++ b/MC/config/ALICE3/ini/tests/xi_pp.C @@ -0,0 +1,46 @@ +int External() +{ + std::string path{"o2sim_Kine.root"}; + int pdgToCheck = 3312; + + TFile file(path.c_str(), "read"); + if (file.IsZombie()) { + std::cerr << "Cannot open ROOT file " << path << std::endl; + return 1; + } + + int nInjectedParticles = 0; + TTree* tree = (TTree*)file.Get("o2sim"); + + if (!tree) { + std::cerr << "Cannot find tree o2sim in file " << path << "\n"; + return 1; + } + + std::vector *tracks{}; + tree->SetBranchAddress("MCTrack", &tracks); + + int nEvents = tree->GetEntries(); + for (int i = 0; i < nEvents; i++) { + tree->GetEntry(i); + for (auto& track : *tracks) { + auto pdgCode = track.GetPdgCode(); + if (pdgCode == pdgToCheck) { + // not injecting anti-particle + nInjectedParticles++; + } + } + } + + if (nInjectedParticles < nEvents) { + // Check that we are correctly injecting one + // particle per event + return 1; + } + + return 0; +} + + + + diff --git a/MC/config/ALICE3/ini/xi_PbPb.ini b/MC/config/ALICE3/ini/xi_PbPb.ini new file mode 100755 index 000000000..efa324ead --- /dev/null +++ b/MC/config/ALICE3/ini/xi_PbPb.ini @@ -0,0 +1,6 @@ +[GeneratorExternal] +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator_pythia8_gun_PbPb.C +funcName=generateNativeXi() + +[GeneratorPythia8] +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator/config_custom_xicc.cfg \ No newline at end of file diff --git a/MC/config/ALICE3/ini/xi_pp.ini b/MC/config/ALICE3/ini/xi_pp.ini new file mode 100755 index 000000000..90039ae12 --- /dev/null +++ b/MC/config/ALICE3/ini/xi_pp.ini @@ -0,0 +1,6 @@ +[GeneratorExternal] +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator_pythia8_gun_pp.C +funcName=generateNativeXi() + +[GeneratorPythia8] +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator/config_custom_xicc.cfg \ No newline at end of file