Lines getting the matched track moved to a method in AliCalorimeterUtils. Lines copie...
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemtoUser / AliFemtoModelCorrFctnTrueQ.cxx
CommitLineData
0b3bd1ac 1////////////////////////////////////////////////////////////////////////////////
2/// ///
3/// AliFemtoModelCorrFctnTrueQ - 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(AliFemtoModelCorrFctnTrueQ, 1)
11#endif
12
13#include "AliFemtoModelGausLCMSFreezeOutGenerator.h"
14#include "AliFemtoModelHiddenInfo.h"
15#include "AliFemtoModelCorrFctnTrueQ.h"
16
17//_______________________
18AliFemtoModelCorrFctnTrueQ::AliFemtoModelCorrFctnTrueQ():
19 AliFemtoModelCorrFctn(),
20 fTrueNum(0),
21 fTrueDen(0)
22{
23 // default constructor
24 char buf[100];
25 char title[100] = "CFTrueQ";
adecdc37 26 snprintf(buf , 100, "%sNum", title);
0b3bd1ac 27 fTrueNum = new TH1D(buf,buf,100,0.0,0.4);
adecdc37 28 snprintf(buf , 100, "%sDen", title);
0b3bd1ac 29 fTrueDen = new TH1D(buf,buf,100,0.0,0.4);
30
31 fTrueNum->Sumw2();
32 fTrueDen->Sumw2();
33}
34//_______________________
35AliFemtoModelCorrFctnTrueQ::AliFemtoModelCorrFctnTrueQ(const char *title, Int_t aNbins, Double_t aQinvLo, Double_t aQinvHi):
36 AliFemtoModelCorrFctn(title, aNbins, aQinvLo, aQinvHi),
37 fTrueNum(0),
38 fTrueDen(0)
39{
40 // basic constructor
41 char buf[100];
adecdc37 42 snprintf(buf , 100, "%sTrueQNum", title);
0b3bd1ac 43 fTrueNum = new TH1D(buf,buf,aNbins,aQinvLo,aQinvHi);
adecdc37 44 snprintf(buf , 100, "%sTrueQDen", title);
0b3bd1ac 45 fTrueDen = new TH1D(buf,buf,aNbins,aQinvLo,aQinvHi);
46
47 fTrueNum->Sumw2();
48 fTrueDen->Sumw2();
49}
50//_______________________
51AliFemtoModelCorrFctnTrueQ::AliFemtoModelCorrFctnTrueQ(const AliFemtoModelCorrFctnTrueQ& aCorrFctn):
52 AliFemtoModelCorrFctn(aCorrFctn),
53 fTrueNum(0),
54 fTrueDen(0)
55{
56 // copy constructor
57 fTrueNum = new TH1D(*aCorrFctn.fTrueNum);
58 fTrueDen = new TH1D(*aCorrFctn.fTrueDen);
59}
60//_______________________
61AliFemtoModelCorrFctnTrueQ::~AliFemtoModelCorrFctnTrueQ()
62{
63 // destructor
64 if (fTrueNum) delete fTrueNum;
65 if (fTrueDen) delete fTrueDen;
66 if (fNumeratorTrue) delete fNumeratorTrue;
67 if (fNumeratorFake) delete fNumeratorFake;
68 if (fDenominator) delete fDenominator;
69}
70
71//_______________________
72AliFemtoModelCorrFctnTrueQ& AliFemtoModelCorrFctnTrueQ::operator=(const AliFemtoModelCorrFctnTrueQ& aCorrFctn)
73{
74 // assignment operator
75 if (this == &aCorrFctn)
76 return *this;
77 if (aCorrFctn.fTrueNum)
78 fTrueNum = new TH1D (*aCorrFctn.fTrueNum);
79 else fTrueNum = 0;
80 if (aCorrFctn.fTrueDen)
81 fTrueDen = new TH1D(*aCorrFctn.fTrueDen);
82 else fTrueDen = 0;
83
84 return *this;
85}
86//_______________________
87AliFemtoString AliFemtoModelCorrFctnTrueQ::Report()
88{
89 // construct report
90 AliFemtoString tStr = "AliFemtoModelCorrFctnTrueQ report";
91
92 return tStr;
93}
94
95//_______________________
96void AliFemtoModelCorrFctnTrueQ::AddRealPair(AliFemtoPair* aPair)
97{
98 // add real (effect) pair
99 AliFemtoModelCorrFctn::AddRealPair(aPair);
100 fTrueNum->Fill(fManager->GetWeightGenerator()->GetKStar()*2);
101}
102//_______________________
103void AliFemtoModelCorrFctnTrueQ::AddMixedPair(AliFemtoPair* aPair)
104{
105 // add mixed (background) pair
106 AliFemtoModelCorrFctn::AddMixedPair(aPair);
107 // save the generated positions
108 fTrueDen->Fill(fManager->GetWeightGenerator()->GetKStar()*2);
109}
110//_______________________
111void AliFemtoModelCorrFctnTrueQ::Write()
112{
113 // write out all the histograms
114 fTrueNum->Write();
115 fTrueDen->Write();
116
117 AliFemtoModelCorrFctn::Write();
118}
119//_______________________
120TList* AliFemtoModelCorrFctnTrueQ::GetOutputList()
121{
122 // Prepare the list of objects to be written to the output
123 TList *tOutputList = AliFemtoModelCorrFctn::GetOutputList();
124
125 tOutputList->Add(fTrueNum);
126 tOutputList->Add(fTrueDen);
127
128 return tOutputList;
129}
130//_______________________
131AliFemtoModelCorrFctn* AliFemtoModelCorrFctnTrueQ::Clone()
132{
133 // Clone the correlation function
134 AliFemtoModelCorrFctnTrueQ *tCopy = new AliFemtoModelCorrFctnTrueQ(*this);
135
136 return tCopy;
137}
138