Skip to content

Commit 6248725

Browse files
committed
Removed not working ini + used hybrid singleton
1 parent f6c32a7 commit 6248725

File tree

4 files changed

+9
-75
lines changed

4 files changed

+9
-75
lines changed

MC/config/common/external/generator/perfConf.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

MC/config/common/external/generator/performanceGenerator.C

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,14 @@ namespace o2
5252
if ( mFraction != -1) {
5353
// This line assumes that the current generator is run in a cocktail with another generator
5454
// which is run before the current one in a sequential way
55-
mNUE = genList.front()->getParticles().size();
56-
LOG(debug) << "Number of tracks from UE is " << mNUE;
55+
if (!mGenList) {
56+
auto &hybridInstance = GeneratorHybrid::Instance();
57+
mGenList = &hybridInstance.getGenerators();
58+
}
59+
if (!mGenList->empty()) {
60+
mNUE = mGenList->front()->getParticles().size();
61+
LOG(debug) << "Number of tracks from UE is " << mNUE;
62+
}
5763
}
5864
unsigned short nSig = (mFraction == -1) ? mNSig : std::lround(mFraction * mNUE);
5965
LOG(debug) << "Generating additional " << nSig << " particles";
@@ -69,7 +75,7 @@ namespace o2
6975
unsigned int mNUE = 0; // Number of tracks in the Underlying event
7076
unsigned short int mTag = 1; // Tag to select the generation function
7177
std::unique_ptr<DecayerPythia8> mDecayer; // Pythia8 decayer for particles not present in the physics list of Geant4 (like Z0)
72-
const std::vector<std::shared_ptr<o2::eventgen::Generator>> genList = GeneratorHybrid::getGenerators();
78+
const std::vector<std::shared_ptr<o2::eventgen::Generator>>* mGenList = nullptr; // Cached generators list
7379
std::map<unsigned short int, std::function<TParticle()>> genMap;
7480
UInt_t mGenID = 42;
7581

MC/config/common/ini/GeneratorPerformance.ini

Lines changed: 0 additions & 4 deletions
This file was deleted.

MC/config/common/ini/tests/GeneratorPerformance.C

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)