// -*- C++ -*-
+/* Copyright (C) 2007 Christian Holm Christensen <cholm@nbi.dk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
/** @file
@brief Declaration of an EventPlane class */
-#ifndef FLOW_EVENTPLANE_H
-#define FLOW_EVENTPLANE_H
+//____________________________________________________________________
+//
+// Class to determine the event plane
+//
+// The event plane is calculated as
+//
+// Psi_n = 1/n * atan((sum_i(w_i sin(n phi_i)))
+// sum_i(w_i cos(n phi_i))))
+//
+// where i runs over all observations of phi in an event, and
+// w_i is the weight of the ith observation of phi
+#ifndef ALIFMDFLOWEVENTPLANE_H
+#define ALIFMDFLOWEVENTPLANE_H
#include <TObject.h>
+#include <TH2D.h>
+#include <TH1D.h>
+class TBrowser;
//______________________________________________________
/** @class AliFMDFlowEventPlane flow/AliFMDFlowEventPlane.h <flow/AliFMDFlowEventPlane.h>
public:
/** Constructor
@param m Harmonic number */
- AliFMDFlowEventPlane(UShort_t m)
- : fSumSinMPhi(0),
- fSumCosMPhi(0),
- fOrder(m),
- fCache(0)
- { Clear(); }
+ AliFMDFlowEventPlane(UShort_t m=0);
+ /** Copy constructor.
+ @param o Object to copy from */
+ AliFMDFlowEventPlane(const AliFMDFlowEventPlane& o);
+ /** Assignement operator.
+ @param o Object to copy from
+ @return Reference to this */
+ AliFMDFlowEventPlane& operator=(const AliFMDFlowEventPlane& o);
/** Destructor */
~AliFMDFlowEventPlane() {}
- /** Clear it */
- void Clear(Option_t* option="");
- /** Add a data point
- @param phi The angle @f$\varphi\in[0,2\pi]@f$
- @param weight The weight */
- void Add(Double_t phi, Double_t weight=1);
+
+ /** @{
+ @name Information */
/** Get the event plane
@return @f$ \Psi_k@f$ */
Double_t Psi() const;
/** Get the harmnic order
@return @f$ k@f$ */
UShort_t Order() const { return fOrder; }
+ /** @} */
+
+ /** @{
+ @name Processing */
+ /** Clear it */
+ void Clear(Option_t* option="");
+ /** Add a data point
+ @param phi The angle @f$\varphi\in[0,2\pi]@f$
+ @param weight The weight */
+ void Add(Double_t phi, Double_t weight=1);
+ /** Called at end of event to fill histograms */
+ void End();
+ /** @} */
+
+ /** @{
+ @name Utilities */
+ /** this is a folder */
+ Bool_t IsFolder() const { return kTRUE; }
+ /** Browse this object */
+ void Browse(TBrowser* b);
+ /** @} */
+
+ /** @{
+ @name histograms */
+ /** @return Sum histogram */
+ const TH2& SumHistogram() const { return fSum; }
+ /** @return Psi histogram */
+ const TH1& PsiHistogram() const { return fPsi; }
+ /** @} */
protected:
/** Utility function to calculate @f$ \Psi@f$ from the sum of
sines and cosines.
@return @f$ \Psi@f$ */
Double_t DoPsi(Double_t sumsin, Double_t sumcos) const;
/** @f$ \sum_i w_i \sin(k \varphi_i)@f$ */
- Double_t fSumSinMPhi;
+ Double_t fSumSinMPhi; // Sum of contributions
/** @f$ \sum_i w_i \cos(k \varphi_i)@f$ */
- Double_t fSumCosMPhi;
+ Double_t fSumCosMPhi; // Sum of contributions
/** Order */
- UShort_t fOrder;
+ UShort_t fOrder; // Order
/** Cache of Psi */
- mutable Double_t fCache;
+ mutable Double_t fCache; // Cache of calculated value
+ /** Histogram of summed sin(m*phi) vs cos(m*phi) */
+ TH2D fSum;
+ /** Histogram of event plane angles */
+ TH1D fPsi;
+ /** Counter */
+ Double_t fScale;
/** Define for ROOT I/O */
ClassDef(AliFMDFlowEventPlane,1);
};