AddTimeStamp was always increasing track length but accounting
[u/mrichter/AliRoot.git] / ANALYSIS / analysis.C
CommitLineData
a5556ea5 1void analysis(Int_t first = -1, Int_t last = -1, const char* directory=".")
2{
3
4 gSystem->Load("$(ALICE_ROOT)/lib/tgt_$(ALICE_TARGET)/libANALYSIS");
5
afa8b37b 6 AliVAODParticle::SetDebug(0);
a5556ea5 7 AliRunAnalysis* analysis = new AliRunAnalysis();
8
9 ::Info("analysis.C","Setting dirs");
10 TObjArray* dirs=0;
11 if ( ((first >= 0) && (last >= 0) ) && ( (last-first)>=0 ) )
12 {//read from many dirs dirs
13 char buff[50];
14 dirs = new TObjArray(last-first+1);
15 for (Int_t i = first; i<=last; i++)
16 {
17// sprintf(buff,"%s/%s/%s/%05.5d",basedir,field,serie,i);
18 printf("%s/%d\n",directory,i);
19 sprintf(buff,"%s/%d",directory,i);
20 TObjString *odir= new TObjString(buff);
21 dirs->Add(odir);
22 }
23 }
24
efdb0cc9 25 AliReaderAOD* reader = new AliReaderAOD("AOD.root");
26 reader->SetDirs(dirs);
27// AliReaderESD* reader = new AliReaderESD(dirs);
28// reader->ReadSimulatedData(kTRUE);
29// reader->SetReadMostProbableOnly(kTRUE);
a5556ea5 30
31/*
32 //example PID cuts
33 AliAODParticleCut* partcut = new AliAODParticleCut();
34 partcut->SetPID(kPiPlus);//here we define the incarnation
35 AliAODPIDCut* pidcut = new AliAODPIDCut(kPiPlus,0.5);//accept all particles types that have PID prob > 50%
36 partcut->AddBasePartCut(pidcut);//
37 reader->AddParticleCut(partcut);//This guy makes a copy of a cut for himself so we can modify it here
38
39 partcut->SetPID(kPiMinus);//here we define that particle has incarnation PiMinus
40 pidcut->SetPID(kPiMinus);//here we define to check if PID probability of being kPiMinus is greater thann 0.5 (number defined few lines above)
41 reader->AddParticleCut(partcut);
42
43 pidcut->SetPID(kKPlus);
44 pidcut->SetPID(kKPlus);
45 reader->AddParticleCut(partcut);
46
47 pidcut->SetPID(kKMinus);
48 pidcut->SetPID(kKMinus);
49 reader->AddParticleCut(partcut);
50*/
51
52 AliFlowAnalysis* flow = new AliFlowAnalysis();
53 analysis->SetReader(reader);
54
55 analysis->Add(flow);
56 analysis->Run();
57 delete analysis;
58}