]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/JET/AliHLTJETReader.h
removing the CTPData from the HLTGlobalTrigger decision because of bug #88431 until...
[u/mrichter/AliRoot.git] / HLT / JET / AliHLTJETReader.h
1 //-*- Mode: C++ -*-
2
3 // $Id:  $
4
5 #ifndef ALIHLTJETREADER_H
6 #define ALIHLTJETREADER_H
7
8 /* This file is property of and copyright by the ALICE HLT Project        * 
9  * ALICE Experiment at CERN, All rights reserved.                         *
10  * See cxx source for full Copyright notice                               */
11
12 /** @file   AliHLTJETReader.h
13     @author Jochen Thaeder
14     @date   
15     @brief  Reader for jet finder
16 */
17
18 #ifdef HAVE_FASTJET
19 #include "fastjet/PseudoJet.hh"
20 #endif
21
22 #include "AliJetReader.h"
23 #include "AliJetReaderHeader.h"
24
25 #include "AliESDEvent.h"
26 #include "AliAODEvent.h"
27
28 #include "AliHLTLogging.h"
29 #include "AliHLTMCEvent.h"
30
31 #include "AliHLTJETBase.h"
32 #include "AliHLTJETTrackCuts.h"
33 #include "AliHLTJETReaderHeader.h"
34
35 #include "AliHLTJETConeSeedCuts.h"
36 #include "AliHLTJETConeGrid.h"
37
38 /**
39  * @class  AliHLTJETReader
40  * This class is the reader class for the JetFinder in the HLT
41  * It implements the reading of ESDs and MCs. AOD reading is 
42  * not yet implemented
43  * <br>
44  * Usage :<br>
45  * - Initilize() // Initializes the reader dependent of the algorithm
46  *
47  * @ingroup alihlt_jet
48  */
49
50 class AliHLTJETReader : public AliJetReader, public AliHLTLogging {
51   
52 public:
53
54   /*
55    * ---------------------------------------------------------------------------------
56    *                            Constructor / Destructor
57    * ---------------------------------------------------------------------------------
58    */
59
60   /** standard constructor */
61   AliHLTJETReader();
62
63   /** destructor */
64   virtual ~AliHLTJETReader();
65
66   /*
67    * ---------------------------------------------------------------------------------
68    *                                Initialize / Reset
69    * ---------------------------------------------------------------------------------
70    */
71
72   /** Initialize reader 
73    *  Calls AliHLTJETReaderHeader::Initialize
74    *  and the private Initialize methods
75    *  @return 0 on success, otherwise <0
76    */
77   Int_t Initialize();
78  
79   /** Reset the event */
80   void ResetEvent();
81
82   /*
83    * ---------------------------------------------------------------------------------
84    *                                     Setter
85    * ---------------------------------------------------------------------------------
86    */
87   
88   /** Set pointer to input event
89    *  Needs "useMC" flag for running in analysis task only
90    *  @param esd an AliESDEvent
91    *  @param aod an AliAODEvent
92    *  @param mc an AliHLTMCEvent
93    */
94   void SetInputEvent(const TObject* esd, const TObject* aod, const TObject* mc);
95
96   /** Set number of jet candates = seeds */
97   void SetNJetCandidates( Int_t i ) { fNJetCandidates = i; }
98
99   /*
100    * ---------------------------------------------------------------------------------
101    *                            Fastjet Reader functionality
102    * ---------------------------------------------------------------------------------
103    */
104
105 #ifdef HAVE_FASTJET
106   /** Fill tracks in fastjet momemtum vector
107    *  @return kTRUE on success, otherwise kFALSE
108    */
109   Bool_t FillVector();
110
111   /** Fill MC tracks in fastjet momemtum vector
112    *  @return kTRUE on success, otherwise kFALSE
113    */
114   Bool_t FillVectorMC();
115
116   /** Fill HLT MC tracks in fastjet momemtum vector
117    *  @return kTRUE on success, otherwise kFALSE
118    */
119   Bool_t FillVectorHLTMC();
120
121   /** Fill ESD tracks in fastjet momemtum vector
122    *  @return kTRUE on success, otherwise kFALSE
123    */
124   Bool_t FillVectorESD();
125
126   /** Fill AOD tracks in fastjet momemtum vector
127    *  @return kTRUE on success, otherwise kFALSE
128    */
129   Bool_t FillVectorAOD();
130 #endif
131
132   /*
133    * ---------------------------------------------------------------------------------
134    *                               Grid functionality
135    * ---------------------------------------------------------------------------------
136    */
137   
138   /** Fill tracks in momentum array 
139    *  @return kTRUE on success, otherwise kFALSE
140    */
141   Bool_t FillGrid();
142
143   /** Fill MC tracks in momentum array 
144    *  @return kTRUE on success, otherwise kFALSE
145    */
146   Bool_t FillGridMC();
147
148   /** Fill HLT MC tracks in momentum array 
149    *  @return kTRUE on success, otherwise kFALSE
150    */
151   Bool_t FillGridHLTMC();
152
153   /** Fill ESD tracks in momentum array 
154    *  @return kTRUE on success, otherwise kFALSE
155    */
156   Bool_t FillGridESD();
157
158   /** Fill AOD tracks in momentum array 
159    *  @return kTRUE on success, otherwise kFALSE
160    */
161   Bool_t FillGridAOD();
162
163   /*
164    * ---------------------------------------------------------------------------------
165    *                                     Getter
166    * ---------------------------------------------------------------------------------
167    */
168
169   /** Get Ptr to AliHLTJETReaderHeader
170    *  @return ptr to AliHLTJETReaderHeader
171    */
172   AliHLTJETReaderHeader*      GetReaderHeader() const { return dynamic_cast<AliHLTJETReaderHeader*>(fReaderHeader);}
173
174 #ifdef HAVE_FASTJET
175   /** Get Ptr to input vector of Fastjet
176    *  @return ptr to input vector of Fastjet
177    */
178   vector<fastjet::PseudoJet>* GetVector()             { return fMomentumVector; }
179 #endif
180
181   /** Get Ptr to grid of cone finder
182    *  @return ptr to grid of cone finder
183    */
184   AliHLTJETConeGrid*          GetGrid()               { return fGrid; }
185
186   /** Get number of jet candates = seeds */
187   Int_t                       GetNJetCandidates()     { return fNJetCandidates; }
188
189   /** Get ptr to jet candiates = seeds for cone finder */
190   TClonesArray*               GetJetCandidates()      { return fJetCandidates; }
191
192   /*
193    * ---------------------------------------------------------------------------------
194    *                                     Seeds
195    * ---------------------------------------------------------------------------------
196    */
197
198   /** Add new seed
199    *  @param aEtaPhi     eta and phi of the seed
200    *  @param aGridIdx    indeces in the grid
201    *  @param coneRadius  coneRadius
202    */
203   void AddSeed( const Float_t* aEtaPhi, const Int_t* aGridIdx, 
204                 const Float_t coneRadius );
205
206   ///////////////////////////////////////////////////////////////////////////////////
207
208 private:
209
210   /** copy constructor prohibited */
211   AliHLTJETReader (const AliHLTJETReader&);
212
213   /** assignment operator prohibited */
214   AliHLTJETReader& operator= (const AliHLTJETReader&);
215
216   /*
217    * ---------------------------------------------------------------------------------
218    *                         Initialize - private
219    * ---------------------------------------------------------------------------------
220    */
221   
222   /** Initialize reader for the FFSC cone jet finder
223    *  @return 0 on success, otherwise <0
224    */
225   Int_t InitializeFFSC();
226
227 #ifdef HAVE_FASTJET
228   /** Initialize reader for the fastjet jet finders
229    *  @return 0 on success, otherwise <0
230    */
231   Int_t InitializeFastjet();
232 #endif
233
234   /*
235    * ---------------------------------------------------------------------------------
236    *                             Members - private
237    * ---------------------------------------------------------------------------------
238    */
239
240   // -- Input
241   // ----------
242
243   /** ESD event */
244   AliESDEvent                 *fESD;            //! transient
245
246   /** off-line MC event */
247   AliMCEvent                  *fMC;             //! transient
248
249   /** on-line MC event */
250   AliHLTMCEvent               *fHLTMC;          //! transient
251
252   /** AOD event */
253   AliAODEvent                 *fAOD;            //! transient
254
255   // -- Particle structures
256   // ------------------------
257
258 #ifdef HAVE_FASTJET
259   /** Vector of fastjet momemtum entries */
260   vector<fastjet::PseudoJet>  *fMomentumVector; //! transient
261 #endif
262
263   /** Grid for cone finder */
264   AliHLTJETConeGrid           *fGrid;           //! transient
265
266   // -- Output 
267   // -----------
268
269   /** Number of jet candates = seeds */
270   Int_t                        fNJetCandidates; // see above
271
272   /** Jet candiates = seeds for cone finder */
273   TClonesArray                *fJetCandidates;  //! transient
274
275   // -- Cuts
276   // ---------
277
278   /** Ptr to seed cuts */
279   AliHLTJETConeSeedCuts       *fSeedCuts;       //! transient
280
281   /** Ptr to track cuts */
282   AliHLTJETTrackCuts          *fTrackCuts;      //! transient
283
284   ClassDef(AliHLTJETReader, 1)
285
286 };
287 #endif
288