]>
Commit | Line | Data |
---|---|---|
242bb794 | 1 | // -*- Mode: C++ -*- |
2 | // $Id$ | |
3 | ||
4 | #ifndef ALIHLTOFFLINEINTERFACE_H | |
5 | #define ALIHLTOFFLINEINTERFACE_H | |
5ba46b3b | 6 | //* This file is property of and copyright by the * |
7 | //* ALICE Experiment at CERN, All rights reserved. * | |
8 | //* See cxx source for full Copyright notice * | |
9 | ||
10 | /// @file AliHLTOfflineInterface.h | |
11 | /// @author Matthias Richter | |
12 | /// @date | |
13 | /// @brief the HLT interface to AliRoot | |
14 | /// | |
30338a30 | 15 | |
242bb794 | 16 | #include <TObject.h> |
17 | #include <TList.h> | |
18 | ||
19 | class AliRunLoader; | |
20 | class AliRawReader; | |
af885e0f | 21 | class AliESDEvent; |
242bb794 | 22 | class TTree; |
23 | ||
24 | /******************************************************************************/ | |
25 | ||
26 | /** | |
27 | * @class AliHLTOfflineInterface | |
28 | * The class implements the basic interface to the AliRoot objects during | |
29 | * reconstructions. | |
30 | * It serves as a base class for offline source and sink interface components | |
af885e0f | 31 | * and provides access methods for the AliRunLoader, AliRawReader and AliESDEvent |
242bb794 | 32 | * objects. The AliRunLoader and the AliRawReader are fixed during one run, |
af885e0f | 33 | * while the AliESDEvent object will be changed from event to event.<br> |
242bb794 | 34 | * \em Note: The digits and clusters trees are not available through this |
35 | * interface class as they are completetly detector (AliLoader) dependend. | |
36 | * | |
37 | * @note This class is only used for the @ref alihlt_system. | |
38 | * | |
39 | * @ingroup alihlt_system | |
40 | */ | |
41 | class AliHLTOfflineInterface : public TObject { | |
42 | public: | |
43 | /** standard constructor */ | |
44 | AliHLTOfflineInterface(); | |
45 | /** constructor | |
46 | * @param pRunLoader pointer to AliRoot run loader | |
47 | * @param pRawReader pointer to AliRoot raw reader | |
48 | */ | |
49 | AliHLTOfflineInterface(AliRunLoader* pRunLoader, AliRawReader* pRawReader); | |
242bb794 | 50 | /** destructor */ |
51 | virtual ~AliHLTOfflineInterface(); | |
52 | ||
53 | /** | |
54 | * Get the AliRoot run loader. | |
55 | */ | |
8451168b | 56 | AliRunLoader* GetRunLoader() const; |
242bb794 | 57 | |
58 | /** | |
59 | * Get the AliRoot raw reader | |
60 | */ | |
8451168b | 61 | AliRawReader* GetRawReader() const; |
242bb794 | 62 | |
63 | /** | |
64 | * Set AliRoot ESD for the current event. | |
65 | */ | |
af885e0f | 66 | int SetESD(Int_t eventNo, AliESDEvent* pESD); |
242bb794 | 67 | |
68 | /** | |
69 | * Get the AliRoot ESD | |
70 | */ | |
af885e0f | 71 | AliESDEvent* GetESD() const; |
242bb794 | 72 | |
73 | /** | |
74 | * Set AliRoot external params. | |
75 | * | |
76 | * @param runLoader the AliRoot runloader | |
77 | * @param rawReader the AliRoot RawReader | |
78 | * @return neg. error code if failed | |
79 | */ | |
80 | int SetParams(AliRunLoader* runLoader, AliRawReader* rawReader); | |
81 | ||
82 | /** | |
83 | * Reset AliRoot internal params. | |
84 | */ | |
85 | int Reset(); | |
86 | ||
87 | /** | |
88 | * Set AliRoot external params. | |
89 | * This method works on the global list. | |
90 | * @param runLoader the AliRoot runloader | |
91 | * @param rawReader the AliRoot RawReader | |
92 | * @return neg. error code if failed | |
93 | */ | |
94 | static int SetParamsToComponents(AliRunLoader* runLoader, AliRawReader* rawReader); | |
95 | ||
96 | /** | |
97 | * Fill ESD for one event. | |
98 | * Fill the ESD with the previously reconstructed data. It must be implmented | |
99 | * by the child class. | |
8451168b | 100 | * @param eventNo event No. \em Note: this is an internal enumeration of the |
101 | * processed events. | |
242bb794 | 102 | * @param runLoader the AliRoot runloader |
af885e0f | 103 | * @param esd an AliESDEvent instance |
242bb794 | 104 | * @return neg. error code if failed |
105 | */ | |
af885e0f | 106 | virtual int FillESD(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd)=0; |
242bb794 | 107 | |
108 | /** | |
109 | * Fill ESD for one event. | |
110 | * The FillESD method of all active AliHLTOfflineDataSink's is called in | |
111 | * order to fill the ESD with the previously reconstructed data. This method | |
112 | * works on the global list. | |
8451168b | 113 | * @param eventNo event No. \em Note: this is an internal enumeration of the |
114 | * processed events. | |
242bb794 | 115 | * @param runLoader the AliRoot runloader |
af885e0f | 116 | * @param esd an AliESDEvent instance |
242bb794 | 117 | * @return neg. error code if failed |
118 | */ | |
af885e0f | 119 | static int FillComponentESDs(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd); |
242bb794 | 120 | |
121 | /** | |
122 | * Reset AliRoot internal params of all active components. | |
123 | * This method works on the global list. | |
124 | */ | |
125 | static int ResetComponents(); | |
126 | ||
127 | protected: | |
128 | /** | |
129 | * Register an OfflineInterface. | |
130 | * @param me instance of AliHLTOfflineInterface | |
131 | * @return neg. error code if failed | |
132 | */ | |
133 | static int Register(AliHLTOfflineInterface* me); | |
134 | ||
135 | /** | |
136 | * Unregister an OfflineInterface. | |
137 | * @param me instance of AliHLTOfflineInterface | |
138 | * @return neg. error code if failed | |
139 | */ | |
140 | static int Unregister(AliHLTOfflineInterface* me); | |
141 | ||
142 | private: | |
ed59629f | 143 | /** copy constructor prohibited */ |
144 | AliHLTOfflineInterface(const AliHLTOfflineInterface&); | |
145 | /** assignment operator prohibited */ | |
146 | AliHLTOfflineInterface& operator=(const AliHLTOfflineInterface&); | |
147 | ||
8451168b | 148 | /** global AliRoot run loader instance (for all components) */ |
149 | static AliRunLoader* fgpRunLoader; //! transient | |
150 | /** global AliRoot raw reader instance (for all components) */ | |
151 | static AliRawReader* fgpRawReader; //! transient | |
152 | ||
153 | /** private AliRoot run loader instance */ | |
242bb794 | 154 | AliRunLoader* fpRunLoader; //! transient |
8451168b | 155 | /** private AliRoot raw reader instance */ |
242bb794 | 156 | AliRawReader* fpRawReader; //! transient |
157 | /** AliRoot HLT ESD instance */ | |
af885e0f | 158 | AliESDEvent* fpESD; //! transient |
242bb794 | 159 | |
7617ca1e | 160 | /** the list of active interfaces */ |
5ba46b3b | 161 | static AliHLTOfflineInterface* fgAnchor; //! transient |
7617ca1e | 162 | |
163 | /** next element in the list */ | |
164 | AliHLTOfflineInterface* fpNext; //! transient | |
165 | ||
166 | /** the current element */ | |
5ba46b3b | 167 | static AliHLTOfflineInterface* fgCurrent; //! transient |
7617ca1e | 168 | |
169 | /** number of interfaces */ | |
5ba46b3b | 170 | static int fgCount; //! see above |
7617ca1e | 171 | |
5ba46b3b | 172 | ClassDef(AliHLTOfflineInterface, 0); |
242bb794 | 173 | }; |
174 | ||
175 | #endif |