Skip to content

Commit e87dc22

Browse files
authored
Merge pull request #70 from JETSCAPE/iSSMemory
explicitly clear the iSS and HadronList every time passing hadrons from iSS to the JETSCAPE framework
2 parents 147f860 + dfa66c8 commit e87dc22

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/hadronization/iSpectraSamplerWrapper.cc

+9
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,12 @@ void iSpectraSamplerWrapper::PassHadronListToJetscapeSameEvent() {
317317
}
318318

319319
void iSpectraSamplerWrapper::PassHadronListToJetscape() {
320+
// clear hadron list before passing new events
321+
for (unsigned i = 0; i < Hadron_list_.size(); i++) {
322+
Hadron_list_.at(i).clear();
323+
}
324+
Hadron_list_.clear();
325+
320326
unsigned int nev = iSpectraSampler_ptr_->get_number_of_sampled_events();
321327
VERBOSE(2) << "Passing all sampled hadrons to the JETSCAPE framework";
322328
VERBOSE(4) << "number of events to pass : " << nev;
@@ -354,6 +360,9 @@ void iSpectraSamplerWrapper::PassHadronListToJetscape() {
354360
<< Hadron_list_.at(iev).size() << " particles.";
355361
}
356362
}
363+
364+
// clear iSS memory, particles have passed to the framework
365+
iSpectraSampler_ptr_->clear();
357366
}
358367

359368
void iSpectraSamplerWrapper::WriteTask(weak_ptr<JetScapeWriter> w) {

0 commit comments

Comments
 (0)