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