]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/OfflineInterface/AliHLTMUONRootifierComponent.h
790a9032dfdd41128fa30a535e6033e3701f01a9
[u/mrichter/AliRoot.git] / HLT / MUON / OfflineInterface / AliHLTMUONRootifierComponent.h
1 #ifndef ALIHLTMUONROOTIFIERCOMPONENT_H
2 #define ALIHLTMUONROOTIFIERCOMPONENT_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   
13  * @brief  Component for converting dHLT raw data into ROOT objects.
14  */
15
16 #include "AliHLTProcessor.h"
17
18 // Temporary solution for grouping together objects for the same event.
19 #include "TObjArray.h"
20 class AliHLTMUONEvent : public TObject
21 {
22 public:
23
24         AliHLTMUONEvent(AliHLTEventID_t eventId = AliHLTEventID_t(-1))
25                 : fEventId(eventId)
26         {
27                 fArray.SetOwner(kTRUE);
28         }
29         
30         virtual ~AliHLTMUONEvent() {}
31         
32         AliHLTEventID_t EventID() const { return fEventId; }
33         const TObjArray& Array() const { return fArray; }
34         
35         // Takes ownership of the object.
36         void Add(TObject* obj) { fArray.Add(obj); }
37         
38         virtual void Print(Option_t* option = NULL) const
39         {
40                 cout << "################## EVENT: " << fEventId << " ##################" << endl;
41                 for (Int_t i = 0; i < fArray.GetEntriesFast(); i++)
42                         if (fArray[i] != NULL) fArray[i]->Print(option);
43         }
44
45 private:
46
47         AliHLTEventID_t fEventId;
48         TObjArray fArray;
49         
50         ClassDef(AliHLTMUONEvent, 1); // Container class for dHLT event results.
51 };
52
53
54 /**
55  * Converts dHLT raw data blocks into ROOT objects.
56  */
57 class AliHLTMUONRootifierComponent : public AliHLTProcessor
58 {
59 public:
60
61         AliHLTMUONRootifierComponent();
62         virtual ~AliHLTMUONRootifierComponent();
63         
64         int DoEvent(const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
65         
66         virtual const char* GetComponentID();
67
68         virtual void GetInputDataTypes(vector<AliHLTComponentDataType>& list);
69         virtual AliHLTComponentDataType GetOutputDataType();
70
71         virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
72
73         virtual AliHLTComponent* Spawn();
74
75 protected:
76
77         virtual int DoInit(int argc, const char** argv);
78         virtual int DoDeinit();
79         
80 private:
81
82         // Prevent copying of these objects.
83         AliHLTMUONRootifierComponent(const AliHLTMUONRootifierComponent& /*object*/);
84         AliHLTMUONRootifierComponent& operator = (const AliHLTMUONRootifierComponent& /*object*/);
85
86         ClassDef(AliHLTMUONRootifierComponent, 0); // Converter component of dHLT raw data.
87 };
88
89 #endif // ALIHLTMUONROOTIFIERCOMPONENT_H