2 //---------------------------------------------------------------------------------
3 // The example of usage of AliKFParticle & AliKFVertex classes for V0 analysis
5 // @author S.Gorbunov, I.Kisel
9 // The AliKFParticleTest macro contains a toy V0 finder for ESD tracks.
10 // At the first step, event primary vertex is reconstructed.
11 // At the second step, ideal PID hypothesis are assigned to all the particles.
12 // At the third step, V0 candidates are constructed for each pair
13 // of positive and negative particles.
14 // V0 candidate considered as good when it passes Chi^2 cut and
15 // it is placed >= 3 Sigma away from the primary vertex.
16 // Invariant mass distribution for all good V0 candidates is plotted.
18 // -= Copyright © ALICE HLT Group =-
19 //_________________________________________________________________________________
22 void AliKFParticleTest(const char *dirname="/d/alice09/sma/v4-05-Rev-03/charmwmi/", Int_t limit = 100)
24 UInt_t startsample = 1000;
25 cout <<"Using events : "<<dirname<<endl;
27 gSystem->AddIncludePath("-I\"$ALICE_ROOT/include\"");
28 gSystem->Load("libANALYSIS.so");
29 gSystem->Load("libANALYSISRL.so");
30 gROOT->LoadMacro("$ALICE_ROOT/STEER/AliKFParticleTest.h+");
36 UInt_t iFile = startsample-1;
37 TChain *chain = new TChain("esdTree");
42 TString pathFile (Form("%s%3.3d/AliESDs.root", dirname, iFile));
43 TFile * file = TFile::Open (pathFile.Data());
44 if (file == 0x0)continue;
46 cout<<"File "<<pathFile.Data()<<endl;
48 if (file->IsZombie ()){
49 cout<<"File "<<pathFile.Data()<<" is zombie"<<endl;
55 chain->Add (pathFile.Data());
58 cout << "Number of files : "<<nFile<<endl;
61 AliAnalysisManager *mgr = new AliAnalysisManager("testEvent");
63 AliAnalysisTask *task = new AliKFParticleTest("AliKFParticleTest");
65 // Create containers for input/output
66 AliAnalysisDataContainer *cinput = mgr->CreateContainer("input0", TChain::Class(), AliAnalysisManager::kInputContainer);
68 // Connect containers to the task input/outputs
70 cout << "Adding task " << task->GetName() << endl;
72 mgr->ConnectInput(task, 0, cinput);
74 AliAnalysisDataContainer *coutput =
75 mgr->CreateContainer("output0", TObjArray::Class(), AliAnalysisManager::kOutputContainer,Form("%s.root",task->GetName()));
76 mgr->ConnectOutput(task,0,coutput);
78 // Init analysis and start event loop
79 if (mgr->InitAnalysis()) {
81 mgr->StartAnalysis("local",chain);