]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/rec/AliHLTMiscImplementation.cxx
adding support for the new AliESDHLTDecision class which will allow to store
[u/mrichter/AliRoot.git] / HLT / rec / AliHLTMiscImplementation.cxx
index 04511655d3d1156eb364d0df5f163adccb063816..7774f5377b599bcc3daefb474a607c3f52473f9e 100644 (file)
 /// @date   
 /// @brief  Miscellaneous methods for the HLT AliRoot integration
 
+// define will be set set from configure.ac, but for now it needs
+// to be set until the changes in STEER have been committed
+#define HAVE_NOT_ALIESDHLTDECISION
+
 #include "AliHLTMiscImplementation.h"
 #include "AliHLTLogging.h"
 #include "AliCDBManager.h"
 #include "AliCDBEntry.h"
 #include "AliGRPManager.h"
 #include "AliRawReader.h"
+#include "AliTracker.h"
+#ifndef HAVE_NOT_ALIESDHLTDECISION
+#include "AliESDHLTDecision.h"
+#endif //HAVE_NOT_ALIESDHLTDECISION
 #include "TGeoGlobalMagField.h"
+#include "AliHLTGlobalTriggerDecision.h"
 
 /** ROOT macro for the implementation of ROOT specific class methods */
 ClassImp(AliHLTMiscImplementation);
@@ -144,3 +153,52 @@ AliHLTUInt64_t AliHLTMiscImplementation::GetTriggerMask(AliRawReader* rawReader)
   }
   return trgMask;
 }
+
+Double_t AliHLTMiscImplementation::GetBz()
+{
+  // Returns Bz.
+  return AliTracker::GetBz();
+}
+
+Double_t AliHLTMiscImplementation::GetBz(const Double_t *r)
+{
+  // Returns Bz (kG) at the point "r" .
+  return AliTracker::GetBz(r);
+}
+
+void AliHLTMiscImplementation::GetBxByBz(const Double_t r[3], Double_t b[3])
+{
+  // Returns Bx, By and Bz (kG) at the point "r" .
+  return AliTracker::GetBxByBz(r, b);
+}
+
+const TClass* AliHLTMiscImplementation::IsAliESDHLTDecision() const
+{
+  // Return the IsA of the AliESDHLTDecision class
+#ifndef HAVE_NOT_ALIESDHLTDECISION
+  return AliESDHLTDecision::Class();
+#else // HAVE_NOT_ALIESDHLTDECISION
+  return NULL;
+#endif // HAVE_NOT_ALIESDHLTDECISION
+}
+
+int AliHLTMiscImplementation::Copy(const AliHLTGlobalTriggerDecision* pDecision, TObject* object) const
+{
+  // Copy HLT global trigger decision to AliESDHLTDecision container
+  if (!pDecision || !object) return -EINVAL;
+#ifndef HAVE_NOT_ALIESDHLTDECISION
+  AliESDHLTDecision* pESDHLTDecision=NULL;
+  if (object->IsA()==NULL ||
+      object->IsA() != AliESDHLTDecision::Class() ||
+      (pESDHLTDecision=dynamic_cast<AliESDHLTDecision*>(object))==NULL) {
+//     HLTError("can not copy HLT global decision to object of class \"%s\"", 
+//          object->IsA()?object->IsA()->GetName():"NULL");
+    return -EINVAL;
+  }
+
+  pESDHLTDecision->~AliESDHLTDecision();
+  new (pESDHLTDecision) AliESDHLTDecision(pDecision->GetTitle());
+
+#endif // HAVE_NOT_ALIESDHLTDECISION
+  return 0;
+}