]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adding Copy and Clone methods inherited from TObject for abstract access and
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 28 Jun 2009 14:49:14 +0000 (14:49 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 28 Jun 2009 14:49:14 +0000 (14:49 +0000)
control of HLT trigger information from the ESD

HLT/BASE/AliHLTGlobalTriggerDecision.cxx
HLT/BASE/AliHLTGlobalTriggerDecision.h
HLT/BASE/AliHLTTriggerDecision.cxx
HLT/BASE/AliHLTTriggerDecision.h

index 4d618a0183300a59d16f2c64e6122bf74ba0b9e8..433d12628b275b5f80e398bf27dfce76dcd98c02 100644 (file)
@@ -1,4 +1,4 @@
-// $Id:$
+// $Id$
 /**************************************************************************
  * This file is property of and copyright by the ALICE HLT Project        *
  * ALICE Experiment at CERN, All rights reserved.                         *
@@ -132,3 +132,24 @@ void AliHLTGlobalTriggerDecision::Print(Option_t* option) const
   }
 }
 
+void AliHLTGlobalTriggerDecision::Copy(TObject &object) const
+{
+  // copy this to the specified object
+
+  AliHLTGlobalTriggerDecision* pDecision=dynamic_cast<AliHLTGlobalTriggerDecision*>(&object);
+  if (pDecision)
+  {
+    // copy members if target is a AliHLTGlobalTriggerDecision
+    *pDecision=*this;
+  }
+
+  // copy the base class
+  AliHLTTriggerDecision::Copy(object);
+}
+
+TObject *AliHLTGlobalTriggerDecision::Clone(const char */*newname*/) const
+{
+  // create a new clone, classname is ignored
+
+  return new AliHLTGlobalTriggerDecision(*this);
+}
index 0787ed600acecf8ac78cb0c0160662fc6d0169d0..97ecbc88eeace44601781779b9a15437ce372e2c 100644 (file)
@@ -1,5 +1,5 @@
 //-*- Mode: C++ -*-
-// $Id:$
+// $Id$
 #ifndef ALIHLTGLOBALTRIGGERDECISION_H
 #define ALIHLTGLOBALTRIGGERDECISION_H
 /* This file is property of and copyright by the ALICE HLT Project        *
@@ -47,7 +47,17 @@ class AliHLTGlobalTriggerDecision : public AliHLTTriggerDecision
    *    global information but not the lists of input objects.
    */
   virtual void Print(Option_t* option = "") const;
+
+  /**
+   * Inherited from TObject. Copy this to the specified object.
+   */
+  virtual void Copy(TObject &object) const;
   
+  /**
+   * Inherited from TObject. Create a new clone.
+   */
+  virtual TObject *Clone(const char *newname="") const;
+
   /**
    * Returns the number of trigger inputs that contributed to this global trigger decision.
    */
index a7e5bd62476f103df6d760f745bd255090e549cc..03daaec1c1cd9c6c6f56d362d9d3c2fea935e0b7 100644 (file)
@@ -1,4 +1,4 @@
-// $Id:$
+// $Id$
 /**************************************************************************
  * This file is property of and copyright by the ALICE HLT Project        *
  * ALICE Experiment at CERN, All rights reserved.                         *
@@ -83,3 +83,31 @@ void AliHLTTriggerDecision::Print(Option_t* option) const
   fTriggerDomain.Print();
 }
 
+void AliHLTTriggerDecision::Copy(TObject &object) const
+{
+  // copy this to the specified object
+
+  AliHLTTriggerDecision* pDecision=dynamic_cast<AliHLTTriggerDecision*>(&object);
+  if (pDecision) {
+    // copy members if target is a AliHLTTriggerDecision
+    *pDecision=*this;
+  }
+
+  // copy the base class
+  TObject::Copy(object);
+}
+
+TObject *AliHLTTriggerDecision::Clone(const char */*newname*/) const
+{
+  // create a new clone, classname is ignored
+
+  return new AliHLTTriggerDecision(*this);
+}
+
+Option_t *AliHLTTriggerDecision::GetOption() const
+{
+  // Return the result of the trigger.
+  // "0" or "1"
+  if (Result()) return "1";
+  return "0";
+}
index 377b564ef0479e78276d2352f66478900913a816..0ae161c0de13c04f90764d0a9d23a6150519162e 100644 (file)
@@ -1,5 +1,5 @@
 //-*- Mode: C++ -*-
-// $Id:$
+// $Id$
 #ifndef ALIHLTTRIGGERDECISION_H
 #define ALIHLTTRIGGERDECISION_H
 /* This file is property of and copyright by the ALICE HLT Project        *
@@ -62,12 +62,33 @@ class AliHLTTriggerDecision : public TObject
    */
   virtual const char* GetName() const { return fName.Data(); }
   
+  /**
+   * Inherited from TObject. Returns the description of the trigger decision.
+   */
+  virtual const char* GetTitle() const { return fDescription.Data(); }
+  
   /**
    * Inherited from TObject. This prints the contents of the trigger decision.
    * \param option  Can be "short" which will print the short format.
    */
   virtual void Print(Option_t* option = "") const;
-  
+
+  /**
+   * Inherited from TObject. Copy this to the specified object.
+   */
+  virtual void Copy(TObject &object) const;
+
+  /**
+   * Inherited from TObject. Create a new clone.
+   */
+  virtual TObject *Clone(const char *newname="") const;
+
+  /**
+   * Inherited from TObject. Return the result of the trigger.
+   * @return   "0" or "1" (note: its a string)
+   */
+  virtual Option_t *GetOption() const;
+
   /**
    * Returns the result of the trigger decision.
    * \returns true if the event was triggered and should be readout.