From 4a035340a9905583e55b067a651ce35b38cd5c57 Mon Sep 17 00:00:00 2001 From: richterm Date: Sun, 28 Jun 2009 14:49:14 +0000 Subject: [PATCH] adding Copy and Clone methods inherited from TObject for abstract access and control of HLT trigger information from the ESD --- HLT/BASE/AliHLTGlobalTriggerDecision.cxx | 23 +++++++++++++++++- HLT/BASE/AliHLTGlobalTriggerDecision.h | 12 +++++++++- HLT/BASE/AliHLTTriggerDecision.cxx | 30 +++++++++++++++++++++++- HLT/BASE/AliHLTTriggerDecision.h | 25 ++++++++++++++++++-- 4 files changed, 85 insertions(+), 5 deletions(-) diff --git a/HLT/BASE/AliHLTGlobalTriggerDecision.cxx b/HLT/BASE/AliHLTGlobalTriggerDecision.cxx index 4d618a01833..433d12628b2 100644 --- a/HLT/BASE/AliHLTGlobalTriggerDecision.cxx +++ b/HLT/BASE/AliHLTGlobalTriggerDecision.cxx @@ -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(&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); +} diff --git a/HLT/BASE/AliHLTGlobalTriggerDecision.h b/HLT/BASE/AliHLTGlobalTriggerDecision.h index 0787ed600ac..97ecbc88eea 100644 --- a/HLT/BASE/AliHLTGlobalTriggerDecision.h +++ b/HLT/BASE/AliHLTGlobalTriggerDecision.h @@ -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. */ diff --git a/HLT/BASE/AliHLTTriggerDecision.cxx b/HLT/BASE/AliHLTTriggerDecision.cxx index a7e5bd62476..03daaec1c1c 100644 --- a/HLT/BASE/AliHLTTriggerDecision.cxx +++ b/HLT/BASE/AliHLTTriggerDecision.cxx @@ -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(&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"; +} diff --git a/HLT/BASE/AliHLTTriggerDecision.h b/HLT/BASE/AliHLTTriggerDecision.h index 377b564ef04..0ae161c0de1 100644 --- a/HLT/BASE/AliHLTTriggerDecision.h +++ b/HLT/BASE/AliHLTTriggerDecision.h @@ -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. -- 2.39.3