Adding output data type of rootifier component to the constants class.
[u/mrichter/AliRoot.git] / HLT / MUON / OfflineInterface / AliHLTMUONESDMaker.cxx
index e95d594..2ef9d65 100644 (file)
@@ -51,7 +51,8 @@ ClassImp(AliHLTMUONESDMaker);
 AliHLTMUONESDMaker::AliHLTMUONESDMaker() :
        AliHLTMUONProcessor(),
        fWarnForUnexpecedBlock(false),
-       fMakeMinimalESD(false)
+       fMakeMinimalESD(false),
+       fAddCustomData(false)
 {
        /// Default constructor.
 }
@@ -109,6 +110,12 @@ int AliHLTMUONESDMaker::DoInit(int argc, const char** argv)
                        fWarnForUnexpecedBlock = true;
                        continue;
                }
+               
+               if (strcmp(argv[i], "-add_rootified_objects") == 0)
+               {
+                       fAddCustomData = true;
+                       continue;
+               }
 
                HLTError("Unknown option '%s'.", argv[i]);
                return -EINVAL;
@@ -229,6 +236,10 @@ int AliHLTMUONESDMaker::DoEvent(
                                triggerRecords.push_back(&inblock[n]);
                        }
                }
+               else if (block->fDataType == AliHLTMUONConstants::RootifiedEventDataType() and fAddCustomData)
+               {
+                       // Do nothing for now, will handle this later.
+               }
                else
                {
                        if (block->fDataType != AliHLTMUONConstants::MansoTracksBlockDataType())
@@ -247,6 +258,19 @@ int AliHLTMUONESDMaker::DoEvent(
                }
        }
        
+       // If we were requested to add all dHLT rootified data objects then do so.
+       if (fAddCustomData)
+       {
+               const AliHLTComponentDataType& type = AliHLTMUONConstants::RootifiedEventDataType();
+               const char* classname = AliHLTMUONEvent::Class_Name();
+               const TObject* obj = NULL;
+               for (obj = GetFirstInputObject(type, classname); obj != NULL; obj = GetNextInputObject())
+               {
+                       // Clone the object since the ESD takes ownership of it.
+                       event.AddObject(obj->Clone());
+               }
+       }
+       
        // Now we can look for tracks to add. We needed the ROOT trigger records
        // and reco hits created before we can create track objects.
        for (block = GetFirstInputBlock(AliHLTMUONConstants::MansoTracksBlockDataType());