7827e1ac0357d081f135986a9fae65495b5ff782
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / macros / Train / PWG2Train2 / ConfigFemtoAnalysis.C
1 /*********************************************************************
2  *                                                                   *
3  * ConfigFemtoAnalysis.C - configuration macro for the femtoscopic   *
4  * analysis, to be run in the analysis train.                        *
5  * Assumed input data: large (>10M) sample of MC pp events           *
6  * Inluded analysis:                                                 *
7  *    - positive pion HBT, 3 kt bins, 1D+3D functions                *
8  *    - negative pion HBT, 3 kt bins, 1D+3D functions                *
9  *    - positive kaon HBT, 1 kt bin,  1D+3D functions                *
10  *                                                                   *
11  * Author: Adam Kisiel (Adam.Kisiel@cern.ch)                         *
12  *                                                                   *
13  *********************************************************************/
14
15 #include "AliFemtoManager.h"
16 #include "AliFemtoEventReaderESDChain.h"
17 #include "AliFemtoEventReaderESDChainKine.h"
18 #include "AliFemtoSimpleAnalysis.h"
19 #include "AliFemtoBasicEventCut.h"
20 #include "AliFemtoESDTrackCut.h"
21 #include "AliFemtoCutMonitorParticleYPt.h"
22 #include "AliFemtoCutMonitorParticleVertPos.h"
23 #include "AliFemtoCutMonitorParticleMomRes.h"
24 #include "AliFemtoCutMonitorEventMult.h"
25 #include "AliFemtoCutMonitorEventVertex.h"
26 #include "AliFemtoShareQualityTPCEntranceSepPairCut.h"
27 #include "AliFemtoQinvCorrFctn.h"
28 #include "AliFemtoShareQualityCorrFctn.h"
29 #include "AliFemtoTPCInnerCorrFctn.h"
30 #include "AliFemtoVertexMultAnalysis.h"
31 #include "AliFemtoCorrFctn3DSpherical.h"
32 #include "AliFemtoChi2CorrFctn.h"
33 #include "AliFemtoCorrFctnTPCNcls.h"
34 #include "AliFemtoModelBPLCMSCorrFctn.h"
35 #include "AliFemtoModelCorrFctn3DSpherical.h"
36 #include "AliFemtoModelGausLCMSFreezeOutGenerator.h"
37 #include "AliFemtoModelGausRinvFreezeOutGenerator.h"
38 #include "AliFemtoModelManager.h"
39 #include "AliFemtoModelWeightGeneratorBasic.h"
40 #include "AliFemtoModelWeightGeneratorLednicky.h"
41 #include "AliFemtoCorrFctnDirectYlm.h"
42 #include "AliFemtoModelCorrFctnDirectYlm.h"
43 #include "AliFemtoModelCorrFctnSource.h"
44 #include "AliFemtoCutMonitorParticlePtPDG.h"
45 #include "AliFemtoKTPairCut.h"
46
47 //________________________________________________________________________
48 AliFemtoManager* ConfigFemtoAnalysis() {
49
50   double PionMass = 0.13956995;
51   double KaonMass = 0.493677;
52   
53   AliFemtoEventReaderESDChainKine* Reader=new AliFemtoEventReaderESDChainKine();
54   Reader->SetConstrained(true);
55   Reader->SetUseTPCOnly(false);
56
57   AliFemtoManager* Manager=new AliFemtoManager();
58   Manager->SetEventReader(Reader);
59         
60   // *** Begin pion-pion (positive) analysis ***
61
62   AliFemtoVertexMultAnalysis *anpip = new AliFemtoVertexMultAnalysis(3, -15.6, 15.6, 5, 2, 200);
63   anpip->SetNumEventsToMix(10);
64   anpip->SetMinSizePartCollection(2);
65
66   AliFemtoBasicEventCut* mecpip = new AliFemtoBasicEventCut();
67   mecpip->SetEventMult(2,100000);
68   mecpip->SetVertZPos(-1000,1000);
69         
70   AliFemtoESDTrackCut* dtcpip = new AliFemtoESDTrackCut();
71   dtcpip->SetPidProbPion(0.2,1.001);
72   dtcpip->SetPidProbMuon(0.0,1.0);
73   dtcpip->SetPidProbKaon(0.0,1.0);
74   dtcpip->SetPidProbProton(0.0,1.0);
75   dtcpip->SetCharge(1.0);
76   dtcpip->SetPt(0.15,0.5);
77   dtcpip->SetMass(PionMass);
78   // Track quality cuts
79   dtcpip->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
80   //  dtcpip->SetStatus(AliESDtrack::kTPCrefit);
81   dtcpip->SetminTPCncls(50);
82   dtcpip->SetRemoveKinks(kTRUE);
83   dtcpip->SetLabel(kFALSE);
84   dtcpip->SetMaxITSChiNdof(2.5);
85   dtcpip->SetMaxTPCChiNdof(3.0);
86   dtcpip->SetMaxImpactXY(3.0);
87   dtcpip->SetMaxImpactZ(3.0);
88
89   AliFemtoCutMonitorParticleYPt *cutPassYPtpip = new AliFemtoCutMonitorParticleYPt("cutPasspip", 0.13957);
90   AliFemtoCutMonitorParticleYPt *cutFailYPtpip = new AliFemtoCutMonitorParticleYPt("cutFailpip", 0.13957);
91   dtcpip->AddCutMonitor(cutPassYPtpip, cutFailYPtpip);
92
93   AliFemtoCutMonitorEventMult *cutPassEvMpip = new AliFemtoCutMonitorEventMult("cutPasspip");
94   AliFemtoCutMonitorEventMult *cutFailEvMpip = new AliFemtoCutMonitorEventMult("cutFailpip");
95   mecpip->AddCutMonitor(cutPassEvMpip, cutFailEvMpip);
96
97   AliFemtoCutMonitorEventVertex *cutPassEvVpip = new AliFemtoCutMonitorEventVertex("cutPasspip");
98   AliFemtoCutMonitorEventVertex *cutFailEvVpip = new AliFemtoCutMonitorEventVertex("cutFailpip");
99   mecpip->AddCutMonitor(cutPassEvVpip, cutFailEvVpip);
100
101   AliFemtoShareQualityTPCEntranceSepPairCut *sqpcpip = new AliFemtoShareQualityTPCEntranceSepPairCut();
102   sqpcpip->SetShareQualityMax(0.0);
103   sqpcpip->SetShareFractionMax(0.02);
104   sqpcpip->SetRemoveSameLabel(kFALSE);
105   sqpcpip->SetTPCEntranceSepMinimum(2.0);
106
107   anpip->SetEventCut(mecpip);
108   anpip->SetFirstParticleCut(dtcpip);
109   anpip->SetSecondParticleCut(dtcpip);
110   anpip->SetPairCut(sqpcpip);
111
112   AliFemtoCorrFctn3DSpherical *cqsphpip = new AliFemtoCorrFctn3DSpherical("cqsphpip",60,0.0,0.3, 12, 12);
113
114   AliFemtoShareQualityCorrFctn *csqqinvpip= new AliFemtoShareQualityCorrFctn("sqqinvcfpip",40,0.0,0.4);
115
116   // Intrdouce kT binning
117   AliFemtoKTPairCut *ktpairkT1pip = new AliFemtoKTPairCut(0.1,0.27);
118   AliFemtoKTPairCut *ktpairkT2pip = new AliFemtoKTPairCut(0.27,0.37);
119   AliFemtoKTPairCut *ktpairkT3pip = new AliFemtoKTPairCut(0.37,0.52);
120
121   AliFemtoCorrFctnDirectYlm *cylmkT1pip = new AliFemtoCorrFctnDirectYlm("cylmkT1pip",3,60,0.0,0.3);
122   cylmkT1pip->SetPairSelectionCut(ktpairkT1pip);
123   anpip->AddCorrFctn(cylmkT1pip);
124     
125   AliFemtoCorrFctnDirectYlm *cylmkT2pip = new AliFemtoCorrFctnDirectYlm("cylmkT2pip",3,60,0.0,0.3);
126   cylmkT2pip->SetPairSelectionCut(ktpairkT2pip);
127   anpip->AddCorrFctn(cylmkT2pip);
128     
129   AliFemtoCorrFctnDirectYlm *cylmkT3pip = new AliFemtoCorrFctnDirectYlm("cylmkT3pip",3,60,0.0,0.3);
130   cylmkT3pip->SetPairSelectionCut(ktpairkT3pip);
131   anpip->AddCorrFctn(cylmkT3pip);
132
133   AliFemtoQinvCorrFctn *cqinvkt1pip = new AliFemtoQinvCorrFctn("qinvcfkt1pip", 100,0.0,1.0);
134   cqinvkt1pip->SetPairSelectionCut(ktpairkT1pip);
135   anpip->AddCorrFctn(cqinvkt1pip);
136
137   AliFemtoQinvCorrFctn *cqinvkt2pip = new AliFemtoQinvCorrFctn("qinvcfkt2pip", 100,0.0,1.0);
138   cqinvkt2pip->SetPairSelectionCut(ktpairkT2pip);
139   anpip->AddCorrFctn(cqinvkt2pip);
140
141   AliFemtoQinvCorrFctn *cqinvkt3pip = new AliFemtoQinvCorrFctn("qinvcfkt3pip", 100,0.0,1.0);
142   cqinvkt3pip->SetPairSelectionCut(ktpairkT3pip);
143   anpip->AddCorrFctn(cqinvkt3pip);
144
145   AliFemtoChi2CorrFctn *cchiqinvpip= new AliFemtoChi2CorrFctn("chicfpip",40,0.0,0.4);
146   AliFemtoCorrFctnTPCNcls *cqtpcnclspip = new AliFemtoCorrFctnTPCNcls("cqtpcnclspip",40,0.0,0.4);
147
148   AliFemtoModelBPLCMSCorrFctn *c3dsmallkt1pip;
149   AliFemtoModelBPLCMSCorrFctn *c3dsmallkt2pip;
150   AliFemtoModelBPLCMSCorrFctn *c3dsmallkt3pip;
151   AliFemtoModelCorrFctn *c1dpipip;
152   AliFemtoModelCorrFctn3DSpherical *c3dmsphpip;
153
154   // Setting up the model calculation
155   // First create the freeze-out generator
156   AliFemtoModelGausLCMSFreezeOutGenerator *tFreezepip = new AliFemtoModelGausLCMSFreezeOutGenerator();
157   tFreezepip->SetSizeOut(1.8*TMath::Sqrt(2.0));                                                
158   tFreezepip->SetSizeSide(1.3*TMath::Sqrt(2.0));                                               
159   tFreezepip->SetSizeLong(1.6*TMath::Sqrt(2.0));                                                
160
161   // And the weight generator                                                                    
162   AliFemtoModelWeightGeneratorBasic *tWeightpip = new AliFemtoModelWeightGeneratorBasic();
163   tWeightpip->SetPairType(AliFemtoModelWeightGenerator::PionPlusPionPlus());
164
165   // Create a manager that will connect it                                                                                                               
166   AliFemtoModelManager *tModelManagerpip = new AliFemtoModelManager();
167   tModelManagerpip->AcceptFreezeOutGenerator(tFreezepip);
168   tModelManagerpip->AcceptWeightGenerator(tWeightpip);
169   tModelManagerpip->CreateCopyHiddenInfo(kFALSE);
170
171   c3dsmallkt1pip = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkt2pip",30, 0.0, 0.3);
172   c3dsmallkt1pip->SetSpecificPairCut(ktpairkT2pip);
173   c3dsmallkt1pip->ConnectToManager(tModelManagerpip);
174
175   c3dsmallkt2pip = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkt1pip",30, 0.0, 0.3);
176   c3dsmallkt2pip->SetSpecificPairCut(ktpairkT1pip);
177   c3dsmallkt2pip->ConnectToManager(tModelManagerpip);
178
179   c3dsmallkt3pip = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkt3pip",30, 0.0, 0.3);
180   c3dsmallkt3pip->SetSpecificPairCut(ktpairkT3pip);
181   c3dsmallkt3pip->ConnectToManager(tModelManagerpip);
182
183   c1dpipip = new AliFemtoModelCorrFctn("c1dpipip",100,0.0,1.0);
184   c1dpipip->ConnectToManager(tModelManagerpip);
185
186   c3dmsphpip = new AliFemtoModelCorrFctn3DSpherical("c3dmsphpip",60, 0.0, 0.3, 12,12);
187   c3dmsphpip->ConnectToManager(tModelManagerpip);
188
189   AliFemtoModelCorrFctnDirectYlm *cmylmkt1pip = new AliFemtoModelCorrFctnDirectYlm("mcylmkt1pip",3,60,0.0,0.3);
190   cmylmkt1pip->SetPairSelectionCut(ktpairkT1pip);
191   cmylmkt1pip->ConnectToManager(tModelManagerpip);
192   anpip->AddCorrFctn(cmylmkt1pip);
193
194   AliFemtoModelCorrFctnDirectYlm *cmylmkt2pip = new AliFemtoModelCorrFctnDirectYlm("mcylmkt2pip",3,60,0.0,0.3);
195   cmylmkt2pip->SetPairSelectionCut(ktpairkT2pip);
196   cmylmkt2pip->ConnectToManager(tModelManagerpip);
197   anpip->AddCorrFctn(cmylmkt2pip);
198
199   AliFemtoModelCorrFctnDirectYlm *cmylmkt3pip = new AliFemtoModelCorrFctnDirectYlm("mcylmkt3pip",3,60,0.0,0.3);
200   cmylmkt3pip->SetPairSelectionCut(ktpairkT3pip);
201   cmylmkt3pip->ConnectToManager(tModelManagerpip);
202   anpip->AddCorrFctn(cmylmkt3pip);
203
204   //###
205   anpip->AddCorrFctn(cqsphpip);
206  
207   anpip->AddCorrFctn(csqqinvpip);
208   anpip->AddCorrFctn(cchiqinvpip);
209   anpip->AddCorrFctn(cqtpcnclspip);
210   anpip->AddCorrFctn(c3dsmallkt1pip);
211   anpip->AddCorrFctn(c3dsmallkt2pip);
212   anpip->AddCorrFctn(c3dsmallkt3pip);
213   anpip->AddCorrFctn(c1dpipip);
214   anpip->AddCorrFctn(c3dmsphpip);
215
216   Manager->AddAnalysis(anpip);  
217
218   // *** End pion-pion (positive) analysis
219
220   // *** Begin pion-pion (negative) analysis ***
221
222   AliFemtoVertexMultAnalysis *anpim = new AliFemtoVertexMultAnalysis(3, -15.6, 15.6, 5, 2, 200);
223   anpim->SetNumEventsToMix(10);
224   anpim->SetMinSizePartCollection(2);
225
226   AliFemtoBasicEventCut* mecpim = new AliFemtoBasicEventCut();
227   mecpim->SetEventMult(2,100000);
228   mecpim->SetVertZPos(-1000,1000);
229         
230   AliFemtoESDTrackCut* dtcpim = new AliFemtoESDTrackCut();
231   dtcpim->SetPidProbPion(0.2,1.001);
232   dtcpim->SetPidProbMuon(0.0,1.0);
233   dtcpim->SetPidProbKaon(0.0,1.0);
234   dtcpim->SetPidProbProton(0.0,1.0);
235   dtcpim->SetCharge(1.0);
236   dtcpim->SetPt(0.15,0.5);
237   dtcpim->SetMass(PionMass);
238   // Track quality cuts
239   dtcpim->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
240   //  dtcpim->SetStatus(AliESDtrack::kTPCrefit);
241   dtcpim->SetminTPCncls(50);
242   dtcpim->SetRemoveKinks(kTRUE);
243   dtcpim->SetLabel(kFALSE);
244   dtcpim->SetMaxITSChiNdof(2.5);
245   dtcpim->SetMaxTPCChiNdof(3.0);
246   dtcpim->SetMaxImpactXY(3.0);
247   dtcpim->SetMaxImpactZ(3.0);
248
249   AliFemtoCutMonitorParticleYPt *cutPassYPtpim = new AliFemtoCutMonitorParticleYPt("cutPasspim", 0.13957);
250   AliFemtoCutMonitorParticleYPt *cutFailYPtpim = new AliFemtoCutMonitorParticleYPt("cutFailpim", 0.13957);
251   dtcpim->AddCutMonitor(cutPassYPtpim, cutFailYPtpim);
252
253   AliFemtoCutMonitorEventMult *cutPassEvMpim = new AliFemtoCutMonitorEventMult("cutPasspim");
254   AliFemtoCutMonitorEventMult *cutFailEvMpim = new AliFemtoCutMonitorEventMult("cutFailpim");
255   mecpim->AddCutMonitor(cutPassEvMpim, cutFailEvMpim);
256
257   AliFemtoCutMonitorEventVertex *cutPassEvVpim = new AliFemtoCutMonitorEventVertex("cutPasspim");
258   AliFemtoCutMonitorEventVertex *cutFailEvVpim = new AliFemtoCutMonitorEventVertex("cutFailpim");
259   mecpim->AddCutMonitor(cutPassEvVpim, cutFailEvVpim);
260
261   AliFemtoShareQualityTPCEntranceSepPairCut *sqpcpim = new AliFemtoShareQualityTPCEntranceSepPairCut();
262   sqpcpim->SetShareQualityMax(0.0);
263   sqpcpim->SetShareFractionMax(0.02);
264   sqpcpim->SetRemoveSameLabel(kFALSE);
265   sqpcpim->SetTPCEntranceSepMinimum(2.0);
266
267   anpim->SetEventCut(mecpim);
268   anpim->SetFirstParticleCut(dtcpim);
269   anpim->SetSecondParticleCut(dtcpim);
270   anpim->SetPairCut(sqpcpim);
271
272   AliFemtoCorrFctn3DSpherical *cqsphpim = new AliFemtoCorrFctn3DSpherical("cqsphpim",60,0.0,0.3, 12, 12);
273
274   AliFemtoShareQualityCorrFctn *csqqinvpim= new AliFemtoShareQualityCorrFctn("sqqinvcfpim",40,0.0,0.4);
275
276   // Intrdouce kT binning
277   AliFemtoKTPairCut *ktpairkT1pim = new AliFemtoKTPairCut(0.1,0.27);
278   AliFemtoKTPairCut *ktpairkT2pim = new AliFemtoKTPairCut(0.27,0.37);
279   AliFemtoKTPairCut *ktpairkT3pim = new AliFemtoKTPairCut(0.37,0.52);
280
281   AliFemtoCorrFctnDirectYlm *cylmkT1pim = new AliFemtoCorrFctnDirectYlm("cylmkT1pim",3,60,0.0,0.3);
282   cylmkT1pim->SetPairSelectionCut(ktpairkT1pim);
283   anpim->AddCorrFctn(cylmkT1pim);
284     
285   AliFemtoCorrFctnDirectYlm *cylmkT2pim = new AliFemtoCorrFctnDirectYlm("cylmkT2pim",3,60,0.0,0.3);
286   cylmkT2pim->SetPairSelectionCut(ktpairkT2pim);
287   anpim->AddCorrFctn(cylmkT2pim);
288     
289   AliFemtoCorrFctnDirectYlm *cylmkT3pim = new AliFemtoCorrFctnDirectYlm("cylmkT3pim",3,60,0.0,0.3);
290   cylmkT3pim->SetPairSelectionCut(ktpairkT3pim);
291   anpim->AddCorrFctn(cylmkT3pim);
292
293   AliFemtoQinvCorrFctn *cqinvkt1pim = new AliFemtoQinvCorrFctn("qinvcfkt1pim", 100,0.0,1.0);
294   cqinvkt1pim->SetPairSelectionCut(ktpairkT1pim);
295   anpim->AddCorrFctn(cqinvkt1pim);
296
297   AliFemtoQinvCorrFctn *cqinvkt2pim = new AliFemtoQinvCorrFctn("qinvcfkt2pim", 100,0.0,1.0);
298   cqinvkt2pim->SetPairSelectionCut(ktpairkT2pim);
299   anpim->AddCorrFctn(cqinvkt2pim);
300
301   AliFemtoQinvCorrFctn *cqinvkt3pim = new AliFemtoQinvCorrFctn("qinvcfkt3pim", 100,0.0,1.0);
302   cqinvkt3pim->SetPairSelectionCut(ktpairkT3pim);
303   anpim->AddCorrFctn(cqinvkt3pim);
304
305   AliFemtoChi2CorrFctn *cchiqinvpim= new AliFemtoChi2CorrFctn("chicfpim",40,0.0,0.4);
306   AliFemtoCorrFctnTPCNcls *cqtpcnclspim = new AliFemtoCorrFctnTPCNcls("cqtpcnclspim",40,0.0,0.4);
307
308   AliFemtoModelBPLCMSCorrFctn *c3dsmallkt1pim;
309   AliFemtoModelBPLCMSCorrFctn *c3dsmallkt2pim;
310   AliFemtoModelBPLCMSCorrFctn *c3dsmallkt3pim;
311   AliFemtoModelCorrFctn *c1dpimip;
312   AliFemtoModelCorrFctn3DSpherical *c3dmsphpim;
313
314   // Setting up the model calculation
315   // First create the freeze-out generator
316   AliFemtoModelGausLCMSFreezeOutGenerator *tFreezepim = new AliFemtoModelGausLCMSFreezeOutGenerator();
317   tFreezepim->SetSizeOut(1.8*TMath::Sqrt(2.0));                                                
318   tFreezepim->SetSizeSide(1.3*TMath::Sqrt(2.0));                                               
319   tFreezepim->SetSizeLong(1.6*TMath::Sqrt(2.0));                                                
320
321   // And the weight generator                                                                    
322   AliFemtoModelWeightGeneratorBasic *tWeightpim = new AliFemtoModelWeightGeneratorBasic();
323   tWeightpim->SetPairType(AliFemtoModelWeightGenerator::PionPlusPionPlus());
324
325   // Create a manager that will connect it                                                                                                               
326   AliFemtoModelManager *tModelManagerpim = new AliFemtoModelManager();
327   tModelManagerpim->AcceptFreezeOutGenerator(tFreezepim);
328   tModelManagerpim->AcceptWeightGenerator(tWeightpim);
329   tModelManagerpim->CreateCopyHiddenInfo(kFALSE);
330
331   c3dsmallkt1pim = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkt2pim",30, 0.0, 0.3);
332   c3dsmallkt1pim->SetSpecificPairCut(ktpairkT2pim);
333   c3dsmallkt1pim->ConnectToManager(tModelManagerpim);
334
335   c3dsmallkt2pim = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkt1pim",30, 0.0, 0.3);
336   c3dsmallkt2pim->SetSpecificPairCut(ktpairkT1pim);
337   c3dsmallkt2pim->ConnectToManager(tModelManagerpim);
338
339   c3dsmallkt3pim = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkt3pim",30, 0.0, 0.3);
340   c3dsmallkt3pim->SetSpecificPairCut(ktpairkT3pim);
341   c3dsmallkt3pim->ConnectToManager(tModelManagerpim);
342
343   c1dpimip = new AliFemtoModelCorrFctn("c1dpimip",100,0.0,1.0);
344   c1dpimip->ConnectToManager(tModelManagerpim);
345
346   c3dmsphpim = new AliFemtoModelCorrFctn3DSpherical("c3dmsphpim",60, 0.0, 0.3, 12,12);
347   c3dmsphpim->ConnectToManager(tModelManagerpim);
348
349   AliFemtoModelCorrFctnDirectYlm *cmylmkt1pim = new AliFemtoModelCorrFctnDirectYlm("mcylmkt1pim",3,60,0.0,0.3);
350   cmylmkt1pim->SetPairSelectionCut(ktpairkT1pim);
351   cmylmkt1pim->ConnectToManager(tModelManagerpim);
352   anpim->AddCorrFctn(cmylmkt1pim);
353
354   AliFemtoModelCorrFctnDirectYlm *cmylmkt2pim = new AliFemtoModelCorrFctnDirectYlm("mcylmkt2pim",3,60,0.0,0.3);
355   cmylmkt2pim->SetPairSelectionCut(ktpairkT2pim);
356   cmylmkt2pim->ConnectToManager(tModelManagerpim);
357   anpim->AddCorrFctn(cmylmkt2pim);
358
359   AliFemtoModelCorrFctnDirectYlm *cmylmkt3pim = new AliFemtoModelCorrFctnDirectYlm("mcylmkt3pim",3,60,0.0,0.3);
360   cmylmkt3pim->SetPairSelectionCut(ktpairkT3pim);
361   cmylmkt3pim->ConnectToManager(tModelManagerpim);
362   anpim->AddCorrFctn(cmylmkt3pim);
363
364   //###
365   anpim->AddCorrFctn(cqsphpim);
366  
367   anpim->AddCorrFctn(csqqinvpim);
368   anpim->AddCorrFctn(cchiqinvpim);
369   anpim->AddCorrFctn(cqtpcnclspim);
370   anpim->AddCorrFctn(c3dsmallkt1pim);
371   anpim->AddCorrFctn(c3dsmallkt2pim);
372   anpim->AddCorrFctn(c3dsmallkt3pim);
373   anpim->AddCorrFctn(c1dpimip);
374   anpim->AddCorrFctn(c3dmsphpim);
375
376   Manager->AddAnalysis(anpim);  
377
378   // *** End pion-pion (negative) analysis
379
380   // *** Begin Kaon-Kaon (positive) analysis
381   AliFemtoVertexMultAnalysis *ankp = new AliFemtoVertexMultAnalysis(18, -15.6, 15.6, 1, 2, 20000);
382   ankp->SetNumEventsToMix(5);
383   ankp->SetMinSizePartCollection(2);
384
385   AliFemtoBasicEventCut* meckp = new AliFemtoBasicEventCut();
386   meckp->SetEventMult(1,100000);
387   meckp->SetVertZPos(-1000,1000);
388         
389   AliFemtoESDTrackCut* dtckp = new AliFemtoESDTrackCut();
390   dtckp->SetPidProbKaon(0.7,1.001);
391   dtckp->SetPidProbMuon(0.0,0.5);
392   dtckp->SetPidProbPion(0.0,0.5);
393   dtckp->SetPidProbProton(0.0,0.5);
394   dtckp->SetCharge(1.0);
395   dtckp->SetMostProbableKaon();
396   dtckp->SetPt(0.15,2.0);
397   dtckp->SetMass(KaonMass);
398   // Track quality cuts
399   dtckp->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
400   //dtckp->SetStatus(AliESDtrack::kTPCrefit);
401   //  dtckp->SetminTPCclsF(95);
402   dtckp->SetminTPCncls(50);
403   dtckp->SetRemoveKinks(kTRUE);
404   dtckp->SetLabel(kFALSE);
405   dtckp->SetMaxITSChiNdof(2.5);
406   dtckp->SetMaxTPCChiNdof(3.0);
407   //  dtckp->SetMaxSigmaToVertex(3.0);
408   dtckp->SetMaxImpactXY(3.0);
409   dtckp->SetMaxImpactZ(3.0);
410
411   AliFemtoCutMonitorParticleYPt *cutPassYPtkp = new AliFemtoCutMonitorParticleYPt("cutPasskp", 0.493677);
412   AliFemtoCutMonitorParticleYPt *cutFailYPtkp = new AliFemtoCutMonitorParticleYPt("cutFailkp", 0.493677);
413   dtckp->AddCutMonitor(cutPassYPtkp, cutFailYPtkp);
414
415   AliFemtoCutMonitorParticlePtPDG *cutPassPidkp = new AliFemtoCutMonitorParticlePtPDG("cutPasskp", 0.493677);
416   AliFemtoCutMonitorParticlePtPDG *cutFailPidkp = new AliFemtoCutMonitorParticlePtPDG("cutFailkp", 0.493677);
417   dtckp->AddCutMonitor(cutPassPidkp, cutFailPidkp);
418
419   AliFemtoCutMonitorParticleMomRes *cutPassMRkp = new AliFemtoCutMonitorParticleMomRes("cutPasskp");
420   AliFemtoCutMonitorParticleMomRes *cutFailMRkp = new AliFemtoCutMonitorParticleMomRes("cutFailkp");
421   dtckp->AddCutMonitor(cutPassMRkp, cutFailMRkp);
422
423   AliFemtoCutMonitorParticleVertPos *cutPassVPkp = new AliFemtoCutMonitorParticleVertPos("cutPasskp");
424   AliFemtoCutMonitorParticleVertPos *cutFailVPkp = new AliFemtoCutMonitorParticleVertPos("cutFailkp");
425   dtckp->AddCutMonitor(cutPassVPkp, cutFailVPkp);
426
427   AliFemtoCutMonitorEventMult *cutPassEvMkp = new AliFemtoCutMonitorEventMult("cutPasskp");
428   AliFemtoCutMonitorEventMult *cutFailEvMkp = new AliFemtoCutMonitorEventMult("cutFailkp");
429   meckp->AddCutMonitor(cutPassEvMkp, cutFailEvMkp);
430
431   AliFemtoCutMonitorEventVertex *cutPassEvVkp = new AliFemtoCutMonitorEventVertex("cutPasskp");
432   AliFemtoCutMonitorEventVertex *cutFailEvVkp = new AliFemtoCutMonitorEventVertex("cutFailkp");
433   meckp->AddCutMonitor(cutPassEvVkp, cutFailEvVkp);
434
435   AliFemtoShareQualityTPCEntranceSepPairCut *sqpckp = new AliFemtoShareQualityTPCEntranceSepPairCut();
436   sqpckp->SetShareQualityMax(0.0);
437   sqpckp->SetShareFractionMax(0.02);
438   sqpckp->SetRemoveSameLabel(kFALSE);
439   sqpckp->SetTPCEntranceSepMinimum(3.0);
440
441   ankp->SetEventCut(meckp);
442   ankp->SetFirstParticleCut(dtckp);
443   ankp->SetSecondParticleCut(dtckp);
444   ankp->SetPairCut(sqpckp);
445
446   AliFemtoQinvCorrFctn *cqinvkp= new AliFemtoQinvCorrFctn("qinvcf",100,0.0,1.0);
447
448   AliFemtoModelBPLCMSCorrFctn *c3dsmallkp;
449   AliFemtoModelCorrFctn *c1dpikp;
450
451   // Setting up the model calculation
452   // First create the freeze-out generator
453   AliFemtoModelGausRinvFreezeOutGenerator *tFreezekp = new AliFemtoModelGausRinvFreezeOutGenerator();
454   tFreezekp->SetSizeInv(1.8*TMath::Sqrt(2.0));
455   tFreezekp->SetSelectPrimaryFromHidden(false);
456
457   // And the weight generator                                                                    
458   AliFemtoModelWeightGeneratorBasic *tWeightkp = new AliFemtoModelWeightGeneratorBasic();
459   tWeightkp->SetPairType(AliFemtoModelWeightGenerator::KaonPlusKaonPlus());
460
461   // Create a manager that will connect it  
462   AliFemtoModelManager *tModelManagerkp = new AliFemtoModelManager();
463   tModelManagerkp->AcceptFreezeOutGenerator(tFreezekp);
464   tModelManagerkp->AcceptWeightGenerator(tWeightkp);
465   tModelManagerkp->CreateCopyHiddenInfo(kFALSE);
466
467   c3dsmallkp = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkp",30, 0.0, 0.6);
468   c3dsmallkp->ConnectToManager(tModelManagerkp);
469
470   c1dpikp = new AliFemtoModelCorrFctn("c1dpikp",100,0.0,1.0);
471   c1dpikp->ConnectToManager(tModelManagerkp);
472
473   //###
474   ankp->AddCorrFctn(cqinvkp);
475  
476   ankp->AddCorrFctn(c3dsmallkp);
477   ankp->AddCorrFctn(c1dpikp);
478
479   Manager->AddAnalysis(ankp);     
480
481   // *** End Kaon-Kaon (positive) analysis
482
483   return Manager;
484 }                         
485