]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLTANALYSIS/JET/analysis/AliHLTJETAnalysisJets.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / HLTANALYSIS / JET / analysis / AliHLTJETAnalysisJets.h
1 //-*- Mode: C++ -*-
2
3 // $Id: AliHLTJETAnalysisJets.h  $
4
5 #ifndef ALIHLTJETANALYSISJETS_H
6 #define ALIHLTJETANALYSISJETS_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   AliHLTJETAnalysisJets.h
13     @author Jochen Thaeder <jochen@thaeder.de>
14     @date   
15     @brief  Container holding analysis objects
16 */
17
18 // see below for class documentation
19 // or
20 // refer to README to build package
21 // or
22 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
23
24 class TH1; 
25 class TClonesArray; 
26
27 class AliAODJet;
28 class AliMCEvent;
29
30 #include "AliHLTLogging.h"
31 #include "AliHLTMCEvent.h"
32 #include "AliHLTJets.h"
33
34 #include "AliHLTJETBase.h"
35
36 #include "AliHLTJETAnalysisBase.h"
37
38 /**
39  * @class AliHLTJETAnalysisJets
40  * This class is a container which holds TClonesArrys of 
41  * histograms needed for the Jet Analysis.
42  *
43  * It need a ptr to MC information (pythia jets) and 
44  * reconstructed jets in the form of AliHLTJets.
45  *
46  * @ingroup alihlt_jet
47  * @ingroup alihlt_jet_analysis
48  */
49
50 class AliHLTJETAnalysisJets : public TObject, public AliHLTLogging {
51 public:
52   
53   /*
54    * ---------------------------------------------------------------------------------
55    *                            Constructor / Destructor
56    * ---------------------------------------------------------------------------------
57    */
58
59   /** Constructor */
60   AliHLTJETAnalysisJets();
61   
62   /** Destructor */
63   ~AliHLTJETAnalysisJets();
64
65   /*
66    * ---------------------------------------------------------------------------------
67    *                         Initialize / Setup / Reset - public
68    * ---------------------------------------------------------------------------------
69    */
70
71   /** Setup analysis class 
72    *  @return 0 on success, <0 on failure
73    */
74   Int_t Initialize();
75
76   /** Reset input for current event */
77   void ResetEvent();
78
79   /*
80    * ---------------------------------------------------------------------------------
81    *                                Setter - public
82    * ---------------------------------------------------------------------------------
83    */
84
85   /** Set reconstructed jets
86    *  @param jets       Ptr to AliHLTJets
87    */
88   void SetJetsRec( AliHLTJets* jets );
89
90   /** Set compare jets
91    *  Filled in order of presence
92    *  @param hltMcEvent    Ptr to AliHLTMCEvent, sets pythia jets in HLT environment
93    *  @param mcEvent       Ptr to AliMCEvent, sets pythia jets in Off-line environment
94    *  @param jets          Ptr to AliHLTJets
95    */
96   void SetJetsCmp( AliHLTMCEvent* hltMcEvent, AliMCEvent* mcEvent, AliHLTJets* jets );
97
98   /*
99    * ---------------------------------------------------------------------------------
100    *                                 Getter - public
101    * ---------------------------------------------------------------------------------
102    */
103
104   /** Returns histogram dependent of histogram type and plot type 
105    *  @param histIdx    histogram type (Ptr to TClonesArray),
106    *                    @see AliHLTJETAnalysisBase
107    *  @param plotIdx    plot type (Entry Idx in TClonesArray),
108    *                    @see AliHLTJETAnalysisBase
109    *  @return           Ptr to TH1 on success, NULL on failure
110    */
111   TH1* GetHistogram ( Int_t histIdx, Int_t plotIdx );
112
113   /*
114    * ---------------------------------------------------------------------------------
115    *                          Analysis - public
116    * ---------------------------------------------------------------------------------
117    */
118
119   /** Anlayze Data Set 
120    *  -Fill unmatched jets into histograms
121    *  -Match jets
122    *  -Fill matched jets into histograms
123    *  @return 0 on success, <0 on failure
124    */
125   Int_t Analyze();
126
127   ///////////////////////////////////////////////////////////////////////////////////
128   
129  private:
130  
131   /** copy constructor prohibited */
132   AliHLTJETAnalysisJets(const AliHLTJETAnalysisJets&);
133   
134   /** assignment operator prohibited */
135   AliHLTJETAnalysisJets& operator=(const AliHLTJETAnalysisJets&);
136
137   /*
138    * ---------------------------------------------------------------------------------
139    *                             Setup / Reset - private
140    * ---------------------------------------------------------------------------------
141    */
142   
143   /** Setup Delta histograms */
144   void SetupDeltaHistograms();
145
146   /** Setup Spectra histograms */
147   void SetupSpectraHistograms();
148
149   /** Setup matched histograms */
150   void SetupMatchedHistograms();
151
152   /*
153    * ---------------------------------------------------------------------------------
154    *                             Analysis - private
155    * ---------------------------------------------------------------------------------
156    */
157
158   /** Match Pythia and Reconstructed Jets  
159    *  @return 0 on success, <0 on failure
160    */
161   Int_t MatchJets();
162   
163   /*
164    * ---------------------------------------------------------------------------------
165    *                                Fill - private
166    * ---------------------------------------------------------------------------------
167    */
168   
169   /** Fill basic Spectra histogram */
170   void FillBasicSpectraHistograms();
171
172   /** Fill unmatched Delta histogram */
173   void FillUnmatchedDeltaHistograms();
174
175   /** Fill matched Delta histogram */
176   void FillMatchedDeltaHistograms();
177
178   /** Fill matched Spectra histogram */
179   void FillMatchedSpectraHistograms();
180
181   /** Fill matched histogram */
182   void FillMatchedHistograms();
183   
184   /*
185    * ---------------------------------------------------------------------------------
186    *                               Helper - private
187    * ---------------------------------------------------------------------------------
188    */
189
190   /** Setup histogram with common parameters 
191    *  @param hist    Ptr to histogram 
192    */
193   void SetupHist( TH1* hist );
194
195   /** Fill 1D histogram, in a TClonesArray
196    *  @param array   Ptr to TClonesArray of histograms
197    *  @param idx     Index in the TClonesArray
198    *  @param valueX  x value
199    */
200   void FillHist( TClonesArray* array, Int_t idx, Float_t valueX  );
201   
202   /** Fill 2D histogram, in a TClonesArray
203    *  @param array   Ptr to TClonesArray of histograms
204    *  @param idx     Index in the TClonesArray
205    *  @param valueX  x value
206    *  @param valueY  y value
207    */
208   void FillHist( TClonesArray* array, Int_t idx, Float_t valueX, Float_t valueY );
209   
210   /** Get Distance^2 in eta phi space of 2 jets
211    *  @param jet1    Ptr to jet 1
212    *  @param jet2    Ptr to jet 2
213    *  @return        Distance^2
214    */
215   Float_t GetDistance2( AliAODJet *jet1, AliAODJet *jet2); 
216
217   /*
218    * ---------------------------------------------------------------------------------
219    *                             Members - private
220    * ---------------------------------------------------------------------------------
221    */
222
223   // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
224   // ++ Data Members 
225   // ++
226   // ++-> replaced every event
227   // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
228
229   /** MC jets are filled in fJetsCmp */
230   Bool_t         fHasMC;                         // see above
231
232   // ---------------------------------------------------
233   // -- Members filled per event
234   // ---------------------------------------------------
235
236   /** reconstructed jets */
237   AliHLTJets    *fJetsRec;                       //! transient      
238
239   /** compare jets - rec or MC */
240   AliHLTJets    *fJetsCmp;                       //! transient      
241
242   /** Array of indices of the matched reconstructed jets */
243   TArrayI       *fMatchedJetsRec;                //! transient      
244
245   /** Array of indices of the matched compae jets */
246   TArrayI       *fMatchedJetsCmp;                //! transient      
247
248
249   // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
250   // ++ Analysis Parameter 
251   // ++
252   // ++ -> Created once
253   // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
254
255   Float_t        fMatchingThreshold;             // see above
256
257   // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
258   // ++ Analysis Output 
259   // ++
260   // ++ -> Created once
261   // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
262
263   // ---------------------------------------------------
264   // -- Difference in reconstruction
265   // ---------------------------------------------------
266   
267   /** Matched Jets - delta Et */
268   TClonesArray  *fDeltaEt;                       // see above
269
270   /** Delta eta ( jetRec - jetCmp ) */
271   TClonesArray  *fDeltaEta;                      // see above
272   
273   /** Delta phi ( jetRec - jetCmp ) */
274   TClonesArray  *fDeltaPhi;                      // see above
275   
276   /** Delta eta, delta phi ( jetRec - jetCmp ) */
277   TClonesArray  *fDeltaEtaDeltaPhi;              // see above
278   
279   // ---------------------------------------------------
280   // -- Jet spectra
281   // ---------------------------------------------------
282   
283   /** Jet spectra in Et */
284   TClonesArray  *fSpectraEt;                     // see above
285
286   /** Jet spectra in eta */
287   TClonesArray  *fSpectraEta;                    // see above
288   
289   /** Jet spectra in phi */
290   TClonesArray  *fSpectraPhi;                    // see above
291            
292   // ---------------------------------------------------
293   // -- Correlations
294   // ---------------------------------------------------
295
296   /** Correleation jetRec vs jetCmp finder */
297   TClonesArray  *fCorrelationsJetEt;             // see above
298
299   // ---------------------------------------------------
300   // -- Resolutions
301   // ---------------------------------------------------
302   
303   /** Resolutions for Et for jetRec - jetCmp fixed */
304   TClonesArray  *fResolutionsJetEt;              // see above
305
306   /** Resolutions for Et for jetfinder - nearside fixed */
307   TClonesArray  *fResolutionsDiJetEt;            // see above
308
309   ClassDef(AliHLTJETAnalysisJets, 3);
310 };
311 #endif