]>
Commit | Line | Data |
---|---|---|
59dfcadd | 1 | #ifndef __CINT__ |
2 | #include "alles.h" | |
3 | #include "AliMagF.h" | |
4 | #include "AliTRDtracker.h" | |
5 | #endif | |
6 | ||
7 | Int_t TRDPropagateBack(const Char_t *geoname, const Char_t *clrsname, | |
8 | const Char_t *inname, const Char_t *outname, Int_t n); | |
9 | ||
10 | Int_t TRDFindTracks(const Char_t *geoname, const Char_t *clrsname, | |
11 | const Char_t *inname, const Char_t *outname, Int_t n); | |
12 | ||
13 | Int_t AliTRDtrackReconstruction(Int_t n=1) { | |
14 | const Char_t *TRDdigName="galice.root"; | |
15 | const Char_t *dummyName="dummy.root"; | |
16 | const Char_t *TRDclsName="AliTRDclusters.root"; | |
17 | const Char_t *TRDtrkName="AliTRDtracks.root"; | |
18 | const Char_t *TPCbkTrkName="AliTPCBackTracks.root"; | |
19 | ||
20 | AliKalmanTrack::SetConvConst(100/0.299792458/0.2/gAlice->Field()->Factor()); | |
21 | ||
22 | ||
23 | // ********** Find TRD tracks from TPC back propagated tracks *********** // | |
24 | ||
25 | ||
26 | if (TRDPropagateBack(TRDclsName, TRDclsName, TPCbkTrkName, TRDtrkName, n)) { | |
27 | cerr<<"Failed to propagate back through TRD !\n"; | |
28 | return 1; | |
29 | } | |
30 | ||
31 | ||
32 | // ********** Find TRD tracks and make seeds for TPC *********** // | |
33 | ||
34 | /* | |
35 | if (TRDFindTracks(TRDclsName,TRDclsName, TRDtrkName, TRDtrkName,n)) { | |
36 | cerr<<"Failed to find TRD tracks !\n"; | |
37 | return 1; | |
38 | } | |
39 | */ | |
40 | ||
41 | return 0; | |
42 | } | |
43 | ||
44 | ||
45 | Int_t TRDPropagateBack(const Char_t *geoname, const Char_t *clrsname, | |
46 | const Char_t *inname, const Char_t *outname, Int_t n) | |
47 | { | |
48 | Int_t rc=0; | |
49 | const Char_t *name="TRDPropagateBack"; | |
50 | cerr<<'\n'<<name<<"...\n"; | |
51 | gBenchmark->Start(name); | |
52 | ||
53 | TFile *geofile =TFile::Open(geoname); | |
54 | TFile *out=TFile::Open(outname,"update"); | |
55 | TFile *in =TFile::Open(inname); | |
56 | TFile *clrsfile =TFile::Open(clrsname); | |
57 | ||
58 | AliTRDtracker *tracker=new AliTRDtracker(geofile); | |
59 | ||
60 | for (Int_t i=0;i<n;i++){ | |
61 | printf("Processing event %d\n",i); | |
62 | tracker->SetEventNumber(i); | |
63 | rc=tracker->PropagateBack(in,out); | |
64 | } | |
65 | ||
66 | delete tracker; | |
67 | in->Close(); | |
68 | out->Close(); | |
69 | geofile->Close(); | |
70 | clrsfile->Close(); | |
71 | ||
72 | gBenchmark->Stop(name); | |
73 | gBenchmark->Show(name); | |
74 | ||
75 | return rc; | |
76 | } | |
77 | ||
78 | ||
79 | Int_t TRDFindTracks(const Char_t *geoname, const Char_t *clrsname, | |
80 | const Char_t *inname, const Char_t *outname, Int_t n) | |
81 | { | |
82 | Int_t rc=0; | |
83 | const Char_t *name="TRDFindTracks"; | |
84 | cerr<<'\n'<<name<<"...\n"; | |
85 | gBenchmark->Start(name); | |
86 | ||
87 | TFile *geofile =TFile::Open(geoname); | |
88 | TFile *out=TFile::Open(outname,"update"); | |
89 | TFile *in =TFile::Open(inname); | |
90 | TFile *clrsfile =TFile::Open(clrsname); | |
91 | ||
92 | AliTRDtracker *tracker=new AliTRDtracker(geofile); | |
93 | tracker->SetAddTRDseeds(); | |
94 | ||
95 | for (Int_t i=0;i<n;i++){ | |
96 | printf("Processing event %d\n",i); | |
97 | tracker->SetEventNumber(i); | |
98 | rc=tracker->Clusters2Tracks(in,out); | |
99 | } | |
100 | ||
101 | delete tracker; | |
102 | in->Close(); | |
103 | out->Close(); | |
104 | geofile->Close(); | |
105 | clrsfile->Close(); | |
106 | ||
107 | gBenchmark->Stop(name); | |
108 | gBenchmark->Show(name); | |
109 | ||
110 | return rc; | |
111 | } | |
112 |