File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -309,6 +309,16 @@ class O2HitMerger : public FairMQDevice
309309 return expectmore;
310310 }
311311
312+ void cleanEvent (int eventID)
313+ {
314+ // remove tree for that eventID
315+ delete mEventToTTreeMap [eventID];
316+ mEventToTTreeMap .erase (eventID);
317+ // remove memfile
318+ delete mEventToTMemFileMap [eventID];
319+ mEventToTMemFileMap .erase (eventID);
320+ }
321+
312322 template <typename T>
313323 void backInsert (T const & from, T& to)
314324 {
@@ -569,7 +579,7 @@ class O2HitMerger : public FairMQDevice
569579 if (confref.isFilterOutNoHitEvents ()) {
570580 if (eventheader && eventheader->getMCEventStats ().getNHits () == 0 ) {
571581 LOG (INFO ) << " Taking out event " << eventID << " due to no hits " ;
572-
582+ cleanEvent (eventID);
573583 return false ;
574584 }
575585 }
@@ -618,12 +628,7 @@ class O2HitMerger : public FairMQDevice
618628 LOG (INFO ) << " outtree has file " << mOutTree ->GetDirectory ()->GetFile ()->GetName ();
619629 mOutFile ->Write (" " , TObject::kOverwrite );
620630
621- // remove tree for that eventID
622- delete mEventToTTreeMap [eventID];
623- mEventToTTreeMap .erase (eventID);
624- // remove memfile
625- delete mEventToTMemFileMap [eventID];
626- mEventToTMemFileMap .erase (eventID);
631+ cleanEvent (eventID);
627632
628633 LOG (INFO ) << " MERGING HITS TOOK " << timer.RealTime ();
629634 return true ;
You can’t perform that action at this time.
0 commit comments