]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/AliHLTMUONEvent.h
Reversing commit 42768 because it apparently breaks the code. Waiting for proper...
[u/mrichter/AliRoot.git] / HLT / MUON / AliHLTMUONEvent.h
1 #ifndef ALIHLTMUONEVENT_H
2 #define ALIHLTMUONEVENT_H
3 /* This file is property of and copyright by the ALICE HLT Project        *
4  * ALICE Experiment at CERN, All rights reserved.                         *
5  * See cxx source for full Copyright notice                               */
6
7 // $Id: $
8
9 ///
10 /// @file   AliHLTMUONRootifierComponent.h
11 /// @author Artur Szostak <artursz@iafrica.com>
12 /// @date   9 May 2008
13 /// @brief  Declaration of class for storing ROOTified data objects for one event.
14 ///
15
16 #include "TObjArray.h"
17 #include "AliHLTMUONDataTypes.h"
18
19 class AliHLTMUONDecision;
20
21
22 class AliHLTMUONEvent : public TObject
23 {
24 public:
25
26         /// AliHLTMUONEvent class contructor.
27         /// \param eventId  The event identifier number for this event. Set to -1 by default.
28         AliHLTMUONEvent(AliHLTEventID_t eventId = AliHLTEventID_t(-1))
29           : TObject(), fEventId(eventId), fArray()
30         {
31                 fArray.SetOwner(kTRUE);
32         }
33         
34         /// Copy constructor performs a deep copy of the object.
35         AliHLTMUONEvent(const AliHLTMUONEvent& event);
36         
37         /// The assignment operator performs a deep copy of the object.
38         AliHLTMUONEvent& operator = (const AliHLTMUONEvent& event);
39         
40         /// Default destructor.
41         virtual ~AliHLTMUONEvent() {}
42         
43         /// Returns the corresponding event ID for the data objects.
44         AliHLTEventID_t EventID() const { return fEventId; }
45         
46         /// Returns the array of data objects for this event.
47         const TObjArray& Array() const { return fArray; }
48         
49         /// Returns the array of data objects for this event.
50         const TObjArray& DataObjects() const { return fArray; }
51         
52         /// Finds the decision object in the array of dHLT objects.
53         const AliHLTMUONDecision* FindDecision() const;
54         
55         /**
56          * Overloaded to find the object given by name in the array of event objects.
57          * \param name  The name of the object to find. This will be the class
58          *      name if the object in the array does not overload the GetName
59          *      method.
60          * \returns  The pointer to the found object or NULL if none was found.
61          */
62         virtual TObject* FindObject(const char* name) const
63         {
64                 return fArray.FindObject(name);
65         }
66         
67         /**
68          * Overloaded to find the object for which obj->IsEqual() is true in
69          * the array of event objects.
70          * \param obj  The object to compare to.
71          * \returns  The pointer to the found object or NULL if none was found.
72          */
73         virtual TObject* FindObject(const TObject* obj) const
74         {
75                 return fArray.FindObject(obj);
76         }
77         
78         /// Adds an object to the event.
79         /// \note This method takes ownership of the object.
80         void Add(TObject* obj) { fArray.Add(obj); }
81         
82         /// Inherited method for printing information about all objects in the event.
83         virtual void Print(Option_t* option = NULL) const;
84         
85         /// Inherited method for clearing the event.
86         virtual void Clear(Option_t* option = "");
87         
88         /// Inherited method for deep copying the event.
89         virtual void Copy(TObject& object) const;
90
91 private:
92
93         /// Performs a deep copy of the event. Assumes this event is already cleared and empty.
94         void DeepCopy(const AliHLTMUONEvent& event);
95
96         AliHLTEventID_t fEventId;  ///< The event ID.
97         TObjArray fArray;          ///< Array of event objects.
98         
99         ClassDef(AliHLTMUONEvent, 3); // Container class for dHLT event results.
100 };
101
102 #endif // ALIHLTMUONEVENT_H