changes in the PID of protons + new config for the proton femtoscopy train
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / macros / Train / ProtonFemtoscopy / SHnoTTC / ConfigFemtoAnalysis.C
1 /*********************************************************************
2  *                                                                   *
3  * Configfemtoanalysis.C - configuration macro for the femtoscopic   *
4  * analysis, meant as a QA process for two-particle effects          *
5  *                                                                   *
6  * Author: Adam Kisiel (Adam.Kisiel@cern.ch)                         *
7  *                                                                   *
8  *********************************************************************/
9
10 #if !defined(__CINT__) || defined(__MAKECINT_)
11 #include "AliFemtoManager.h"
12 #include "AliFemtoEventReaderESDChain.h"
13 #include "AliFemtoEventReaderESDChainKine.h"
14 #include "AliFemtoEventReaderAODChain.h"
15 #include "AliFemtoSimpleAnalysis.h"
16 #include "AliFemtoBasicEventCut.h"
17 #include "AliFemtoESDTrackCut.h"
18 #include "AliFemtoCorrFctn.h"
19 #include "AliFemtoCutMonitorParticleYPt.h"
20 #include "AliFemtoCutMonitorParticleVertPos.h"
21 #include "AliFemtoCutMonitorParticleMomRes.h"
22 #include "AliFemtoCutMonitorParticlePID.h"
23 #include "AliFemtoCutMonitorEventMult.h"
24 #include "AliFemtoCutMonitorEventVertex.h"
25 #include "AliFemtoShareQualityTPCEntranceSepPairCut.h"
26 #include "AliFemtoPairCutAntiGamma.h"
27 #include "AliFemtoPairCutRadialDistance.h"
28 #include "AliFemtoQinvCorrFctn.h"
29 #include "AliFemtoCorrFctnNonIdDR.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 "AliFemtoBPLCMS3DCorrFctn.h"
37 #include "AliFemtoCorrFctn3DLCMSSym.h"
38 #include "AliFemtoModelBPLCMSCorrFctn.h"
39 #include "AliFemtoModelCorrFctn3DSpherical.h"
40 #include "AliFemtoModelGausLCMSFreezeOutGenerator.h"
41 #include "AliFemtoModelGausRinvFreezeOutGenerator.h"
42 #include "AliFemtoModelManager.h"
43 #include "AliFemtoModelWeightGeneratorBasic.h"
44 #include "AliFemtoModelWeightGeneratorLednicky.h"
45 #include "AliFemtoCorrFctnDirectYlm.h"
46 #include "AliFemtoModelCorrFctnDirectYlm.h"
47 #include "AliFemtoModelCorrFctnSource.h"
48 #include "AliFemtoCutMonitorParticlePtPDG.h"
49 #include "AliFemtoKTPairCut.h"
50 #include "AliFemtoAvgSepCorrFctn.h"
51 #endif
52
53 //________________________________________________________________________
54 AliFemtoManager* ConfigFemtoAnalysis() {
55
56   double PionMass = 0.13956995;
57   double KaonMass = 0.493677;
58   double ProtonMass = 0.938272013;
59
60   // double psi = TMath::Pi()/2.;
61   // double psid = TMath::Pi()/6.;
62
63   // int runepvzero[7] = {1, 1, 1, 1, 1, 1, 1};
64   // double epvzerobins[7] = {-psi, -psi+psid, -psi+2*psid, -psi+3*psid, -psi+4*psid, -psi+5*psid, -psi+6*psid};
65
66   double psi = TMath::Pi()/2.;
67   double psid = TMath::Pi()/3.;
68
69   int runepvzero[4] = {0, 0, 0, 1};
70   double epvzerobins[4] = {-psi, -psi+psid, -psi+2*psid, -psi+3*psid};
71
72   int runmults[10] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0};
73   int multbins[11] = {0.001, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900};
74
75   int runch[3] = {1, 1, 1};
76   const char *chrgs[3] = { "PP", "APAP", "PAP" };
77
78   int runktdep = 1;
79   double ktrng[3] = {0.01, 1.0, 5.0};
80
81   int numOfMultBins = 10;
82   int numOfChTypes = 3;
83   int numOfkTbins = 2;
84   int numOfEPvzero = 4;
85
86   int runqinv = 1;
87   int runshlcms = 0;// 0:PRF(PAP), 1:LCMS(PP,APAP)
88
89   int runtype = 2; // Types 0 - global, 1 - ITS only, 2 - TPC Inner
90   int isrealdata = 1;
91
92   //  int gammacut = 1;
93
94   double shqmax = 1.0;
95   int nbinssh = 100;
96
97   AliFemtoEventReaderAODChain *Reader = new AliFemtoEventReaderAODChain();
98   Reader->SetFilterBit(7);
99   Reader->SetCentralityPreSelection(0.001, 510);
100   Reader->SetEPVZERO(kTRUE);
101
102   AliFemtoManager* Manager = new AliFemtoManager();
103   Manager->SetEventReader(Reader);
104
105   AliFemtoVertexMultAnalysis    *anetaphitpc[10*3*2];
106   AliFemtoBasicEventCut         *mecetaphitpc[10*3*2];
107   AliFemtoCutMonitorEventMult   *cutPassEvMetaphitpc[50];
108   AliFemtoCutMonitorEventMult   *cutFailEvMetaphitpc[50];
109   // AliFemtoCutMonitorEventVertex *cutPassEvVetaphitpc[50];
110   // AliFemtoCutMonitorEventVertex *cutFailEvVetaphitpc[50];
111   AliFemtoESDTrackCut           *dtc1etaphitpc[50];
112   AliFemtoESDTrackCut           *dtc2etaphitpc[50];
113   AliFemtoCutMonitorParticleYPt *cutPass1YPtetaphitpc[50];
114   AliFemtoCutMonitorParticleYPt *cutFail1YPtetaphitpc[50];
115   AliFemtoCutMonitorParticlePID *cutPass1PIDetaphitpc[50];
116   AliFemtoCutMonitorParticlePID *cutFail1PIDetaphitpc[50];
117   AliFemtoCutMonitorParticleYPt *cutPass2YPtetaphitpc[50];
118   AliFemtoCutMonitorParticleYPt *cutFail2YPtetaphitpc[50];
119   AliFemtoCutMonitorParticlePID *cutPass2PIDetaphitpc[50];
120   AliFemtoCutMonitorParticlePID *cutFail2PIDetaphitpc[50];
121   //   AliFemtoPairCutAntiGamma      *sqpcetaphitpcdiff[10*3];
122   //   AliFemtoShareQualityTPCEntranceSepPairCut      *sqpcetaphitpcsame[10*3];
123   //AliFemtoPairCutAntiGamma      *sqpcetaphitpc[10*3];
124   AliFemtoPairCutRadialDistance      *sqpcetaphitpc[50];
125   //  AliFemtoChi2CorrFctn          *cchiqinvetaphitpc[20*2];
126   AliFemtoKTPairCut             *ktpcuts[50*2];
127   AliFemtoCorrFctnDirectYlm     *cylmtpc[50];
128   AliFemtoCorrFctnDirectYlm     *cylmkttpc[50*2];
129   AliFemtoCorrFctnDirectYlm     *cylmetaphitpc[10*3];
130   AliFemtoQinvCorrFctn          *cqinvkttpc[50*2];
131   AliFemtoQinvCorrFctn          *cqinvtpc[50];
132   AliFemtoCorrFctnNonIdDR       *ckstartpc[50];
133   AliFemtoCorrFctnNonIdDR       *ckstarkttpc[50*2];
134   AliFemtoCorrFctnDEtaDPhi      *cdedpetaphi[50*2];
135   AliFemtoAvgSepCorrFctn          *cAvgSeptpc[50];
136
137   //   AliFemtoCorrFctn3DLCMSSym     *cq3dlcmskttpc[20*2];
138   //   AliFemtoCorrFctnTPCNcls       *cqinvnclstpc[20];
139   //   AliFemtoShareQualityCorrFctn  *cqinvsqtpc[20*10];
140   //   AliFemtoChi2CorrFctn          *cqinvchi2tpc[20];
141     AliFemtoTPCInnerCorrFctn      *cqinvinnertpc[50];
142
143   // *** Third QA task - HBT analysis with all pair cuts off, TPC only ***
144   // *** Begin pion-pion (positive) analysis ***
145   int aniter = 0;
146
147   for (int imult = 0; imult < numOfMultBins; imult++) {
148     if (runmults[imult]) {
149
150       for (int ichg = 0; ichg < numOfChTypes; ichg++) {
151         if (runch[ichg]) {
152
153           for (int iepvzero = 0; iepvzero < numOfEPvzero; iepvzero++) {
154             if (runepvzero[iepvzero]) {
155
156               aniter = imult * numOfChTypes + ichg * numOfEPvzero + iepvzero;
157               // aniter = ichg * numOfMultBins + imult * numOfEPvzero + iepvzero;
158
159               // cout << "aniter = " << aniter << endl;
160               //        aniter = ichg * numOfMultBins + imult;
161
162               // if (ichg == 2)
163               //        runshlcms = 0;
164               // else
165               //        runshlcms = 1;
166
167
168               //________________________
169
170               anetaphitpc[aniter] = new AliFemtoVertexMultAnalysis(8, -8.0, 8.0, 4, multbins[imult], multbins[imult+1]);
171               anetaphitpc[aniter]->SetNumEventsToMix(10);
172               anetaphitpc[aniter]->SetMinSizePartCollection(1);
173               anetaphitpc[aniter]->SetVerboseMode(kFALSE);
174
175               mecetaphitpc[aniter] = new AliFemtoBasicEventCut();
176               mecetaphitpc[aniter]->SetEventMult(0.001,100000);
177               mecetaphitpc[aniter]->SetVertZPos(-8,8);
178
179               if (iepvzero == 3)
180                 mecetaphitpc[aniter]->SetEPVZERO(epvzerobins[0],epvzerobins[3]);
181               else
182                 mecetaphitpc[aniter]->SetEPVZERO(epvzerobins[iepvzero],epvzerobins[iepvzero+1]);
183
184               // if (isrealdata)
185               //     mecetaphitpc[aniter]->SetAcceptOnlyPhysics(kTRUE);
186
187               // cutPassEvMetaphitpc[aniter] = new AliFemtoCutMonitorEventMult(Form("cutPass%stpcM%iPsi%i", chrgs[ichg], imult, iepvzero));
188               // cutFailEvMetaphitpc[aniter] = new AliFemtoCutMonitorEventMult(Form("cutFail%stpcM%iPsi%i", chrgs[ichg], imult, iepvzero));
189               // mecetaphitpc[aniter]->AddCutMonitor(cutPassEvMetaphitpc[aniter], cutFailEvMetaphitpc[aniter]);
190
191               // cutPassEvVetaphitpc[aniter] = new AliFemtoCutMonitorEventVertex(Form("cutPass%stpcM%i", chrgs[ichg], imult));
192               // cutFailEvVetaphitpc[aniter] = new AliFemtoCutMonitorEventVertex(Form("cutFail%stpcM%i", chrgs[ichg], imult));
193               // mecetaphitpc[aniter]->AddCutMonitor(cutPassEvVetaphitpc[aniter], cutFailEvVetaphitpc[aniter]);
194
195               dtc1etaphitpc[aniter] = new AliFemtoESDTrackCut();
196               dtc2etaphitpc[aniter] = new AliFemtoESDTrackCut();
197
198               if (ichg == 0) {
199                 dtc1etaphitpc[aniter]->SetCharge(1.0);
200                 dtc1etaphitpc[aniter]->SetPt(0.7,4.0);
201               }
202               else if (ichg == 1) {
203                 dtc1etaphitpc[aniter]->SetCharge(-1.0);
204                 dtc1etaphitpc[aniter]->SetPt(0.7,4.0);
205               }
206               else if (ichg == 2) {
207                 dtc1etaphitpc[aniter]->SetCharge(-1.0);
208                 dtc2etaphitpc[aniter]->SetCharge(1.0);
209                 dtc1etaphitpc[aniter]->SetPt(0.7,4.0);
210                 dtc2etaphitpc[aniter]->SetPt(0.7,4.0);
211               }
212
213               dtc1etaphitpc[aniter]->SetEta(-0.8,0.8);
214               dtc1etaphitpc[aniter]->SetMass(ProtonMass);
215               dtc1etaphitpc[aniter]->SetMostProbableProton();
216               dtc1etaphitpc[aniter]->SetNsigma(3.0);
217               //dtc1etaphitpc[aniter]->SetNsigma(2.0);
218               dtc1etaphitpc[aniter]->SetNsigmaTPCTOF(kTRUE);
219               //dtc1etaphitpc[aniter]->SetNsigmaTPConly(kTRUE);
220
221               if (ichg == 2) {
222                 dtc2etaphitpc[aniter]->SetEta(-0.8,0.8);
223                 dtc2etaphitpc[aniter]->SetMass(ProtonMass);
224                 dtc2etaphitpc[aniter]->SetMostProbableProton();
225                 dtc2etaphitpc[aniter]->SetNsigma(3.0);
226                 //dtc2etaphitpc[aniter]->SetNsigma(2.0);
227                 dtc2etaphitpc[aniter]->SetNsigmaTPCTOF(kTRUE);
228                 //dtc2etaphitpc[aniter]->SetNsigmaTPConly(kTRUE);
229
230               }
231
232               // Track quality cuts
233
234               if (runtype == 0) {
235                 dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
236                 //          dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCrefit);
237                 //    dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kITSrefit);
238                 dtc1etaphitpc[aniter]->SetminTPCncls(80);
239                 dtc1etaphitpc[aniter]->SetRemoveKinks(kTRUE);
240                 dtc1etaphitpc[aniter]->SetLabel(kFALSE);
241                 //    dtc1etaphitpc[aniter]->SetMaxITSChiNdof(6.0);
242                 dtc1etaphitpc[aniter]->SetMaxTPCChiNdof(4.0);
243                 dtc1etaphitpc[aniter]->SetMaxImpactXY(0.2);
244                 //            dtc1etaphitpc[aniter]->SetMaxImpactXYPtDep(0.0182, 0.0350, -1.01);
245                 dtc1etaphitpc[aniter]->SetMaxImpactZ(0.15);
246                 //      dtc1etaphitpc[aniter]->SetMaxSigmaToVertex(6.0);
247               }
248               else if (runtype == 1) {
249                 //      dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
250                 //    dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCrefit);
251                 //          dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kITSrefit|AliESDtrack::kITSpureSA);
252                 //      dtc1etaphitpc[aniter]->SetminTPCncls(70);
253                 dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kITSrefit);
254                 dtc1etaphitpc[aniter]->SetRemoveKinks(kTRUE);
255                 dtc1etaphitpc[aniter]->SetLabel(kFALSE);
256                 //    dtc1etaphitpc[aniter]->SetMaxITSChiNdof(6.0);
257                 //      dtc1etaphitpc[aniter]->SetMaxTPCChiNdof(6.0);
258                 dtc1etaphitpc[aniter]->SetMaxImpactXY(0.2);
259                 dtc1etaphitpc[aniter]->SetMaxImpactZ(0.25);
260                 //      dtc1etaphitpc[aniter]->SetMaxSigmaToVertex(6.0);
261               }
262               else if (runtype == 2) {
263                 //dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
264                 dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCin);
265                 dtc1etaphitpc[aniter]->SetminTPCncls(80);
266                 dtc1etaphitpc[aniter]->SetRemoveKinks(kTRUE);
267                 dtc1etaphitpc[aniter]->SetLabel(kFALSE);
268                 dtc1etaphitpc[aniter]->SetMaxTPCChiNdof(4.0);
269                 //dtc1etaphitpc[aniter]->SetMaxImpactXY(0.1); // 2.4 0.1
270                 // dtc1etaphitpc[aniter]->SetMaxImpactXYPtDep(0.0205, 0.035, -1.1);     //      DCA xy
271                 dtc1etaphitpc[aniter]->SetMaxImpactXYPtDep(0.018, 0.035, -1.01);     //      DCA xy
272                 dtc1etaphitpc[aniter]->SetMaxImpactZ(0.15); // 2.0 0.1
273
274                 if (ichg == 2) {
275                   //dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
276                   dtc2etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCin);
277                   dtc2etaphitpc[aniter]->SetminTPCncls(80);
278                   dtc2etaphitpc[aniter]->SetRemoveKinks(kTRUE);
279                   dtc2etaphitpc[aniter]->SetLabel(kFALSE);
280                   dtc2etaphitpc[aniter]->SetMaxTPCChiNdof(4.0);
281                   //dtc2etaphitpc[aniter]->SetMaxImpactXY(0.1); // 2.4 0.1
282                   // dtc2etaphitpc[aniter]->SetMaxImpactXYPtDep(0.0205, 0.035, -1.1);     //      DCA xy
283                   dtc2etaphitpc[aniter]->SetMaxImpactXYPtDep(0.018, 0.035, -1.01);     //      DCA xy
284                   dtc2etaphitpc[aniter]->SetMaxImpactZ(0.15); // 2.0 0.1
285                 }
286
287               }
288
289               // cutPass1YPtetaphitpc[aniter] = new AliFemtoCutMonitorParticleYPt(Form("cutPass1%stpcM%iPsi%i", chrgs[ichg], imult, iepvzero),ProtonMass);
290               // cutFail1YPtetaphitpc[aniter] = new AliFemtoCutMonitorParticleYPt(Form("cutFail1%stpcM%iPsi%i", chrgs[ichg], imult, iepvzero),ProtonMass);
291               // dtc1etaphitpc[aniter]->AddCutMonitor(cutPass1YPtetaphitpc[aniter], cutFail1YPtetaphitpc[aniter]);
292
293               // cutPass1PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutPass1%stpcM%iPsi%i", chrgs[ichg], imult, iepvzero),2);//0-pion,1-kaon,2-proton
294               // cutFail1PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutFail1%stpcM%iPsi%i", chrgs[ichg], imult , iepvzero),2);
295               // dtc1etaphitpc[aniter]->AddCutMonitor(cutPass1PIDetaphitpc[aniter], cutFail1PIDetaphitpc[aniter]);
296
297               // if (ichg == 2){
298               //     cutPass2PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutPass2%stpcM%i", chrgs[ichg], imult),2);//0-pion,1-kaon,2-proton
299               //     cutFail2PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutFail2%stpcM%i", chrgs[ichg], imult),2);
300               //     dtc2etaphitpc[aniter]->AddCutMonitor(cutPass2PIDetaphitpc[aniter], cutFail2PIDetaphitpc[aniter]);
301               // }
302
303               // sqpcetaphitpc[aniter] = new AliFemtoPairCutAntiGamma();
304               sqpcetaphitpc[aniter] = new AliFemtoPairCutRadialDistance();
305
306               if (runtype == 0) {
307                 sqpcetaphitpc[aniter]->SetShareQualityMax(1.0);
308                 sqpcetaphitpc[aniter]->SetShareFractionMax(0.05);
309                 sqpcetaphitpc[aniter]->SetRemoveSameLabel(kFALSE);
310                 // sqpcetaphitpc[aniter]->SetMaxEEMinv(0.0);
311                 // sqpcetaphitpc[aniter]->SetMaxThetaDiff(0.0);
312                 //          sqpcetaphitpc[aniter]->SetTPCEntranceSepMinimum(1.5);
313                 //sqpcetaphitpc[aniter]->SetRadialDistanceMinimum(0.12, 0.03);
314                 //          sqpcetaphitpc[aniter]->SetEtaDifferenceMinimum(0.02);
315               }
316               else if (runtype == 1) {
317                 sqpcetaphitpc[aniter]->SetShareQualityMax(1.0);
318                 sqpcetaphitpc[aniter]->SetShareFractionMax(1.05);
319                 sqpcetaphitpc[aniter]->SetRemoveSameLabel(kFALSE);
320                 // sqpcetaphitpc[aniter]->SetMaxEEMinv(0.002);
321                 // sqpcetaphitpc[aniter]->SetMaxThetaDiff(0.008);
322                 //          sqpcetaphitpc[aniter]->SetTPCEntranceSepMinimum(5.0);
323                 //sqpcetaphitpc[aniter]->SetRadialDistanceMinimum(1.2, 0.03);
324                 //          sqpcetaphitpc[aniter]->SetEtaDifferenceMinimum(0.02);
325               }
326               else if (runtype == 2) {
327                 //sqpcetaphitpc[aniter]->SetUseAOD(kTRUE);
328
329                 sqpcetaphitpc[aniter]->SetShareQualityMax(1.0);
330                 sqpcetaphitpc[aniter]->SetShareFractionMax(0.05);
331                 sqpcetaphitpc[aniter]->SetRemoveSameLabel(kFALSE);
332
333                 //          if (gammacut == 0) {
334                 //sqpcetaphitpc[aniter]->SetMaxEEMinv(0.0);
335                 //sqpcetaphitpc[aniter]->SetMaxThetaDiff(0.0);
336                 //}
337                 //else if (gammacut == 1) {
338                 //sqpcetaphitpc[aniter]->SetMaxEEMinv(0.002);
339                 //sqpcetaphitpc[aniter]->SetMaxThetaDiff(0.008);
340                 //}
341
342                 // sqpcetaphitpc[aniter]->SetMagneticFieldSign(-1); // field1 -1, field3 +1
343                 // sqpcetaphitpc[aniter]->SetMinimumRadius(0.8); // biggest inefficiency for R=1.1 m (checked on small sample)
344
345                 // sqpcetaphitpc[aniter]->SetMinimumRadius(1.2); //0.8
346                 // sqpcetaphitpc[aniter]->SetPhiStarMin(kFALSE);
347                 // sqpcetaphitpc[aniter]->SetPhiStarDifferenceMinimum(0.045); // 0.012 - pions, 0.017 - kaons, 0.018
348                 // sqpcetaphitpc[aniter]->SetEtaDifferenceMinimum(0.01); // 0.017 - pions, 0.015 - kaons
349
350               }
351
352               anetaphitpc[aniter]->SetEventCut(mecetaphitpc[aniter]);
353
354               if (ichg == 2) {
355                 anetaphitpc[aniter]->SetFirstParticleCut(dtc1etaphitpc[aniter]);
356                 anetaphitpc[aniter]->SetSecondParticleCut(dtc2etaphitpc[aniter]);
357               }
358               else {
359                 anetaphitpc[aniter]->SetFirstParticleCut(dtc1etaphitpc[aniter]);
360                 anetaphitpc[aniter]->SetSecondParticleCut(dtc1etaphitpc[aniter]);
361               }
362
363               anetaphitpc[aniter]->SetPairCut(sqpcetaphitpc[aniter]);
364
365
366               if (ichg == 2) {
367                 ckstartpc[aniter] = new AliFemtoCorrFctnNonIdDR(Form("ckstar%stpcM%iPsi%i", chrgs[ichg], imult, iepvzero),nbinssh,0.0,shqmax);
368                 anetaphitpc[aniter]->AddCorrFctn(ckstartpc[aniter]);
369               }
370               else {
371
372                 cqinvtpc[aniter] = new AliFemtoQinvCorrFctn(Form("cqinv%stpcM%iPsi%i", chrgs[ichg], imult, iepvzero),2*nbinssh,0.0,2*shqmax);
373                 anetaphitpc[aniter]->AddCorrFctn(cqinvtpc[aniter]);
374
375               }
376
377               cylmtpc[aniter] = new AliFemtoCorrFctnDirectYlm(Form("cylm%stpcM%i", chrgs[ichg], imult),2,nbinssh, 0.0,shqmax,runshlcms);
378               anetaphitpc[aniter]->AddCorrFctn(cylmtpc[aniter]);
379
380
381               cAvgSeptpc[aniter] = new AliFemtoAvgSepCorrFctn(Form("cAvgSep%stpcM%iPsi%i", chrgs[ichg], imult, iepvzero),4*nbinssh,0.0,200);
382               anetaphitpc[aniter]->AddCorrFctn(cAvgSeptpc[aniter]);
383
384               cqinvinnertpc[aniter] = new AliFemtoTPCInnerCorrFctn(Form("cqinvinner%stpcM%d", chrgs[ichg], imult),nbinssh,0.0,shqmax);
385               cqinvinnertpc[aniter]->SetRadius(1.2);
386               anetaphitpc[aniter]->AddCorrFctn(cqinvinnertpc[aniter]);
387
388
389               if (runktdep) {
390                 int ktm;
391                 for (int ikt=0; ikt<numOfkTbins; ikt++) {
392
393                   ktm = aniter * numOfkTbins + ikt;
394                   ktpcuts[ktm] = new AliFemtoKTPairCut(ktrng[ikt], ktrng[ikt+1]);
395
396
397                   cylmkttpc[ktm] = new AliFemtoCorrFctnDirectYlm(Form("cylm%stpcM%ikT%i", chrgs[ichg], imult, ikt),2,nbinssh,0.0,shqmax,runshlcms);
398                   cylmkttpc[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
399                   anetaphitpc[aniter]->AddCorrFctn(cylmkttpc[ktm]);
400
401                   if (ichg == 2) {
402                     ckstarkttpc[ktm] = new AliFemtoCorrFctnNonIdDR(Form("ckstar%stpcM%iPsi%ikT%i", chrgs[ichg], imult, iepvzero, ikt),nbinssh,0.0,shqmax);
403                     ckstarkttpc[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
404                     anetaphitpc[aniter]->AddCorrFctn(ckstarkttpc[ktm]);
405
406
407                   }
408                   else {
409                     cqinvkttpc[ktm] = new AliFemtoQinvCorrFctn(Form("cqinv%stpcM%iPsi%ikT%i", chrgs[ichg], imult, iepvzero, ikt),2*nbinssh,0.0,2*shqmax);
410                     cqinvkttpc[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
411                     anetaphitpc[aniter]->AddCorrFctn(cqinvkttpc[ktm]);
412                   }
413
414                   //          cqinvsqtpc[ktm] = new AliFemtoShareQualityCorrFctn(Form("cqinvsq%stpcM%ikT%i", chrgs[ichg], imult, ikt),nbinssh,0.0,shqmax);
415                   //          cqinvsqtpc[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
416                   //          anetaphitpc[aniter]->AddCorrFctn(cqinvsqtpc[ktm]);
417
418                   // cqinvinnertpc[ktm] = new AliFemtoTPCInnerCorrFctn(Form("cqinvinner%stpcM%ikT%i", chrgs[ichg], imult, ikt),nbinssh,0.0,shqmax);
419                   // cqinvinnertpc[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
420                   // cqinvinnertpc[ktm]->SetRadius(1.2);
421                   // anetaphitpc[aniter]->AddCorrFctn(cqinvinnertpc[ktm]);
422
423                   //          if (run3d) {
424                   //            cq3dlcmskttpc[ktm] = new AliFemtoCorrFctn3DLCMSSym(Form("cq3d%stpcM%ikT%i", chrgs[ichg], imult, ikt),60,(imult>3)?((imult>6)?((imult>7)?0.6:0.4):0.25):0.15);
425                   //            cq3dlcmskttpc[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
426                   //            anetaphitpc[aniter]->AddCorrFctn(cq3dlcmskttpc[ktm]);
427                   //          }
428                 }
429               }
430
431               // cdedpetaphi[aniter] = new AliFemtoCorrFctnDEtaDPhi(Form("cdedp%stpcM%i", chrgs[ichg], imult),240, 240);
432               // anetaphitpc[aniter]->AddCorrFctn(cdedpetaphi[aniter]);
433
434               Manager->AddAnalysis(anetaphitpc[aniter]);
435             }
436           }
437         }
438       }
439     }
440   }
441
442
443 // *** End pion-pion (positive) analysis
444
445
446   return Manager;
447 }