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