forked from alisw/AliPhysics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAliKFParticleTest.C
More file actions
84 lines (66 loc) · 2.66 KB
/
Copy pathAliKFParticleTest.C
File metadata and controls
84 lines (66 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//---------------------------------------------------------------------------------
// The example of usage of AliKFParticle & AliKFVertex classes for V0 analysis
// .
// @author S.Gorbunov, I.Kisel
// @version 1.0
// @since 13.05.07
//
// The AliKFParticleTest macro contains a toy V0 finder for ESD tracks.
// At the first step, event primary vertex is reconstructed.
// At the second step, ideal PID hypothesis are assigned to all the particles.
// At the third step, V0 candidates are constructed for each pair
// of positive and negative particles.
// V0 candidate considered as good when it passes Chi^2 cut and
// it is placed >= 3 Sigma away from the primary vertex.
// Invariant mass distribution for all good V0 candidates is plotted.
//
// -= Copyright © ALICE HLT Group =-
//_________________________________________________________________________________
void AliKFParticleTest(const char *dirname="/d/alice09/sma/v4-05-Rev-03/charmwmi/", Int_t limit = 100)
{
UInt_t startsample = 1000;
cout <<"Using events : "<<dirname<<endl;
gSystem->AddIncludePath("-I\"$ALICE_ROOT/include\"");
gSystem->Load("libANALYSIS");
gSystem->Load("libANALYSISRL");
gROOT->LoadMacro("$ALICE_ROOT/STEER/AliKFParticleTest.h+");
//
// Setup chain
//
UInt_t nFile = 0;
UInt_t iFile = startsample-1;
TChain *chain = new TChain("esdTree");
while (nFile < limit)
{
iFile++;
TString pathFile (Form("%s%3.3d/AliESDs.root", dirname, iFile));
TFile * file = TFile::Open (pathFile.Data());
if (file == 0x0)continue;
cout<<"File "<<pathFile.Data()<<endl;
if (file->IsZombie ()){
cout<<"File "<<pathFile.Data()<<" is zombie"<<endl;
file->Close();
continue;
}
file->Close();
chain->Add (pathFile.Data());
nFile++;
}
cout << "Number of files : "<<nFile<<endl;
AliAnalysisManager *mgr = new AliAnalysisManager("testEvent");
AliAnalysisTask *task = new AliKFParticleTest("AliKFParticleTest");
// Create containers for input/output
AliAnalysisDataContainer *cinput = mgr->CreateContainer("input0", TChain::Class(), AliAnalysisManager::kInputContainer);
// Connect containers to the task input/outputs
cout << "Adding task " << task->GetName() << endl;
mgr->ConnectInput(task, 0, cinput);
AliAnalysisDataContainer *coutput =
mgr->CreateContainer("output0", TObjArray::Class(), AliAnalysisManager::kOutputContainer,Form("%s.root",task->GetName()));
mgr->ConnectOutput(task,0,coutput);
// Init analysis and start event loop
if (mgr->InitAnalysis()) {
mgr->PrintStatus();
mgr->StartAnalysis("local",chain);
}
delete mgr;
}