]>
Commit | Line | Data |
---|---|---|
121a60bd | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* $Id$ */ | |
17 | ||
18 | /////////////////////////////////////////////////////////////////////////////// | |
19 | // // | |
4fad09c9 | 20 | // Class for TRD reconstruction // |
121a60bd | 21 | // // |
22 | /////////////////////////////////////////////////////////////////////////////// | |
23 | ||
e3b2b5e5 | 24 | #include <TFile.h> |
3a039a31 | 25 | #include <TObjString.h> |
26 | #include <TObjArray.h> | |
121a60bd | 27 | |
121a60bd | 28 | #include "AliRunLoader.h" |
3bc9d03e | 29 | #include "AliRawReader.h" |
30 | #include "AliLog.h" | |
3bc9d03e | 31 | #include "AliESDTrdTrack.h" |
af885e0f | 32 | #include "AliESDEvent.h" |
3bc9d03e | 33 | |
34 | #include "AliTRDReconstructor.h" | |
3fe61b77 | 35 | #include "AliTRDclusterizer.h" |
121a60bd | 36 | #include "AliTRDtracker.h" |
b0f03c34 | 37 | #include "AliTRDpidESD.h" |
e3b2b5e5 | 38 | #include "AliTRDgtuTrack.h" |
a8fbb161 | 39 | #include "AliTRDrawData.h" |
40 | #include "AliTRDdigitsManager.h" | |
e4f2f73d | 41 | #include "AliTRDtrackerV1.h" |
42 | #include "AliTRDrecoParam.h" | |
121a60bd | 43 | |
44 | ClassImp(AliTRDReconstructor) | |
45 | ||
3a039a31 | 46 | |
eb38ed55 | 47 | //_____________________________________________________________________________ |
3a039a31 | 48 | AliTRDReconstructor::AliTRDReconstructor() |
49 | :AliReconstructor() | |
50 | ,fSteerParam(0x00000007) | |
51 | { | |
52 | memset(fStreamLevel, 0, 5*sizeof(UChar_t)); | |
53 | // Xe tail cancellation parameters | |
54 | fTCParams[0] = 1.156; // r1 | |
55 | fTCParams[1] = 0.130; // r2 | |
56 | fTCParams[2] = 0.114; // c1 | |
57 | fTCParams[3] = 0.624; // c2 | |
58 | // Ar tail cancellation parameters | |
181c7f7e | 59 | fTCParams[4] = 6.; // r1 |
60 | fTCParams[5] = 0.62; // r2 | |
61 | fTCParams[6] = 0.0087;// c1 | |
62 | fTCParams[7] = 0.07; // c2 | |
eb38ed55 | 63 | } |
64 | ||
3a039a31 | 65 | //_____________________________________________________________________________ |
66 | AliTRDReconstructor::AliTRDReconstructor(const AliTRDReconstructor &r) | |
67 | :AliReconstructor(r) | |
181c7f7e | 68 | ,fSteerParam(r.fSteerParam) |
3a039a31 | 69 | { |
70 | memcpy(fStreamLevel, r.fStreamLevel, 5*sizeof(UChar_t)); | |
71 | memcpy(fTCParams, r.fTCParams, 8*sizeof(Double_t)); | |
72 | } | |
eb38ed55 | 73 | |
acd241e9 | 74 | //_____________________________________________________________________________ |
75 | void AliTRDReconstructor::Init(){ | |
76 | // | |
77 | // Init Options | |
78 | // | |
79 | SetOption(GetOption()); | |
20bcdcc4 | 80 | |
81 | AliInfo("TRD reconstruction will use the following settings:"); | |
82 | printf("\tWrite Clusters [cw] : %s\n", fSteerParam&kWriteClusters?"yes":"no"); | |
83 | printf("\tWrite Online Tracklets [tw] : %s\n", fSteerParam&kWriteTracklets?"yes":"no"); | |
84 | printf("\tDrift Gas Argon [ar] : %s\n", fSteerParam&kDriftGas?"yes":"no"); | |
85 | printf("\tStand Alone Tracking [sa] : %s\n", fSteerParam&kSeeding?"yes":"no"); | |
86 | printf("\tNN PID [nn] : %s\n", fSteerParam&kSteerPID?"yes":"no"); | |
87 | printf("\tStreaming Levels : Clusterizer[%d] Tracker[%d] PID[%d]\n", fStreamLevel[kClusterizer], fStreamLevel[kTracker], fStreamLevel[kPID]); | |
acd241e9 | 88 | } |
0397ce53 | 89 | |
121a60bd | 90 | //_____________________________________________________________________________ |
a8fbb161 | 91 | void AliTRDReconstructor::ConvertDigits(AliRawReader *rawReader |
92 | , TTree *digitsTree) const | |
121a60bd | 93 | { |
3bc9d03e | 94 | // |
25ca55ce | 95 | // Convert raw data digits into digit objects in a root tree |
3bc9d03e | 96 | // |
121a60bd | 97 | |
ca21baaa | 98 | AliInfo("Convert raw data digits into digit objects [RawReader -> Digit TTree]"); |
99 | ||
a8fbb161 | 100 | AliTRDrawData rawData; |
3a0f6479 | 101 | rawReader->Reset(); |
102 | rawReader->Select("TRD"); | |
a8fbb161 | 103 | AliTRDdigitsManager *manager = rawData.Raw2Digits(rawReader); |
104 | manager->MakeBranch(digitsTree); | |
105 | manager->WriteDigits(); | |
c0ab62ff | 106 | delete manager; |
0ee00e25 | 107 | |
121a60bd | 108 | } |
109 | ||
25ca55ce | 110 | //_____________________________________________________________________________ |
111 | void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader | |
112 | , TTree *clusterTree) const | |
113 | { | |
114 | // | |
115 | // Reconstruct clusters | |
116 | // | |
117 | ||
ca21baaa | 118 | AliInfo("Reconstruct TRD clusters from RAW data [RawReader -> Cluster TTree]"); |
25ca55ce | 119 | |
c5f589b9 | 120 | |
3a0f6479 | 121 | rawReader->Reset(); |
122 | rawReader->Select("TRD"); | |
123 | ||
ca21baaa | 124 | // New (fast) cluster finder |
3fe61b77 | 125 | AliTRDclusterizer clusterer("clusterer","TRD clusterizer"); |
3a039a31 | 126 | clusterer.SetReconstructor(this); |
25ca55ce | 127 | clusterer.OpenOutput(clusterTree); |
ca21baaa | 128 | clusterer.SetAddLabels(kFALSE); |
129 | clusterer.Raw2ClustersChamber(rawReader); | |
d6e36038 | 130 | |
25ca55ce | 131 | } |
132 | ||
133 | //_____________________________________________________________________________ | |
a8fbb161 | 134 | void AliTRDReconstructor::Reconstruct(TTree *digitsTree |
135 | , TTree *clusterTree) const | |
25ca55ce | 136 | { |
137 | // | |
138 | // Reconstruct clusters | |
139 | // | |
e4f2f73d | 140 | |
ca21baaa | 141 | AliInfo("Reconstruct TRD clusters from Digits [Digit TTree -> Cluster TTree]"); |
25ca55ce | 142 | |
3fe61b77 | 143 | AliTRDclusterizer clusterer("clusterer","TRD clusterizer"); |
3a039a31 | 144 | clusterer.SetReconstructor(this); |
25ca55ce | 145 | clusterer.OpenOutput(clusterTree); |
146 | clusterer.ReadDigits(digitsTree); | |
147 | clusterer.MakeClusters(); | |
d6e36038 | 148 | |
25ca55ce | 149 | } |
150 | ||
151 | //_____________________________________________________________________________ | |
44dbae42 | 152 | AliTracker *AliTRDReconstructor::CreateTracker() const |
121a60bd | 153 | { |
3bc9d03e | 154 | // |
155 | // Create a TRD tracker | |
156 | // | |
121a60bd | 157 | |
e4f2f73d | 158 | //return new AliTRDtracker(NULL); |
3a039a31 | 159 | AliTRDtrackerV1 *tracker = new AliTRDtrackerV1(); |
160 | tracker->SetReconstructor(this); | |
161 | return tracker; | |
25ca55ce | 162 | |
25ca55ce | 163 | } |
164 | ||
165 | //_____________________________________________________________________________ | |
166 | void AliTRDReconstructor::FillESD(TTree* /*digitsTree*/ | |
167 | , TTree* /*clusterTree*/ | |
ca21baaa | 168 | , AliESDEvent* /*esd*/) const |
25ca55ce | 169 | { |
170 | // | |
af26ce80 | 171 | // Fill ESD |
25ca55ce | 172 | // |
173 | ||
25ca55ce | 174 | } |
3a039a31 | 175 | |
176 | ||
177 | //_____________________________________________________________________________ | |
178 | void AliTRDReconstructor::SetOption(Option_t *opt) | |
179 | { | |
180 | // Read option string into the steer param. | |
181 | // | |
182 | // Default steer param values | |
183 | // | |
184 | // write clusters [cw] = true | |
185 | // track seeding (stand alone tracking) [sa] = true | |
186 | // PID method in reconstruction (NN) [nn] = true | |
187 | // write online tracklets [tw] = false | |
188 | // drift gas [ar] = false | |
189 | // | |
190 | fSteerParam = 0x00000007; | |
191 | ||
192 | TString s(opt); | |
193 | TObjArray *opar = s.Tokenize(","); | |
194 | for(Int_t ipar=0; ipar<opar->GetEntriesFast(); ipar++){ | |
195 | TString sopt(((TObjString*)(*opar)[ipar])->String()); | |
196 | if(sopt.Contains("!cw")){ | |
197 | fSteerParam &= ~kWriteClusters; | |
198 | continue; | |
199 | } else if(sopt.Contains("!sa")){ | |
200 | fSteerParam &= ~kSeeding; | |
201 | continue; | |
202 | } else if(sopt.Contains("!nn")){ | |
203 | fSteerParam &= ~kSteerPID; | |
204 | continue; | |
205 | } else if(sopt.Contains("tw")){ | |
20bcdcc4 | 206 | if(!sopt.Contains("!")) fSteerParam |= kWriteTracklets; |
3a039a31 | 207 | continue; |
208 | } else if(sopt.Contains("ar")){ | |
20bcdcc4 | 209 | if(!sopt.Contains("!")) fSteerParam |= kDriftGas; |
3a039a31 | 210 | continue; |
acd241e9 | 211 | } else if(sopt.Contains("sl")){ |
212 | TObjArray *stl = sopt.Tokenize("_"); | |
213 | if(stl->GetEntriesFast() < 3) continue; | |
214 | TString taskstr(((TObjString*)(*stl)[1])->String()); | |
215 | TString levelstring(((TObjString*)(*stl)[2])->String()); | |
216 | // Set the stream Level | |
217 | Int_t level = levelstring.Atoi(); | |
218 | AliTRDReconstructorTask task = kTracker; | |
219 | if(taskstr.CompareTo("cl") == 0) task = kClusterizer; | |
220 | else if(taskstr.CompareTo("tr") == 0) task = kTracker; | |
221 | else if(taskstr.CompareTo("pi") == 0) task = kPID; | |
222 | SetStreamLevel(level, task); | |
223 | continue; | |
224 | } | |
3a039a31 | 225 | } |
226 | } | |
227 | ||
acd241e9 | 228 | //_____________________________________________________________________________ |
229 | void AliTRDReconstructor::SetStreamLevel(Int_t level, AliTRDReconstructorTask task){ | |
230 | // | |
231 | // Set the Stream Level for one of the tasks Clusterizer, Tracker or PID | |
232 | // | |
233 | TString taskname; | |
234 | switch(task){ | |
235 | case kClusterizer: taskname = "Clusterizer"; | |
236 | break; | |
237 | case kTracker: taskname = "Tracker"; | |
238 | break; | |
239 | case kPID: taskname = "PID"; | |
240 | break; | |
241 | } | |
20bcdcc4 | 242 | //AliInfo(Form("Setting Stream Level for Task %s to %d", taskname.Data(),level)); |
acd241e9 | 243 | fStreamLevel[(Int_t)task] = level; |
244 | } |