Commit bfd378c
Pythia8 seeding improvements
This commit improves the seeding of Pythia8 in O2.
The seeding...
(a) ... is now done as part of the object's Init function automatically.
Users are no longer required to provide own seeding logic,
which can significantly simplify the setup.
By default, Pythia8 will seed against ROOT TRandom::GetSeed,
which is itself set to values of the command line option `--seed`,
used in the o2-sim ... or o2-sim-dpl-eventgen execetuables (which
are the 2 places undertaking event generation). This setup guarantees
that
```
o2-sim-dpl-eventgen --generator pythiapp --seed x
```
will result in different event sequences when x changes.
(b) Users can simply set the seed via a `setInitialSeed` function
on the GeneratorPythia8 object. The function must be called before
GeneratorPythia8::Init is executed. So calling it right after the constructor
is fine.
Example code (e.g., inside user Generator macro) is:
```
auto mygen = new o2::eventgen::GeneratorPythia8();
long seed = atol(getenv(ALIEN_PROC_ID));
if(!mygen->setInitialSeed(seed)) {
std::cerr << "seeding failed";
}
```
In result, the commit leads to a simplification of the Pythia8
setup also in GeneratorFactory.
(cherry picked from commit 4179712)1 parent 7d85fff commit bfd378c
File tree
3 files changed
+65
-6
lines changed- Generators
- include/Generators
- src
3 files changed
+65
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
166 | 172 | | |
167 | 173 | | |
168 | 174 | | |
| |||
251 | 257 | | |
252 | 258 | | |
253 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
254 | 263 | | |
255 | 264 | | |
256 | 265 | | |
| |||
269 | 278 | | |
270 | 279 | | |
271 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
272 | 287 | | |
273 | 288 | | |
274 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
| 72 | + | |
| 73 | + | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | 75 | | |
80 | 76 | | |
81 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
74 | 114 | | |
75 | 115 | | |
76 | 116 | | |
| |||
80 | 120 | | |
81 | 121 | | |
82 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
83 | 129 | | |
84 | 130 | | |
85 | 131 | | |
| |||
147 | 193 | | |
148 | 194 | | |
149 | 195 | | |
| 196 | + | |
| 197 | + | |
150 | 198 | | |
151 | 199 | | |
152 | 200 | | |
| |||
0 commit comments