]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.h
Add correlation functions binned directly in spherical harmonics
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemtoUser / AliFemtoCorrFctnDirectYlm.h
1 ////////////////////////////////////////////////////////////////////////////////
2 //                                                                            //
3 // AliFemtoCorrFctnDirectYlm - Correlation function that is binned in Ylms    //
4 // directly. Provides a way to store the numerator and denominator            //
5 // in Ylms directly and correctly calculate the correlation                   //
6 // function from them.                                                        //
7 //                                                                            //
8 // Authors: Adam Kisiel kisiel@mps.ohio-state.edu                             //
9 //                                                                            //
10 ////////////////////////////////////////////////////////////////////////////////
11 #ifndef ALIFEMTOCORRFCTNDIRECTYLM_H
12 #define ALIFEMTOCORRFCTNDIRECTYLM_H
13
14 #include <math.h>
15 #include <complex>
16 #include <TH1D.h>
17 #include <TH3D.h>
18 #include <TFile.h>
19 #include "AliFemtoCorrFctn.h"
20 #include "AliFemtoYlm.h"
21
22 using namespace std;
23
24 class AliFemtoCorrFctnDirectYlm: public AliFemtoCorrFctn {
25  public:
26   AliFemtoCorrFctnDirectYlm();
27   AliFemtoCorrFctnDirectYlm(const char *name, int maxl, int ibin, double vmin, double vmax);
28   AliFemtoCorrFctnDirectYlm(const AliFemtoCorrFctnDirectYlm& aCorrFctn);
29   ~AliFemtoCorrFctnDirectYlm();
30
31   AliFemtoCorrFctnDirectYlm& operator=(const AliFemtoCorrFctnDirectYlm& aCorrFctn);
32
33   void AddRealPair(double *qvec, double weight=1.0);
34   void AddMixedPair(double *qvec, double weight=1.0);
35
36   void AddRealPair(double qout, double qside, double qlong, double weight=1.0);
37   void AddMixedPair(double qout, double qside, double qlong, double weight=1.0);
38
39   virtual AliFemtoString Report();
40
41   virtual void AddRealPair(AliFemtoPair* aPair);
42   virtual void AddMixedPair(AliFemtoPair* aPair);
43
44   virtual void Finish();
45   virtual TList* GetOutputList();
46
47   void Write();
48
49   void ReadFromFile(TFile *infile, const char *name, int maxl);
50
51   TH1D *GetNumRealHist(int el, int em);
52   TH1D *GetNumImagHist(int el, int em);
53
54   TH1D *GetDenRealHist(int el, int em);
55   TH1D *GetDenImagHist(int el, int em);
56
57  private:
58   double ClebschGordan(double aJot1, double aEm1, double aJot2, double aEm2, double aJot, double aEm);
59   double DeltaJ(double aJot1, double aJot2, double aJot);
60   double WignerSymbol(double aJot1, double aEm1, double aJot2, double aEm2, double aJot, double aEm);
61   
62   void GetMtilde(complex<double>* aMat, double *aMTilde); 
63   
64   int  GetMaxJM() const;
65   void GetElEmForIndex(int aIndex, double *aEl, double *aEm) const;
66   void GetElEmForIndex(int aIndex, int *aEl, int *aEm) const;
67   int  GetBin(int qbin, int ilmzero, int zeroimag, int ilmprim, int primimag);
68
69   int  PackYlmVector(const double *invec, double *outvec);
70   int  PackYlmMatrix(const double *inmat, double *outmat);
71
72   int GetIndexForLM(int el, int em) const;
73
74   void PackCovariances();
75   void UnpackCovariances();
76
77   TH1D **fnumsreal;            // Real parts of Ylm components of the numerator
78   TH1D **fnumsimag;            // Imaginary parts of Ylm components of the numerator
79   TH1D **fdensreal;            // Real parts of Ylm components of the denominator           
80   TH1D **fdensimag;            // Imaginary parts of Ylm components of the denominator
81
82   TH1D *fbinctn;               // Bin occupation for the numerator
83   TH1D *fbinctd;               // Bin occupation for the denominator
84
85   TH3D *fcovnum;               // Numerator covariance matrix packed into TH3D
86   TH3D *fcovden;               // Denominator covariance matrix packed into TH3D
87
88   double *fcovmnum;            // Covariance matrix for the numerator
89   double *fcovmden;            // Covariance matrix for the denominator
90
91   int fMaxL;                  // l cut-off of the decomposition
92
93   int    fMaxJM;               // number of l-m combinations
94   double *fels;                // table of l's
95   double *fems;                // table of m's
96   int    *felsi;               // table of integer l's
97   int    *femsi;               // table of integer m's
98
99   complex<double> *fYlmBuffer; // buffer for ylm calculation
100   double *factorials;         // Helper table of factorials
101
102   double fSout;                // Save last calculated qout
103   double fSside;               // Save last calculated qside
104   double fSlong;               // Save last calculated qlong
105
106 };
107
108 #endif
109