]>
Commit | Line | Data |
---|---|---|
121a60bd | 1 | /************************************************************************** |
91834b8d | 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 | **************************************************************************/ | |
121a60bd | 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> | |
66f6bfd9 | 27 | #include <TClonesArray.h> |
121a60bd | 28 | |
121a60bd | 29 | #include "AliRunLoader.h" |
3bc9d03e | 30 | #include "AliRawReader.h" |
31 | #include "AliLog.h" | |
3bc9d03e | 32 | #include "AliESDTrdTrack.h" |
af885e0f | 33 | #include "AliESDEvent.h" |
3bc9d03e | 34 | |
35 | #include "AliTRDReconstructor.h" | |
3fe61b77 | 36 | #include "AliTRDclusterizer.h" |
121a60bd | 37 | #include "AliTRDtracker.h" |
b0f03c34 | 38 | #include "AliTRDpidESD.h" |
e3b2b5e5 | 39 | #include "AliTRDgtuTrack.h" |
a8fbb161 | 40 | #include "AliTRDrawData.h" |
41 | #include "AliTRDdigitsManager.h" | |
e4f2f73d | 42 | #include "AliTRDtrackerV1.h" |
43 | #include "AliTRDrecoParam.h" | |
121a60bd | 44 | |
97b6dfac | 45 | #define SETFLG(n,f) ((n) |= f) |
46 | #define CLRFLG(n,f) ((n) &= ~f) | |
47 | ||
121a60bd | 48 | ClassImp(AliTRDReconstructor) |
49 | ||
66f6bfd9 | 50 | TClonesArray *AliTRDReconstructor::fgClusters = 0x0; |
eb38ed55 | 51 | //_____________________________________________________________________________ |
3a039a31 | 52 | AliTRDReconstructor::AliTRDReconstructor() |
53 | :AliReconstructor() | |
97b6dfac | 54 | ,fSteerParam(0) |
3a039a31 | 55 | { |
97b6dfac | 56 | // setting default "ON" steering parameters |
57 | // write clusters [cw] | |
58 | SETFLG(fSteerParam, kWriteClusters); | |
59 | // track seeding (stand alone tracking) [sa] | |
60 | SETFLG(fSteerParam, kSeeding); | |
61 | // PID method in reconstruction (NN) [nn] | |
62 | SETFLG(fSteerParam, kSteerPID); | |
63 | ||
3a039a31 | 64 | memset(fStreamLevel, 0, 5*sizeof(UChar_t)); |
65 | // Xe tail cancellation parameters | |
66 | fTCParams[0] = 1.156; // r1 | |
67 | fTCParams[1] = 0.130; // r2 | |
68 | fTCParams[2] = 0.114; // c1 | |
69 | fTCParams[3] = 0.624; // c2 | |
70 | // Ar tail cancellation parameters | |
181c7f7e | 71 | fTCParams[4] = 6.; // r1 |
72 | fTCParams[5] = 0.62; // r2 | |
73 | fTCParams[6] = 0.0087;// c1 | |
74 | fTCParams[7] = 0.07; // c2 | |
eb38ed55 | 75 | } |
76 | ||
3a039a31 | 77 | //_____________________________________________________________________________ |
78 | AliTRDReconstructor::AliTRDReconstructor(const AliTRDReconstructor &r) | |
79 | :AliReconstructor(r) | |
181c7f7e | 80 | ,fSteerParam(r.fSteerParam) |
3a039a31 | 81 | { |
91834b8d | 82 | memcpy(fStreamLevel, r.fStreamLevel, 5*sizeof(UChar_t)); |
83 | memcpy(fTCParams, r.fTCParams, 8*sizeof(Double_t)); | |
3a039a31 | 84 | } |
eb38ed55 | 85 | |
48f8adf3 | 86 | //_____________________________________________________________________________ |
87 | AliTRDReconstructor::~AliTRDReconstructor() | |
88 | { | |
89 | if(fgClusters) { | |
90 | fgClusters->Delete(); delete fgClusters; | |
91 | } | |
18c05eb3 | 92 | } |
48f8adf3 | 93 | |
91834b8d | 94 | |
acd241e9 | 95 | //_____________________________________________________________________________ |
91834b8d | 96 | void AliTRDReconstructor::Init(){ |
18c05eb3 | 97 | // |
98 | // Init Options | |
99 | // | |
18c05eb3 | 100 | SetOption(GetOption()); |
20bcdcc4 | 101 | |
c2cd1e8f | 102 | AliInfo(Form("\tDigitsConversion [dc] : %s", fSteerParam&kDigitsConversion?"yes":"no")); |
103 | AliInfo(Form("\tWrite Clusters [cw] : %s", fSteerParam&kWriteClusters?"yes":"no")); | |
104 | AliInfo(Form("\tWrite Online Tracklets [tw] : %s", fSteerParam&kWriteTracklets?"yes":"no")); | |
105 | AliInfo(Form("\tDrift Gas Argon [ar] : %s", fSteerParam&kDriftGas?"yes":"no")); | |
106 | AliInfo(Form("\tStand Alone Tracking [sa] : %s", fSteerParam&kSeeding?"yes":"no")); | |
107 | AliInfo(Form("\tHLT Tracking [hlt] : %s", fSteerParam&kHLT?"yes":"no")); | |
108 | AliInfo(Form("\tCosmic Reconstruction [cos] : %s", fSteerParam&kCosmic?"yes":"no")); | |
109 | AliInfo(Form("\tNN PID [nn] : %s", fSteerParam&kSteerPID?"yes":"no")); | |
110 | AliInfo(Form("\t8 dEdx slices in ESD [8s] : %s", fSteerParam&kEightSlices?"yes":"no")); | |
111 | AliInfo(Form("\tStreaming Levels : Clusterizer[%d] Tracker[%d] PID[%d]", fStreamLevel[kClusterizer], fStreamLevel[kTracker], fStreamLevel[kPID])); | |
acd241e9 | 112 | } |
0397ce53 | 113 | |
121a60bd | 114 | //_____________________________________________________________________________ |
a8fbb161 | 115 | void AliTRDReconstructor::ConvertDigits(AliRawReader *rawReader |
91834b8d | 116 | , TTree *digitsTree) const |
121a60bd | 117 | { |
3bc9d03e | 118 | // |
25ca55ce | 119 | // Convert raw data digits into digit objects in a root tree |
3bc9d03e | 120 | // |
9926e335 | 121 | AliInfo("Feature not available for the moment."); return; |
121a60bd | 122 | |
91834b8d | 123 | AliInfo("Convert raw data digits into digit objects [RawReader -> Digit TTree]"); |
124 | ||
a8fbb161 | 125 | AliTRDrawData rawData; |
3a0f6479 | 126 | rawReader->Reset(); |
127 | rawReader->Select("TRD"); | |
a8fbb161 | 128 | AliTRDdigitsManager *manager = rawData.Raw2Digits(rawReader); |
129 | manager->MakeBranch(digitsTree); | |
130 | manager->WriteDigits(); | |
c0ab62ff | 131 | delete manager; |
0ee00e25 | 132 | |
121a60bd | 133 | } |
134 | ||
25ca55ce | 135 | //_____________________________________________________________________________ |
136 | void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader | |
137 | , TTree *clusterTree) const | |
138 | { | |
139 | // | |
140 | // Reconstruct clusters | |
141 | // | |
142 | ||
91834b8d | 143 | //AliInfo("Reconstruct TRD clusters from RAW data [RawReader -> Cluster TTree]"); |
144 | ||
145 | ||
3a0f6479 | 146 | rawReader->Reset(); |
147 | rawReader->Select("TRD"); | |
148 | ||
ca21baaa | 149 | // New (fast) cluster finder |
3fe61b77 | 150 | AliTRDclusterizer clusterer("clusterer","TRD clusterizer"); |
3a039a31 | 151 | clusterer.SetReconstructor(this); |
25ca55ce | 152 | clusterer.OpenOutput(clusterTree); |
ca21baaa | 153 | clusterer.SetAddLabels(kFALSE); |
154 | clusterer.Raw2ClustersChamber(rawReader); | |
66f6bfd9 | 155 | |
156 | if(IsWritingClusters()) return; | |
d6e36038 | 157 | |
66f6bfd9 | 158 | // take over ownership of clusters |
159 | fgClusters = clusterer.RecPoints(); | |
160 | clusterer.SetClustersOwner(kFALSE); | |
25ca55ce | 161 | } |
162 | ||
163 | //_____________________________________________________________________________ | |
a8fbb161 | 164 | void AliTRDReconstructor::Reconstruct(TTree *digitsTree |
165 | , TTree *clusterTree) const | |
25ca55ce | 166 | { |
167 | // | |
168 | // Reconstruct clusters | |
169 | // | |
e4f2f73d | 170 | |
91834b8d | 171 | //AliInfo("Reconstruct TRD clusters from Digits [Digit TTree -> Cluster TTree]"); |
172 | ||
3fe61b77 | 173 | AliTRDclusterizer clusterer("clusterer","TRD clusterizer"); |
3a039a31 | 174 | clusterer.SetReconstructor(this); |
25ca55ce | 175 | clusterer.OpenOutput(clusterTree); |
176 | clusterer.ReadDigits(digitsTree); | |
177 | clusterer.MakeClusters(); | |
d6e36038 | 178 | |
66f6bfd9 | 179 | if(IsWritingClusters()) return; |
180 | ||
181 | // take over ownership of clusters | |
182 | fgClusters = clusterer.RecPoints(); | |
183 | clusterer.SetClustersOwner(kFALSE); | |
25ca55ce | 184 | } |
185 | ||
186 | //_____________________________________________________________________________ | |
44dbae42 | 187 | AliTracker *AliTRDReconstructor::CreateTracker() const |
121a60bd | 188 | { |
3bc9d03e | 189 | // |
190 | // Create a TRD tracker | |
191 | // | |
121a60bd | 192 | |
e4f2f73d | 193 | //return new AliTRDtracker(NULL); |
3a039a31 | 194 | AliTRDtrackerV1 *tracker = new AliTRDtrackerV1(); |
195 | tracker->SetReconstructor(this); | |
196 | return tracker; | |
25ca55ce | 197 | |
25ca55ce | 198 | } |
199 | ||
200 | //_____________________________________________________________________________ | |
201 | void AliTRDReconstructor::FillESD(TTree* /*digitsTree*/ | |
91834b8d | 202 | , TTree* /*clusterTree*/ |
203 | , AliESDEvent* /*esd*/) const | |
25ca55ce | 204 | { |
205 | // | |
af26ce80 | 206 | // Fill ESD |
25ca55ce | 207 | // |
208 | ||
25ca55ce | 209 | } |
3a039a31 | 210 | |
91834b8d | 211 | |
3a039a31 | 212 | //_____________________________________________________________________________ |
213 | void AliTRDReconstructor::SetOption(Option_t *opt) | |
214 | { | |
91834b8d | 215 | // Read option string into the steer param. |
216 | // | |
217 | // Default steer param values | |
218 | // | |
97b6dfac | 219 | // digits conversion [dc] = false |
56b32fd7 | 220 | // drift gas [ar] = false - do not update the number of exponentials in the TC ! |
91834b8d | 221 | // write clusters [cw] = true |
56b32fd7 | 222 | // write online tracklets [tw] = false |
91834b8d | 223 | // track seeding (stand alone tracking) [sa] = true |
224 | // PID method in reconstruction (NN) [nn] = true | |
56b32fd7 | 225 | // 8 dEdx slices in ESD [8s] = false |
91834b8d | 226 | // HLT tracking [hlt] = false |
227 | // Cosmic Reconstruction [cos] = false | |
228 | // | |
97b6dfac | 229 | |
230 | AliReconstructor::SetOption(opt); | |
3a039a31 | 231 | |
232 | TString s(opt); | |
233 | TObjArray *opar = s.Tokenize(","); | |
234 | for(Int_t ipar=0; ipar<opar->GetEntriesFast(); ipar++){ | |
235 | TString sopt(((TObjString*)(*opar)[ipar])->String()); | |
97b6dfac | 236 | if(sopt.Contains("dc")){ |
237 | SETFLG(fSteerParam, kDigitsConversion); | |
238 | if(sopt.Contains("!")) CLRFLG(fSteerParam, kDigitsConversion); | |
00872461 | 239 | continue; |
97b6dfac | 240 | } else if(sopt.Contains("cw")){ |
241 | SETFLG(fSteerParam, kWriteClusters); | |
242 | if(sopt.Contains("!")) CLRFLG(fSteerParam, kWriteClusters); | |
243 | continue; | |
244 | } else if(sopt.Contains("sa")){ | |
245 | SETFLG(fSteerParam, kSeeding); | |
246 | if(sopt.Contains("!")) CLRFLG(fSteerParam, kSeeding); | |
3a039a31 | 247 | continue; |
97b6dfac | 248 | } else if(sopt.Contains("nn")){ |
249 | SETFLG(fSteerParam, kSteerPID); | |
250 | if(sopt.Contains("!")) CLRFLG(fSteerParam, kSteerPID); | |
3a039a31 | 251 | continue; |
56b32fd7 | 252 | } else if(sopt.Contains("8s")){ |
253 | SETFLG(fSteerParam, kEightSlices); | |
254 | if(sopt.Contains("!")) CLRFLG(fSteerParam, kEightSlices); | |
255 | continue; | |
3a039a31 | 256 | } else if(sopt.Contains("tw")){ |
97b6dfac | 257 | SETFLG(fSteerParam, kWriteTracklets); |
258 | if(sopt.Contains("!")) CLRFLG(fSteerParam, kWriteTracklets); | |
3a039a31 | 259 | continue; |
260 | } else if(sopt.Contains("ar")){ | |
97b6dfac | 261 | SETFLG(fSteerParam, kDriftGas); |
262 | if(sopt.Contains("!")) CLRFLG(fSteerParam, kDriftGas); | |
3a039a31 | 263 | continue; |
4302c900 | 264 | } else if(sopt.Contains("hlt")){ |
97b6dfac | 265 | SETFLG(fSteerParam, kHLT); |
266 | if(sopt.Contains("!")) CLRFLG(fSteerParam, kHLT); | |
4302c900 | 267 | continue; |
91834b8d | 268 | } else if(sopt.Contains("cos")){ |
97b6dfac | 269 | SETFLG(fSteerParam, kCosmic); |
270 | if(sopt.Contains("!")) CLRFLG(fSteerParam, kCosmic); | |
acd241e9 | 271 | } else if(sopt.Contains("sl")){ |
91834b8d | 272 | TObjArray *stl = sopt.Tokenize("_"); |
273 | if(stl->GetEntriesFast() < 3) continue; | |
274 | TString taskstr(((TObjString*)(*stl)[1])->String()); | |
275 | TString levelstring(((TObjString*)(*stl)[2])->String()); | |
276 | // Set the stream Level | |
277 | Int_t level = levelstring.Atoi(); | |
278 | AliTRDReconstructorTask task = kTracker; | |
279 | if(taskstr.CompareTo("cl") == 0) task = kClusterizer; | |
280 | else if(taskstr.CompareTo("tr") == 0) task = kTracker; | |
281 | else if(taskstr.CompareTo("pi") == 0) task = kPID; | |
282 | SetStreamLevel(level, task); | |
283 | continue; | |
284 | } | |
3a039a31 | 285 | } |
286 | } | |
287 | ||
acd241e9 | 288 | //_____________________________________________________________________________ |
91834b8d | 289 | void AliTRDReconstructor::SetStreamLevel(Int_t level, AliTRDReconstructorTask task){ |
18c05eb3 | 290 | // |
291 | // Set the Stream Level for one of the tasks Clusterizer, Tracker or PID | |
292 | // | |
18c05eb3 | 293 | TString taskname; |
91834b8d | 294 | switch(task){ |
295 | case kClusterizer: | |
296 | taskname = "Clusterizer"; | |
297 | break; | |
298 | case kTracker: | |
299 | taskname = "Tracker"; | |
300 | break; | |
301 | case kPID: | |
302 | taskname = "PID"; | |
303 | break; | |
18c05eb3 | 304 | } |
91834b8d | 305 | //AliInfo(Form("Setting Stream Level for Task %s to %d", taskname.Data(),level)); |
18c05eb3 | 306 | fStreamLevel[(Int_t)task] = level; |
acd241e9 | 307 | } |