]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/BASE/AliHLTOfflineInterface.h
Modified initialisation
[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 */
59 const AliRunLoader* GetRunLoader() const;
60
61 /**
62 * Get the AliRoot raw reader
63 */
64 const AliRawReader* GetRawReader() const;
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.
103 * @param runLoader the AliRoot runloader
104 * @param esd an AliESD instance
105 * @return neg. error code if failed
106 */
107 virtual int FillESD(AliRunLoader* runLoader, AliESD* esd)=0;
108
109 /**
110 * Fill ESD for one event.
111 * The FillESD method of all active AliHLTOfflineDataSink's is called in
112 * order to fill the ESD with the previously reconstructed data. This method
113 * works on the global list.
114 * @param runLoader the AliRoot runloader
115 * @param esd an AliESD instance
116 * @return neg. error code if failed
117 */
118 static int FillComponentESDs(AliRunLoader* runLoader, AliESD* esd);
119
120 /**
121 * Reset AliRoot internal params of all active components.
122 * This method works on the global list.
123 */
124 static int ResetComponents();
125
126protected:
127 /**
128 * Register an OfflineInterface.
129 * @param me instance of AliHLTOfflineInterface
130 * @return neg. error code if failed
131 */
132 static int Register(AliHLTOfflineInterface* me);
133
134 /**
135 * Unregister an OfflineInterface.
136 * @param me instance of AliHLTOfflineInterface
137 * @return neg. error code if failed
138 */
139 static int Unregister(AliHLTOfflineInterface* me);
140
141 private:
142 /** the list of active interfaces */
143 static TList fgList; // see above
144
145 /** the current object link (list position) */
146 static TObjLink* fgCurrentLnk; // see above
147
148 /** AliRoot run loader instance */
149 AliRunLoader* fpRunLoader; //! transient
150 /** AliRoot raw reader instance */
151 AliRawReader* fpRawReader; //! transient
152 /** AliRoot HLT ESD instance */
153 AliESD* fpESD; //! transient
154
155 ClassDef(AliHLTOfflineInterface, 1);
156};
157
158#endif