]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adding support for the new AliESDHLTDecision class which will allow to store
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Nov 2009 22:26:04 +0000 (22:26 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Nov 2009 22:26:04 +0000 (22:26 +0000)
the HLT decision also in the ESD. The code is not activated yet. Finishing the
necessary changes in STEER now

HLT/BASE/AliHLTGlobalTriggerDecision.cxx
HLT/BASE/AliHLTMisc.cxx
HLT/BASE/AliHLTMisc.h
HLT/configure.ac
HLT/rec/AliHLTMiscImplementation.cxx
HLT/rec/AliHLTMiscImplementation.h

index c087b3270dd1736cf21c1fcf95ce219ac3d962ed..ce646852786c7670dafaf81113a89c664e4e8346 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "AliHLTGlobalTriggerDecision.h"
 #include "Riostream.h"
+#include "TClass.h"
+#include "AliHLTMisc.h"
 
 ClassImp(AliHLTGlobalTriggerDecision)
 
@@ -136,6 +138,11 @@ void AliHLTGlobalTriggerDecision::Copy(TObject &object) const
 {
   // copy this to the specified object
 
+  if (object.IsA() == AliHLTMisc::Instance().IsAliESDHLTDecision()) {
+    AliHLTMisc::Instance().Copy(this, &object);
+    return;
+  }
+
   AliHLTGlobalTriggerDecision* pDecision=dynamic_cast<AliHLTGlobalTriggerDecision*>(&object);
   if (pDecision)
   {
index 07d3d5efbbd72349a9cbb29b6b9db3b6b200387b..5a9b6ff4b2b7717d7ed94b0de167ad5f35d60e92 100644 (file)
@@ -142,6 +142,18 @@ void AliHLTMisc::GetBxByBz(const Double_t r[3], Double_t b[3])
   return;
 }
 
+const TClass* AliHLTMisc::IsAliESDHLTDecision() const
+{
+  // default method, functionality is implemented in the child class
+  return NULL;
+}
+
+int AliHLTMisc::Copy(const AliHLTGlobalTriggerDecision* /*pDecision*/, TObject* /*pESDHLTDecision*/) const
+{
+  // default method, functionality is implemented in the child class
+  return -EFAULT;
+}
+
 ostream  &operator<<(ostream &out, const AliHLTComponentDataType &dt)
 {
   // printout of AliHLTComponentDataType struct
index ccdf6bd8749aa57271a81a2e87145214386fb435..b7561ab07c9554f16dd811f914d7e79d22fb8ee2 100644 (file)
@@ -21,6 +21,7 @@ class AliCDBManager;
 class AliCDBEntry;
 class AliRawReader;
 class AliHLTComponentDataType;
+class AliHLTGlobalTriggerDecision;
 
 class AliHLTMisc : public TObject {
  public:
@@ -48,6 +49,9 @@ class AliHLTMisc : public TObject {
   virtual Double_t GetBz(const Double_t *r);
   virtual void GetBxByBz(const Double_t r[3], Double_t b[3]);
 
+  virtual const TClass* IsAliESDHLTDecision() const;
+  virtual int Copy(const AliHLTGlobalTriggerDecision* pDecision, TObject* pESDHLTDecision) const;
+
  private:
   static AliHLTMisc* fgInstance;
 
index 190f5f8c37c4c14cf803a5a1eff236db4d03a6a8..eeb35ea827b4e225adc4483e84f443d578781f71 100644 (file)
@@ -342,6 +342,7 @@ if test ! "x$have_aliroot" = "xno" ; then
   have_aliqav1=no
   AC_CHECK_HEADER([AliQAv1.h], [have_aliqav1=yes], [])
   AM_CONDITIONAL(EN_HLT_QA, test x$have_aliqav1 = xyes)
+  AC_CHECK_HEADER([AliESDHLTDecision.h], [], [AC_DEFINE(HAVE_NOT_ALIESDHLTDECISION)])
 
   dnl
   dnl required header files and libraries for modules
index fbfea54864d969a2ff686588fd6296792d372189..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 "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);
@@ -163,3 +171,34 @@ 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;
+}
index 71715f10a4dd5dde368fc58ddefc309aff60ebec..42909e3bcbc16cdaba4e6486ae3da4c10a4275f9 100644 (file)
@@ -37,6 +37,9 @@ class AliHLTMiscImplementation : public AliHLTMisc
   Double_t GetBz(const Double_t *r);
   void GetBxByBz(const Double_t r[3], Double_t b[3]);
 
+  const TClass* IsAliESDHLTDecision() const;
+  int Copy(const AliHLTGlobalTriggerDecision* pDecision, TObject* pESDHLTDecision) const;
+
  private:
 
   ClassDef(AliHLTMiscImplementation, 0)