Lines getting the matched track moved to a method in AliCalorimeterUtils. Lines copie...
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / macros / Train / Train3 / 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 #if !defined(__CINT__) || defined(__MAKECINT_)
16 #include "AliFemtoManager.h"
17 #include "AliFemtoEventReaderESDChain.h"
18 #include "AliFemtoEventReaderESDChainKine.h"
19 #include "AliFemtoSimpleAnalysis.h"
20 #include "AliFemtoBasicEventCut.h"
21 #include "AliFemtoESDTrackCut.h"
22 #include "AliFemtoCorrFctn.h"
23 #include "AliFemtoCutMonitorParticleYPt.h"
24 #include "AliFemtoCutMonitorParticleVertPos.h"
25 #include "AliFemtoCutMonitorParticleMomRes.h"
26 #include "AliFemtoCutMonitorEventMult.h"
27 #include "AliFemtoCutMonitorEventVertex.h"
28 #include "AliFemtoShareQualityTPCEntranceSepPairCut.h"
29 #include "AliFemtoQinvCorrFctn.h"
30 #include "AliFemtoShareQualityCorrFctn.h"
31 #include "AliFemtoTPCInnerCorrFctn.h"
32 #include "AliFemtoVertexMultAnalysis.h"
33 #include "AliFemtoCorrFctn3DSpherical.h"
34 #include "AliFemtoChi2CorrFctn.h"
35 #include "AliFemtoCorrFctnTPCNcls.h"
36 #include "AliFemtoModelBPLCMSCorrFctn.h"
37 #include "AliFemtoModelCorrFctn3DSpherical.h"
38 #include "AliFemtoModelGausLCMSFreezeOutGenerator.h"
39 #include "AliFemtoModelGausRinvFreezeOutGenerator.h"
40 #include "AliFemtoModelManager.h"
41 #include "AliFemtoModelWeightGeneratorBasic.h"
42 #include "AliFemtoModelWeightGeneratorLednicky.h"
43 #include "AliFemtoCorrFctnDirectYlm.h"
44 #include "AliFemtoModelCorrFctnDirectYlm.h"
45 #include "AliFemtoModelCorrFctnSource.h"
46 #include "AliFemtoCutMonitorParticlePtPDG.h"
47 #include "AliFemtoKTPairCut.h"
48 #endif
49
50 //________________________________________________________________________
51 AliFemtoManager* ConfigFemtoAnalysis() {
52
53   double PionMass = 0.13956995;
54   double KaonMass = 0.493677;
55   
56   AliFemtoEventReaderESDChainKine* Reader=new AliFemtoEventReaderESDChainKine();
57   Reader->SetConstrained(true);
58   Reader->SetUseTPCOnly(false);
59
60   AliFemtoManager* Manager=new AliFemtoManager();
61   Manager->SetEventReader(Reader);
62
63   int runPositivePions = 1;
64   int runNegativePions = 1;
65   int runPositiveKaons = 1;
66   int runNegativeKaons = 1;
67   int runPositiveNegativeKaons = 1;
68
69   if (runPositivePions) {
70     // *** Begin pion-pion (positive) analysis ***
71     AliFemtoVertexMultAnalysis *anpip = new AliFemtoVertexMultAnalysis(3, -15.6, 15.6, 1, 2, 200000);
72     anpip->SetNumEventsToMix(10);
73     anpip->SetMinSizePartCollection(2);
74
75     AliFemtoBasicEventCut* mecpip = new AliFemtoBasicEventCut();
76     mecpip->SetEventMult(2,100000);
77     mecpip->SetVertZPos(-1000,1000);
78         
79     AliFemtoESDTrackCut* dtcpip = new AliFemtoESDTrackCut();
80     dtcpip->SetPidProbPion(0.2,1.001);
81     dtcpip->SetPidProbMuon(0.0,1.0);
82     dtcpip->SetPidProbKaon(0.0,1.0);
83     dtcpip->SetPidProbProton(0.0,1.0);
84     dtcpip->SetCharge(1.0);
85     dtcpip->SetPt(0.15,0.5);
86     dtcpip->SetRapidity(-0.8,0.8);
87     dtcpip->SetMass(PionMass);
88     // Track quality cuts
89     dtcpip->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
90     //  dtcpip->SetStatus(AliESDtrack::kTPCrefit);
91     dtcpip->SetminTPCncls(50);
92     dtcpip->SetRemoveKinks(kTRUE);
93     dtcpip->SetLabel(kFALSE);
94     dtcpip->SetMaxITSChiNdof(2.5);
95     dtcpip->SetMaxTPCChiNdof(3.0);
96     dtcpip->SetMaxImpactXY(3.0);
97     dtcpip->SetMaxImpactZ(3.0);
98
99     // Track monitors
100     AliFemtoCutMonitorParticleYPt *cutPassYPtpip = new AliFemtoCutMonitorParticleYPt("cutPasspip", 0.13957);
101     AliFemtoCutMonitorParticleYPt *cutFailYPtpip = new AliFemtoCutMonitorParticleYPt("cutFailpip", 0.13957);
102     dtcpip->AddCutMonitor(cutPassYPtpip, cutFailYPtpip);
103
104     AliFemtoCutMonitorEventMult *cutPassEvMpip = new AliFemtoCutMonitorEventMult("cutPasspip");
105     AliFemtoCutMonitorEventMult *cutFailEvMpip = new AliFemtoCutMonitorEventMult("cutFailpip");
106     mecpip->AddCutMonitor(cutPassEvMpip, cutFailEvMpip);
107
108     AliFemtoCutMonitorEventVertex *cutPassEvVpip = new AliFemtoCutMonitorEventVertex("cutPasspip");
109     AliFemtoCutMonitorEventVertex *cutFailEvVpip = new AliFemtoCutMonitorEventVertex("cutFailpip");
110     mecpip->AddCutMonitor(cutPassEvVpip, cutFailEvVpip);
111
112     // Pair cut
113     AliFemtoShareQualityTPCEntranceSepPairCut *sqpcpip = new AliFemtoShareQualityTPCEntranceSepPairCut();
114     sqpcpip->SetShareQualityMax(0.0);
115     sqpcpip->SetShareFractionMax(0.02);
116     sqpcpip->SetRemoveSameLabel(kFALSE);
117     sqpcpip->SetTPCEntranceSepMinimum(2.0);
118
119     anpip->SetEventCut(mecpip);
120     anpip->SetFirstParticleCut(dtcpip);
121     anpip->SetSecondParticleCut(dtcpip);
122     anpip->SetPairCut(sqpcpip);
123
124     // Two-track quality monitoring
125     AliFemtoShareQualityCorrFctn *csqqinvpip= new AliFemtoShareQualityCorrFctn("sqqinvcfpip",40,0.0,0.4);
126     AliFemtoChi2CorrFctn *cchiqinvpip= new AliFemtoChi2CorrFctn("chicfpip",40,0.0,0.4);
127     AliFemtoCorrFctnTPCNcls *cqtpcnclspip = new AliFemtoCorrFctnTPCNcls("cqtpcnclspip",40,0.0,0.4);
128
129     // Intrdouce kT binning
130     AliFemtoKTPairCut *ktpairkT1pip = new AliFemtoKTPairCut(0.1,0.27);
131     AliFemtoKTPairCut *ktpairkT2pip = new AliFemtoKTPairCut(0.27,0.37);
132     AliFemtoKTPairCut *ktpairkT3pip = new AliFemtoKTPairCut(0.37,0.52);
133
134     // Purely experimental correlation function
135     AliFemtoCorrFctnDirectYlm *cylmkT1pip = new AliFemtoCorrFctnDirectYlm("cylmkT1pip",3,80,0.0,0.8,1);
136     cylmkT1pip->SetPairSelectionCut(ktpairkT1pip);
137     anpip->AddCorrFctn(cylmkT1pip);
138     
139     AliFemtoCorrFctnDirectYlm *cylmkT2pip = new AliFemtoCorrFctnDirectYlm("cylmkT2pip",3,80,0.0,0.8,1);
140     cylmkT2pip->SetPairSelectionCut(ktpairkT2pip);
141     anpip->AddCorrFctn(cylmkT2pip);
142     
143     AliFemtoCorrFctnDirectYlm *cylmkT3pip = new AliFemtoCorrFctnDirectYlm("cylmkT3pip",3,80,0.0,0.8,1);
144     cylmkT3pip->SetPairSelectionCut(ktpairkT3pip);
145     anpip->AddCorrFctn(cylmkT3pip);
146
147     AliFemtoQinvCorrFctn *cqinvkt1pip = new AliFemtoQinvCorrFctn("qinvcfkt1pip", 100,0.0,1.0);
148     cqinvkt1pip->SetPairSelectionCut(ktpairkT1pip);
149     anpip->AddCorrFctn(cqinvkt1pip);
150
151     AliFemtoQinvCorrFctn *cqinvkt2pip = new AliFemtoQinvCorrFctn("qinvcfkt2pip", 100,0.0,1.0);
152     cqinvkt2pip->SetPairSelectionCut(ktpairkT2pip);
153     anpip->AddCorrFctn(cqinvkt2pip);
154
155     AliFemtoQinvCorrFctn *cqinvkt3pip = new AliFemtoQinvCorrFctn("qinvcfkt3pip", 100,0.0,1.0);
156     cqinvkt3pip->SetPairSelectionCut(ktpairkT3pip);
157     anpip->AddCorrFctn(cqinvkt3pip);
158
159     // Setting up the model calculation
160     // First create the freeze-out generator
161     AliFemtoModelGausLCMSFreezeOutGenerator *tFreezepip = new AliFemtoModelGausLCMSFreezeOutGenerator();
162     tFreezepip->SetSizeOut(1.8*TMath::Sqrt(2.0));                                                
163     tFreezepip->SetSizeSide(1.3*TMath::Sqrt(2.0));                                               
164     tFreezepip->SetSizeLong(1.6*TMath::Sqrt(2.0));                                                
165
166     // And the weight generator                                                                    
167     AliFemtoModelWeightGeneratorBasic *tWeightpip = new AliFemtoModelWeightGeneratorBasic();
168     tWeightpip->SetPairType(AliFemtoModelWeightGenerator::PionPlusPionPlus());
169
170     // Create a manager that will connect it                                                                                                               
171     AliFemtoModelManager *tModelManagerpip = new AliFemtoModelManager();
172     tModelManagerpip->AcceptFreezeOutGenerator(tFreezepip);
173     tModelManagerpip->AcceptWeightGenerator(tWeightpip);
174     tModelManagerpip->CreateCopyHiddenInfo(kFALSE);
175
176     // Model correlation functions
177     AliFemtoModelCorrFctn *c1dpipip;
178     AliFemtoModelBPLCMSCorrFctn *c3dsmallkt1pip;
179     AliFemtoModelBPLCMSCorrFctn *c3dsmallkt2pip;
180     AliFemtoModelBPLCMSCorrFctn *c3dsmallkt3pip;
181
182     c1dpipip = new AliFemtoModelCorrFctn("c1dpipip",100,0.0,1.0);
183     c1dpipip->ConnectToManager(tModelManagerpip);
184
185     c3dsmallkt1pip = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkt1pip",40, -0.4, 0.4);
186     c3dsmallkt1pip->SetSpecificPairCut(ktpairkT1pip);
187     c3dsmallkt1pip->ConnectToManager(tModelManagerpip);
188
189     c3dsmallkt2pip = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkt2pip",40, -0.4, 0.4);
190     c3dsmallkt2pip->SetSpecificPairCut(ktpairkT2pip);
191     c3dsmallkt2pip->ConnectToManager(tModelManagerpip);
192
193     c3dsmallkt3pip = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkt3pip",40, -0.4, 0.4);
194     c3dsmallkt3pip->SetSpecificPairCut(ktpairkT3pip);
195     c3dsmallkt3pip->ConnectToManager(tModelManagerpip);
196
197     AliFemtoModelCorrFctnDirectYlm *cmylmkt1pip = new AliFemtoModelCorrFctnDirectYlm("mcylmkt1pip",3,80,0.0,0.8,1);
198     cmylmkt1pip->SetPairSelectionCut(ktpairkT1pip);
199     cmylmkt1pip->ConnectToManager(tModelManagerpip);
200
201     AliFemtoModelCorrFctnDirectYlm *cmylmkt2pip = new AliFemtoModelCorrFctnDirectYlm("mcylmkt2pip",3,80,0.0,0.8,1);
202     cmylmkt2pip->SetPairSelectionCut(ktpairkT2pip);
203     cmylmkt2pip->ConnectToManager(tModelManagerpip);
204
205     AliFemtoModelCorrFctnDirectYlm *cmylmkt3pip = new AliFemtoModelCorrFctnDirectYlm("mcylmkt3pip",3,80,0.0,0.8,1);
206     cmylmkt3pip->SetPairSelectionCut(ktpairkT3pip);
207     cmylmkt3pip->ConnectToManager(tModelManagerpip);
208
209     // Add correlation functions to the analysis 
210     anpip->AddCorrFctn(csqqinvpip);
211     anpip->AddCorrFctn(cchiqinvpip);
212     anpip->AddCorrFctn(cqtpcnclspip);
213     anpip->AddCorrFctn(c3dsmallkt1pip);
214     anpip->AddCorrFctn(c3dsmallkt2pip);
215     anpip->AddCorrFctn(c3dsmallkt3pip);
216     anpip->AddCorrFctn(c1dpipip);
217     anpip->AddCorrFctn(cmylmkt1pip);
218     anpip->AddCorrFctn(cmylmkt2pip);
219     anpip->AddCorrFctn(cmylmkt3pip);
220
221     Manager->AddAnalysis(anpip);        
222
223     // *** End pion-pion (positive) analysis
224   }
225
226   if (runNegativePions) {
227     // *** Begin pion-pion (negative) analysis ***
228     AliFemtoVertexMultAnalysis *anpim = new AliFemtoVertexMultAnalysis(3, -15.6, 15.6, 1, 2, 200000);
229     anpim->SetNumEventsToMix(10);
230     anpim->SetMinSizePartCollection(2);
231
232     AliFemtoBasicEventCut* mecpim = new AliFemtoBasicEventCut();
233     mecpim->SetEventMult(2,100000);
234     mecpim->SetVertZPos(-1000,1000);
235         
236     AliFemtoESDTrackCut* dtcpim = new AliFemtoESDTrackCut();
237     dtcpim->SetPidProbPion(0.2,1.001);
238     dtcpim->SetPidProbMuon(0.0,1.0);
239     dtcpim->SetPidProbKaon(0.0,1.0);
240     dtcpim->SetPidProbProton(0.0,1.0);
241     dtcpim->SetCharge(1.0);
242     dtcpim->SetPt(0.15,0.5);
243     dtcpim->SetRapidity(-0.8,0.8);
244     dtcpim->SetMass(PionMass);
245     // Track quality cuts
246     dtcpim->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
247     //  dtcpim->SetStatus(AliESDtrack::kTPCrefit);
248     dtcpim->SetminTPCncls(50);
249     dtcpim->SetRemoveKinks(kTRUE);
250     dtcpim->SetLabel(kFALSE);
251     dtcpim->SetMaxITSChiNdof(2.5);
252     dtcpim->SetMaxTPCChiNdof(3.0);
253     dtcpim->SetMaxImpactXY(3.0);
254     dtcpim->SetMaxImpactZ(3.0);
255
256     // Track monitors
257     AliFemtoCutMonitorParticleYPt *cutPassYPtpim = new AliFemtoCutMonitorParticleYPt("cutPasspim", 0.13957);
258     AliFemtoCutMonitorParticleYPt *cutFailYPtpim = new AliFemtoCutMonitorParticleYPt("cutFailpim", 0.13957);
259     dtcpim->AddCutMonitor(cutPassYPtpim, cutFailYPtpim);
260
261     AliFemtoCutMonitorEventMult *cutPassEvMpim = new AliFemtoCutMonitorEventMult("cutPasspim");
262     AliFemtoCutMonitorEventMult *cutFailEvMpim = new AliFemtoCutMonitorEventMult("cutFailpim");
263     mecpim->AddCutMonitor(cutPassEvMpim, cutFailEvMpim);
264
265     AliFemtoCutMonitorEventVertex *cutPassEvVpim = new AliFemtoCutMonitorEventVertex("cutPasspim");
266     AliFemtoCutMonitorEventVertex *cutFailEvVpim = new AliFemtoCutMonitorEventVertex("cutFailpim");
267     mecpim->AddCutMonitor(cutPassEvVpim, cutFailEvVpim);
268
269     // Pair cut
270     AliFemtoShareQualityTPCEntranceSepPairCut *sqpcpim = new AliFemtoShareQualityTPCEntranceSepPairCut();
271     sqpcpim->SetShareQualityMax(0.0);
272     sqpcpim->SetShareFractionMax(0.02);
273     sqpcpim->SetRemoveSameLabel(kFALSE);
274     sqpcpim->SetTPCEntranceSepMinimum(2.0);
275
276     anpim->SetEventCut(mecpim);
277     anpim->SetFirstParticleCut(dtcpim);
278     anpim->SetSecondParticleCut(dtcpim);
279     anpim->SetPairCut(sqpcpim);
280
281     // Two-track quality monitoring
282     AliFemtoShareQualityCorrFctn *csqqinvpim= new AliFemtoShareQualityCorrFctn("sqqinvcfpim",40,0.0,0.4);
283     AliFemtoChi2CorrFctn *cchiqinvpim= new AliFemtoChi2CorrFctn("chicfpim",40,0.0,0.4);
284     AliFemtoCorrFctnTPCNcls *cqtpcnclspim = new AliFemtoCorrFctnTPCNcls("cqtpcnclspim",40,0.0,0.4);
285
286     // Intrdouce kT binning
287     AliFemtoKTPairCut *ktpairkT1pim = new AliFemtoKTPairCut(0.1,0.27);
288     AliFemtoKTPairCut *ktpairkT2pim = new AliFemtoKTPairCut(0.27,0.37);
289     AliFemtoKTPairCut *ktpairkT3pim = new AliFemtoKTPairCut(0.37,0.52);
290
291     // Purely experimental correlation function
292     AliFemtoCorrFctnDirectYlm *cylmkT1pim = new AliFemtoCorrFctnDirectYlm("cylmkT1pim",3,80,0.0,0.8,1);
293     cylmkT1pim->SetPairSelectionCut(ktpairkT1pim);
294     anpim->AddCorrFctn(cylmkT1pim);
295     
296     AliFemtoCorrFctnDirectYlm *cylmkT2pim = new AliFemtoCorrFctnDirectYlm("cylmkT2pim",3,80,0.0,0.8,1);
297     cylmkT2pim->SetPairSelectionCut(ktpairkT2pim);
298     anpim->AddCorrFctn(cylmkT2pim);
299     
300     AliFemtoCorrFctnDirectYlm *cylmkT3pim = new AliFemtoCorrFctnDirectYlm("cylmkT3pim",3,80,0.0,0.8,1);
301     cylmkT3pim->SetPairSelectionCut(ktpairkT3pim);
302     anpim->AddCorrFctn(cylmkT3pim);
303
304     AliFemtoQinvCorrFctn *cqinvkt1pim = new AliFemtoQinvCorrFctn("qinvcfkt1pim", 100,0.0,1.0);
305     cqinvkt1pim->SetPairSelectionCut(ktpairkT1pim);
306     anpim->AddCorrFctn(cqinvkt1pim);
307
308     AliFemtoQinvCorrFctn *cqinvkt2pim = new AliFemtoQinvCorrFctn("qinvcfkt2pim", 100,0.0,1.0);
309     cqinvkt2pim->SetPairSelectionCut(ktpairkT2pim);
310     anpim->AddCorrFctn(cqinvkt2pim);
311
312     AliFemtoQinvCorrFctn *cqinvkt3pim = new AliFemtoQinvCorrFctn("qinvcfkt3pim", 100,0.0,1.0);
313     cqinvkt3pim->SetPairSelectionCut(ktpairkT3pim);
314     anpim->AddCorrFctn(cqinvkt3pim);
315
316     // Setting up the model calculation
317     // First create the freeze-out generator
318     AliFemtoModelGausLCMSFreezeOutGenerator *tFreezepim = new AliFemtoModelGausLCMSFreezeOutGenerator();
319     tFreezepim->SetSizeOut(1.8*TMath::Sqrt(2.0));                                                
320     tFreezepim->SetSizeSide(1.3*TMath::Sqrt(2.0));                                               
321     tFreezepim->SetSizeLong(1.6*TMath::Sqrt(2.0));                                                
322
323     // And the weight generator                                                                    
324     AliFemtoModelWeightGeneratorBasic *tWeightpim = new AliFemtoModelWeightGeneratorBasic();
325     tWeightpim->SetPairType(AliFemtoModelWeightGenerator::PionPlusPionPlus());
326
327     // Create a manager that will connect it                                                                                                               
328     AliFemtoModelManager *tModelManagerpim = new AliFemtoModelManager();
329     tModelManagerpim->AcceptFreezeOutGenerator(tFreezepim);
330     tModelManagerpim->AcceptWeightGenerator(tWeightpim);
331     tModelManagerpim->CreateCopyHiddenInfo(kFALSE);
332
333     // Model correlation functions
334     AliFemtoModelCorrFctn *c1dpipim;
335     AliFemtoModelBPLCMSCorrFctn *c3dsmallkt1pim;
336     AliFemtoModelBPLCMSCorrFctn *c3dsmallkt2pim;
337     AliFemtoModelBPLCMSCorrFctn *c3dsmallkt3pim;
338
339     c1dpipim = new AliFemtoModelCorrFctn("c1dpipim",100,0.0,1.0);
340     c1dpipim->ConnectToManager(tModelManagerpim);
341
342     c3dsmallkt1pim = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkt1pim",40, -0.4, 0.4);
343     c3dsmallkt1pim->SetSpecificPairCut(ktpairkT1pim);
344     c3dsmallkt1pim->ConnectToManager(tModelManagerpim);
345
346     c3dsmallkt2pim = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkt2pim",40, -0.4, 0.4);
347     c3dsmallkt2pim->SetSpecificPairCut(ktpairkT2pim);
348     c3dsmallkt2pim->ConnectToManager(tModelManagerpim);
349
350     c3dsmallkt3pim = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkt3pim",40, -0.4, 0.4);
351     c3dsmallkt3pim->SetSpecificPairCut(ktpairkT3pim);
352     c3dsmallkt3pim->ConnectToManager(tModelManagerpim);
353
354     AliFemtoModelCorrFctnDirectYlm *cmylmkt1pim = new AliFemtoModelCorrFctnDirectYlm("mcylmkt1pim",3,80,0.0,0.8,1);
355     cmylmkt1pim->SetPairSelectionCut(ktpairkT1pim);
356     cmylmkt1pim->ConnectToManager(tModelManagerpim);
357
358     AliFemtoModelCorrFctnDirectYlm *cmylmkt2pim = new AliFemtoModelCorrFctnDirectYlm("mcylmkt2pim",3,80,0.0,0.8,1);
359     cmylmkt2pim->SetPairSelectionCut(ktpairkT2pim);
360     cmylmkt2pim->ConnectToManager(tModelManagerpim);
361
362     AliFemtoModelCorrFctnDirectYlm *cmylmkt3pim = new AliFemtoModelCorrFctnDirectYlm("mcylmkt3pim",3,80,0.0,0.8,1);
363     cmylmkt3pim->SetPairSelectionCut(ktpairkT3pim);
364     cmylmkt3pim->ConnectToManager(tModelManagerpim);
365
366     // Add correlation functions to the analysis 
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(c1dpipim);
374     anpim->AddCorrFctn(cmylmkt1pim);
375     anpim->AddCorrFctn(cmylmkt2pim);
376     anpim->AddCorrFctn(cmylmkt3pim);
377
378     Manager->AddAnalysis(anpim);        
379
380     // *** End pion-pion (negative) analysis
381   }
382
383   if (runPositiveKaons) {
384     // *** Begin Kaon-Kaon (positive) analysis
385     AliFemtoVertexMultAnalysis *ankp = new AliFemtoVertexMultAnalysis(18, -15.6, 15.6, 1, 2, 20000);
386     ankp->SetNumEventsToMix(5);
387     ankp->SetMinSizePartCollection(2);
388
389     AliFemtoBasicEventCut* meckp = new AliFemtoBasicEventCut();
390     meckp->SetEventMult(1,100000);
391     meckp->SetVertZPos(-1000,1000);
392         
393     AliFemtoESDTrackCut* dtckp = new AliFemtoESDTrackCut();
394     dtckp->SetPidProbKaon(0.7,1.001);
395     dtckp->SetPidProbMuon(0.0,0.5);
396     dtckp->SetPidProbPion(0.0,0.5);
397     dtckp->SetPidProbProton(0.0,0.5);
398     dtckp->SetCharge(1.0);
399     dtckp->SetMostProbableKaon();
400     dtckp->SetMomRangeTOFpidIs(0.6,10000.);
401     dtckp->SetPt(0.15,2.0);
402     dtckp->SetMass(KaonMass);
403     // Track quality cuts
404     dtckp->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
405     dtckp->SetminTPCncls(50);
406     dtckp->SetRemoveKinks(kTRUE);
407     dtckp->SetLabel(kFALSE);
408     dtckp->SetMaxITSChiNdof(2.5);
409     dtckp->SetMaxTPCChiNdof(3.0);
410     dtckp->SetMaxImpactXY(3.0);
411     dtckp->SetMaxImpactZ(3.0);
412
413     AliFemtoCutMonitorParticleYPt *cutPassYPtkp = new AliFemtoCutMonitorParticleYPt("cutPasskp", 0.493677);
414     AliFemtoCutMonitorParticleYPt *cutFailYPtkp = new AliFemtoCutMonitorParticleYPt("cutFailkp", 0.493677);
415     dtckp->AddCutMonitor(cutPassYPtkp, cutFailYPtkp);
416
417     AliFemtoCutMonitorParticlePtPDG *cutPassPidkp = new AliFemtoCutMonitorParticlePtPDG("cutPasskp", 0.493677);
418     AliFemtoCutMonitorParticlePtPDG *cutFailPidkp = new AliFemtoCutMonitorParticlePtPDG("cutFailkp", 0.493677);
419     dtckp->AddCutMonitor(cutPassPidkp, cutFailPidkp);
420
421     AliFemtoCutMonitorParticleMomRes *cutPassMRkp = new AliFemtoCutMonitorParticleMomRes("cutPasskp");
422     AliFemtoCutMonitorParticleMomRes *cutFailMRkp = new AliFemtoCutMonitorParticleMomRes("cutFailkp");
423     dtckp->AddCutMonitor(cutPassMRkp, cutFailMRkp);
424
425     AliFemtoCutMonitorParticleVertPos *cutPassVPkp = new AliFemtoCutMonitorParticleVertPos("cutPasskp");
426     AliFemtoCutMonitorParticleVertPos *cutFailVPkp = new AliFemtoCutMonitorParticleVertPos("cutFailkp");
427     dtckp->AddCutMonitor(cutPassVPkp, cutFailVPkp);
428
429     AliFemtoCutMonitorEventMult *cutPassEvMkp = new AliFemtoCutMonitorEventMult("cutPasskp");
430     AliFemtoCutMonitorEventMult *cutFailEvMkp = new AliFemtoCutMonitorEventMult("cutFailkp");
431     meckp->AddCutMonitor(cutPassEvMkp, cutFailEvMkp);
432
433     AliFemtoCutMonitorEventVertex *cutPassEvVkp = new AliFemtoCutMonitorEventVertex("cutPasskp");
434     AliFemtoCutMonitorEventVertex *cutFailEvVkp = new AliFemtoCutMonitorEventVertex("cutFailkp");
435     meckp->AddCutMonitor(cutPassEvVkp, cutFailEvVkp);
436
437     AliFemtoShareQualityTPCEntranceSepPairCut *sqpckp = new AliFemtoShareQualityTPCEntranceSepPairCut();
438     sqpckp->SetShareQualityMax(0.0);
439     sqpckp->SetShareFractionMax(0.02);
440     sqpckp->SetRemoveSameLabel(kFALSE);
441     sqpckp->SetTPCEntranceSepMinimum(3.0);
442
443     ankp->SetEventCut(meckp);
444     ankp->SetFirstParticleCut(dtckp);
445     ankp->SetSecondParticleCut(dtckp);
446     ankp->SetPairCut(sqpckp);
447
448     AliFemtoQinvCorrFctn *cqinvkp= new AliFemtoQinvCorrFctn("qinvcf",100,0.0,1.0);
449
450     AliFemtoModelBPLCMSCorrFctn *c3dsmallkp;
451     AliFemtoModelCorrFctn *c1dpikp;
452
453     // Setting up the model calculation
454     // First create the freeze-out generator
455     AliFemtoModelGausRinvFreezeOutGenerator *tFreezekp = new AliFemtoModelGausRinvFreezeOutGenerator();
456     tFreezekp->SetSizeInv(1.8*TMath::Sqrt(2.0));
457     tFreezekp->SetSelectPrimaryFromHidden(false);
458
459     // And the weight generator                                                                    
460     //   AliFemtoModelWeightGeneratorBasic *tWeightkp = new AliFemtoModelWeightGeneratorBasic();
461     //   tWeightkp->SetPairType(AliFemtoModelWeightGenerator::KaonPlusKaonPlus());
462     AliFemtoModelWeightGeneratorLednicky *tWeightkp = new AliFemtoModelWeightGeneratorLednicky();
463     tWeightkp->SetPairType(AliFemtoModelWeightGenerator::KaonPlusKaonPlus());
464     tWeightkp->SetCoulOn();
465     tWeightkp->SetQuantumOn();
466     tWeightkp->SetStrongOff();
467     tWeightkp->Set3BodyOff();
468
469     // Create a manager that will connect it  
470     AliFemtoModelManager *tModelManagerkp = new AliFemtoModelManager();
471     tModelManagerkp->AcceptFreezeOutGenerator(tFreezekp);
472     tModelManagerkp->AcceptWeightGenerator(tWeightkp);
473     tModelManagerkp->CreateCopyHiddenInfo(kFALSE);
474
475     c3dsmallkp = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkp",30, 0.0, 0.6);
476     c3dsmallkp->ConnectToManager(tModelManagerkp);
477
478     c1dpikp = new AliFemtoModelCorrFctn("c1dpikp",100,0.0,1.0);
479     c1dpikp->ConnectToManager(tModelManagerkp);
480
481     //###
482     ankp->AddCorrFctn(cqinvkp);
483  
484     ankp->AddCorrFctn(c3dsmallkp);
485     ankp->AddCorrFctn(c1dpikp);
486
487     Manager->AddAnalysis(ankp);   
488
489     // *** End Kaon-Kaon (positive) analysis
490   }
491
492   if (runNegativeKaons) {
493     // *** Begin Kaon-Kaon (negative) analysis
494     AliFemtoVertexMultAnalysis *ankm = new AliFemtoVertexMultAnalysis(18, -15.6, 15.6, 1, 2, 20000);
495     ankm->SetNumEventsToMix(5);
496     ankm->SetMinSizePartCollection(2);
497
498     AliFemtoBasicEventCut* meckm = new AliFemtoBasicEventCut();
499     meckm->SetEventMult(1,100000);
500     meckm->SetVertZPos(-1000,1000);
501         
502     AliFemtoESDTrackCut* dtckm = new AliFemtoESDTrackCut();
503     dtckm->SetPidProbKaon(0.7,1.001);
504     dtckm->SetPidProbMuon(0.0,0.5);
505     dtckm->SetPidProbPion(0.0,0.5);
506     dtckm->SetPidProbProton(0.0,0.5);
507     dtckp->SetMomRangeTOFpidIs(0.6,10000.);
508     dtckm->SetCharge(-1.0);
509     dtckm->SetMostProbableKaon();
510     dtckm->SetPt(0.15,2.0);
511     dtckm->SetMass(KaonMass);
512     // Track quality cuts
513     dtckm->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
514     dtckm->SetminTPCncls(50);
515     dtckm->SetRemoveKinks(kTRUE);
516     dtckm->SetLabel(kFALSE);
517     dtckm->SetMaxITSChiNdof(2.5);
518     dtckm->SetMaxTPCChiNdof(3.0);
519     dtckm->SetMaxImpactXY(3.0);
520     dtckm->SetMaxImpactZ(3.0);
521
522     AliFemtoCutMonitorParticleYPt *cutPassYPtkm = new AliFemtoCutMonitorParticleYPt("cutPasskm", 0.493677);
523     AliFemtoCutMonitorParticleYPt *cutFailYPtkm = new AliFemtoCutMonitorParticleYPt("cutFailkm", 0.493677);
524     dtckm->AddCutMonitor(cutPassYPtkm, cutFailYPtkm);
525
526     AliFemtoCutMonitorParticlePtPDG *cutPassPidkm = new AliFemtoCutMonitorParticlePtPDG("cutPasskm", 0.493677);
527     AliFemtoCutMonitorParticlePtPDG *cutFailPidkm = new AliFemtoCutMonitorParticlePtPDG("cutFailkm", 0.493677);
528     dtckm->AddCutMonitor(cutPassPidkm, cutFailPidkm);
529
530     AliFemtoCutMonitorParticleMomRes *cutPassMRkm = new AliFemtoCutMonitorParticleMomRes("cutPasskm");
531     AliFemtoCutMonitorParticleMomRes *cutFailMRkm = new AliFemtoCutMonitorParticleMomRes("cutFailkm");
532     dtckm->AddCutMonitor(cutPassMRkm, cutFailMRkm);
533
534     AliFemtoCutMonitorParticleVertPos *cutPassVPkm = new AliFemtoCutMonitorParticleVertPos("cutPasskm");
535     AliFemtoCutMonitorParticleVertPos *cutFailVPkm = new AliFemtoCutMonitorParticleVertPos("cutFailkm");
536     dtckm->AddCutMonitor(cutPassVPkm, cutFailVPkm);
537
538     AliFemtoCutMonitorEventMult *cutPassEvMkm = new AliFemtoCutMonitorEventMult("cutPasskm");
539     AliFemtoCutMonitorEventMult *cutFailEvMkm = new AliFemtoCutMonitorEventMult("cutFailkm");
540     meckm->AddCutMonitor(cutPassEvMkm, cutFailEvMkm);
541
542     AliFemtoCutMonitorEventVertex *cutPassEvVkm = new AliFemtoCutMonitorEventVertex("cutPasskm");
543     AliFemtoCutMonitorEventVertex *cutFailEvVkm = new AliFemtoCutMonitorEventVertex("cutFailkm");
544     meckm->AddCutMonitor(cutPassEvVkm, cutFailEvVkm);
545
546     AliFemtoShareQualityTPCEntranceSepPairCut *sqpckm = new AliFemtoShareQualityTPCEntranceSepPairCut();
547     sqpckm->SetShareQualityMax(0.0);
548     sqpckm->SetShareFractionMax(0.02);
549     sqpckm->SetRemoveSameLabel(kFALSE);
550     sqpckm->SetTPCEntranceSepMinimum(3.0);
551
552     ankm->SetEventCut(meckm);
553     ankm->SetFirstParticleCut(dtckm);
554     ankm->SetSecondParticleCut(dtckm);
555     ankm->SetPairCut(sqpckm);
556
557     AliFemtoQinvCorrFctn *cqinvkm= new AliFemtoQinvCorrFctn("qinvcf",100,0.0,1.0);
558
559     AliFemtoModelBPLCMSCorrFctn *c3dsmallkm;
560     AliFemtoModelCorrFctn *c1dpikm;
561
562     // Setting up the model calculation
563     // First create the freeze-out generator
564     AliFemtoModelGausRinvFreezeOutGenerator *tFreezekm = new AliFemtoModelGausRinvFreezeOutGenerator();
565     tFreezekm->SetSizeInv(1.8*TMath::Sqrt(2.0));
566     tFreezekm->SetSelectPrimaryFromHidden(false);
567
568     // And the weight generator                                                                    
569     //   AliFemtoModelWeightGeneratorBasic *tWeightkp = new AliFemtoModelWeightGeneratorBasic();
570     //   tWeightkp->SetPairType(AliFemtoModelWeightGenerator::KaonPlusKaonPlus());
571     AliFemtoModelWeightGeneratorLednicky *tWeightkm = new AliFemtoModelWeightGeneratorLednicky();
572     tWeightkm->SetPairType(AliFemtoModelWeightGenerator::KaonPlusKaonPlus());
573     tWeightkm->SetCoulOn();
574     tWeightkm->SetQuantumOn();
575     tWeightkm->SetStrongOff();
576     tWeightkm->Set3BodyOff();
577
578     // Create a manager that will connect it  
579     AliFemtoModelManager *tModelManagerkm = new AliFemtoModelManager();
580     tModelManagerkm->AcceptFreezeOutGenerator(tFreezekp);
581     tModelManagerkm->AcceptWeightGenerator(tWeightkp);
582     tModelManagerkm->CreateCopyHiddenInfo(kFALSE);
583
584     c3dsmallkm = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkm",30, 0.0, 0.6);
585     c3dsmallkm->ConnectToManager(tModelManagerkm);
586
587     c1dpikm = new AliFemtoModelCorrFctn("c1dpikm",100,0.0,1.0);
588     c1dpikm->ConnectToManager(tModelManagerkm);
589
590     //###
591     ankm->AddCorrFctn(cqinvkm);
592  
593     ankm->AddCorrFctn(c3dsmallkm);
594     ankm->AddCorrFctn(c1dpikm);
595
596     Manager->AddAnalysis(ankm);   
597
598     // *** End Kaon-Kaon (negative) analysis
599   }
600
601   if (runPositiveNegativeKaons) {
602     // *** Begin Kaon+Kaon- analysis
603     AliFemtoVertexMultAnalysis *ankpkm = new AliFemtoVertexMultAnalysis(18, -15.6, 15.6, 1, 2, 20000);
604     ankpkm->SetNumEventsToMix(5);
605     ankpkm->SetMinSizePartCollection(2);
606
607     AliFemtoBasicEventCut* meckpkm = new AliFemtoBasicEventCut();
608     meckpkm->SetEventMult(1,100000);
609     meckpkm->SetVertZPos(-1000,1000);
610         
611     AliFemtoESDTrackCut* dtckp = new AliFemtoESDTrackCut();
612     dtckp->SetPidProbKaon(0.7,1.001);
613     dtckp->SetPidProbMuon(0.0,0.5);
614     dtckp->SetPidProbPion(0.0,0.5);
615     dtckp->SetPidProbProton(0.0,0.5);
616     dtckp->SetMomRangeTOFpidIs(0.6,10000.);
617     dtckp->SetCharge(1.0);
618     dtckp->SetMostProbableKaon();
619     dtckp->SetPt(0.15,2.0);
620     dtckp->SetMass(KaonMass);
621     // Track quality cuts
622     dtckp->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
623     dtckp->SetminTPCncls(50);
624     dtckp->SetRemoveKinks(kTRUE);
625     dtckp->SetLabel(kFALSE);
626     dtckp->SetMaxITSChiNdof(2.5);
627     dtckp->SetMaxTPCChiNdof(3.0);
628     dtckp->SetMaxImpactXY(3.0);
629     dtckp->SetMaxImpactZ(3.0);
630
631     AliFemtoESDTrackCut* dtckm = new AliFemtoESDTrackCut();
632     dtckm->SetPidProbKaon(0.7,1.001);
633     dtckm->SetPidProbMuon(0.0,0.5);
634     dtckm->SetPidProbPion(0.0,0.5);
635     dtckm->SetPidProbProton(0.0,0.5);
636     dtckm->SetMomRangeTOFpidIs(0.6,10000.);
637     dtckm->SetCharge(-1.0);
638     dtckm->SetMostProbableKaon();
639     dtckm->SetPt(0.15,2.0);
640     dtckm->SetMass(KaonMass);
641     // Track quality cuts
642     dtckm->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
643     dtckm->SetminTPCncls(50);
644     dtckm->SetRemoveKinks(kTRUE);
645     dtckm->SetLabel(kFALSE);
646     dtckm->SetMaxITSChiNdof(2.5);
647     dtckm->SetMaxTPCChiNdof(3.0);
648     dtckm->SetMaxImpactXY(3.0);
649     dtckm->SetMaxImpactZ(3.0);
650
651
652     AliFemtoCutMonitorParticleYPt *cutPassYPtkp = new AliFemtoCutMonitorParticleYPt("cutPasskp", 0.493677);
653     AliFemtoCutMonitorParticleYPt *cutFailYPtkp = new AliFemtoCutMonitorParticleYPt("cutFailkp", 0.493677);
654     dtckp->AddCutMonitor(cutPassYPtkp, cutFailYPtkp);
655
656     AliFemtoCutMonitorParticleYPt *cutPassYPtkm = new AliFemtoCutMonitorParticleYPt("cutPasskm", 0.493677);
657     AliFemtoCutMonitorParticleYPt *cutFailYPtkm = new AliFemtoCutMonitorParticleYPt("cutFailkm", 0.493677);
658     dtckm->AddCutMonitor(cutPassYPtkm, cutFailYPtkm);
659
660     AliFemtoCutMonitorParticlePtPDG *cutPassPidkp = new AliFemtoCutMonitorParticlePtPDG("cutPasskp", 0.493677);
661     AliFemtoCutMonitorParticlePtPDG *cutFailPidkp = new AliFemtoCutMonitorParticlePtPDG("cutFailkp", 0.493677);
662     dtckp->AddCutMonitor(cutPassPidkp, cutFailPidkp);
663
664     AliFemtoCutMonitorParticlePtPDG *cutPassPidkm = new AliFemtoCutMonitorParticlePtPDG("cutPasskm", 0.493677);
665     AliFemtoCutMonitorParticlePtPDG *cutFailPidkm = new AliFemtoCutMonitorParticlePtPDG("cutFailkm", 0.493677);
666     dtckm->AddCutMonitor(cutPassPidkm, cutFailPidkm);
667   
668     AliFemtoCutMonitorParticleMomRes *cutPassMRkp = new AliFemtoCutMonitorParticleMomRes("cutPasskp");
669     AliFemtoCutMonitorParticleMomRes *cutFailMRkp = new AliFemtoCutMonitorParticleMomRes("cutFailkp");
670     dtckp->AddCutMonitor(cutPassMRkp, cutFailMRkp);
671
672     AliFemtoCutMonitorParticleMomRes *cutPassMRkm = new AliFemtoCutMonitorParticleMomRes("cutPasskm");
673     AliFemtoCutMonitorParticleMomRes *cutFailMRkm = new AliFemtoCutMonitorParticleMomRes("cutFailkm");
674     dtckm->AddCutMonitor(cutPassMRkm, cutFailMRkm);
675
676     AliFemtoCutMonitorParticleVertPos *cutPassVPkp = new AliFemtoCutMonitorParticleVertPos("cutPasskp");
677     AliFemtoCutMonitorParticleVertPos *cutFailVPkp = new AliFemtoCutMonitorParticleVertPos("cutFailkp");
678     dtckp->AddCutMonitor(cutPassVPkp, cutFailVPkp);
679
680     AliFemtoCutMonitorParticleVertPos *cutPassVPkm = new AliFemtoCutMonitorParticleVertPos("cutPasskm");
681     AliFemtoCutMonitorParticleVertPos *cutFailVPkm = new AliFemtoCutMonitorParticleVertPos("cutFailkm");
682     dtckm->AddCutMonitor(cutPassVPkm, cutFailVPkm);
683
684     AliFemtoCutMonitorEventMult *cutPassEvMkpkm = new AliFemtoCutMonitorEventMult("cutPasskpkm");
685     AliFemtoCutMonitorEventMult *cutFailEvMkpkm = new AliFemtoCutMonitorEventMult("cutFailkpkm");
686     meckpkm->AddCutMonitor(cutPassEvMkpkm, cutFailEvMkpkm);
687  
688     AliFemtoCutMonitorEventVertex *cutPassEvVkpkm = new AliFemtoCutMonitorEventVertex("cutPasskpkm");
689     AliFemtoCutMonitorEventVertex *cutFailEvVkpkm = new AliFemtoCutMonitorEventVertex("cutFailkpkm");
690     meckpkm->AddCutMonitor(cutPassEvVkpkm, cutFailEvVkpkm);
691
692     AliFemtoShareQualityTPCEntranceSepPairCut *sqpckpkm = new AliFemtoShareQualityTPCEntranceSepPairCut();
693     sqpckpkm->SetShareQualityMax(0.0);
694     sqpckpkm->SetShareFractionMax(0.02);
695     sqpckpkm->SetRemoveSameLabel(kFALSE);
696     sqpckpkm->SetTPCEntranceSepMinimum(3.0);
697
698     ankpkm->SetEventCut(meckpkm);
699     ankpkm->SetFirstParticleCut(dtckp);
700     ankpkm->SetSecondParticleCut(dtckm);
701     ankpkm->SetPairCut(sqpckpkm);
702
703     AliFemtoQinvCorrFctn *cqinvkpkm= new AliFemtoQinvCorrFctn("qinvcf",100,0.0,1.0);
704
705     AliFemtoModelBPLCMSCorrFctn *c3dsmallkpkm;
706     AliFemtoModelCorrFctn *c1dpikpkm;
707
708     // Setting up the model calculation
709     // First create the freeze-out generator
710     AliFemtoModelGausRinvFreezeOutGenerator *tFreezekpkm = new AliFemtoModelGausRinvFreezeOutGenerator();
711     tFreezekpkm->SetSizeInv(1.8*TMath::Sqrt(2.0));
712     tFreezekpkm->SetSelectPrimaryFromHidden(false);
713
714     // And the weight generator                                                                    
715     AliFemtoModelWeightGeneratorLednicky *tWeightkpkm = new AliFemtoModelWeightGeneratorLednicky();
716     tWeightkpkm->SetPairType(AliFemtoModelWeightGenerator::KaonPlusKaonMinus());
717     tWeightkpkm->SetCoulOn();
718     tWeightkpkm->SetQuantumOn();
719     tWeightkpkm->SetStrongOff();
720     tWeightkpkm->Set3BodyOff();
721
722     // Create a manager that will connect it  
723     AliFemtoModelManager *tModelManagerkpkm = new AliFemtoModelManager();
724     tModelManagerkpkm->AcceptFreezeOutGenerator(tFreezekpkm);
725     tModelManagerkpkm->AcceptWeightGenerator(tWeightkpkm);
726     tModelManagerkpkm->CreateCopyHiddenInfo(kFALSE);
727
728     c3dsmallkpkm = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkpkm",30, 0.0, 0.6);
729     c3dsmallkpkm->ConnectToManager(tModelManagerkpkm);
730
731     c1dpikpkm = new AliFemtoModelCorrFctn("c1dpikpkm",100,0.0,1.0);
732     c1dpikpkm->ConnectToManager(tModelManagerkpkm);
733
734     //###
735     ankpkm->AddCorrFctn(cqinvkpkm);
736  
737     ankpkm->AddCorrFctn(c3dsmallkpkm);
738     ankpkm->AddCorrFctn(c1dpikpkm);
739
740     Manager->AddAnalysis(ankpkm);         
741
742     // *** End Kaon+Kaon-  analysis
743   }
744   //   if (runPositiveKaons) {
745   //     // *** Begin Kaon-Kaon (positive) analysis
746   //     AliFemtoVertexMultAnalysis *ankp = new AliFemtoVertexMultAnalysis(10, -15.6, 15.6, 1, 2, 20000);
747   //     ankp->SetNumEventsToMix(10);
748   //     ankp->SetMinSizePartCollection(2);
749
750   //     AliFemtoBasicEventCut* meckp = new AliFemtoBasicEventCut();
751   //     meckp->SetEventMult(1,100000);
752   //     meckp->SetVertZPos(-1000,1000);
753         
754   //     AliFemtoESDTrackCut* dtckp = new AliFemtoESDTrackCut();
755   //     dtckp->SetPidProbKaon(0.7,1.001);
756   //     dtckp->SetPidProbMuon(0.0,0.5);
757   //     dtckp->SetPidProbPion(0.0,0.5);
758   //     dtckp->SetPidProbProton(0.0,0.5);
759   //     dtckp->SetCharge(1.0);
760   //     dtckp->SetMostProbableKaon();
761   //     dtckp->SetPt(0.15,2.0);
762   //     dtckp->SetMass(KaonMass);
763   //     dtckp->SetRapidity(-0.8,0.8);
764   //     // Track quality cuts
765   //     dtckp->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
766   //     //dtckp->SetStatus(AliESDtrack::kTPCrefit);
767   //     //  dtckp->SetminTPCclsF(95);
768   //     dtckp->SetminTPCncls(50);
769   //     dtckp->SetRemoveKinks(kTRUE);
770   //     dtckp->SetLabel(kFALSE);
771   //     dtckp->SetMaxITSChiNdof(2.5);
772   //     dtckp->SetMaxTPCChiNdof(3.0);
773   //     //  dtckp->SetMaxSigmaToVertex(3.0);
774   //     dtckp->SetMaxImpactXY(3.0);
775   //     dtckp->SetMaxImpactZ(3.0);
776
777   //     AliFemtoCutMonitorParticleYPt *cutPassYPtkp = new AliFemtoCutMonitorParticleYPt("cutPasskp", 0.493677);
778   //     AliFemtoCutMonitorParticleYPt *cutFailYPtkp = new AliFemtoCutMonitorParticleYPt("cutFailkp", 0.493677);
779   //     dtckp->AddCutMonitor(cutPassYPtkp, cutFailYPtkp);
780
781   //     AliFemtoCutMonitorParticlePtPDG *cutPassPidkp = new AliFemtoCutMonitorParticlePtPDG("cutPasskp", 0.493677);
782   //     AliFemtoCutMonitorParticlePtPDG *cutFailPidkp = new AliFemtoCutMonitorParticlePtPDG("cutFailkp", 0.493677);
783   //     dtckp->AddCutMonitor(cutPassPidkp, cutFailPidkp);
784
785   //     AliFemtoCutMonitorParticleMomRes *cutPassMRkp = new AliFemtoCutMonitorParticleMomRes("cutPasskp");
786   //     AliFemtoCutMonitorParticleMomRes *cutFailMRkp = new AliFemtoCutMonitorParticleMomRes("cutFailkp");
787   //     dtckp->AddCutMonitor(cutPassMRkp, cutFailMRkp);
788
789   //     AliFemtoCutMonitorParticleVertPos *cutPassVPkp = new AliFemtoCutMonitorParticleVertPos("cutPasskp");
790   //     AliFemtoCutMonitorParticleVertPos *cutFailVPkp = new AliFemtoCutMonitorParticleVertPos("cutFailkp");
791   //     dtckp->AddCutMonitor(cutPassVPkp, cutFailVPkp);
792
793   //     AliFemtoCutMonitorEventMult *cutPassEvMkp = new AliFemtoCutMonitorEventMult("cutPasskp");
794   //     AliFemtoCutMonitorEventMult *cutFailEvMkp = new AliFemtoCutMonitorEventMult("cutFailkp");
795   //     meckp->AddCutMonitor(cutPassEvMkp, cutFailEvMkp);
796
797   //     AliFemtoCutMonitorEventVertex *cutPassEvVkp = new AliFemtoCutMonitorEventVertex("cutPasskp");
798   //     AliFemtoCutMonitorEventVertex *cutFailEvVkp = new AliFemtoCutMonitorEventVertex("cutFailkp");
799   //     meckp->AddCutMonitor(cutPassEvVkp, cutFailEvVkp);
800
801   //     AliFemtoShareQualityTPCEntranceSepPairCut *sqpckp = new AliFemtoShareQualityTPCEntranceSepPairCut();
802   //     sqpckp->SetShareQualityMax(0.0);
803   //     sqpckp->SetShareFractionMax(0.02);
804   //     sqpckp->SetRemoveSameLabel(kFALSE);
805   //     sqpckp->SetTPCEntranceSepMinimum(3.0);
806
807   //     ankp->SetEventCut(meckp);
808   //     ankp->SetFirstParticleCut(dtckp);
809   //     ankp->SetSecondParticleCut(dtckp);
810   //     ankp->SetPairCut(sqpckp);
811
812   //     AliFemtoQinvCorrFctn *cqinvkp= new AliFemtoQinvCorrFctn("qinvcf",100,0.0,1.0);
813
814   //     AliFemtoModelBPLCMSCorrFctn *c3dsmallkp;
815   //     AliFemtoModelCorrFctn *c1dpikp;
816
817   //     // Setting up the model calculation
818   //     // First create the freeze-out generator
819   //     AliFemtoModelGausRinvFreezeOutGenerator *tFreezekp = new AliFemtoModelGausRinvFreezeOutGenerator();
820   //     tFreezekp->SetSizeInv(1.8*TMath::Sqrt(2.0));
821   //     tFreezekp->SetSelectPrimaryFromHidden(false);
822
823   //     // And the weight generator                                                                    
824   //     //   AliFemtoModelWeightGeneratorBasic *tWeightkp = new AliFemtoModelWeightGeneratorBasic();
825   //     //   tWeightkp->SetPairType(AliFemtoModelWeightGenerator::KaonPlusKaonPlus());
826   //     AliFemtoModelWeightGeneratorLednicky *tWeightkp = new AliFemtoModelWeightGeneratorLednicky();
827   //     tWeightkp->SetPairType(AliFemtoModelWeightGenerator::KaonPlusKaonPlus());
828   //     tWeightkp->SetCoulOn();
829   //     tWeightkp->SetQuantumOn();
830   //     tWeightkp->SetStrongOff();
831   //     tWeightkp->Set3BodyOff();
832
833   //     // Create a manager that will connect it  
834   //     AliFemtoModelManager *tModelManagerkp = new AliFemtoModelManager();
835   //     tModelManagerkp->AcceptFreezeOutGenerator(tFreezekp);
836   //     tModelManagerkp->AcceptWeightGenerator(tWeightkp);
837   //     tModelManagerkp->CreateCopyHiddenInfo(kFALSE);
838
839   //     c3dsmallkp = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkp",30, 0.0, 0.6);
840   //     c3dsmallkp->ConnectToManager(tModelManagerkp);
841
842   //     c1dpikp = new AliFemtoModelCorrFctn("c1dpikp",100,0.0,1.0);
843   //     c1dpikp->ConnectToManager(tModelManagerkp);
844
845   //     //###
846   //     ankp->AddCorrFctn(cqinvkp);
847  
848   //     ankp->AddCorrFctn(c3dsmallkp);
849   //     ankp->AddCorrFctn(c1dpikp);
850
851   //     Manager->AddAnalysis(ankp);      
852
853   //     // *** End Kaon-Kaon (positive) analysis
854   //   }
855
856   //   if (runNegativeKaons) {
857   //     // *** Begin Kaon-Kaon (negative) analysis
858   //     AliFemtoVertexMultAnalysis *ankm = new AliFemtoVertexMultAnalysis(10, -15.6, 15.6, 1, 2, 20000);
859   //     ankm->SetNumEventsToMix(10);
860   //     ankm->SetMinSizePartCollection(2);
861
862   //     AliFemtoBasicEventCut* meckm = new AliFemtoBasicEventCut();
863   //     meckm->SetEventMult(1,100000);
864   //     meckm->SetVertZPos(-1000,1000);
865         
866   //     AliFemtoESDTrackCut* dtckm = new AliFemtoESDTrackCut();
867   //     dtckm->SetPidProbKaon(0.7,1.001);
868   //     dtckm->SetPidProbMuon(0.0,0.5);
869   //     dtckm->SetPidProbPion(0.0,0.5);
870   //     dtckm->SetPidProbProton(0.0,0.5);
871   //     dtckm->SetCharge(1.0);
872   //     dtckm->SetMostProbableKaon();
873   //     dtckm->SetPt(0.15,2.0);
874   //     dtckm->SetMass(KaonMass);
875   //     dtckm->SetRapidity(-0.8,0.8);
876   //     // Track quality cuts
877   //     dtckm->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
878   //     //dtckm->SetStatus(AliESDtrack::kTPCrefit);
879   //     //  dtckm->SetminTPCclsF(95);
880   //     dtckm->SetminTPCncls(50);
881   //     dtckm->SetRemoveKinks(kTRUE);
882   //     dtckm->SetLabel(kFALSE);
883   //     dtckm->SetMaxITSChiNdof(2.5);
884   //     dtckm->SetMaxTPCChiNdof(3.0);
885   //     //  dtckm->SetMaxSigmaToVertex(3.0);
886   //     dtckm->SetMaxImpactXY(3.0);
887   //     dtckm->SetMaxImpactZ(3.0);
888
889   //     AliFemtoCutMonitorParticleYPt *cutPassYPtkm = new AliFemtoCutMonitorParticleYPt("cutPasskm", 0.493677);
890   //     AliFemtoCutMonitorParticleYPt *cutFailYPtkm = new AliFemtoCutMonitorParticleYPt("cutFailkm", 0.493677);
891   //     dtckm->AddCutMonitor(cutPassYPtkm, cutFailYPtkm);
892
893   //     AliFemtoCutMonitorParticlePtPDG *cutPassPidkm = new AliFemtoCutMonitorParticlePtPDG("cutPasskm", 0.493677);
894   //     AliFemtoCutMonitorParticlePtPDG *cutFailPidkm = new AliFemtoCutMonitorParticlePtPDG("cutFailkm", 0.493677);
895   //     dtckm->AddCutMonitor(cutPassPidkm, cutFailPidkm);
896
897   //     AliFemtoCutMonitorParticleMomRes *cutPassMRkm = new AliFemtoCutMonitorParticleMomRes("cutPasskm");
898   //     AliFemtoCutMonitorParticleMomRes *cutFailMRkm = new AliFemtoCutMonitorParticleMomRes("cutFailkm");
899   //     dtckm->AddCutMonitor(cutPassMRkm, cutFailMRkm);
900
901   //     AliFemtoCutMonitorParticleVertPos *cutPassVPkm = new AliFemtoCutMonitorParticleVertPos("cutPasskm");
902   //     AliFemtoCutMonitorParticleVertPos *cutFailVPkm = new AliFemtoCutMonitorParticleVertPos("cutFailkm");
903   //     dtckm->AddCutMonitor(cutPassVPkm, cutFailVPkm);
904
905   //     AliFemtoCutMonitorEventMult *cutPassEvMkm = new AliFemtoCutMonitorEventMult("cutPasskm");
906   //     AliFemtoCutMonitorEventMult *cutFailEvMkm = new AliFemtoCutMonitorEventMult("cutFailkm");
907   //     meckm->AddCutMonitor(cutPassEvMkm, cutFailEvMkm);
908
909   //     AliFemtoCutMonitorEventVertex *cutPassEvVkm = new AliFemtoCutMonitorEventVertex("cutPasskm");
910   //     AliFemtoCutMonitorEventVertex *cutFailEvVkm = new AliFemtoCutMonitorEventVertex("cutFailkm");
911   //     meckm->AddCutMonitor(cutPassEvVkm, cutFailEvVkm);
912
913   //     AliFemtoShareQualityTPCEntranceSepPairCut *sqpckm = new AliFemtoShareQualityTPCEntranceSepPairCut();
914   //     sqpckm->SetShareQualityMax(0.0);
915   //     sqpckm->SetShareFractionMax(0.02);
916   //     sqpckm->SetRemoveSameLabel(kFALSE);
917   //     sqpckm->SetTPCEntranceSepMinimum(3.0);
918
919   //     ankm->SetEventCut(meckm);
920   //     ankm->SetFirstParticleCut(dtckm);
921   //     ankm->SetSecondParticleCut(dtckm);
922   //     ankm->SetPairCut(sqpckm);
923
924   //     AliFemtoQinvCorrFctn *cqinvkm= new AliFemtoQinvCorrFctn("qinvcf",100,0.0,1.0);
925
926   //     AliFemtoModelBPLCMSCorrFctn *c3dsmallkm;
927   //     AliFemtoModelCorrFctn *c1dpikm;
928
929   //     // Setting up the model calculation
930   //     // First create the freeze-out generator
931   //     AliFemtoModelGausRinvFreezeOutGenerator *tFreezekm = new AliFemtoModelGausRinvFreezeOutGenerator();
932   //     tFreezekm->SetSizeInv(1.8*TMath::Sqrt(2.0));
933   //     tFreezekm->SetSelectPrimaryFromHidden(false);
934
935   //     // And the weight generator                                                                    
936   //     //   AliFemtoModelWeightGeneratorBasic *tWeightkm = new AliFemtoModelWeightGeneratorBasic();
937   //     //   tWeightkm->SetPairType(AliFemtoModelWeightGenerator::KaonPlusKaonPlus());
938   //     AliFemtoModelWeightGeneratorLednicky *tWeightkm = new AliFemtoModelWeightGeneratorLednicky();
939   //     tWeightkm->SetPairType(AliFemtoModelWeightGenerator::KaonPlusKaonPlus());
940   //     tWeightkm->SetCoulOn();
941   //     tWeightkm->SetQuantumOn();
942   //     tWeightkm->SetStrongOff();
943   //     tWeightkm->Set3BodyOff();
944
945   //     // Create a manager that will connect it  
946   //     AliFemtoModelManager *tModelManagerkm = new AliFemtoModelManager();
947   //     tModelManagerkm->AcceptFreezeOutGenerator(tFreezekm);
948   //     tModelManagerkm->AcceptWeightGenerator(tWeightkm);
949   //     tModelManagerkm->CreateCopyHiddenInfo(kFALSE);
950
951   //     c3dsmallkm = new AliFemtoModelBPLCMSCorrFctn("c3dsmallkm",30, 0.0, 0.6);
952   //     c3dsmallkm->ConnectToManager(tModelManagerkm);
953
954   //     c1dpikm = new AliFemtoModelCorrFctn("c1dpikm",100,0.0,1.0);
955   //     c1dpikm->ConnectToManager(tModelManagerkm);
956
957   //     //###
958   //     ankm->AddCorrFctn(cqinvkm);
959  
960   //     ankm->AddCorrFctn(c3dsmallkm);
961   //     ankm->AddCorrFctn(c1dpikm);
962
963   //     Manager->AddAnalysis(ankm);      
964
965   //     // *** End Kaon-Kaon (positive) analysis
966   //   }
967
968   return Manager;
969 }                         
970