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
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[GeneratorExternal]
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C
funcName=generateLFTriggered("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/strangeparticlelist.gun", 4)

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

[DecayerPythia8]
config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
int External()
{
std::string path{"o2sim_Kine.root"};
int numberOfInjectedSignalsPerEvent{1};
std::vector<int> injectedPDGs = {
3334,
-3334,
3312,
-3312};

auto nInjection = injectedPDGs.size();

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);

std::vector<int> nSignal;
for (int i = 0; i < nInjection; i++) {
nSignal.push_back(0);
}

auto nEvents = tree->GetEntries();
for (int i = 0; i < nEvents; i++) {
auto check = tree->GetEntry(i);
for (int idxMCTrack = 0; idxMCTrack < tracks->size(); ++idxMCTrack) {
auto track = tracks->at(idxMCTrack);
auto pdg = track.GetPdgCode();
auto it = std::find(injectedPDGs.begin(), injectedPDGs.end(), pdg);
int index = std::distance(injectedPDGs.begin(), it); // index of injected PDG
if (it != injectedPDGs.end()) // found
{
// count signal PDG
nSignal[index]++;
}
}
}
std::cout << "--------------------------------\n";
std::cout << "# Events: " << nEvents << "\n";
for (int i = 0; i < nInjection; i++) {
std::cout << "# Injected nuclei \n";
std::cout << injectedPDGs[i] << ": " << nSignal[i] << "\n";
if (nSignal[i] == 0) {
std::cerr << "No generated: " << injectedPDGs[i] << "\n";
return 1; // At least one of the injected particles should be generated
}
}
return 0;
}
29 changes: 29 additions & 0 deletions MC/config/PWGLF/pythia8/generator/pythia8_jet_ropes_136tev.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
### beams
Beams:idA = 2212 # proton
Beams:idB = 2212 # proton
Beams:eCM = 13600. # GeV

### processes
SoftQCD:inelastic = off
HardQCD:all = on

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

### phase space cuts
PhaseSpace:pTHatMin = 8
PhaseSpace:pTHatMax = 600
PhaseSpace:bias2Selection = on
PhaseSpace:bias2SelectionPow = 4

Random:setSeed = on
Random:seed = 0

Ropewalk:RopeHadronization = on
Ropewalk:doShoving = off
Ropewalk:doFlavour = on
Ropewalk:r0 = 0.5
Ropewalk:m0 = 0.2
Ropewalk:beta = 0.1
PartonVertex:setVertex = on