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
38 changes: 38 additions & 0 deletions MC/config/ALICE3/ini/tests/xicc_background_PbPb.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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");
if (!tree) {
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
return 1;
}

std::vector<o2::MCTrack> *tracks{};
tree->SetBranchAddress("MCTrack", &tracks);
auto nEvents = tree->GetEntries();
int nInjected = 0;
for (int i = 0; i < nEvents; i++) {
tree->GetEntry(i);
for (auto& track : *tracks) {
auto pdgCode = std::fabs(track.GetPdgCode());
if (pdgCode == 3312) {
nInjected++;
}
}
}

// Check if we are above typical Angantyr numbers
if (nInjected < 5 * nEvents) {
std::cerr << "Too few particles injected\n";
return 1;
}

return 0;
}
9 changes: 9 additions & 0 deletions MC/config/ALICE3/ini/xicc_background_PbPb.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Diamond]
width[2]=6.0

[GeneratorExternal]
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator_pythia8_strangeness_gun_PbPb.C
funcName=generatePYTHIA()

[GeneratorPythia8]
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator/pythia8_PbPb.cfg
Loading