4 #ifndef ALIHLTOFFLINEINTERFACE_H
5 #define ALIHLTOFFLINEINTERFACE_H
6 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7 * See cxx source for full Copyright notice */
9 /** @file AliHLTOfflineInterface.h
10 @author Matthias Richter
12 @brief the HLT interface to AliRoot
15 // see below for class documentation
17 // refer to README to build package
19 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
29 /******************************************************************************/
32 * @class AliHLTOfflineInterface
33 * The class implements the basic interface to the AliRoot objects during
35 * It serves as a base class for offline source and sink interface components
36 * and provides access methods for the AliRunLoader, AliRawReader and AliESDEvent
37 * objects. The AliRunLoader and the AliRawReader are fixed during one run,
38 * while the AliESDEvent object will be changed from event to event.<br>
39 * \em Note: The digits and clusters trees are not available through this
40 * interface class as they are completetly detector (AliLoader) dependend.
42 * @note This class is only used for the @ref alihlt_system.
44 * @ingroup alihlt_system
46 class AliHLTOfflineInterface : public TObject {
48 /** standard constructor */
49 AliHLTOfflineInterface();
51 * @param pRunLoader pointer to AliRoot run loader
52 * @param pRawReader pointer to AliRoot raw reader
54 AliHLTOfflineInterface(AliRunLoader* pRunLoader, AliRawReader* pRawReader);
55 /** not a valid copy constructor, defined according to effective C++ style */
56 AliHLTOfflineInterface(const AliHLTOfflineInterface&);
57 /** not a valid assignment op, but defined according to effective C++ style */
58 AliHLTOfflineInterface& operator=(const AliHLTOfflineInterface&);
60 virtual ~AliHLTOfflineInterface();
63 * Get the AliRoot run loader.
65 AliRunLoader* GetRunLoader() const;
68 * Get the AliRoot raw reader
70 AliRawReader* GetRawReader() const;
73 * Set AliRoot ESD for the current event.
75 int SetESD(Int_t eventNo, AliESDEvent* pESD);
80 AliESDEvent* GetESD() const;
83 * Set AliRoot external params.
85 * @param runLoader the AliRoot runloader
86 * @param rawReader the AliRoot RawReader
87 * @return neg. error code if failed
89 int SetParams(AliRunLoader* runLoader, AliRawReader* rawReader);
92 * Reset AliRoot internal params.
97 * Set AliRoot external params.
98 * This method works on the global list.
99 * @param runLoader the AliRoot runloader
100 * @param rawReader the AliRoot RawReader
101 * @return neg. error code if failed
103 static int SetParamsToComponents(AliRunLoader* runLoader, AliRawReader* rawReader);
106 * Fill ESD for one event.
107 * Fill the ESD with the previously reconstructed data. It must be implmented
108 * by the child class.
109 * @param eventNo event No. \em Note: this is an internal enumeration of the
111 * @param runLoader the AliRoot runloader
112 * @param esd an AliESDEvent instance
113 * @return neg. error code if failed
115 virtual int FillESD(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd)=0;
118 * Fill ESD for one event.
119 * The FillESD method of all active AliHLTOfflineDataSink's is called in
120 * order to fill the ESD with the previously reconstructed data. This method
121 * works on the global list.
122 * @param eventNo event No. \em Note: this is an internal enumeration of the
124 * @param runLoader the AliRoot runloader
125 * @param esd an AliESDEvent instance
126 * @return neg. error code if failed
128 static int FillComponentESDs(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd);
131 * Reset AliRoot internal params of all active components.
132 * This method works on the global list.
134 static int ResetComponents();
138 * Register an OfflineInterface.
139 * @param me instance of AliHLTOfflineInterface
140 * @return neg. error code if failed
142 static int Register(AliHLTOfflineInterface* me);
145 * Unregister an OfflineInterface.
146 * @param me instance of AliHLTOfflineInterface
147 * @return neg. error code if failed
149 static int Unregister(AliHLTOfflineInterface* me);
152 /** global AliRoot run loader instance (for all components) */
153 static AliRunLoader* fgpRunLoader; //! transient
154 /** global AliRoot raw reader instance (for all components) */
155 static AliRawReader* fgpRawReader; //! transient
157 /** private AliRoot run loader instance */
158 AliRunLoader* fpRunLoader; //! transient
159 /** private AliRoot raw reader instance */
160 AliRawReader* fpRawReader; //! transient
161 /** AliRoot HLT ESD instance */
162 AliESDEvent* fpESD; //! transient
164 /** the list of active interfaces */
165 static AliHLTOfflineInterface* fAnchor; //! transient
167 /** next element in the list */
168 AliHLTOfflineInterface* fpNext; //! transient
170 /** the current element */
171 static AliHLTOfflineInterface* fCurrent; //! transient
173 /** number of interfaces */
174 static int fCount; //! see above
176 ClassDef(AliHLTOfflineInterface, 3);