2 /* Copyright (C) 2007 Christian Holm Christensen <cholm@nbi.dk>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation; either version 2.1 of
7 * the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 @brief Declaration of an EventPlane class */
21 //____________________________________________________________________
23 // Class to determine the event plane
25 // The event plane is calculated as
27 // Psi_n = 1/n * atan((sum_i(w_i sin(n phi_i)))
28 // sum_i(w_i cos(n phi_i))))
30 // where i runs over all observations of phi in an event, and
31 // w_i is the weight of the ith observation of phi
32 #ifndef ALIFMDFLOWEVENTPLANE_H
33 #define ALIFMDFLOWEVENTPLANE_H
39 //______________________________________________________
40 /** @class AliFMDFlowEventPlane flow/AliFMDFlowEventPlane.h <flow/AliFMDFlowEventPlane.h>
41 @brief Class to determine the event plane
43 The event plane is calculated as
45 \Psi_n = \frac1n\tan^{-1}\left[\frac{\sum_i(w_i\sin(n\varphi_i))}
46 {\sum_i(w_i\cos(n\varphi_i))}\right]
48 where @f$ i @f$ runs over all observations of @f$\varphi@f$ in an
49 event, and @f$ w_i@f$ is the weight of the @f$ i@f$ observation of
54 class AliFMDFlowEventPlane : public TObject
58 @param m Harmonic number */
59 AliFMDFlowEventPlane(UShort_t m=0);
61 @param o Object to copy from */
62 AliFMDFlowEventPlane(const AliFMDFlowEventPlane& o);
63 /** Assignement operator.
64 @param o Object to copy from
65 @return Reference to this */
66 AliFMDFlowEventPlane& operator=(const AliFMDFlowEventPlane& o);
68 ~AliFMDFlowEventPlane() {}
72 /** Get the event plane
73 @return @f$ \Psi_k@f$ */
75 /** Get the event plane angle @f$ \Psi_k@f$ @e disregarding the
76 contribution from the observation @f$ \varphi_i@f$ with weight
77 @f$ w_i@f$. This is to avoid auto-correlations
78 @param phi The observation @f$ \varphi_i@f$
79 @param w The weight @f$ w_i@f$ of the obervation.
80 @return The event plane angle @f$ \Psi_k@f$ with out the
81 contribution from @f$ \varphi_i@f$ */
82 Double_t Psi(Double_t phi, Double_t w=1) const;
83 /** Get the harmnic order
85 UShort_t Order() const { return fOrder; }
91 void Clear(Option_t* option="");
93 @param phi The angle @f$\varphi\in[0,2\pi]@f$
94 @param weight The weight */
95 void Add(Double_t phi, Double_t weight=1);
96 /** Called at end of event to fill histograms */
102 /** this is a folder */
103 Bool_t IsFolder() const { return kTRUE; }
104 /** Browse this object */
105 void Browse(TBrowser* b);
110 /** @return Sum histogram */
111 const TH2& SumHistogram() const { return fSum; }
112 /** @return Psi histogram */
113 const TH1& PsiHistogram() const { return fPsi; }
116 /** Utility function to calculate @f$ \Psi@f$ from the sum of
118 @param sumsin Sum of sines
119 @param sumcos Sum of cosine.
120 @return @f$ \Psi@f$ */
121 Double_t DoPsi(Double_t sumsin, Double_t sumcos) const;
122 /** @f$ \sum_i w_i \sin(k \varphi_i)@f$ */
123 Double_t fSumSinMPhi; // Sum of contributions
124 /** @f$ \sum_i w_i \cos(k \varphi_i)@f$ */
125 Double_t fSumCosMPhi; // Sum of contributions
127 UShort_t fOrder; // Order
129 mutable Double_t fCache; // Cache of calculated value
130 /** Histogram of summed sin(m*phi) vs cos(m*phi) */
132 /** Histogram of event plane angles */
136 /** Define for ROOT I/O */
137 ClassDef(AliFMDFlowEventPlane,1);