StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtCorrFctnDirectYlm.h
1 /****************************************************************************
2  * $Id: StHbtCorrFctnDirectYlm.h,v 1.1 2013/01/18 14:46:02 yyang Exp $
3  *
4  * Author: Yan Yang, hce137@gmail.com
5  * **************************************************************************
6  * Description: Correlation function that is binned in Ylms directly
7  * Provides a way to store the numerator and denominator
8  * in Ylms directly and correctly calculate the correlation
9  * function from them.
10  * The original author is not known, I guess Kisiel would be.
11  ***************************************************************************/
12 
13 #ifndef StHbtCorrFctnDirectYlm_hh
14 #define StHbtCorrFctnDirectYlm_hh
15 
16 
17 #include <math.h>
18 #include <complex>
19 #include <TH1D.h>
20 #include <TH3D.h>
21 #include <TFile.h>
22 #include "StHbtCorrFctn.hh"
23 #include "StHbtYlm.h"
24 
25 using namespace std;
26 class TRootIOCtor;
27 
29 {
30 public:
32  StHbtCorrFctnDirectYlm(const char* name, int maxl, int ibin, double vmin, double vmax);
34 
35  virtual StHbtString Report();
36 
37  virtual void AddRealPair(const StHbtPair* aPair) { AddRealPair(aPair, 1); }
38  virtual void AddMixedPair(const StHbtPair* aPair) { AddMixedPair(aPair, 1); }
39  void AddRealPair(const StHbtPair* aPair, double weight);
40  void AddMixedPair(const StHbtPair* aPair, double weight);
41 
42  void SetR2Factor(bool aFactor);
43  void DoEMCIC();
44 
45  virtual void Finish();
46  virtual void Write() {}
47  void Write(TFile* rfile);
48 
49  void SetPairCut(StHbtPairCut* pc) { mPairCut = pc; }
50  void ReadFromFile(TFile* ifile);
51  void CalcCorrFctn();
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 //TH1D *GetCfnRealHist(int el, int em);
60 //TH1D *GetCfnImagHist(int el, int em);
61 
62 //void SetAdvancedNormalization(double radius, double bohr, double purity, int binmin, int binmax);
63 
64 private:
65  double ClebschGordan(double aJot1, double aEm1, double aJot2, double aEm2, double aJot, double aEm);
66  double WignerSymbol(double aJot1, double aEm1, double aJot2, double aEm2, double aJot, double aEm);
67  double DeltaJ(double aJot1, double aJot2, double aJot);
68 
69  void GetMtilde(complex<double>* aMat, double* aMTilde);
70 
71  int GetMaxJM();
72  void GetElEmForIndex(int aIndex, double* aEl, double* aEm);
73  void GetElEmForIndex(int aIndex, int* aEl, int* aEm);
74  int GetBin(int qbin, int ilmzero, int zeroimag, int ilmprim, int primimag);
75 
76  int PackYlmVector(double* invec, double* outvec);
77  int PackYlmVectorIndependentOnly(double* invec, double* outvec);
78 
79  int PackYlmMatrix(double* inmat, double* outmat);
80 //void UnPackYlmMatrix(double *inmat, double *outmat);
81 
82  int PackYlmMatrixIndependentOnly(double* inmat, double* outmat);
83  void UnPackYlmMatrixIndependentOnly(double* inmat, double* outmat, int insize);
84 
85  void InvertYlmIndependentMatrix(double* inmat, double* outmat);
86 
87  int GetIndexForLM(int el, int em);
88 
89  void PackCovariances();
90  void UnpackCovariances();
91 //void PackCfcCovariance();
92 
93  TH1D** numsreal;
94  TH1D** numsimag;
95  TH1D** densreal;
96  TH1D** densimag;
97 
98  TH1D** cftnreal; //Real parts of Ylm components of the correlation function
99  TH1D** cftnimag; //Imaginary parts of Ylm components of the correlation function
100 
101  TH1D* binctn;
102  TH1D* binctd;
103 
104  TH3D* covnum;
105  TH3D* covden;
106 //TH3D *covcfc; // Correlation function covariance matrix packed into TH3D
107 
108  double* covmnum;
109  double* covmden;
110  double* covmcfc;
111 
112  int fMaxL; //l cut-off of the decomposition
113 
114  int maxjm; //number of l-m combinations
115  int* elsi;
116  int* emsi;
117  double* els;
118  double* ems;
119 
120  complex<double>* ylmbuffer;
121  double* factorials;
122 
123  int fR2factor; //If 1 all entries are scaled by 1/r^2
124 
125  bool mDoEMCIC;
126  TH1D** emcicP1P2T;
127  TH1D** emcicP1P2Z;
128  TH1D** emcicE1E2;
129  TH1D** emcicE1plusE2;
130  string mName;
131  int mNbins;
132  double mkmin;
133  double mkmax;
134 
135  double mNormRadius; //Asymptotic radius for normalization
136  double mNormBohr; //Bohr radius for advances normalization
137  double mNormPurity; //Purity scaling the asymptotic hehavior
138  int mNormBinMin; //Minimum bin for normalization
139  int mNormBinMax; //Maximum bin for normalization
140 
141 #ifdef __ROOT__
142  ClassDef(StHbtCorrFctnDirectYlm, 1)
143 #endif
144 
145 };
146 
147 #endif
148 
149 /***************************************************************************
150  * $Log: StHbtCorrFctnDirectYlm.h,v $
151  * Revision 1.1 2013/01/18 14:46:02 yyang
152  * Add ultilities for SHD of CF
153  *
154  * ***********************************************************************/