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)/libHBTAnalysis");
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");
53 reader = new AliHBTReaderKineTree();
54 processopt="Particles"; //this reader by definition reads only simulated particles
58 reader = new AliHBTReaderTPC();
62 reader = new AliHBTReaderITSv1();
66 reader = new AliHBTReaderITSv2();
70 cerr<<"Option "<<datatype<<" not recognized. Exiting"<<endl;
75 if ( (first >= 0) && (last>=0) && ( (last-first)>=0 ) )
76 {//read from many dirs dirs
78 dirs = new TObjArray(last-first+1);
79 for (Int_t i = first; i<=last; i++)
81 sprintf(buff,"%s/%s/%s/%d",basedir,field,serie,i);
82 TObjString *odir= new TObjString(buff);
86 reader->SetDirs(dirs);
88 /***********************************************************/
90 //we want have only low pt pi+ so set a cut to reader
91 AliHBTParticleCut* readerpartcut= new AliHBTParticleCut();
92 readerpartcut->SetPtRange(0.0,1.5);
93 readerpartcut->SetPID(kPiPlus);
94 reader->AddParticleCut(readerpartcut);//read this particle type with this cut
96 analysis->SetReader(reader);
97 /************************************************************/
99 AliHBTPairCut *paircut = new AliHBTPairCut();
100 paircut->SetQInvRange(0.0,0.20);
101 analysis->SetGlobalPairCut(paircut);
103 AliHBTQInvCorrelFctn * qinvcfT= new AliHBTQInvCorrelFctn();
104 AliHBTQInvCorrelFctn * qinvcfP= new AliHBTQInvCorrelFctn();
106 analysis->AddTrackFunction(qinvcfT);
107 analysis->AddParticleFunction(qinvcfP);
109 analysis->Process(processopt);
111 qinvcfP->Rename("qinvcfP","Particle (simulated) Qinv CF \\pi^{+} \\pi^{+}");
112 qinvcfT->Rename("qinvcfT","Track (recontructed) Qinv CF \\pi^{+} \\pi^{+}");
114 TFile histoOutput(outfile,"recreate");
115 analysis->WriteFunctions();
121 delete readerpartcut;