]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.cxx
Add correlation functions binned directly in spherical harmonics
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemtoUser / AliFemtoModelCorrFctnDirectYlm.cxx
1 ////////////////////////////////////////////////////////////////////////////////
2 ///                                                                          ///
3 /// AliFemtoModelCorrFctnDirectYlm - the class for correlation function which   ///
4 /// uses the model framework and weight generation and saves the generated   ///
5 /// emission source                                                          ///
6 /// Authors: Adam Kisiel, kisiel@mps.ohio-state.edu                          ///
7 ///                                                                          ///
8 ////////////////////////////////////////////////////////////////////////////////
9 #ifdef __ROOT__
10   ClassImp(AliFemtoModelCorrFctnDirectYlm, 1)
11 #endif
12
13 #include "AliFemtoModelGausLCMSFreezeOutGenerator.h"
14 #include "AliFemtoModelHiddenInfo.h"
15 #include "AliFemtoModelCorrFctnDirectYlm.h"
16     
17 //_______________________
18 AliFemtoModelCorrFctnDirectYlm::AliFemtoModelCorrFctnDirectYlm(): 
19   AliFemtoModelCorrFctn(),
20   fCYlmTrue(0),
21   fCYlmFake(0)
22 {
23   // default constructor
24
25   fCYlmTrue = new AliFemtoCorrFctnDirectYlm();
26   fCYlmFake = new AliFemtoCorrFctnDirectYlm();
27 }
28 //_______________________
29 AliFemtoModelCorrFctnDirectYlm::AliFemtoModelCorrFctnDirectYlm(const char *title, Int_t aMaxL, Int_t aNbins, Double_t aQinvLo, Double_t aQinvHi):
30   AliFemtoModelCorrFctn(title, aNbins, aQinvLo, aQinvHi),
31   fCYlmTrue(0),
32   fCYlmFake(0)
33 {
34   // basic constructor
35   char fname[1000];
36   sprintf(fname, "%s%s", title, "True");
37   fCYlmTrue = new AliFemtoCorrFctnDirectYlm(fname, aMaxL, aNbins, aQinvLo, aQinvHi);
38   sprintf(fname, "%s%s", title, "Fake");
39   fCYlmFake = new AliFemtoCorrFctnDirectYlm(fname, aMaxL, aNbins, aQinvLo, aQinvHi);
40 }
41 //_______________________
42 AliFemtoModelCorrFctnDirectYlm::AliFemtoModelCorrFctnDirectYlm(const AliFemtoModelCorrFctnDirectYlm& aCorrFctn):
43   AliFemtoModelCorrFctn(aCorrFctn),
44   fCYlmTrue(0),
45   fCYlmFake(0)
46 {
47   // copy constructor
48   fCYlmTrue = dynamic_cast<AliFemtoCorrFctnDirectYlm*>(aCorrFctn.fCYlmTrue->Clone());
49   fCYlmFake = dynamic_cast<AliFemtoCorrFctnDirectYlm*>(aCorrFctn.fCYlmFake->Clone());
50 }
51 //_______________________
52 AliFemtoModelCorrFctnDirectYlm::~AliFemtoModelCorrFctnDirectYlm()
53 {
54   // destructor
55   if (fCYlmTrue) delete fCYlmTrue;
56   if (fCYlmFake) delete fCYlmFake;
57   if (fNumeratorTrue) delete fNumeratorTrue;
58   if (fNumeratorFake) delete fNumeratorFake;
59   if (fDenominator) delete fDenominator;
60 }
61
62 //_______________________
63 AliFemtoModelCorrFctnDirectYlm& AliFemtoModelCorrFctnDirectYlm::operator=(const AliFemtoModelCorrFctnDirectYlm& aCorrFctn)
64 {
65   // assignment operator
66   if (this == &aCorrFctn) 
67     return *this;
68
69   if (aCorrFctn.fCYlmTrue)
70     fCYlmTrue = dynamic_cast<AliFemtoCorrFctnDirectYlm*>(aCorrFctn.fCYlmTrue->Clone());
71   else fCYlmTrue = 0;
72
73   if (aCorrFctn.fCYlmFake)
74     fCYlmFake = dynamic_cast<AliFemtoCorrFctnDirectYlm*>(aCorrFctn.fCYlmFake->Clone());
75   else fCYlmFake = 0;
76
77   return *this;
78 }
79 //_______________________
80 AliFemtoString AliFemtoModelCorrFctnDirectYlm::Report()
81 {
82   // construct report
83   AliFemtoString tStr = "AliFemtoModelCorrFctnDirectYlm report";
84
85   return tStr;
86 }
87
88 //_______________________
89 void AliFemtoModelCorrFctnDirectYlm::AddRealPair(AliFemtoPair* aPair)
90 {
91   // add real (effect) pair
92   Double_t weight = fManager->GetWeight(aPair);
93   
94   fCYlmTrue->AddRealPair(aPair->QOutPf(), aPair->QSidePf(), aPair->QLongPf(), weight);
95 }
96 //_______________________
97 void AliFemtoModelCorrFctnDirectYlm::AddMixedPair(AliFemtoPair* aPair)
98 {
99   // add mixed (background) pair
100   Double_t weight = fManager->GetWeight(aPair);
101
102   fCYlmTrue->AddMixedPair(aPair->QOutPf(), aPair->QSidePf(), aPair->QLongPf(), 1.0);
103   fCYlmFake->AddRealPair(aPair->QOutPf(), aPair->QSidePf(), aPair->QLongPf(), weight);
104   fCYlmFake->AddMixedPair(aPair->QOutPf(), aPair->QSidePf(), aPair->QLongPf(), 1.0);
105 }
106 //_______________________
107 void AliFemtoModelCorrFctnDirectYlm::Write()
108 {
109   // write out all the histograms
110   
111   fCYlmTrue->Write();
112   fCYlmFake->Write();
113 }
114 //_______________________
115 TList* AliFemtoModelCorrFctnDirectYlm::GetOutputList()
116 {
117   // Prepare the list of objects to be written to the output
118   TList *tOutputList = AliFemtoModelCorrFctn::GetOutputList();
119   tOutputList->Clear();
120
121   tOutputList->Add(fCYlmTrue->GetOutputList());
122   tOutputList->Add(fCYlmFake->GetOutputList());
123
124   return tOutputList;
125 }
126 //_______________________
127 AliFemtoModelCorrFctn* AliFemtoModelCorrFctnDirectYlm::Clone()
128 {
129   // Clone the correlation function
130   AliFemtoModelCorrFctnDirectYlm *tCopy = new AliFemtoModelCorrFctnDirectYlm(*this);
131   
132   return tCopy;
133 }
134
135 void AliFemtoModelCorrFctnDirectYlm::Finish()
136 {
137   fCYlmTrue->Finish();
138   fCYlmFake->Finish();
139 }