Skip to content
Open
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
Expand Up @@ -34,12 +34,13 @@ class O2DatabasePDG
public:
static TDatabasePDG* Instance()
{
static bool initialized = false; // initialize this --> adds particles to TDatabasePDG;
auto db = TDatabasePDG::Instance();
if (!initialized) {
// adds the ALICE particles to TDatabasePDG on first use.
// Initialisation is done through a local static database to make the Instance() function thread-safe
static TDatabasePDG* db = [] {
auto db = TDatabasePDG::Instance();
addALICEParticles(db);
initialized = true;
}
return db;
}();
return db;
}

Expand Down
1 change: 0 additions & 1 deletion Detectors/gconfig/data/extra_ions_pdg_table.dat
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,6 @@
1352 W174 1000741740 1 100 Ion 222 1.61992e+02 0.00000e+00 0 0 0 -1 0 0
1353 Hg198 1000801980 1 100 Ion 240 1.84365e+02 0.00000e+00 0 0 0 -1 0 0
1354 Pd115 1000461150 1 100 Ion 138 1.07018e+02 0.00000e+00 0 0 0 -1 0 0
1355 Li4 1000030040 1 100 Ion 9 3.74977e+00 0.00000e+00 0 0 0 -1 0 0
1356 Lu170 1000711700 1 100 Ion 213 1.58261e+02 0.00000e+00 0 0 0 -1 0 0
1357 Ho163 1000671630 1 100 Ion 201 1.51733e+02 0.00000e+00 0 0 0 -1 0 0
1358 Tm153 1000691530 1 100 Ion 207 1.42430e+02 0.00000e+00 0 0 0 -1 0 0
Expand Down
2 changes: 1 addition & 1 deletion Generators/src/GeneratorFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void GeneratorFactory::setPrimaryGenerator(o2::conf::SimConfig const& conf, Fair

/** generators **/

o2::O2DatabasePDG::addALICEParticles(TDatabasePDG::Instance());
o2::O2DatabasePDG::Instance(); //--> ALICE particles are added once in this call
auto genconfig = conf.getGenerator();
#if defined(GENERATORS_WITH_PYTHIA8) && defined(GENERATORS_WITH_HEPMC3)
std::string hyperloopExtHybridConfigFile; // set when IS_HYPERLOOP is defined
Expand Down
4 changes: 2 additions & 2 deletions macro/o2sim.C
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ FairRunSim* o2sim_init(bool asservice, bool evalmat = false)
// run init
run->Init();

// add ALICE particles to TDatabasePDG singleton
o2::O2DatabasePDG::addALICEParticles(TDatabasePDG::Instance());
// ensure ALICE particles are in the TDatabasePDG singleton (added once, thread-safely)
o2::O2DatabasePDG::Instance();

long runStart = timestamp;
{
Expand Down
Loading