doing backward compatibility correctly
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 10 May 2008 05:53:53 +0000 (05:53 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 10 May 2008 05:53:53 +0000 (05:53 +0000)
HLT/configure.ac
HLT/rec/AliHLTEsdManager.cxx

index e95e1c2e0463dc0dcf44571415b4446af7b15f44..19f140e6397be566d5ac7f56d22d59ab10538e36 100644 (file)
@@ -260,9 +260,8 @@ if test ! "x$have_aliroot" = "xno" ; then
                                  [AliESDEvent esd1;
                                   AliESDEvent esd2;
                                   esd2=esd1;])],
                                  [AliESDEvent esd1;
                                   AliESDEvent esd2;
                                   esd2=esd1;])],
-                 [AC_DEFINE(HAVE_ESD_COPY)
-                 have_esd_copy=yes], 
-                [])
+                 [have_esd_copy=yes], 
+                [AC_DEFINE(HAVE_NOT_ESD_COPY)])
   AC_MSG_CHECKING(for ESD assignment operator)
   AC_MSG_RESULT([$have_esd_copy])
 
   AC_MSG_CHECKING(for ESD assignment operator)
   AC_MSG_RESULT([$have_esd_copy])
 
index 8ce85f9834b9c47def0f8be33e4ad57c9cd66947..f63df7b7c17d70cd919e91008de60873a116c31f 100644 (file)
@@ -117,20 +117,15 @@ int AliHLTEsdManager::WriteESD(const AliHLTUInt8_t* pBuffer, AliHLTUInt32_t size
          fESDs.push_back(newEntry);
        }
        if (tgtesd) {
          fESDs.push_back(newEntry);
        }
        if (tgtesd) {
-#ifdef HAVE_ESD_COPY
+#ifndef HAVE_NOT_ESD_COPY
          *tgtesd=*pESD;
          *tgtesd=*pESD;
-#else
-         TTree* pTmpTree=AliHLTEsdManager::EmbedIntoTree(pESD);
-         if (pTmpTree) {
-           tgtesd->ReadFromTree(pTmpTree);
-           pTmpTree->GetEvent(0);
-           pTmpTree->GetUserInfo()->Clear();
-           delete pTmpTree;
-           HLTDebug("data block %s written to target ESD", AliHLTComponent::DataType2Text(dt).c_str());
-         } else {
-           iResult=-ENOMEM;
+#else //HAVE_NOT_ESD_COPY
+         static bool warningPrinted=false;
+         if (!warningPrinted) {
+           HLTWarning("old version of AliESDEvent does not provide assignment operator, skip merging to global hltEsd");
          }
          }
-#endif
+         warningPrinted=true;
+#endif //HAVE_NOT_ESD_COPY
        } else {
        entry=Find(dt);
        if (entry) {
        } else {
        entry=Find(dt);
        if (entry) {
@@ -250,7 +245,7 @@ int AliHLTEsdManager::AliHLTEsdListEntry::WriteESD(AliESDEvent* pSrcESD, int eve
 {
   // see header file for class documentation
   int iResult=0;
 {
   // see header file for class documentation
   int iResult=0;
-#ifdef HAVE_ESD_COPY
+#ifndef HAVE_NOT_ESD_COPY
   if (fName.IsNull()) {
     // this is the first event, create the file name
     TString origin;
   if (fName.IsNull()) {
     // this is the first event, create the file name
     TString origin;
@@ -311,7 +306,7 @@ int AliHLTEsdManager::AliHLTEsdListEntry::WriteESD(AliESDEvent* pSrcESD, int eve
       fpTree->GetUserInfo()->Clear();
     }
   }
       fpTree->GetUserInfo()->Clear();
     }
   }
-#else //HAVE_ESD_COPY
+#else //HAVE_NOT_ESD_COPY
   // this is the old workaround, necessary for older AliRoot versions
   // version<=v4-12-Release
 
   // this is the old workaround, necessary for older AliRoot versions
   // version<=v4-12-Release
 
@@ -509,7 +504,7 @@ int AliHLTEsdManager::AliHLTEsdListEntry::WriteESD(AliESDEvent* pSrcESD, int eve
       gSystem->Exec(shellcmd);
     }
   }
       gSystem->Exec(shellcmd);
     }
   }
-#endif //HAVE_ESD_COPY
+#endif //HAVE_NOT_ESD_COPY
 
   return iResult;
 }
 
   return iResult;
 }