Fixing new line ending
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / macros / Train / KchKch_MC_ESD / ConfigFemtoAnalysis.C
1
2 /*********************************************************************
3  *                                                                   *
4  * ConfigFemtoAnalysis.C - configuration macro for the femtoscopic   *
5  * analysis, meant as a QA process for two-particle effects          *
6  *                                                                   *
7  * Author: Adam Kisiel (Adam.Kisiel@cern.ch)                         *
8  *                                                                   *
9  *********************************************************************/
10
11 #if !defined(__CINT__) || defined(__MAKECINT_)
12 #include "AliFemtoManager.h"
13 #include "AliFemtoEventReaderESDChain.h"
14 #include "AliFemtoEventReaderESDChainKine.h"
15 #include "AliFemtoEventReaderAODChain.h"
16 #include "AliFemtoSimpleAnalysis.h"
17 #include "AliFemtoBasicEventCut.h"
18 #include "AliFemtoESDTrackCut.h"
19 #include "AliFemtoCorrFctn.h"
20 #include "AliFemtoCutMonitorParticleYPt.h"
21 #include "AliFemtoCutMonitorParticleVertPos.h"
22 #include "AliFemtoCutMonitorParticleMomRes.h"
23 #include "AliFemtoCutMonitorParticlePID.h"
24 #include "AliFemtoCutMonitorEventMult.h"
25 #include "AliFemtoCutMonitorEventVertex.h"
26 #include "AliFemtoShareQualityTPCEntranceSepPairCut.h"
27 #include "AliFemtoPairCutAntiGamma.h"
28 #include "AliFemtoPairCutRadialDistance.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 "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 "AliFemtoModelCorrFctn.h"
49 #include "AliFemtoCutMonitorParticlePtPDG.h"
50 #include "AliFemtoKTPairCut.h"
51 #include "AliFemtoCutMonitorCollections.h"
52 #endif
53  
54 //_  6 fm  pure kaons _(0.2-0.4)______________________________________________________________________
55 AliFemtoManager* ConfigFemtoAnalysis() {
56
57   double PionMass = 0.13956995;
58   double KaonMass = 0.493677;
59   double ProtonMass = 0.938272013;
60
61   //multiplicity bins
62   int runmults[10] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
63   int multbins[11] = {0.01, 200000, 400, 600, 900, 950, 500, 600, 700, 800, 900};
64
65   int runch[3] = {1, 1, 0};
66   const char *chrgs[3] = { "kk", "akak", "kak" };
67
68   int runktdep = 1;
69  // double ktrng[8] = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 1.0};
70   double ktrng[4] = {0.2, 0.4, 0.6, 1.0};
71
72   int run3d = 0; // Do 3D cartesian analysis?
73   int runshlcms = 1;
74
75   int nbinssh = 100;
76   double shqmax = 0.5;
77
78
79   AliFemtoEventReaderESDChainKine *Reader = new AliFemtoEventReaderESDChainKine();
80   Reader->SetKaonAnalysis(kTRUE);
81   //Reader->SetUseMultiplicity(AliFemtoEventReaderESDChainKine::kCentrality);
82   //Reader->SetReadTrackType(AliFemtoEventReaderESDChainKine::kGlobal);
83
84   // AliFemtoEventReaderKinematicsChain *Reader = new AliFemtoEventReaderKinematicsChain();
85   // Reader->SetUseMultiplicity(AliFemtoEventReaderKinematicsChain::kGlobalCount);
86   // // // Reader->SetReadTrackType(AliFemtoEventReaderESDChainKine::kGlobal);
87
88   AliFemtoModelGausRinvFreezeOutGenerator *tFreeze = new AliFemtoModelGausRinvFreezeOutGenerator();
89   tFreeze->SetSizeInv(5.0);
90
91  // AliFemtoModelWeightGeneratorLednicky *tWeight = new AliFemtoModelWeightGeneratorLednicky();
92   // tWeight->SetPairType(AliFemtoModelWeightGenerator::KaonPlusKaonPlus());
93    
94     AliFemtoModelWeightGeneratorBasic *tWeight = new AliFemtoModelWeightGeneratorBasic();
95         tWeight->SetPairType(AliFemtoModelWeightGenerator::KaonPlusKaonPlus());
96    
97  //////// tWeight->SetPairType(5);
98   //tWeight->SetPairType(1);
99
100   AliFemtoModelManager *tModelManager = new AliFemtoModelManager();
101   tModelManager->AcceptFreezeOutGenerator(tFreeze);
102   tModelManager->AcceptWeightGenerator(tWeight);
103   tModelManager->CreateCopyHiddenInfo(kFALSE);
104   //tModelManager->CreateCopyHiddenInfo(kTRUE);
105
106   AliFemtoManager* Manager=new AliFemtoManager();
107   Manager->SetEventReader(Reader);
108
109   AliFemtoVertexMultAnalysis    *anetaphitpc[30];
110   AliFemtoBasicEventCut         *mecetaphitpc[30];
111   AliFemtoCutMonitorEventMult   *cutPassEvMetaphitpc[30];
112   AliFemtoCutMonitorEventMult   *cutFailEvMetaphitpc[30];
113   AliFemtoCutMonitorEventVertex *cutPassEvVetaphitpc[30];
114   AliFemtoCutMonitorEventVertex *cutFailEvVetaphitpc[30];
115   AliFemtoCutMonitorCollections   *cutPassColletaphitpc[30];
116   AliFemtoCutMonitorCollections   *cutFailColletaphitpc[30];
117   AliFemtoESDTrackCut           *dtc1etaphitpc[30];
118   AliFemtoESDTrackCut           *dtc2etaphitpc[30];
119   AliFemtoCutMonitorParticleYPt *cutPass1YPtetaphitpc[30];
120   AliFemtoCutMonitorParticleYPt *cutFail1YPtetaphitpc[30];
121   AliFemtoCutMonitorParticlePID *cutPass1PIDetaphitpc[30];
122   AliFemtoCutMonitorParticlePID *cutFail1PIDetaphitpc[30];
123   AliFemtoCutMonitorParticleYPt *cutPass2YPtetaphitpc[30];
124   AliFemtoCutMonitorParticleYPt *cutFail2YPtetaphitpc[30];
125   AliFemtoCutMonitorParticlePID *cutPass2PIDetaphitpc[30];
126   AliFemtoCutMonitorParticlePID *cutFail2PIDetaphitpc[30];
127   //  AliFemtoPairCutAntiGamma      *sqpcetaphitpc[30];
128   AliFemtoShareQualityPairCut      *sqpcetaphitpc[30];
129   //AliFemtoPairCutRadialDistance      *sqpcetaphitpc[30];
130   AliFemtoModelCorrFctnDirectYlm     *cylmetaphitpc[30];
131   AliFemtoCorrFctnDEtaDPhi      *cdedpetaphi[30];
132   AliFemtoChi2CorrFctn          *cchiqinvetaphitpc[30];
133   AliFemtoKTPairCut             *ktpcuts[30*7];
134   AliFemtoModelCorrFctnDirectYlm     *cylmkttpc[30*7];
135   //AliFemtoModelQinvCorrFctn          *cqinvkttpc[30*7];
136   AliFemtoModelCorrFctnSource          *cqinvkttpc[30*7];
137 //  AliFemtoModelCorrFctn          *cqinvkttpc[30*7];
138   //AliFemtoModelCorrFctn3DLCMSSym     *cq3dlcmskttpc[30*7];
139   AliFemtoCorrFctnTPCNcls       *cqinvnclstpc[30];
140   AliFemtoShareQualityCorrFctn  *cqinvsqtpc[30*10];
141   AliFemtoChi2CorrFctn          *cqinvchi2tpc[30];
142   AliFemtoTPCInnerCorrFctn      *cqinvinnertpc[30*10];
143
144
145   // *** Begin pion-pion analysis ***
146   int aniter = 0;
147
148   for (int imult=0; imult<10; imult++) {
149     if (runmults[imult]) {
150       for (int ichg=0; ichg<3; ichg++) {
151         if (runch[ichg]) {
152           aniter = ichg*10+imult;
153
154           anetaphitpc[aniter] = new AliFemtoVertexMultAnalysis(10, -8.0, 8.0, 4, multbins[imult], multbins[imult+1]);
155           anetaphitpc[aniter]->SetNumEventsToMix(5);
156           anetaphitpc[aniter]->SetMinSizePartCollection(1);
157
158           mecetaphitpc[aniter] = new AliFemtoBasicEventCut();
159           mecetaphitpc[aniter]->SetEventMult(0,200000);
160           mecetaphitpc[aniter]->SetVertZPos(-8,8);
161
162
163           dtc1etaphitpc[aniter] = new AliFemtoESDTrackCut();
164           dtc2etaphitpc[aniter] = new AliFemtoESDTrackCut();
165
166
167     
168           if (ichg == 0) {
169             dtc1etaphitpc[aniter]->SetCharge(1.0);
170             dtc1etaphitpc[aniter]->SetPt(0.2,1.5);
171           }
172           else if (ichg == 1) {
173             dtc1etaphitpc[aniter]->SetCharge(-1.0);
174             dtc1etaphitpc[aniter]->SetPt(0.2,1.5);
175           }
176           else if (ichg == 2) {
177             dtc1etaphitpc[aniter]->SetCharge(-1.0);
178             dtc2etaphitpc[aniter]->SetCharge(1.0);
179             dtc1etaphitpc[aniter]->SetPt(0.2,1.5);
180             dtc2etaphitpc[aniter]->SetPt(0.2,1.5);
181           }
182
183           dtc1etaphitpc[aniter]->SetEta(-0.8,0.8);
184           dtc1etaphitpc[aniter]->SetMass(KaonMass);
185 //test          dtc1etaphitpc[aniter]->SetMostProbableKaon();
186 //test          dtc1etaphitpc[aniter]->SetNsigma(3.0);
187           //dtc1etaphitpc[aniter]->SetNsigma(2.0);
188 //test          dtc1etaphitpc[aniter]->SetNsigmaTPCTOF(kTRUE);
189           //dtc1etaphitpc[aniter]->SetNsigmaTPConly(kTRUE);
190
191           if (ichg == 2) {
192             dtc2etaphitpc[aniter]->SetEta(-0.8,0.8);
193             dtc2etaphitpc[aniter]->SetMass(KaonMass);
194 //test            dtc2etaphitpc[aniter]->SetMostProbableKaon();
195 //test            dtc2etaphitpc[aniter]->SetNsigma(3.0);
196             //dtc2etaphitpc[aniter]->SetNsigma(2.0);
197 //test            dtc2etaphitpc[aniter]->SetNsigmaTPCTOF(kTRUE);
198             //dtc2etaphitpc[aniter]->SetNsigmaTPConly(kTRUE);
199
200           }
201
202
203            dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCin);
204            dtc1etaphitpc[aniter]->SetminTPCncls(80);
205            dtc1etaphitpc[aniter]->SetRemoveKinks(kTRUE);
206            dtc1etaphitpc[aniter]->SetLabel(kFALSE);
207            dtc1etaphitpc[aniter]->SetMaxTPCChiNdof(4.0);
208            dtc1etaphitpc[aniter]->SetMaxImpactXY(2.4); // 2.4 0.1
209            dtc1etaphitpc[aniter]->SetMaxImpactZ(3.2); // 2.0 0.1
210
211            AliFemtoCutMonitorParticleYPt *cutPassYPtkp = new AliFemtoCutMonitorParticleYPt("cutPasskp", 0.493677);
212            AliFemtoCutMonitorParticleYPt *cutFailYPtkp = new AliFemtoCutMonitorParticleYPt("cutFailkp", 0.493677);
213            dtc1etaphitpc[aniter]->AddCutMonitor(cutPassYPtkp, cutFailYPtkp);
214
215            AliFemtoCutMonitorParticlePtPDG *cutPassPidkp = new AliFemtoCutMonitorParticlePtPDG("cutPasskp", 0.493677);
216            AliFemtoCutMonitorParticlePtPDG *cutFailPidkp = new AliFemtoCutMonitorParticlePtPDG("cutFailkp", 0.493677);
217            dtc1etaphitpc[aniter]->AddCutMonitor(cutPassPidkp, cutFailPidkp);
218
219            AliFemtoCutMonitorParticleMomRes *cutPassMRkp = new AliFemtoCutMonitorParticleMomRes("cutPasskp");
220            AliFemtoCutMonitorParticleMomRes *cutFailMRkp = new AliFemtoCutMonitorParticleMomRes("cutFailkp");
221            dtc1etaphitpc[aniter]->AddCutMonitor(cutPassMRkp, cutFailMRkp);
222
223
224           sqpcetaphitpc[aniter] = new AliFemtoShareQualityPairCut();
225           //sqpcetaphitpc[aniter] = new AliFemtoPairCutRadialDistance();
226           sqpcetaphitpc[aniter]->SetShareQualityMax(1.0);
227           sqpcetaphitpc[aniter]->SetShareFractionMax(0.05);
228           sqpcetaphitpc[aniter]->SetRemoveSameLabel(kFALSE);
229
230
231           anetaphitpc[aniter]->SetEventCut(mecetaphitpc[aniter]);
232           if (ichg == 2) {
233             anetaphitpc[aniter]->SetFirstParticleCut(dtc1etaphitpc[aniter]);
234             anetaphitpc[aniter]->SetSecondParticleCut(dtc2etaphitpc[aniter]);
235           }
236           else {
237             anetaphitpc[aniter]->SetFirstParticleCut(dtc1etaphitpc[aniter]);
238             anetaphitpc[aniter]->SetSecondParticleCut(dtc1etaphitpc[aniter]);
239           }
240
241           anetaphitpc[aniter]->SetPairCut(sqpcetaphitpc[aniter]);
242
243
244           //Qinv (without kT bins)
245           cqinvkttpc[aniter] = new AliFemtoModelCorrFctnSource(Form("cqinv%stpcM%i", chrgs[ichg], imult),nbinssh,0.0,shqmax);
246           //cqinvkttpc[aniter] = new AliFemtoModelCorrFctn(Form("cqinv%stpcM%i", chrgs[ichg], imult),nbinssh,0.0,shqmax);
247         //  ktpcuts[0] = new AliFemtoKTPairCut(0.2,0.4);
248          // cqinvkttpc[aniter]->SetPairSelectionCut(ktpcuts[0]);
249           cqinvkttpc[aniter]->ConnectToManager(tModelManager);
250           anetaphitpc[aniter]->AddCorrFctn(cqinvkttpc[aniter]);
251
252
253           if (runktdep) {
254             int ktm;
255             for (int ikt=0; ikt<3; ikt++) {
256               ktm = aniter*3 + ikt;
257               ktpcuts[ktm] = new AliFemtoKTPairCut(ktrng[ikt], ktrng[ikt+1]);
258
259               cqinvkttpc[ktm] = new AliFemtoModelCorrFctnSource(Form("cqinv%stpcM%ikT%i", chrgs[ichg], imult, ikt),nbinssh,0.0, shqmax);
260               cqinvkttpc[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
261               cqinvkttpc[ktm]->ConnectToManager(tModelManager);
262               anetaphitpc[aniter]->AddCorrFctn(cqinvkttpc[ktm]);
263
264               //if (run3d) {
265               //                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);
266               //cq3dlcmskttpc[ktm] = new AliFemtoModelCorrFctn3DLCMSSym(Form("cq3d%stpcM%ikT%i", chrgs[ichg], imult, ikt),60,0.5);
267               //cq3dlcmskttpc[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
268               //anetaphitpc[aniter]->AddCorrFctn(cq3dlcmskttpc[ktm]);
269               //}
270             }
271           }
272
273           //cdedpetaphi[aniter] = new AliFemtoCorrFctnDEtaDPhi(Form("cdedp%stpcM%i", chrgs[ichg], imult),39, 39);
274           //anetaphitpc[aniter]->AddCorrFctn(cdedpetaphi[aniter]);
275
276           Manager->AddAnalysis(anetaphitpc[aniter]);
277         }
278       }
279     }
280   }
281   // *** End pion-pion analysis
282
283   return Manager;
284 }