+void AliHLTReconstructor::Terminate()
+{
+ /// overloaded from AliReconstructor: terminate event processing
+
+ // indicate step 'Terminate'
+ SetProcessingStep(kProcessingStepTerminate);
+
+ if (fpPluginBase) {
+ AliHLTSystem* pSystem=fpPluginBase->GetInstance();
+ if (pSystem) {
+ // 2012-04-02
+ // clean up the HLTOUT instance if still existing, currently FinishEvent
+ // is not called at the end of the event processing and the cleanup
+ // needs to be done here to avoid a warning message. Later it can be
+ // declared a malfunction if the HLTOUT instance is still existing at
+ // this point.
+ AliHLTOUT* pHLTOUT=NULL;
+ pSystem->InvalidateHLTOUT(&pHLTOUT);
+ if (pHLTOUT) {
+ pHLTOUT->Reset();
+ delete pHLTOUT;
+ pHLTOUT=NULL;
+ }
+
+ AliDebug(0, Form("terminate HLT system: status %#x", pSystem->GetStatusFlags()));
+ if (pSystem->CheckStatus(AliHLTSystem::kStarted)) {
+ // send specific 'event' to execute the stop sequence
+ pSystem->Reconstruct(0, NULL, NULL);
+ }
+ }
+ }
+}
+
+void AliHLTReconstructor::FinishEvent()
+{
+ /// overloaded from AliReconstructor: finish current event
+ if (!fpPluginBase) return;
+
+ // indicate step 'FinishEvent'
+ SetProcessingStep(kProcessingStepFinishEvent);
+
+ AliInfo("finishing event");
+ AliHLTSystem* pSystem=fpPluginBase->GetInstance();
+ if (pSystem) {
+ // this is the end of the lifetime of the HLTOUT instance
+ // called after all other modules have been reconstructed
+ AliHLTOUT* pHLTOUT=NULL;
+ pSystem->InvalidateHLTOUT(&pHLTOUT);
+ if (pHLTOUT) {
+ pHLTOUT->Reset();
+ delete pHLTOUT;
+ pHLTOUT=NULL;
+ }
+ }
+}
+