#include "AliHLTMUONEvent.h"
#include "AliHLTMUONDecision.h"
+#include "AliLog.h"
#include <iostream>
ClassImp(AliHLTMUONEvent);
+AliHLTMUONEvent::AliHLTMUONEvent(const AliHLTMUONEvent& event) :
+ TObject(),
+ fEventId(event.fEventId),
+ fArray()
+{
+ /// Copy constructor performs a deep copy of the object.
+
+ fEventId = event.fEventId;
+ fArray.SetOwner(kTRUE);
+ TIter next(&event.fArray);
+ TObject* obj = NULL;
+ while ( (obj = next()) != NULL )
+ {
+ fArray.Add(obj->Clone());
+ }
+}
+
+
+AliHLTMUONEvent& AliHLTMUONEvent::operator = (const AliHLTMUONEvent& event)
+{
+ /// The assignment operator performs a deep copy of the object.
+
+ TObject::operator = (event);
+ fEventId = event.fEventId;
+ fArray.Clear();
+ TIter next(&event.fArray);
+ TObject* obj = NULL;
+ while ( (obj = next()) != NULL )
+ {
+ fArray.Add(obj->Clone());
+ }
+ return *this;
+}
+
+
const AliHLTMUONDecision* AliHLTMUONEvent::FindDecision() const
{
/// Finds the decision object in the event from the list of dHLT objects.
for (Int_t i = 0; i < fArray.GetEntriesFast(); i++)
if (fArray[i] != NULL) fArray[i]->Print(option);
}
+
+
+void AliHLTMUONEvent::Clear(Option_t* option)
+{
+ /// Clears the internal array of event objects.
+
+ fEventId = AliHLTEventID_t(-1);
+ fArray.Clear(option);
+}
+
+
+void AliHLTMUONEvent::Copy(TObject& object) const
+{
+ /// Deep copy this object to the target object.
+ /// \param object The target object to copy to.
+
+ if (object.IsA() != this->IsA())
+ {
+ AliError(Form("Cannot copy an object of type %s to a type of %s.",
+ this->ClassName(), object.ClassName()
+ ));
+ return;
+ }
+
+ TObject::Copy(object);
+ AliHLTMUONEvent& event = static_cast<AliHLTMUONEvent&>(object);
+ event.fEventId = fEventId;
+ event.fArray.Clear();
+ TIter next(&fArray);
+ TObject* obj = NULL;
+ while ( (obj = next()) != NULL )
+ {
+ event.fArray.Add(obj->Clone());
+ }
+}
+
fArray.SetOwner(kTRUE);
}
+ /// Copy constructor performs a deep copy of the object.
+ AliHLTMUONEvent(const AliHLTMUONEvent& event);
+
+ /// The assignment operator performs a deep copy of the object.
+ AliHLTMUONEvent& operator = (const AliHLTMUONEvent& event);
+
/// Default destructor.
virtual ~AliHLTMUONEvent() {}
/// Inherited method for printing information about all objects in the event.
virtual void Print(Option_t* option = NULL) const;
+
+ /// Inherited method for clearing the event.
+ virtual void Clear(Option_t* option = "");
+
+ /// Inherited method for deep copying the event.
+ virtual void Copy(TObject& object) const;
private: