@@ -104,14 +104,13 @@ namespace o2
104104 }
105105 auto & extgen_filename = params[0 ];
106106 auto & extgen_func = params[1 ];
107- // auto extGen = std::unique_ptr<FairGenerator >(o2::conf::GetFromMacro<FairGenerator *>(extgen_filename, extgen_func, "FairGenerator*", "extgen"));
107+ auto extGen = std::unique_ptr<o2::eventgen::Generator >(o2::conf::GetFromMacro<o2::eventgen::Generator *>(extgen_filename, extgen_func, " FairGenerator*" , " extgen" ));
108108 if (!extGen) {
109109 LOG (fatal) << " Failed to load external generator from " << extgen_filename << " with function " << extgen_func;
110110 exit (1 );
111111 }
112- mExternal .push_back (std::move (extGen));
112+ gens .push_back (std::move (extGen));
113113 mGens .push_back (gen);
114- mExtFlag .push_back (mGens .size () - 1 );
115114 }
116115 } else {
117116 LOG (info) << " Generator " << gen << " not found in the list of available generators \n " ;
@@ -124,7 +123,7 @@ namespace o2
124123 Bool_t GeneratorHybrid::Init ()
125124 {
126125 // init all sub-gens
127- int count = 0 , countext = 0 ;
126+ int count = 0 ;
128127 for (auto & gen : mGens )
129128 {
130129 if (gen == " pythia8" ){
@@ -148,16 +147,9 @@ namespace o2
148147 LOG (info) << " Setting \' Pythia8\' base configuration: " << config << std::endl;
149148 dynamic_cast <o2::eventgen::GeneratorPythia8*>(gens[count].get ())->setConfig (config);
150149 }
151- if (gen == " external" ){
152- // mExternal[countext]->Init();
153- addSubGenerator (count + countext, gen);
154- countext++;
155- }
156- else {
157- gens[count]->Init ();
158- addSubGenerator (count + countext, gen);
159- count++;
160- }
150+ gens[count]->Init ();
151+ addSubGenerator (count, gen);
152+ count++;
161153 }
162154 return Generator::Init ();
163155 }
@@ -177,15 +169,8 @@ namespace o2
177169 mIndex = mCurrentFraction ;
178170 }
179171 LOG (info) << " GeneratorHybrid: generating event with generator " << mGens [mIndex ];
180- if (mGens [mIndex ] == " external" ) {
181- // Check in which position of extFlag mIndex is
182- mCurrentExt = std::distance (mExtFlag .begin (), std::find (mExtFlag .begin (), mExtFlag .end (), mIndex ));
183- LOG (info) << " GeneratorHybrid: events generated on stack" ;
184- // mExtStack.getPrimaries()
185- } else {
186- gens[mIndex ]->clearParticles (); // clear container of this class
187- gens[mIndex ]->generateEvent ();
188- }
172+ gens[mIndex ]->clearParticles (); // clear container of this class
173+ gens[mIndex ]->generateEvent ();
189174 // notify the sub event generator
190175 notifySubGenerator (mIndex );
191176 mseqCounter++;
@@ -195,11 +180,8 @@ namespace o2
195180 Bool_t GeneratorHybrid::importParticles ()
196181 {
197182 mParticles .clear (); // clear container of mother class
198- if (mGens [mIndex ] == " external" ) {
199- } else {
200- gens[mIndex ]->importParticles ();
201- std::copy (gens[mIndex ]->getParticles ().begin (), gens[mIndex ]->getParticles ().end (), std::back_insert_iterator (mParticles ));
202- }
183+ gens[mIndex ]->importParticles ();
184+ std::copy (gens[mIndex ]->getParticles ().begin (), gens[mIndex ]->getParticles ().end (), std::back_insert_iterator (mParticles ));
203185
204186 // we need to fix particles statuses --> need to enforce this on the importParticles level of individual generators
205187 for (auto & p : mParticles )
0 commit comments