]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AliFMDEventPlaneFinder.h
New script to generate overview index. Javascript code to
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliFMDEventPlaneFinder.h
CommitLineData
2b556440 1// This task finds the eventplane
2// using the FMD
3//
4#ifndef ALIFMDEVENTPLANEFINDER_H
5#define ALIFMDEVENTPLANEFINDER_H
6/**
7 * @file AliFMDEventPlaneFinder.h
8 * @author Alexander Hansen
9 * @date Tue Feb 14 2012
10 *
11 * @brief
12 *
13 *
14 * @ingroup pwglf_forward
15 */
16#include <TNamed.h>
17#include <TVector2.h>
18#include "AliForwardUtil.h"
19class AliVEvent;
20class TH1D;
21class TH2F;
22class TH2D;
23class TString;
24class AliOADBContainer;
25class AliAODForwardEP;
26
290052e7 27/**
28 * Find the event plane using the FMD
29 *
30 */
2b556440 31class AliFMDEventPlaneFinder : public TNamed
32{
33public:
34 /**
35 * Constructor
36 */
37 AliFMDEventPlaneFinder();
38 /**
39 * Constructor
40 *
41 * @param name Name of object
42 */
43 AliFMDEventPlaneFinder(const char* name);
44 /**
45 * Copy constructor
46 *
47 * @param o Object to copy from
48 */
49 AliFMDEventPlaneFinder(const AliFMDEventPlaneFinder& o);
50 /**
51 * Destructor
52 */
53 virtual ~AliFMDEventPlaneFinder();
54 /**
55 * Assignement operator
56 *
57 * @param o Object to assign from
58 *
59 * @return Reference to this object
60 */
61 AliFMDEventPlaneFinder& operator=(const AliFMDEventPlaneFinder& o);
290052e7 62 /**
2b556440 63 * Initialize this sub-algorithm
64 *
290052e7 65 * @param etaAxis Eta axis to use
2b556440 66 */
5934a3e3 67 virtual void SetupForData(const TAxis& etaAxis);
2b556440 68 /**
69 * Do the calculations
70 *
71 * @param hists Histogram cache
290052e7 72 * @param esd Event
73 * @param aodEp Output object
74 * @param h Output histogram
2b556440 75 *
76 * @return true on successs
77 */
78 Bool_t FindEventplane(AliVEvent* esd,
79 AliAODForwardEP& aodEp,
80 TH2D* h,
81 AliForwardUtil::Histos* hists);
82 /**
83 * Output diagnostic histograms to directory
84 *
85 * @param dir List to write in
86 */
5934a3e3 87 virtual void CreateOutputObjects(TList* dir);
2b556440 88 /**
89 * Print information
90 *
91 * @param option Print options
92 * - max Print max weights
93 */
94 void Print(Option_t* option="") const;
290052e7 95 /**
2b556440 96 * Set the debug level. The higher the value the more output
97 *
98 * @param dbg Debug level
99 */
100 void SetDebug(Int_t dbg=1) { fDebug = dbg; }
290052e7 101 /**
102 * Calculate Q vectors
103 *
104 * @param h dN/detadphi histogram
105 * @param eHist histogram for ep vs. eta
106 */
2b556440 107 void CalcQVectors(TH2D* h, TH1D* eHist);
290052e7 108 /**
109 * Calculate the eventplane from a vector
110 *
111 * @param v TVector2 of Q-vectors
112 *
113 * @return the eventplane as a double
114 */
115 Double_t CalcEventplane(const TVector2& v) const;
116 /**
117 * Set the run number, used for OADB object
118 *
119 * @param run Run number
120 */
2b556440 121 void SetRunNumber(Int_t run);
290052e7 122 /**
123 * Get the run number
124 *
125 * @return returns the run number
126 */
2b556440 127 Int_t GetRunNumber() { return fRunNumber; }
290052e7 128 /**
129 * Get the OADB phi distribution for flattening
130 */
2b556440 131 void GetPhiDist();
290052e7 132 /**
133 * Flag for setting the use of phi weights for flattening
134 *
135 * @param use true or false
136 */
2b556440 137 void SetUsePhiWeights(Bool_t use = kTRUE) { fUsePhiWeights = use; }
290052e7 138 /**
139 * Fill diagnostics hists
140 *
141 * @param fmdEP Object containing results of FMD EP calculations
142 */
2b556440 143 void FillHists(AliAODForwardEP* fmdEP);
290052e7 144 /**
145 * Set the OADB path, for using a custom OADB path and file
146 *
147 * @param fname Name of the custom OADB file, including path
148 */
2b556440 149 void SetOADBPath(Char_t* fname) { fOADBFileName = fname; }
150
151protected:
290052e7 152 /**
153 * Get the phi weight from OADB histogram for the ep flattening
154 *
155 * @param etaBin which eta bin
156 * @param phiBin which phi bin
157 *
158 * @return phi weight for etaBin, phiBin as double
159 */
2b556440 160 Double_t GetPhiWeight(Int_t etaBin, Int_t phiBin) const;
6ff251d8 161 /**
66cf95f2 162 * Calculat the difference @f$a_1 - a_2@f$ between two angles
6ff251d8 163 * @f$a_1, a_2@f$ and normalize to @f$[-\pi/2,\pi/2]@f$
164 *
165 * @param a1 First angle @f$a_1@f$
166 * @param a2 Second angle @f$a_2@f$
167 *
168 * @return @f$a_1 - a_2 \in[-\pi/2,\pi/2]@f$
169 */
170 Double_t CalcDifference(Double_t a1, Double_t a2) const;
171 /**
172 * Make a histogram of @f$\Psi_R@f$ values
173 *
174 * @param name Name of histogram
175 * @param title Source
176 * @param color Color of histogram
177 *
178 * @return Newly allocated histogram
179 */
180 TH1D* MakePsiRHist(const char* name,
181 const char* title,
182 Int_t color);
183 /**
184 * Make a difference histogram, and add to the output list
185 *
186 * @param name Name of histogram
187 * @param first First variable to correlate (X axis)
188 * @param second Second variable to correlate (Y axis)
189 * @param color Fill and line color of histogram
190 *
191 * @return Newly allocated histogram
192 */
193 TH1D* MakeDiffHist(const char* name,
194 const char* first,
195 const char* second,
196 Int_t color);
197 /**
198 * Make a correlation histogram, and add it to the output list.
199 *
200 * @param name Name of histogram
201 * @param first First variable to correlate (X axis)
202 * @param second Second variable to correlate (Y axis)
203 *
204 * @return Newly allocated histogram
205 */
206 TH2F* MakeCorrHist(const char* name,
207 const char* first,
208 const char* second);
209 TList* fList; // List for diag. hists.
210 AliVEvent* fEvent; // Current event
211 TVector2 fQt; // Q vector for total ep
212 TVector2 fQa; // Q vector for sub-ep A
213 TVector2 fQc; // Q vector for sub-ep C
214 TVector2 fQ1; // Q vector for sub-ep 1
215 TVector2 fQ2; // Q vector for sub-ep 2
216 TVector2 fQeta; // Q vector for psi eta-dependence
217 TH1D* fHepFMD; // Diagnostics histogram
218 TH1D* fHepFMDA; // Diagnostics histogram
219 TH1D* fHepFMDC; // Diagnostics histogram
220 TH1D* fHepFMDQC1; // Diagnostics histogram
221 TH1D* fHepFMDQC2; // Diagnostics histogram
222 TH1D* fHdiffFMDAC; // Diagnostics histogram
223 TH1D* fHdiffFMDTPC; // Diagnostics histogram
224 TH1D* fHdiffFMDVZERO; // Diagnostics histogram
225 TH2F* fHcorrFMDAC; // Diagnostics histogram
226 TH2F* fHcorrFMDTPC; // Diagnostics histogram
227 TH2F* fHcorrFMDVZERO; // Diagnostics histogram
228 TH2D* fHPhi; // Diagnostics histogram
229 Int_t fDebug; // Debug flag
230 TString fOADBFileName; // Path to OADB container
231 AliOADBContainer* fOADBContainer; // OADBContainer object
232 TH2D* fPhiDist; // Phi dist. for phi weights
233 Int_t fRunNumber; // Run number supplied
234 Bool_t fUsePhiWeights; // Flag for phi weights
2b556440 235
5934a3e3 236 ClassDef(AliFMDEventPlaneFinder,2); //
2b556440 237};
238
239#endif
240// Local Variables:
241// mode: C++
242// End:
243