4 #ifndef ALIHLTOFFLINEINTERFACE_H
5 #define ALIHLTOFFLINEINTERFACE_H
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 *
10 /// @file AliHLTOfflineInterface.h
11 /// @author Matthias Richter
13 /// @brief the HLT interface to AliRoot
24 /******************************************************************************/
27 * @class AliHLTOfflineInterface
28 * The class implements the basic interface to the AliRoot objects during
30 * It serves as a base class for offline source and sink interface components
31 * and provides access methods for the AliRunLoader, AliRawReader and AliESDEvent
32 * objects. The AliRunLoader and the AliRawReader are fixed during one run,
33 * while the AliESDEvent object will be changed from event to event.<br>
34 * \em Note: The digits and clusters trees are not available through this
35 * interface class as they are completetly detector (AliLoader) dependend.
37 * @note This class is only used for the @ref alihlt_system.
39 * @ingroup alihlt_system
41 class AliHLTOfflineInterface : public TObject {
43 /** standard constructor */
44 AliHLTOfflineInterface();
46 * @param pRunLoader pointer to AliRoot run loader
47 * @param pRawReader pointer to AliRoot raw reader
49 AliHLTOfflineInterface(AliRunLoader* pRunLoader, AliRawReader* pRawReader);
51 virtual ~AliHLTOfflineInterface();
54 * Get the AliRoot run loader.
56 AliRunLoader* GetRunLoader() const;
59 * Get the AliRoot raw reader
61 AliRawReader* GetRawReader() const;
64 * Set AliRoot ESD for the current event.
66 int SetESD(Int_t eventNo, AliESDEvent* pESD);
71 AliESDEvent* GetESD() const;
74 * Set AliRoot external params.
76 * @param runLoader the AliRoot runloader
77 * @param rawReader the AliRoot RawReader
78 * @return neg. error code if failed
80 int SetParams(AliRunLoader* runLoader, AliRawReader* rawReader);
83 * Reset AliRoot internal params.
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
94 static int SetParamsToComponents(AliRunLoader* runLoader, AliRawReader* rawReader);
97 * Fill ESD for one event.
98 * Fill the ESD with the previously reconstructed data. It must be implmented
100 * @param eventNo event No. \em Note: this is an internal enumeration of the
102 * @param runLoader the AliRoot runloader
103 * @param esd an AliESDEvent instance
104 * @return neg. error code if failed
106 virtual int FillESD(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd)=0;
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.
113 * @param eventNo event No. \em Note: this is an internal enumeration of the
115 * @param runLoader the AliRoot runloader
116 * @param esd an AliESDEvent instance
117 * @return neg. error code if failed
119 static int FillComponentESDs(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd);
122 * Reset AliRoot internal params of all active components.
123 * This method works on the global list.
125 static int ResetComponents();
129 * Register an OfflineInterface.
130 * @param me instance of AliHLTOfflineInterface
131 * @return neg. error code if failed
133 static int Register(AliHLTOfflineInterface* me);
136 * Unregister an OfflineInterface.
137 * @param me instance of AliHLTOfflineInterface
138 * @return neg. error code if failed
140 static int Unregister(AliHLTOfflineInterface* me);
143 /** copy constructor prohibited */
144 AliHLTOfflineInterface(const AliHLTOfflineInterface&);
145 /** assignment operator prohibited */
146 AliHLTOfflineInterface& operator=(const AliHLTOfflineInterface&);
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
153 /** private AliRoot run loader instance */
154 AliRunLoader* fpRunLoader; //! transient
155 /** private AliRoot raw reader instance */
156 AliRawReader* fpRawReader; //! transient
157 /** AliRoot HLT ESD instance */
158 AliESDEvent* fpESD; //! transient
160 /** the list of active interfaces */
161 static AliHLTOfflineInterface* fgAnchor; //! transient
163 /** next element in the list */
164 AliHLTOfflineInterface* fpNext; //! transient
166 /** the current element */
167 static AliHLTOfflineInterface* fgCurrent; //! transient
169 /** number of interfaces */
170 static int fgCount; //! see above
172 ClassDef(AliHLTOfflineInterface, 0);