|
1 | | -//R__LOAD_LIBRARY(libDPMJET.so) |
2 | | -//R__LOAD_LIBRARY(libDpmJetLib.so) |
| 1 | +R__LOAD_LIBRARY(libDPMJET.so) |
| 2 | +R__LOAD_LIBRARY(libDpmJetLib.so) |
3 | 3 | R__LOAD_LIBRARY(libStarlib.so) |
4 | 4 | R__ADD_INCLUDE_PATH($STARlight_ROOT/include) |
5 | 5 |
|
@@ -104,7 +104,7 @@ class GeneratorStarlight_class : public Generator |
104 | 104 | {"kIncohPsi2sToElPi", 4, 444011, 20, -1.0, -1.0, 100443, 1 }, // |
105 | 105 | {"kIncohUpsilonToMu", 4, 553013, 20, -1.0, -1.0, 553, 0 }, // |
106 | 106 | {"kIncohUpsilonToEl", 4, 553011, 20, -1.0, -1.0, 553, 0 }, // |
107 | | -// {"kDpmjetSingle", 5, 113, 20, -1.0, -1.0, -1, 0 }, // |
| 107 | + {"kDpmjetSingle", 5, 113, 20, -1.0, -1.0, -1, 0 }, // |
108 | 108 | {"kTauLowToEl3Pi", 1, 15, 990, 3.5, 20.0, -1, 1 }, // from 0.4 to 15 GeV |
109 | 109 | {"kTauLowToPo3Pi", 1, 15, 990, 3.5, 20.0, -1, 1 }, // from 0.4 to 15 GeV |
110 | 110 | {"kTauLowToElMu", 1, 15, 990, 3.5, 20.0, -1, 1 }, // from 0.4 to 15 GeV |
@@ -312,8 +312,28 @@ class GeneratorStarlight_class : public Generator |
312 | 312 |
|
313 | 313 |
|
314 | 314 | FairGenerator* |
315 | | - GeneratorStarlight(std::string configuration = "empty",float energyCM = 5020, int beam1Z = 82, int beam1A = 208, int beam2Z = 82, int beam2A = 208, std::string extrapars = "") |
| 315 | + GeneratorStarlight(std::string configuration = "empty",float energyCM = 5020, int beam1Z = 82, int beam1A = 208, int beam2Z = 82, int beam2A = 208, std::string extrapars = "",std::string dpmjetconf = "") |
316 | 316 | { |
| 317 | + if(dpmjetconf.size() != 0){ |
| 318 | + //Copy necesary files to the working directory |
| 319 | + TString pathDPMJET = gSystem->ExpandPathName("$DPMJET_ROOT/dpmdata"); |
| 320 | + system(TString::Format("cp -r %s .",pathDPMJET.Data())); |
| 321 | + system(TString::Format("cp %s ./my.input",dpmjetconf.c_str())); |
| 322 | + |
| 323 | + //Reset four seeds of the DPMJET random generator in the config |
| 324 | + std::random_device rd; |
| 325 | + std::mt19937 gen(rd()); |
| 326 | + std::uniform_int_distribution<> dist(1, 168); |
| 327 | + |
| 328 | + std::string command = "awk -i inplace -v nums=\""; |
| 329 | + for (int i = 0; i < 4; ++i)command += TString::Format("%d.0 ", dist(gen)); |
| 330 | + command +=" \" \' "; |
| 331 | + command += "BEGIN {split(nums, newvals);}"; |
| 332 | + command += "{if ($1 == \"RNDMINIT\") {printf \"%-16s%-9s%-9s%-9s%-9s\\n\", $1, newvals[1], newvals[2], newvals[3], newvals[4];}"; |
| 333 | + command += " else {print $0;}}\' \"my.input\" "; |
| 334 | + system(command.c_str()); |
| 335 | + } |
| 336 | + |
317 | 337 | auto gen = new o2::eventgen::GeneratorStarlight_class(); |
318 | 338 | gen->selectConfiguration(configuration); |
319 | 339 | gen->setCollisionSystem(energyCM, beam1Z, beam1A, beam2Z, beam2A); |
|
0 commit comments