1 void hbtanalysis(Option_t* datatype, Option_t* processopt="TracksAndParticles",
2 Int_t first = -1,Int_t last = -1,
3 char *outfile = "hbtanalysis.root")
6 //Anlyzes TPC recontructed tracks and simulated particles that corresponds to them
8 //datatype defines type of data to be read
9 // Kine - analyzes Kine Tree: simulated particles
10 // TPC - analyzes TPC tracking + particles corresponding to these tracks
11 // ITSv1 - analyzes ITSv1 ----------------------//--------------------------
12 // ITSv2 - analyzes ITSv2 ----------------------//--------------------------
14 //processopt defines option passed to AliHBTAnlysis::Process method
15 // default: TracksAndParticles - process both recontructed tracks and sim. particles corresponding to them
16 // Tracks - process only recontructed tracks
17 // Particles - process only simulated particles
19 //Reads data from diroctories from first to last(including)
20 // For examples if first=3 and last=5 it reads from
24 //if first or last is negative (or both), it reads from current directory
26 //these names I use when analysis is done directly from CASTOR files via RFIO
27 // const char* basedir="rfio:/castor/cern.ch/user/s/skowron/";
28 // const char* serie="standard";
29 // const char* field = "0.4";
30 const char* basedir=".";
32 const char* field = "";
34 // Dynamically link some shared libs
35 gROOT->LoadMacro("loadlibs.C");
38 gSystem->Load("$(ALICE_ROOT)/lib/tgt_$(ALICE_TARGET)/libHBTAN");
41 /***********************************************************/
42 //Create analysis and reader
43 AliHBTAnalysis * analysis = new AliHBTAnalysis();
46 Int_t kine = strcmp(datatype,"Kine");
47 Int_t TPC = strcmp(datatype,"TPC");
48 Int_t ITSv1 = strcmp(datatype,"ITSv1");
49 Int_t ITSv2 = strcmp(datatype,"ITSv2");
50 Int_t intern = strcmp(datatype,"Intern");
54 reader = new AliHBTReaderKineTree();
55 processopt="Particles"; //this reader by definition reads only simulated particles
59 reader = new AliHBTReaderTPC();
63 reader = new AliHBTReaderITSv1();
67 reader = new AliHBTReaderITSv2();
71 reader = new AliHBTReaderInternal("Kine.sum.root");
75 cerr<<"Option "<<datatype<<" not recognized. Exiting"<<endl;
80 if ( (first >= 0) && (last>=0) && ( (last-first)>=0 ) )
81 {//read from many dirs dirs
83 dirs = new TObjArray(last-first+1);
84 for (Int_t i = first; i<=last; i++)
86 sprintf(buff,"%s/%s/%s/%d",basedir,field,serie,i);
87 TObjString *odir= new TObjString(buff);
91 reader->SetDirs(dirs);
93 /***********************************************************/
95 //we want have only low pt pi+ so set a cut to reader
96 AliHBTParticleCut* readerpartcut= new AliHBTParticleCut();
97 readerpartcut->SetPtRange(0.0,1.5);
98 readerpartcut->SetPID(kPiPlus);
99 reader->AddParticleCut(readerpartcut);//read this particle type with this cut
101 analysis->SetReader(reader);
102 /************************************************************/
104 AliHBTPairCut *paircut = new AliHBTPairCut();
105 paircut->SetQInvRange(0.0,0.20);
106 analysis->SetGlobalPairCut(paircut);
108 AliHBTQInvCorrelFctn * qinvcfT= new AliHBTQInvCorrelFctn();
109 AliHBTQInvCorrelFctn * qinvcfP= new AliHBTQInvCorrelFctn();
111 analysis->AddTrackFunction(qinvcfT);
112 analysis->AddParticleFunction(qinvcfP);
115 qinvcfP->Rename("qinvcfP","Particle (simulated) Qinv CF \\pi^{+} \\pi^{+}");
116 qinvcfT->Rename("qinvcfT","Track (recontructed) Qinv CF \\pi^{+} \\pi^{+}");
118 AliHBTQOutCMSLCCorrelFctn* qoutP = new AliHBTQOutCMSLCCorrelFctn();
119 qoutP->Rename("qoutP","Particle (simulated) Q_{out} CF \\pi^{+} \\pi^{+}");
120 AliHBTQOutCMSLCCorrelFctn* qoutT = new AliHBTQOutCMSLCCorrelFctn();
121 qoutT->Rename("qoutT","Track (recontructed) Q_{out} CF \\pi^{+} \\pi^{+}");
123 AliHBTPairCut *outPairCut = new AliHBTPairCut();
124 outPairCut->SetQOutCMSLRange(0.0,0.15);
125 outPairCut->SetQSideCMSLRange(0.0,0.02);
126 outPairCut->SetQLongCMSLRange(0.0,0.02);
127 qoutP->SetPairCut(outPairCut);
128 qoutT->SetPairCut(outPairCut);
130 AliHBTQSideCMSLCCorrelFctn* qsideP = new AliHBTQSideCMSLCCorrelFctn();
131 qsideP->Rename("qsideP","Particle (simulated) Q_{side} CF \\pi^{+} \\pi^{+}");
132 AliHBTQSideCMSLCCorrelFctn* qsideT = new AliHBTQSideCMSLCCorrelFctn();
133 qsideT->Rename("qsideT","Track (recontructed) Q_{side} CF \\pi^{+} \\pi^{+}");
135 AliHBTPairCut *sidePairCut = new AliHBTPairCut();
136 sidePairCut->SetQOutCMSLRange(0.0,0.02);
137 sidePairCut->SetQSideCMSLRange(0.0,0.15);
138 sidePairCut->SetQLongCMSLRange(0.0,0.02);
139 qsideP->SetPairCut(sidePairCut);
140 qsideT->SetPairCut(sidePairCut);
143 AliHBTQLongCMSLCCorrelFctn* qlongP = new AliHBTQLongCMSLCCorrelFctn();
144 qlongP->Rename("qlongP","Particle (simulated) Q_{long} CF \\pi^{+} \\pi^{+}");
145 AliHBTQLongCMSLCCorrelFctn* qlongT = new AliHBTQLongCMSLCCorrelFctn();
146 qlongT->Rename("qlongT","Track (recontructed) Q_{long} CF \\pi^{+} \\pi^{+}");
148 AliHBTPairCut *longPairCut = new AliHBTPairCut();
149 longPairCut->SetQOutCMSLRange(0.0,0.02);
150 longPairCut->SetQSideCMSLRange(0.0,0.02);
151 longPairCut->SetQLongCMSLRange(0.0,0.15);
152 qlongP->SetPairCut(longPairCut);
153 qlongT->SetPairCut(longPairCut);
155 analysis->AddTrackFunction(qoutP);
156 analysis->AddParticleFunction(qoutT);
158 analysis->AddTrackFunction(qsideP);
159 analysis->AddParticleFunction(qsideT);
161 analysis->AddTrackFunction(qlongT);
162 analysis->AddParticleFunction(qlongT);
165 analysis->Process(processopt);
167 TFile histoOutput(outfile,"recreate");
168 analysis->WriteFunctions();
174 delete readerpartcut;