1 // This task finds the eventplane
4 #ifndef ALIFMDEVENTPLANEFINDER_H
5 #define ALIFMDEVENTPLANEFINDER_H
7 * @file AliFMDEventPlaneFinder.h
8 * @author Alexander Hansen
9 * @date Tue Feb 14 2012
14 * @ingroup pwglf_forward
18 #include "AliForwardUtil.h"
24 class AliOADBContainer;
25 class AliAODForwardEP;
28 * Find the event plane using the FMD
31 class AliFMDEventPlaneFinder : public TNamed
37 AliFMDEventPlaneFinder();
41 * @param name Name of object
43 AliFMDEventPlaneFinder(const char* name);
47 * @param o Object to copy from
49 AliFMDEventPlaneFinder(const AliFMDEventPlaneFinder& o);
53 virtual ~AliFMDEventPlaneFinder();
55 * Assignement operator
57 * @param o Object to assign from
59 * @return Reference to this object
61 AliFMDEventPlaneFinder& operator=(const AliFMDEventPlaneFinder& o);
63 * Initialize this sub-algorithm
65 * @param etaAxis Eta axis to use
67 virtual void SetupForData(const TAxis& etaAxis);
71 * @param hists Histogram cache
73 * @param aodEp Output object
74 * @param h Output histogram
76 * @return true on successs
78 Bool_t FindEventplane(AliVEvent* esd,
79 AliAODForwardEP& aodEp,
81 AliForwardUtil::Histos* hists);
83 * Output diagnostic histograms to directory
85 * @param dir List to write in
87 virtual void CreateOutputObjects(TList* dir);
91 * @param option Print options
92 * - max Print max weights
94 void Print(Option_t* option="") const;
96 * Set the debug level. The higher the value the more output
98 * @param dbg Debug level
100 void SetDebug(Int_t dbg=1) { fDebug = dbg; }
102 * Calculate Q vectors
104 * @param h dN/detadphi histogram
105 * @param eHist histogram for ep vs. eta
107 void CalcQVectors(TH2D* h, TH1D* eHist);
109 * Calculate the eventplane from a vector
111 * @param v TVector2 of Q-vectors
113 * @return the eventplane as a double
115 Double_t CalcEventplane(const TVector2& v) const;
117 * Set the run number, used for OADB object
119 * @param run Run number
121 void SetRunNumber(Int_t run);
125 * @return returns the run number
127 Int_t GetRunNumber() { return fRunNumber; }
129 * Get the OADB phi distribution for flattening
133 * Flag for setting the use of phi weights for flattening
135 * @param use true or false
137 void SetUsePhiWeights(Bool_t use = kTRUE) { fUsePhiWeights = use; }
139 * Fill diagnostics hists
141 * @param fmdEP Object containing results of FMD EP calculations
143 void FillHists(AliAODForwardEP* fmdEP);
145 * Set the OADB path, for using a custom OADB path and file
147 * @param fname Name of the custom OADB file, including path
149 void SetOADBPath(Char_t* fname) { fOADBFileName = fname; }
153 * Get the phi weight from OADB histogram for the ep flattening
155 * @param etaBin which eta bin
156 * @param phiBin which phi bin
158 * @return phi weight for etaBin, phiBin as double
160 Double_t GetPhiWeight(Int_t etaBin, Int_t phiBin) const;
162 * Calculat the difference @f$a_1 - a_2@f$ between two angles
163 * @f$a_1, a_2@f$ and normalize to @f$[-\pi/2,\pi/2]@f$
165 * @param a1 First angle @f$a_1@f$
166 * @param a2 Second angle @f$a_2@f$
168 * @return @f$a_1 - a_2 \in[-\pi/2,\pi/2]@f$
170 Double_t CalcDifference(Double_t a1, Double_t a2) const;
172 * Make a histogram of @f$\Psi_R@f$ values
174 * @param name Name of histogram
175 * @param title Source
176 * @param color Color of histogram
178 * @return Newly allocated histogram
180 TH1D* MakePsiRHist(const char* name,
184 * Make a difference histogram, and add to the output list
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
191 * @return Newly allocated histogram
193 TH1D* MakeDiffHist(const char* name,
198 * Make a correlation histogram, and add it to the output list.
200 * @param name Name of histogram
201 * @param first First variable to correlate (X axis)
202 * @param second Second variable to correlate (Y axis)
204 * @return Newly allocated histogram
206 TH2F* MakeCorrHist(const char* name,
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
236 ClassDef(AliFMDEventPlaneFinder,2); //