-
Notifications
You must be signed in to change notification settings - Fork 196
For requesting MC pp #2350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+181
−0
Merged
For requesting MC pp #2350
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e51b45c
Create Generator_InjectedInclusiveJpsiPsi2SMidy_2026_Pythia8_TriggerG…
shreyasiacharya 7050517
Create Generator_InjectedInclusiveJpsiPsi2SMidy_2026_Pythia8_TriggerG…
shreyasiacharya 960a72a
Create Generator_InjectedInclusiveJpsiPsi2SMidy_Pythia8_TriggerGap.C
shreyasiacharya 14259aa
Merge branch 'AliceO2Group:master' into master
shreyasiacharya 235d750
Update Generator_InjectedInclusiveJpsiPsi2SMidy_Pythia8_TriggerGap.C
shreyasiacharya 95461d7
Update Generator_InjectedInclusiveJpsiPsi2SMidy_2026_Pythia8_TriggerG…
shreyasiacharya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
MC/config/PWGDQ/ini/Generator_InjectedInclusiveJpsiPsi2SMidy_2026_Pythia8_TriggerGap.ini
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/PWGDQ/external/generator/generator_pythia8_HadronTriggered_withGap.C | ||
| funcName=GeneratorInclusiveJpsiPsi2S_EvtGenMidY(5,-1.5,1.5) | ||
|
|
||
| [GeneratorPythia8] | ||
| config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGDQ/pythia8/generator/pythia8_inel_triggerGap.cfg |
102 changes: 102 additions & 0 deletions
102
MC/config/PWGDQ/ini/tests/Generator_InjectedInclusiveJpsiPsi2SMidy_2026_Pythia8_TriggerGap.C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| int External() | ||
| { | ||
| int checkPdgSignal[] = {443, 100443}; | ||
| int checkPdgDecay = 11; | ||
| double rapiditymin = -4.3; | ||
| double rapiditymax = -2.3; | ||
| std::string path{"o2sim_Kine.root"}; | ||
| std::cout << "Check for\nsignal PDG " << checkPdgSignal << "\ndecay PDG " << checkPdgDecay << "\n"; | ||
| 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 nLeptons{}; | ||
| int nAntileptons{}; | ||
| int nLeptonPairs{}; | ||
| int nLeptonPairsToBeDone{}; | ||
| int nSignalJpsi{}; | ||
| int nSignalPsi2S{}; | ||
| int nSignalJpsiWithinAcc{}; | ||
| int nSignalPsi2SWithinAcc{}; | ||
| auto nEvents = tree->GetEntries(); | ||
| o2::steer::MCKinematicsReader mcreader("o2sim", o2::steer::MCKinematicsReader::Mode::kMCKine); | ||
| Bool_t isInjected = kFALSE; | ||
|
|
||
| for (int i = 0; i < nEvents; i++) | ||
| { | ||
| tree->GetEntry(i); | ||
| for (auto &track : *tracks) | ||
| { | ||
| auto pdg = track.GetPdgCode(); | ||
| auto rapidity = track.GetRapidity(); | ||
| auto idMoth = track.getMotherTrackId(); | ||
| if (pdg == checkPdgDecay) | ||
| { | ||
| // count leptons | ||
| nLeptons++; | ||
| } | ||
| else if (pdg == -checkPdgDecay) | ||
| { | ||
| // count anti-leptons | ||
| nAntileptons++; | ||
| } | ||
| else if (pdg == checkPdgSignal[0] || pdg == checkPdgSignal[1]) | ||
| { | ||
| if (idMoth < 0) | ||
| { | ||
| // count signal PDG | ||
| pdg == checkPdgSignal[0] ? nSignalJpsi++ : nSignalPsi2S++; | ||
| // count signal PDG within acceptance | ||
| if (rapidity > rapiditymin && rapidity < rapiditymax) | ||
| { | ||
| pdg == checkPdgSignal[0] ? nSignalJpsiWithinAcc++ : nSignalPsi2SWithinAcc++; | ||
| } | ||
| } | ||
| auto child0 = o2::mcutils::MCTrackNavigator::getDaughter0(track, *tracks); | ||
| auto child1 = o2::mcutils::MCTrackNavigator::getDaughter1(track, *tracks); | ||
| if (child0 != nullptr && child1 != nullptr) | ||
| { | ||
| // check for parent-child relations | ||
| auto pdg0 = child0->GetPdgCode(); | ||
| auto pdg1 = child1->GetPdgCode(); | ||
| std::cout << "First and last children of parent " << checkPdgSignal << " are PDG0: " << pdg0 << " PDG1: " << pdg1 << "\n"; | ||
| if (std::abs(pdg0) == checkPdgDecay && std::abs(pdg1) == checkPdgDecay && pdg0 == -pdg1) | ||
| { | ||
| nLeptonPairs++; | ||
| if (child0->getToBeDone() && child1->getToBeDone()) | ||
| { | ||
| nLeptonPairsToBeDone++; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| std::cout << "#events: " << nEvents << "\n" | ||
| << "#leptons: " << nLeptons << "\n" | ||
| << "#antileptons: " << nAntileptons << "\n" | ||
| << "#signal (prompt Jpsi): " << nSignalJpsi << "; within acceptance " << rapiditymin << " < y < " << rapiditymax << " : " << nSignalJpsiWithinAcc << "\n" | ||
| << "#signal (prompt Psi(2S)): " << nSignalPsi2S << "; within acceptance " << rapiditymin << " < y < " << rapiditymax << " : " << nSignalPsi2SWithinAcc << "\n" | ||
| << "#lepton pairs: " << nLeptonPairs << "\n" | ||
| << "#lepton pairs to be done: " << nLeptonPairs << "\n"; | ||
|
jackal1-66 marked this conversation as resolved.
|
||
|
|
||
| if (nLeptonPairs == 0 || nLeptons == 0 || nAntileptons == 0) | ||
| { | ||
| std::cerr << "Number of leptons, number of anti-leptons as well as number of lepton pairs should all be greater than 1.\n"; | ||
| return 1; | ||
| } | ||
| if (nLeptonPairs != nLeptonPairsToBeDone) | ||
| { | ||
| std::cerr << "The number of lepton pairs should be the same as the number of lepton pairs which should be transported.\n"; | ||
| return 1; | ||
| } | ||
|
|
||
| return 0; | ||
| } | ||
72 changes: 72 additions & 0 deletions
72
MC/config/PWGDQ/ini/tests/Generator_InjectedInclusiveJpsiPsi2SMidy_Pythia8_TriggerGap.C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| int External() | ||
| { | ||
| int checkPdgSignal = 443; | ||
| int checkPdgDecay = 11; | ||
| std::string path{"o2sim_Kine.root"}; | ||
| std::cout << "Check for\nsignal PDG " << checkPdgSignal << "\ndecay PDG " << checkPdgDecay << "\n"; | ||
| 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 nLeptons{}; | ||
| int nAntileptons{}; | ||
| int nLeptonPairs{}; | ||
| int nLeptonPairsToBeDone{}; | ||
| int nSignal{}; | ||
| auto nEvents = tree->GetEntries(); | ||
|
|
||
| for (int i = 0; i < nEvents; i++) { | ||
| tree->GetEntry(i); | ||
| for (auto& track : *tracks) { | ||
| auto pdg = track.GetPdgCode(); | ||
| if (pdg == checkPdgDecay) { | ||
| // count leptons | ||
| nLeptons++; | ||
| } else if(pdg == -checkPdgDecay) { | ||
| // count anti-leptons | ||
| nAntileptons++; | ||
| } else if (pdg == checkPdgSignal) { | ||
| // count signal PDG | ||
| nSignal++; | ||
| auto child0 = o2::mcutils::MCTrackNavigator::getDaughter0(track, *tracks); | ||
| auto child1 = o2::mcutils::MCTrackNavigator::getDaughter1(track, *tracks); | ||
| if (child0 != nullptr && child1 != nullptr) { | ||
| // check for parent-child relations | ||
| auto pdg0 = child0->GetPdgCode(); | ||
| auto pdg1 = child1->GetPdgCode(); | ||
| std::cout << "First and last children of parent " << checkPdgSignal << " are PDG0: " << pdg0 << " PDG1: " << pdg1 << "\n"; | ||
| if (std::abs(pdg0) == checkPdgDecay && std::abs(pdg1) == checkPdgDecay && pdg0 == -pdg1) { | ||
|
jackal1-66 marked this conversation as resolved.
|
||
| nLeptonPairs++; | ||
| if (child0->getToBeDone() && child1->getToBeDone()) { | ||
| nLeptonPairsToBeDone++; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| std::cout << "#events: " << nEvents << "\n" | ||
| << "#leptons: " << nLeptons << "\n" | ||
| << "#antileptons: " << nAntileptons << "\n" | ||
| << "#signal: " << nSignal << "\n" | ||
| << "#lepton pairs: " << nLeptonPairs << "\n" | ||
| << "#lepton pairs to be done: " << nLeptonPairs << "\n"; | ||
|
jackal1-66 marked this conversation as resolved.
|
||
|
|
||
|
|
||
| if (nLeptonPairs == 0 || nLeptons == 0 || nAntileptons == 0) { | ||
| std::cerr << "Number of leptons, number of anti-leptons as well as number of lepton pairs should all be greater than 1.\n"; | ||
| return 1; | ||
| } | ||
| if (nLeptonPairs != nLeptonPairsToBeDone) { | ||
| std::cerr << "The number of lepton pairs should be the same as the number of lepton pairs which should be transported.\n"; | ||
| return 1; | ||
| } | ||
|
|
||
| return 0; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.