4 #include "AliHBTAnalysis.h"
8 #include "AliReaderESD.h"
9 #include "AliReaderKineTree.h"
11 #include "AliAODPairCut.h"
12 #include "AliHBTQResolutionFctns.h"
13 #include "AliHBTQDistributionFctns.h"
14 #include "AliHBTTwoTrackEffFctn.h"
15 #include "AliHBTCorrelFctn.h"
16 #include "AliHBTLLWeights.h"
17 #include "AliHBTWeightTheorFctn.h"
19 #include "TObjString.h"
23 #include "AliHBTMonDistributionFctns.h"
24 #include "AliHBTMonResolutionFctns.h"
28 void hbtanalysis(Option_t* datatype, Option_t* processopt="TracksAndParticles",
29 Int_t first = -1,Int_t last = -1,
30 char *outfile = "hbtanalysis.root")
33 AliVAODParticle::SetDebug(0);
34 AliLoader::SetDebug(0);
37 AliAODParticleCut c2 = c1;
40 //Anlyzes TPC recontructed tracks and simulated particles that corresponds to them
42 //datatype defines type of data to be read
43 // Kine - analyzes Kine Tree: simulated particles
44 // TPC - analyzes TPC tracking + particles corresponding to these tracks
45 // ITSv1 - analyzes ITSv1 ----------------------//--------------------------
46 // ITSv2 - analyzes ITSv2 ----------------------//--------------------------
48 //processopt defines option passed to AliHBTAnlysis::Process method
49 // default: TracksAndParticles - process both recontructed tracks and sim. particles corresponding to them
50 // Tracks - process only recontructed tracks
51 // Particles - process only simulated particles
53 //Reads data from diroctories from first to last(including)
54 // For examples if first=3 and last=5 it reads from
58 //if first or last is negative (or both), it reads from current directory
60 //these names I use when analysis is done directly from CASTOR files via RFIO
61 // const char* basedir="rfio:/castor/cern.ch/user/s/skowron/";
62 // const char* serie="standard";
63 // const char* field = "0.4";
65 const char* basedir=".";
67 const char* field = "";
69 Bool_t threeDcuts = kFALSE;
71 // Dynamically link some shared libs
72 // gROOT->LoadMacro("loadlibs.C");
75 gSystem->Load("$(ALICE_ROOT)/lib/tgt_$(ALICE_TARGET)/libHBTAN");
78 /***********************************************************/
79 //Create analysis and reader
80 AliHBTAnalysis * analysis = new AliHBTAnalysis();
81 analysis->SetCutsOnTracks();
84 Int_t kine = strcmp(datatype,"Kine");
85 Int_t ESD = strcmp(datatype,"ESD");
86 Int_t intern = strcmp(datatype,"Intern");
90 reader = new AliReaderKineTree();
91 processopt="Particles"; //this reader by definition reads only simulated particles
95 AliReaderESD* esdreader = new AliReaderESD();
96 esdreader->MustTPC(kTRUE);
97 esdreader->ReadSimulatedData(kTRUE);
98 esdreader->SetNumberOfTrackPoints(5,30.);
99 esdreader->SetClusterMap();
104 cerr<<"Option "<<datatype<<" not recognized. Exiting"<<endl;
109 if ( (first >= 0) && (last>=0) && ( (last-first)>=0 ) )
110 {//read from many dirs dirs
112 dirs = new TObjArray(last-first+1);
113 for (Int_t i = first; i<=last; i++)
115 sprintf(buff,"%s/%s/%s/%d",basedir,field,serie,i);
116 TObjString *odir= new TObjString(buff);
120 reader->SetDirs(dirs);
122 /***********************************************************/
123 /***** R E A D E R ***************************************/
124 /***********************************************************/
126 //we want have only low pt pi+ so set a cut to reader
127 AliAODParticleCut* readerpartcut= new AliAODParticleCut();
128 readerpartcut->SetPtRange(0.0,10.0);
129 readerpartcut->SetPID(kPiPlus);
130 reader->AddParticleCut(readerpartcut);//read this particle type with this cut
132 // readerpartcut->SetPtRange(0.0,10.0);
133 // readerpartcut->SetPID(kPiMinus);
134 // reader->AddParticleCut(readerpartcut);//read this particle type with this cut
136 analysis->SetReader(reader);
138 AliAODPairCut *paircut = new AliAODPairCut();
139 Float_t qinvmin = 0.0;
140 Float_t qinvmax = 0.05;//50MeV
141 paircut->SetQInvRange(qinvmin,qinvmax);
143 // paircut->SetAvSeparationRange(10.); //AntiMerging
144 paircut->SetClusterOverlapRange(-.5,1.0);//AntiSplitting
146 // AliVAODParticleCut* partcut= new AliVAODParticleCut();
147 // partcut->SetPID(kPiPlus);
148 // paircut->SetFirstPartCut(partcut);
149 // partcut->SetPID(kPiMinus);
150 // paircut->SetSecondPartCut(partcut);
152 analysis->SetGlobalPairCut(paircut);
154 /***********************************************************/
155 /***** W E I G H T S ******************************/
156 /***********************************************************/
158 AliHBTLLWeights::Instance()->SetParticlesTypes(kPiPlus,kPiPlus);
159 AliHBTLLWeights::Instance()->SetColoumb(kFALSE);
160 AliHBTLLWeights::Instance()->SetStrongInterSwitch(kFALSE);
162 AliHBTLLWeights::Instance()->SetRandomPosition(kFALSE);
163 //AliHBTLLWeights::Instance()->SetR1dw(8.0);
165 AliHBTLLWeights::Instance()->Init();
166 AliHBTLLWeights::Instance()->Set();
169 AliHBTWeightTheorQInvFctn *wqinvcfP = new AliHBTWeightTheorQInvFctn(100,qinvmax);
170 wqinvcfP->SetNumberOfBinsToScale(30);
171 wqinvcfP->Rename("wqinvcfP","Lednicky Q_{inv} Theoretical Correlation Function");
172 analysis->AddParticleFunction(wqinvcfP);
174 /************************************************************/
175 /**** Q INV Correlation Function ************************/
176 /************************************************************/
179 AliHBTQInvCorrelFctn * qinvcfT = new AliHBTQInvCorrelFctn(100,qinvmax);
180 AliHBTQInvCorrelFctn * qinvcfP = new AliHBTQInvCorrelFctn(100,qinvmax);
182 analysis->AddTrackFunction(qinvcfT);
183 analysis->AddParticleFunction(qinvcfP);
186 qinvcfP->Rename("qinvcfP","Particle (simulated) Qinv CF \\pi^{+} \\pi^{+}");
187 qinvcfT->Rename("qinvcfT","Track (recontructed) Qinv CF \\pi^{+} \\pi^{+}");
189 /************************************************************/
190 /**** Q OUT Correlation Function ************************/
191 /************************************************************/
193 AliHBTQOutLCMSCorrelFctn* qoutP = new AliHBTQOutLCMSCorrelFctn();
194 qoutP->Rename("qoutP","Particle (simulated) Q_{out} CF \\pi^{+} \\pi^{+}");
195 AliHBTQOutLCMSCorrelFctn* qoutT = new AliHBTQOutLCMSCorrelFctn();
196 qoutT->Rename("qoutT","Track (recontructed) Q_{out} CF \\pi^{+} \\pi^{+}");
198 AliAODPairCut *outPairCut = new AliAODPairCut();
199 outPairCut->SetQOutCMSLRange(0.0,0.15);
200 outPairCut->SetQSideCMSLRange(0.0,0.02);
201 outPairCut->SetQLongCMSLRange(0.0,0.02);
202 qoutP->SetPairCut(outPairCut);
203 qoutT->SetPairCut(outPairCut);
205 //analysis->AddTrackFunction(qoutP);
206 //analysis->AddParticleFunction(qoutT);
208 /************************************************************/
209 /**** Q SIDE Correlation Function ***********************/
210 /************************************************************/
212 AliHBTQSideLCMSCorrelFctn* qsideP = new AliHBTQSideLCMSCorrelFctn(100,qinvmax);
213 qsideP->Rename("qsideP","Particle (simulated) Q_{side} CF \\pi^{+} \\pi^{+}");
214 AliHBTQSideLCMSCorrelFctn* qsideT = new AliHBTQSideLCMSCorrelFctn(100,qinvmax);
215 qsideT->Rename("qsideT","Track (recontructed) Q_{side} CF \\pi^{+} \\pi^{+}");
217 AliAODPairCut *sidePairCut = new AliAODPairCut();
218 sidePairCut->SetQOutCMSLRange(0.0,0.02);
219 sidePairCut->SetQSideCMSLRange(0.0,0.15);
220 sidePairCut->SetQLongCMSLRange(0.0,0.02);
221 qsideP->SetPairCut(sidePairCut);
222 qsideT->SetPairCut(sidePairCut);
224 //analysis->AddTrackFunction(qsideP);
225 //analysis->AddParticleFunction(qsideT);
227 /************************************************************/
228 /**** Q LONG Correlation Function ***********************/
229 /************************************************************/
231 AliHBTQLongLCMSCorrelFctn* qlongP = new AliHBTQLongLCMSCorrelFctn(100,qinvmax);
232 qlongP->Rename("qlongP","Particle (simulated) Q_{long} CF \\pi^{+} \\pi^{+}");
233 AliHBTQLongLCMSCorrelFctn* qlongT = new AliHBTQLongLCMSCorrelFctn(100,qinvmax);
234 qlongT->Rename("qlongT","Track (recontructed) Q_{long} CF \\pi^{+} \\pi^{+}");
236 AliAODPairCut *longPairCut = new AliAODPairCut();
237 longPairCut->SetQOutCMSLRange(0.0,0.02);
238 longPairCut->SetQSideCMSLRange(0.0,0.02);
239 longPairCut->SetQLongCMSLRange(0.0,0.15);
240 qlongP->SetPairCut(longPairCut);
241 qlongT->SetPairCut(longPairCut);
243 //analysis->AddTrackFunction(qlongT);
244 //analysis->AddParticleFunction(qlongT);
247 /************************************************************/
248 /************************************************************/
249 /************************************************************/
250 /**** R E S O L U T I O N S ***********************/
251 /************************************************************/
252 /************************************************************/
253 /************************************************************/
257 AliHBTQInvResolVsKtFctn qinvVsktF(200,1.0,0.0,300,0.015,-0.015); //QInvLCMS Res Vs Kt
258 if (threeDcuts) qinvVsktF.SetPairCut(paircut);
259 //analysis->AddResolutionFunction(&qinvVsktF);
261 AliHBTQOutResolVsKtFctn qoutVsktF(200,1.0,0.0,300,0.05,-0.05); //QOutLCMS Res Vs Kt
262 if (threeDcuts) qoutVsktF.SetPairCut(outPairCut);
263 //analysis->AddResolutionFunction(&qoutVsktF);
265 AliHBTQSideResolVsKtFctn qsideVsktF(200,1.0,0.0,300,0.015,-0.015); //QSideLCMS Res Vs Kt
266 if (threeDcuts) qsideVsktF.SetPairCut(sidePairCut);
267 //analysis->AddResolutionFunction(&qsideVsktF);
269 AliHBTQLongResolVsKtFctn qlongVsktF(200,1.0,0.0,300,0.015,-0.015); //QLongLCMS Res Vs Kt
270 if (threeDcuts) qlongVsktF.SetPairCut(longPairCut);
271 //analysis->AddResolutionFunction(&qlongVsktF);
273 AliHBTQInvResolVsQInvFctn qInvVsqinvF(200,qinvmax,qinvmin,300,0.015,-0.015); //QInvLCMS Res Vs QInvLCMS
274 //analysis->AddResolutionFunction(&qInvVsqinvF);
276 AliHBTQOutResolVsQInvFctn qoutVsqinvF(200,qinvmax,qinvmin,300,0.05,-0.05); //QOutLCMS Res Vs QInvLCMS
277 if (threeDcuts) qoutVsqinvF.SetPairCut(outPairCut);
278 //analysis->AddResolutionFunction(&qoutVsqinvF);
280 AliHBTQSideResolVsQInvFctn qsideVsqinvF(200,qinvmax,qinvmin,300,0.015,-0.015); //QSideLCMS Res Vs QInvLCMS
281 if (threeDcuts) qsideVsqinvF.SetPairCut(sidePairCut);
282 //analysis->AddResolutionFunction(&qsideVsqinvF);
284 AliHBTQLongResolVsQInvFctn qlongVsqinvF(200,qinvmax,qinvmin,300,0.015,-0.015); //QLongLCMS Res Vs QInvLCMS
285 if (threeDcuts) qlongVsqinvF.SetPairCut(longPairCut);
286 //analysis->AddResolutionFunction(&qlongVsqinvF);
289 AliHBTPairThetaResolVsQInvFctn pairThetaVsqinv(200,qinvmax,qinvmin,300,0.015,-0.015);
290 if (threeDcuts) pairThetaVsqinv.SetPairCut(longPairCut);
291 //analysis->AddResolutionFunction(&pairThetaVsqinv);
293 AliHBTPairThetaResolVsKtFctn pairThetaVsKt(200,1.0,0.0,300,0.015,-0.015);
294 if (threeDcuts) pairThetaVsKt.SetPairCut(longPairCut);
295 //analysis->AddResolutionFunction(&pairThetaVsKt);
298 phipc.SetQLongCMSLRange(0.0,0.02);
300 AliHBTPairPhiResolVsQInvFctn pairPhiVsqinv(200,qinvmax,qinvmin,300,0.015,-0.015);
301 if (threeDcuts) pairPhiVsqinv.SetPairCut(&phipc);
302 //analysis->AddResolutionFunction(&pairPhiVsqinv);
304 AliHBTPairPhiResolVsKtFctn pairPhiVsKt(200,1.0,0.0,300,0.015,-0.015);
305 if (threeDcuts) pairPhiVsKt.SetPairCut(&phipc);
306 //analysis->AddResolutionFunction(&pairPhiVsKt);
309 AliHBTQOutResolVsQOutFctn qoutVsqoutF; //QOutLCMS Res Vs QOut
310 if (threeDcuts) qoutVsqoutF.SetPairCut(outPairCut);
311 //analysis->AddResolutionFunction(&qoutVsqoutF);
313 AliHBTQSideResolVsQSideFctn qsideVsqsideF;//QSideLCMS Res Vs QSide
314 if (threeDcuts) qsideVsqsideF.SetPairCut(sidePairCut);
315 //analysis->AddResolutionFunction(&qsideVsqsideF);
318 AliHBTQLongResolVsQLongFctn qlongVsqlongF;//QLongLCMS Res Vs QLong
319 if (threeDcuts) qlongVsqlongF.SetPairCut(longPairCut);
320 //analysis->AddResolutionFunction(&qlongVsqlongF);
323 /************************************************************/
324 /************************************************************/
325 /************************************************************/
326 /**** D I S T R B U T I O N S ***********************/
327 /************************************************************/
328 /************************************************************/
329 /************************************************************/
331 /************************************************************/
332 /**** OUT VS KT ***********************/
333 /************************************************************/
334 AliHBTQOutDistributionVsKtFctn qoutVsKtDistP;
335 qoutVsKtDistP.Rename("qoutVsKtDistP",qoutVsKtDistP.GetTitle());
336 AliHBTQOutDistributionVsKtFctn qoutVsKtDistT;
337 qoutVsKtDistT.Rename("qoutVsKtDistT",qoutVsKtDistT.GetTitle());
338 if (threeDcuts) qoutVsKtDistP.SetPairCut(outPairCut);
339 if (threeDcuts) qoutVsKtDistT.SetPairCut(outPairCut);
340 //analysis->AddParticleFunction(&qoutVsKtDistP);
341 //analysis->AddTrackFunction(&qoutVsKtDistT);
342 /************************************************************/
343 /**** Side VS KT ***********************/
344 /************************************************************/
345 AliHBTQSideDistributionVsKtFctn qSideVsKtDistP;
346 qSideVsKtDistP.Rename("qSideVsKtDistP",qSideVsKtDistP.GetTitle());
347 AliHBTQSideDistributionVsKtFctn qSideVsKtDistT;
348 qSideVsKtDistT.Rename("qSideVsKtDistT",qSideVsKtDistT.GetTitle());
349 if (threeDcuts) qSideVsKtDistP.SetPairCut(sidePairCut);
350 if (threeDcuts) qSideVsKtDistT.SetPairCut(sidePairCut);
351 //analysis->AddParticleFunction(&qSideVsKtDistP);
352 //analysis->AddTrackFunction(&qSideVsKtDistT);
353 /************************************************************/
354 /**** Long VS KT ***********************/
355 /************************************************************/
356 AliHBTQLongDistributionVsKtFctn qLongVsKtDistP;
357 qLongVsKtDistP.Rename("qLongVsKtDistP",qLongVsKtDistP.GetTitle());
358 AliHBTQLongDistributionVsKtFctn qLongVsKtDistT;
359 qLongVsKtDistT.Rename("qLongVsKtDistT",qLongVsKtDistT.GetTitle());
360 if (threeDcuts) qLongVsKtDistP.SetPairCut(longPairCut);
361 if (threeDcuts) qLongVsKtDistT.SetPairCut(longPairCut);
362 //analysis->AddParticleFunction(&qLongVsKtDistP);
363 //analysis->AddTrackFunction(&qLongVsKtDistT);
365 /************************************************************/
366 /************************************************************/
367 /************************************************************/
368 /**** M O N I T O R R E S O L U T I O N S *************/
369 /************************************************************/
370 /************************************************************/
371 /************************************************************/
373 AliHBTMonPxResolutionVsPtFctn PxVsPtResF(200,1.0,0.0,300,0.05,-0.05);
374 //analysis->AddParticleAndTrackMonitorFunction(&PxVsPtResF);
376 AliHBTMonPyResolutionVsPtFctn PyVsPtResF(200,1.0,0.0,300,0.05,-0.05);
377 //analysis->AddParticleAndTrackMonitorFunction(&PyVsPtResF);
379 AliHBTMonPzResolutionVsPtFctn PzVsPtResF(200,1.0,0.0,300,0.05,-0.05);
380 //analysis->AddParticleAndTrackMonitorFunction(&PzVsPtResF);
382 AliHBTMonPResolutionVsPtFctn PVsPtResF(200,1.0,0.0,300,0.05,-0.05);
383 //analysis->AddParticleAndTrackMonitorFunction(&PVsPtResF);
385 AliHBTMonPtResolutionVsPtFctn PtVsPtResF(400,4.0,0.0,300,0.07,-0.07);
386 analysis->AddParticleAndTrackMonitorFunction(&PtVsPtResF);
388 AliHBTMonPhiResolutionVsPtFctn PhiVsPtResF(200,1.0,0.0,300,0.02,-0.02);
389 analysis->AddParticleAndTrackMonitorFunction(&PhiVsPtResF);
391 AliHBTMonThetaResolutionVsPtFctn ThetaVsPtResF(200,1.0,0.0,300,0.02,-0.02);
392 analysis->AddParticleAndTrackMonitorFunction(&ThetaVsPtResF);
397 /************************************************************/
398 /**** P R O C E S S ***********************/
399 /************************************************************/
400 analysis->SetBufferSize(2);
401 analysis->SetCutsOnTracks();
403 analysis->Process(processopt);
405 TFile histoOutput(outfile,"recreate");
406 analysis->WriteFunctions();
412 delete readerpartcut;