]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/macros/make_scan_results.C
Extra header added to the list
[u/mrichter/AliRoot.git] / EVE / macros / make_scan_results.C
1 // Label is used to store scanning result for tracks and trackelts.
2 //
3 // BIT(1) stores the original selection.
4 // BIT(0) stores the user selection (set to same value as b1 at init).
5 //
6 // This allows to check all possible combinations.
7
8 struct XXX
9 {
10   const char   *bname;
11   const char   *oname;
12   TBranch      *branch;
13   AliESDVertex *vert;
14 };
15
16 XXX vvv[3] = {
17   { "VT",   "PrimVertTracks" },
18   { "VTPC", "PrimVertTPC" },
19   { "VSPD", "PrimVertSPD" }
20 };
21
22 void make_scan_results()
23 {
24   TFile *f = TFile::Open("scan_results.root", "UPDATE");
25
26   f->Delete("SR;*");
27
28   T = new TTree("SR", "Scanning results");
29
30   TClonesArray* ts = new TClonesArray("AliESDtrack", 32);
31   TBranch * tb = T->Branch("T", &ts);
32   delete ts;
33
34   AliMultiplicity *ms = 0;
35   TBranch *mb = T->Branch("M", &ms);
36
37   for (Int_t v = 0; v < 3; ++v)
38   {
39     vvv[v].vert   = 0;
40     vvv[v].branch = T->Branch(vvv[v].bname, &vvv[v].vert);
41   }
42
43   for (Int_t i=0; i<=9999; ++i)
44   {
45     TString name;
46
47     name.Form("Tracks_%04d", i);
48     ts = (TClonesArray*) f->Get(name);
49     if (ts == 0)
50       continue;
51
52     name.Form("Tracklets_%04d", i);
53     ms = (AliMultiplicity*) f->Get(name);
54     if (ms == 0)
55       Error("make_scan_results", "'%s' not found.", name.Data());
56
57     tb->SetAddress(&ts);
58     mb->SetAddress(&ms);
59
60     for (Int_t v = 0; v < 3; ++v)
61     {
62       name.Form("%s_%04d", vvv[v].oname, i);
63       vvv[v].vert = (AliESDVertex*) f->Get(name);
64       if (vvv[v].vert == 0)
65         Error("make_scan_results", "'%s' not found.", name.Data());
66       vvv[v].branch->SetAddress(&vvv[v].vert);
67     }
68
69     T->Fill();
70
71     delete ts;
72     delete ms;
73     for (Int_t v = 0; v < 3; ++v) delete vvv[v].vert;
74   }
75
76   T->Write();
77
78   f->Close();
79   delete f;
80 }