reverting r42022, changes to be committed separately in order to disentangle backporting
[u/mrichter/AliRoot.git] / HLT / MUON / OfflineInterface / AliHLTMUONRootifierComponent.cxx
index 6f0e916..7155bcf 100644 (file)
@@ -24,6 +24,9 @@
 ///
 /// Implements a component to convert dHLT raw data into TObjects.
 
+#include "AliHLTMessage.h"
+#include "TString.h"
+#include "AliESDEvent.h"
 #include "AliHLTMUONRootifierComponent.h"
 #include "AliHLTMUONEvent.h"
 #include "AliHLTMUONConstants.h"
@@ -207,7 +210,20 @@ int AliHLTMUONRootifierComponent::DoEvent(
                        i, DataType2Text(block->fDataType).c_str(), block->fPtr, block->fSize
                );
                
-               if (block->fDataType == AliHLTMUONConstants::RecHitsBlockDataType())
+               if (block->fDataType == AliHLTMUONConstants::ESDDataType())
+               {
+                       AliHLTMessage *fMessage = new AliHLTMessage( block->fPtr, block->fSize );
+                       // -- Check if TMessage payload is TObject
+                       if ( fMessage->What() == kMESS_OBJECT )
+                       {
+                               TString fClassName = fMessage->GetClass()->GetName();
+                               AliESDEvent* esd = reinterpret_cast<AliESDEvent*>(fMessage->ReadObject( fMessage->GetClass() ));
+                               esd->GetStdContent();
+                               event.Add(esd);
+                       }
+                       fMessage->Reset();
+               }
+               else if (block->fDataType == AliHLTMUONConstants::RecHitsBlockDataType())
                {
                        specification |= block->fSpecification;
                        AliHLTMUONRecHitsBlockReader inblock(block->fPtr, block->fSize);
@@ -392,9 +408,12 @@ int AliHLTMUONRootifierComponent::DoEvent(
                                        );
                                }
                                
+                               // Add an new empty trigger record since none was found.
                                trigrec = new AliHLTMUONTriggerRecord(
                                                0, 0, 0, 0, 0, sourceDDL
                                        );
+                               triggerMap[triginfo.fTrigRecId] = trigrec;
+                               event.Add(trigrec);
                        }
                        else
                        {
@@ -742,6 +761,7 @@ int AliHLTMUONRootifierComponent::DoEvent(
                                AliHLTMUONMansoTrack* tr = new AliHLTMUONMansoTrack(t.fTrackId);
                                event.Add(tr);
                                track = tr;
+                               mansoTrackMap[t.fTrackId] = tr;
                        }
                        
                        new (singlesDecisions[singlesDecisions.GetEntriesFast()])
@@ -809,12 +829,14 @@ int AliHLTMUONRootifierComponent::DoEvent(
                                AliHLTMUONMansoTrack* tr = new AliHLTMUONMansoTrack(t.fTrackAId);
                                event.Add(tr);
                                trackA = tr;
+                               mansoTrackMap[t.fTrackAId] = tr;
                        }
                        if (trackB == NULL)
                        {
                                AliHLTMUONMansoTrack* tr = new AliHLTMUONMansoTrack(t.fTrackBId);
                                event.Add(tr);
                                trackB = tr;
+                               mansoTrackMap[t.fTrackBId] = tr;
                        }
                        
                        new (pairsDecisions[pairsDecisions.GetEntriesFast()])