-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PWGLF: Add GeneratorLFLnnPbPb.ini and lnn_pbpb.gun files (#1774)
* PWGLF: Add GeneratorLFLnnPbPb.ini and lnn_pbpb.gun files * add GeneratorLnnPbPb.C * Fix configuration
- Loading branch information
1 parent
0323099
commit dc22d4e
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,6 @@ | ||
[GeneratorExternal] | ||
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_longlived_gaptriggered.C | ||
funcName=generateLongLivedGapTriggered("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/lnn_pbpb.gun", 1) | ||
|
||
[GeneratorPythia8] | ||
config=${O2_ROOT}/share/Generators/egconfig/pythia8_hi.cfg |
This file contains 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,53 @@ | ||
int External() | ||
{ | ||
std::string path{"o2sim_Kine.root"}; | ||
std::vector<int> possiblePDGs = {1010000030, -1010000030}; | ||
|
||
int nPossiblePDGs = possiblePDGs.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> injectedPDGs; | ||
|
||
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(possiblePDGs.begin(), possiblePDGs.end(), pdg); | ||
if (it != possiblePDGs.end() && track.isPrimary()) // found | ||
{ | ||
injectedPDGs.push_back(pdg); | ||
} | ||
} | ||
} | ||
std::cout << "--------------------------------\n"; | ||
std::cout << "# Events: " << nEvents << "\n"; | ||
if(injectedPDGs.empty()){ | ||
std::cerr << "No injected particles\n"; | ||
return 1; // At least one of the injected particles should be generated | ||
} | ||
for (int i = 0; i < nPossiblePDGs; i++) | ||
{ | ||
std::cout << "# Injected nuclei \n"; | ||
std::cout << possiblePDGs[i] << ": " << std::count(injectedPDGs.begin(), injectedPDGs.end(), possiblePDGs[i]) << "\n"; | ||
} | ||
return 0; | ||
} |
This file contains 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,3 @@ | ||
# PDG N ptMin ptMax yMin yMax | ||
1010000030 10 0.2 10 -1 1 | ||
-1010000030 10 0.2 10 -1 1 |