]>
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()); | |
80 | } | |
0397ce53 | 81 | |
121a60bd | 82 | //_____________________________________________________________________________ |
a8fbb161 | 83 | void AliTRDReconstructor::ConvertDigits(AliRawReader *rawReader |
84 | , TTree *digitsTree) const | |
121a60bd | 85 | { |
3bc9d03e | 86 | // |
25ca55ce | 87 | // Convert raw data digits into digit objects in a root tree |
3bc9d03e | 88 | // |
121a60bd | 89 | |
ca21baaa | 90 | AliInfo("Convert raw data digits into digit objects [RawReader -> Digit TTree]"); |
91 | ||
a8fbb161 | 92 | AliTRDrawData rawData; |
3a0f6479 | 93 | rawReader->Reset(); |
94 | rawReader->Select("TRD"); | |
a8fbb161 | 95 | AliTRDdigitsManager *manager = rawData.Raw2Digits(rawReader); |
96 | manager->MakeBranch(digitsTree); | |
97 | manager->WriteDigits(); | |
c0ab62ff | 98 | delete manager; |
0ee00e25 | 99 | |
121a60bd | 100 | } |
101 | ||
25ca55ce | 102 | //_____________________________________________________________________________ |
103 | void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader | |
104 | , TTree *clusterTree) const | |
105 | { | |
106 | // | |
107 | // Reconstruct clusters | |
108 | // | |
109 | ||
ca21baaa | 110 | AliInfo("Reconstruct TRD clusters from RAW data [RawReader -> Cluster TTree]"); |
25ca55ce | 111 | |
c5f589b9 | 112 | |
3a0f6479 | 113 | rawReader->Reset(); |
114 | rawReader->Select("TRD"); | |
115 | ||
ca21baaa | 116 | // New (fast) cluster finder |
3fe61b77 | 117 | AliTRDclusterizer clusterer("clusterer","TRD clusterizer"); |
3a039a31 | 118 | clusterer.SetReconstructor(this); |
25ca55ce | 119 | clusterer.OpenOutput(clusterTree); |
ca21baaa | 120 | clusterer.SetAddLabels(kFALSE); |
121 | clusterer.Raw2ClustersChamber(rawReader); | |
d6e36038 | 122 | |
25ca55ce | 123 | } |
124 | ||
125 | //_____________________________________________________________________________ | |
a8fbb161 | 126 | void AliTRDReconstructor::Reconstruct(TTree *digitsTree |
127 | , TTree *clusterTree) const | |
25ca55ce | 128 | { |
129 | // | |
130 | // Reconstruct clusters | |
131 | // | |
e4f2f73d | 132 | |
ca21baaa | 133 | AliInfo("Reconstruct TRD clusters from Digits [Digit TTree -> Cluster TTree]"); |
25ca55ce | 134 | |
3fe61b77 | 135 | AliTRDclusterizer clusterer("clusterer","TRD clusterizer"); |
3a039a31 | 136 | clusterer.SetReconstructor(this); |
25ca55ce | 137 | clusterer.OpenOutput(clusterTree); |
138 | clusterer.ReadDigits(digitsTree); | |
139 | clusterer.MakeClusters(); | |
d6e36038 | 140 | |
25ca55ce | 141 | } |
142 | ||
143 | //_____________________________________________________________________________ | |
44dbae42 | 144 | AliTracker *AliTRDReconstructor::CreateTracker() const |
121a60bd | 145 | { |
3bc9d03e | 146 | // |
147 | // Create a TRD tracker | |
148 | // | |
121a60bd | 149 | |
e4f2f73d | 150 | //return new AliTRDtracker(NULL); |
3a039a31 | 151 | AliTRDtrackerV1 *tracker = new AliTRDtrackerV1(); |
152 | tracker->SetReconstructor(this); | |
153 | return tracker; | |
25ca55ce | 154 | |
25ca55ce | 155 | } |
156 | ||
157 | //_____________________________________________________________________________ | |
158 | void AliTRDReconstructor::FillESD(TTree* /*digitsTree*/ | |
159 | , TTree* /*clusterTree*/ | |
ca21baaa | 160 | , AliESDEvent* /*esd*/) const |
25ca55ce | 161 | { |
162 | // | |
af26ce80 | 163 | // Fill ESD |
25ca55ce | 164 | // |
165 | ||
25ca55ce | 166 | } |
3a039a31 | 167 | |
168 | ||
169 | //_____________________________________________________________________________ | |
170 | void AliTRDReconstructor::SetOption(Option_t *opt) | |
171 | { | |
172 | // Read option string into the steer param. | |
173 | // | |
174 | // Default steer param values | |
175 | // | |
176 | // write clusters [cw] = true | |
177 | // track seeding (stand alone tracking) [sa] = true | |
178 | // PID method in reconstruction (NN) [nn] = true | |
179 | // write online tracklets [tw] = false | |
180 | // drift gas [ar] = false | |
181 | // | |
182 | fSteerParam = 0x00000007; | |
183 | ||
184 | TString s(opt); | |
185 | TObjArray *opar = s.Tokenize(","); | |
186 | for(Int_t ipar=0; ipar<opar->GetEntriesFast(); ipar++){ | |
187 | TString sopt(((TObjString*)(*opar)[ipar])->String()); | |
188 | if(sopt.Contains("!cw")){ | |
189 | fSteerParam &= ~kWriteClusters; | |
190 | continue; | |
191 | } else if(sopt.Contains("!sa")){ | |
192 | fSteerParam &= ~kSeeding; | |
193 | continue; | |
194 | } else if(sopt.Contains("!nn")){ | |
195 | fSteerParam &= ~kSteerPID; | |
196 | continue; | |
197 | } else if(sopt.Contains("tw")){ | |
198 | fSteerParam |= kWriteTracklets; | |
199 | continue; | |
200 | } else if(sopt.Contains("ar")){ | |
201 | fSteerParam |= kDriftGas; | |
202 | continue; | |
acd241e9 | 203 | } else if(sopt.Contains("sl")){ |
204 | TObjArray *stl = sopt.Tokenize("_"); | |
205 | if(stl->GetEntriesFast() < 3) continue; | |
206 | TString taskstr(((TObjString*)(*stl)[1])->String()); | |
207 | TString levelstring(((TObjString*)(*stl)[2])->String()); | |
208 | // Set the stream Level | |
209 | Int_t level = levelstring.Atoi(); | |
210 | AliTRDReconstructorTask task = kTracker; | |
211 | if(taskstr.CompareTo("cl") == 0) task = kClusterizer; | |
212 | else if(taskstr.CompareTo("tr") == 0) task = kTracker; | |
213 | else if(taskstr.CompareTo("pi") == 0) task = kPID; | |
214 | SetStreamLevel(level, task); | |
215 | continue; | |
216 | } | |
3a039a31 | 217 | } |
218 | } | |
219 | ||
acd241e9 | 220 | //_____________________________________________________________________________ |
221 | void AliTRDReconstructor::SetStreamLevel(Int_t level, AliTRDReconstructorTask task){ | |
222 | // | |
223 | // Set the Stream Level for one of the tasks Clusterizer, Tracker or PID | |
224 | // | |
225 | TString taskname; | |
226 | switch(task){ | |
227 | case kClusterizer: taskname = "Clusterizer"; | |
228 | break; | |
229 | case kTracker: taskname = "Tracker"; | |
230 | break; | |
231 | case kPID: taskname = "PID"; | |
232 | break; | |
233 | } | |
234 | AliInfo(Form("Setting Stream Level for Task %s to %d", taskname.Data(),level)); | |
235 | fStreamLevel[(Int_t)task] = level; | |
236 | } |