]>
Commit | Line | Data |
---|---|---|
d08a92dd | 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 | /* | |
7fffa85b | 17 | $Log: AliTOFClusterFinder.cxx,v $ |
18 | Revision 1.31 2007/11/24 14:53:19 zampolli | |
19 | Status flag implemented as UChar_t | |
20 | ||
98f5acd7 | 21 | Revision 1.30 2007/10/04 13:08:52 arcelli |
22 | updates to comply with AliTOFGeometryV5 becoming AliTOFGeometry | |
23 | ||
ba66add8 | 24 | Revision 1.29 2007/10/03 10:42:33 arcelli |
25 | updates to handle new AliTOFcluster, inheriting form AliCluster3D | |
26 | ||
ac359ffe | 27 | Revision 1.28 2007/05/31 16:06:05 arcelli |
28 | move instance of AliRawStream outside loop on DDL | |
29 | ||
ef58b2af | 30 | Revision 1.27 2007/05/02 16:31:49 arcelli |
c3891b7a | 31 | Add methods to handle single event reconstruction. retrieval of Calib |
32 | info moved to AliTOFReconstructor ctor, and passed via a pointer to | |
33 | AliTOFcalib | |
ef58b2af | 34 | |
94f5f8f2 | 35 | Revision 1.26 2007/04/30 19:02:24 arcelli |
36 | hopefully the last refinements for correct type conversion in calibration | |
37 | ||
a33fec85 | 38 | Revision 1.25 2007/04/30 15:22:17 arcelli |
39 | Change TOF digit Time, Tot etc to int type | |
40 | ||
bf33f8f0 | 41 | Revision 1.24 2007/04/27 11:19:31 arcelli |
42 | updates for the new decoder | |
43 | ||
7813bb1a | 44 | Revision 1.23 2007/04/23 16:51:39 decaro |
c3891b7a | 45 | Digits-to-raw_data conversion: correction for a more real description |
46 | (A.De Caro, R.Preghenella) | |
7813bb1a | 47 | |
515faf5d | 48 | Revision 1.22 2007/04/19 17:26:32 arcelli |
49 | Fix a bug (add some debug printout | |
50 | ||
0451c2e6 | 51 | Revision 1.21 2007/04/18 17:28:12 arcelli |
52 | Set the ToT bin width to the one actually used... | |
53 | ||
605370db | 54 | Revision 1.20 2007/03/09 09:57:23 arcelli |
55 | Remove a forgotten include of Riostrem | |
56 | ||
c77771e2 | 57 | Revision 1.19 2007/03/08 15:41:20 arcelli |
58 | set uncorrected times when filling RecPoints | |
59 | ||
3432ebfa | 60 | Revision 1.18 2007/03/06 16:31:20 arcelli |
61 | Add Uncorrected TOF Time signal | |
62 | ||
aa5476d8 | 63 | Revision 1.17 2007/02/28 18:09:11 arcelli |
c3891b7a | 64 | Add protection against failed retrieval of the CDB cal object, |
65 | now Reconstruction exits with AliFatal | |
aa5476d8 | 66 | |
a1cab04c | 67 | Revision 1.16 2007/02/20 15:57:00 decaro |
68 | Raw data update: to read the TOF raw data defined in UNPACKED mode | |
69 | ||
d08a92dd | 70 | |
71 | Revision 0.03 2005/07/28 A. De Caro | |
72 | Implement public method | |
73 | Raw2Digits(Int_t, AliRawReader *) | |
74 | to convert digits from raw data in MC digits | |
75 | (temporary solution) | |
76 | ||
77 | Revision 0.02 2005/07/27 A. De Caro | |
78 | Implement public method | |
79 | Digits2RecPoint(Int_t) | |
80 | to convert digits in clusters | |
81 | ||
82 | Revision 0.02 2005/07/26 A. De Caro | |
83 | Implement private methods | |
84 | InsertCluster(AliTOFcluster *) | |
85 | FindClusterIndex(Double_t) | |
86 | originally implemented in AliTOFtracker | |
87 | by S. Arcelli and C. Zampolli | |
88 | ||
89 | Revision 0.01 2005/07/25 A. De Caro | |
90 | Implement public methods | |
91 | Digits2RecPoint(AliRawReader *, TTree *) | |
92 | Digits2RecPoint(Int_t, AliRawReader *) | |
93 | to convert raw data in clusters | |
94 | */ | |
95 | ||
96 | //////////////////////////////////////////////////////////////// | |
97 | // // | |
98 | // Class for TOF cluster finder // | |
99 | // // | |
100 | // Starting from Raw Data, create rec points, // | |
101 | // fill TreeR for TOF, // | |
102 | // write TOF.RecPoints.root file // | |
103 | // // | |
104 | //////////////////////////////////////////////////////////////// | |
105 | ||
5c7c93fa | 106 | #include "Riostream.h" |
15ec34b9 | 107 | |
0e46b9ae | 108 | #include "TClonesArray.h" |
515faf5d | 109 | #include "TStopwatch.h" |
0e46b9ae | 110 | #include "TTree.h" |
5c7c93fa | 111 | //#include <TGeoManager.h> |
ac359ffe | 112 | #include <TGeoMatrix.h> |
5c7c93fa | 113 | //#include <TGeoPhysicalNode.h> |
d08a92dd | 114 | |
d0eb8f39 | 115 | #include "AliDAQ.h" |
0e46b9ae | 116 | #include "AliLoader.h" |
d08a92dd | 117 | #include "AliLog.h" |
0e46b9ae | 118 | #include "AliRawReader.h" |
d08a92dd | 119 | #include "AliRunLoader.h" |
5c7c93fa | 120 | //#include "AliAlignObj.h" |
121 | #include <AliGeomManager.h> | |
d08a92dd | 122 | |
15ec34b9 | 123 | #include "AliTOFcalib.h" |
17149e6b | 124 | #include "AliTOFChannelOnlineArray.h" |
125 | #include "AliTOFChannelOnlineStatusArray.h" | |
ba66add8 | 126 | #include "AliTOFChannelOffline.h" |
d08a92dd | 127 | #include "AliTOFClusterFinder.h" |
0e46b9ae | 128 | #include "AliTOFcluster.h" |
129 | #include "AliTOFdigit.h" | |
0e46b9ae | 130 | #include "AliTOFGeometry.h" |
15ec34b9 | 131 | #include "AliTOFrawData.h" |
0275b7df | 132 | //#include "AliTOFRawStream.h" |
0e46b9ae | 133 | |
2bf4d9d6 | 134 | #include "AliTOFDeltaBCOffset.h" |
135 | #include "AliTOFCTPLatency.h" | |
136 | #include "AliTOFT0Fill.h" | |
137 | ||
15ec34b9 | 138 | //extern TFile *gFile; |
d08a92dd | 139 | |
140 | ClassImp(AliTOFClusterFinder) | |
141 | ||
94f5f8f2 | 142 | AliTOFClusterFinder::AliTOFClusterFinder(AliTOFcalib *calib): |
d08a92dd | 143 | fRunLoader(0), |
144 | fTOFLoader(0), | |
145 | fTreeD(0), | |
146 | fTreeR(0), | |
147 | fDigits(new TClonesArray("AliTOFdigit", 4000)), | |
148 | fRecPoints(new TClonesArray("AliTOFcluster", 4000)), | |
15ec34b9 | 149 | fNumberOfTofClusters(0), |
7813bb1a | 150 | fVerbose(0), |
94f5f8f2 | 151 | fDecoderVersion(0), |
0275b7df | 152 | fTOFcalib(calib), |
153 | fTOFRawStream(AliTOFRawStream()) | |
d08a92dd | 154 | { |
155 | // | |
156 | // Constructor | |
157 | // | |
158 | ||
d08a92dd | 159 | } |
2bf66a2d | 160 | |
d08a92dd | 161 | //______________________________________________________________________________ |
162 | ||
94f5f8f2 | 163 | AliTOFClusterFinder::AliTOFClusterFinder(AliRunLoader* runLoader, AliTOFcalib *calib): |
d08a92dd | 164 | fRunLoader(runLoader), |
165 | fTOFLoader(runLoader->GetLoader("TOFLoader")), | |
166 | fTreeD(0), | |
167 | fTreeR(0), | |
168 | fDigits(new TClonesArray("AliTOFdigit", 4000)), | |
169 | fRecPoints(new TClonesArray("AliTOFcluster", 4000)), | |
15ec34b9 | 170 | fNumberOfTofClusters(0), |
7813bb1a | 171 | fVerbose(0), |
94f5f8f2 | 172 | fDecoderVersion(0), |
0275b7df | 173 | fTOFcalib(calib), |
174 | fTOFRawStream(AliTOFRawStream()) | |
d08a92dd | 175 | { |
176 | // | |
177 | // Constructor | |
178 | // | |
179 | ||
7aeeaf38 | 180 | } |
181 | ||
182 | //------------------------------------------------------------------------ | |
183 | AliTOFClusterFinder::AliTOFClusterFinder(const AliTOFClusterFinder &source) | |
8a190ba2 | 184 | :TObject(source), |
58d8d9a3 | 185 | fRunLoader(0), |
186 | fTOFLoader(0), | |
187 | fTreeD(0), | |
188 | fTreeR(0), | |
8a190ba2 | 189 | fDigits(source.fDigits), |
190 | fRecPoints(source.fRecPoints), | |
15ec34b9 | 191 | fNumberOfTofClusters(0), |
94f5f8f2 | 192 | fVerbose(0), |
8a190ba2 | 193 | fDecoderVersion(source.fDecoderVersion), |
0275b7df | 194 | fTOFcalib(source.fTOFcalib), |
195 | fTOFRawStream(source.fTOFRawStream) | |
7aeeaf38 | 196 | { |
197 | // copy constructor | |
7aeeaf38 | 198 | } |
199 | ||
200 | //------------------------------------------------------------------------ | |
d0eb8f39 | 201 | AliTOFClusterFinder& AliTOFClusterFinder::operator=(const AliTOFClusterFinder &source) |
7aeeaf38 | 202 | { |
203 | // ass. op. | |
8a190ba2 | 204 | |
205 | if (this == &source) | |
206 | return *this; | |
207 | ||
208 | TObject::operator=(source); | |
209 | fDigits=source.fDigits; | |
210 | fRecPoints=source.fRecPoints; | |
211 | fVerbose=source.fVerbose; | |
212 | fDecoderVersion=source.fDecoderVersion; | |
213 | fTOFcalib=source.fTOFcalib; | |
0275b7df | 214 | fTOFRawStream=source.fTOFRawStream; |
7aeeaf38 | 215 | return *this; |
216 | ||
d08a92dd | 217 | } |
218 | //______________________________________________________________________________ | |
219 | ||
220 | AliTOFClusterFinder::~AliTOFClusterFinder() | |
221 | { | |
222 | ||
223 | // | |
224 | // Destructor | |
225 | // | |
226 | ||
227 | if (fDigits) | |
228 | { | |
229 | fDigits->Delete(); | |
230 | delete fDigits; | |
231 | fDigits=0; | |
232 | } | |
233 | if (fRecPoints) | |
234 | { | |
235 | fRecPoints->Delete(); | |
236 | delete fRecPoints; | |
237 | fRecPoints=0; | |
238 | } | |
239 | ||
d08a92dd | 240 | } |
241 | //______________________________________________________________________________ | |
242 | ||
243 | void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent) | |
244 | { | |
245 | // | |
246 | // Converts digits to recpoints for TOF | |
247 | // | |
248 | ||
515faf5d | 249 | TStopwatch stopwatch; |
250 | stopwatch.Start(); | |
251 | ||
56483762 | 252 | Int_t inholes = 0; |
253 | ||
d08a92dd | 254 | fRunLoader->GetEvent(iEvent); |
255 | ||
256 | fTreeD = fTOFLoader->TreeD(); | |
257 | if (fTreeD == 0x0) | |
258 | { | |
259 | AliFatal("AliTOFClusterFinder: Can not get TreeD"); | |
260 | } | |
261 | ||
262 | TBranch *branch = fTreeD->GetBranch("TOF"); | |
263 | if (!branch) { | |
264 | AliError("can't get the branch with the TOF digits !"); | |
265 | return; | |
266 | } | |
267 | ||
b24266ca | 268 | TClonesArray staticdigits("AliTOFdigit",10000); |
269 | staticdigits.Clear(); | |
270 | TClonesArray *digits =&staticdigits; | |
d08a92dd | 271 | branch->SetAddress(&digits); |
272 | ||
273 | ResetRecpoint(); | |
274 | ||
275 | fTreeR = fTOFLoader->TreeR(); | |
276 | if (fTreeR == 0x0) | |
277 | { | |
278 | fTOFLoader->MakeTree("R"); | |
279 | fTreeR = fTOFLoader->TreeR(); | |
280 | } | |
281 | ||
282 | Int_t bufsize = 32000; | |
283 | fTreeR->Branch("TOF", &fRecPoints, bufsize); | |
284 | ||
285 | fTreeD->GetEvent(0); | |
286 | Int_t nDigits = digits->GetEntriesFast(); | |
287 | AliDebug(2,Form("Number of TOF digits: %d",nDigits)); | |
288 | ||
ac359ffe | 289 | Int_t ii; |
bf33f8f0 | 290 | Int_t dig[5]; //cluster detector indeces |
2bf4d9d6 | 291 | Int_t parTOF[7]; //The TOF signal parameters |
bf33f8f0 | 292 | Bool_t status=kTRUE; // assume all sim channels ok in the beginning... |
d08a92dd | 293 | for (ii=0; ii<nDigits; ii++) { |
294 | AliTOFdigit *d = (AliTOFdigit*)digits->UncheckedAt(ii); | |
295 | dig[0]=d->GetSector(); | |
296 | dig[1]=d->GetPlate(); | |
297 | dig[2]=d->GetStrip(); | |
298 | dig[3]=d->GetPadz(); | |
299 | dig[4]=d->GetPadx(); | |
300 | ||
729f0d7f | 301 | /* check valid index */ |
302 | if (dig[0]==-1||dig[1]==-1||dig[2]==-1||dig[3]==-1||dig[4]==-1) continue; | |
303 | ||
56483762 | 304 | // Do not reconstruct anything in the holes |
305 | if (dig[0]==13 || dig[0]==14 || dig[0]==15 ) { // sectors with holes | |
306 | if (dig[1]==2) { // plate with holes | |
307 | inholes++; | |
308 | continue; | |
309 | } | |
310 | } | |
311 | ||
2bf66a2d | 312 | AliDebug(2,Form(" %2d %1d %2d %1d %2d ",dig[0],dig[1],dig[2],dig[3],dig[4])); |
d0eb8f39 | 313 | |
bf33f8f0 | 314 | parTOF[0] = d->GetTdc(); //the TDC signal |
315 | parTOF[1] = d->GetToT(); //the ToT signal | |
316 | parTOF[2] = d->GetAdc(); // the adc charge | |
317 | parTOF[3] = d->GetTdcND(); // non decalibrated sim time | |
318 | parTOF[4] = d->GetTdc(); // raw time, == Tdc time for the moment | |
2bf4d9d6 | 319 | parTOF[5] = 0; // deltaBC |
320 | parTOF[6] = 0; // L0-L1 latency | |
ac359ffe | 321 | Double_t posClus[3]; |
322 | Double_t covClus[6]; | |
323 | UShort_t volIdClus=GetClusterVolIndex(dig); | |
324 | GetClusterPars(dig, posClus,covClus); | |
325 | AliTOFcluster *tofCluster = new AliTOFcluster(volIdClus,posClus[0],posClus[1],posClus[2],covClus[0],covClus[1],covClus[2],covClus[3],covClus[4],covClus[5],d->GetTracks(),dig,parTOF,status,ii); | |
d08a92dd | 326 | InsertCluster(tofCluster); |
bafe290d | 327 | |
d08a92dd | 328 | } |
329 | ||
bafe290d | 330 | AliDebug(1,Form("Number of found clusters: %d for event: %d", fNumberOfTofClusters, iEvent)); |
d08a92dd | 331 | |
37879eed | 332 | CalibrateRecPoint(); |
d08a92dd | 333 | FillRecPoint(); |
334 | ||
335 | fTreeR->Fill(); | |
336 | ResetRecpoint(); | |
337 | ||
338 | fTOFLoader = fRunLoader->GetLoader("TOFLoader"); | |
339 | fTOFLoader->WriteRecPoints("OVERWRITE"); | |
340 | ||
bafe290d | 341 | AliDebug(1,Form("Execution time to read TOF digits and to write TOF clusters : R:%.4fs C:%.4fs", |
342 | stopwatch.RealTime(),stopwatch.CpuTime())); | |
56483762 | 343 | if (inholes) AliWarning(Form("Clusters in the TOF holes: %d",inholes)); |
515faf5d | 344 | |
94f5f8f2 | 345 | } |
346 | ||
347 | //______________________________________________________________________________ | |
348 | ||
349 | void AliTOFClusterFinder::Digits2RecPoints(TTree* digitsTree, TTree* clusterTree) | |
350 | { | |
351 | // | |
352 | // Converts digits to recpoints for TOF | |
353 | // | |
354 | ||
355 | TStopwatch stopwatch; | |
356 | stopwatch.Start(); | |
357 | ||
56483762 | 358 | Int_t inholes = 0; |
359 | ||
94f5f8f2 | 360 | /// fRunLoader->GetEvent(iEvent); |
361 | ||
362 | if (digitsTree == 0x0) | |
363 | { | |
364 | AliFatal("AliTOFClusterFinder: Can not get TreeD"); | |
365 | } | |
366 | ||
367 | TBranch *branch = digitsTree->GetBranch("TOF"); | |
368 | if (!branch) { | |
369 | AliError("can't get the branch with the TOF digits !"); | |
370 | return; | |
371 | } | |
372 | ||
b24266ca | 373 | TClonesArray staticdigits("AliTOFdigit",10000); |
374 | staticdigits.Clear(); | |
375 | TClonesArray *digits = & staticdigits; | |
94f5f8f2 | 376 | branch->SetAddress(&digits); |
377 | ||
378 | ResetRecpoint(); | |
379 | ||
380 | fTreeR=clusterTree; | |
381 | Int_t bufsize = 32000; | |
382 | fTreeR->Branch("TOF", &fRecPoints, bufsize); | |
383 | ||
384 | digitsTree->GetEvent(0); | |
385 | Int_t nDigits = digits->GetEntriesFast(); | |
386 | AliDebug(2,Form("Number of TOF digits: %d",nDigits)); | |
387 | ||
ac359ffe | 388 | Int_t ii; |
94f5f8f2 | 389 | Int_t dig[5]; //cluster detector indeces |
2bf4d9d6 | 390 | Int_t parTOF[7]; //The TOF signal parameters |
94f5f8f2 | 391 | Bool_t status=kTRUE; // assume all sim channels ok in the beginning... |
392 | for (ii=0; ii<nDigits; ii++) { | |
393 | AliTOFdigit *d = (AliTOFdigit*)digits->UncheckedAt(ii); | |
394 | dig[0]=d->GetSector(); | |
395 | dig[1]=d->GetPlate(); | |
396 | dig[2]=d->GetStrip(); | |
397 | dig[3]=d->GetPadz(); | |
398 | dig[4]=d->GetPadx(); | |
399 | ||
729f0d7f | 400 | /* check valid index */ |
401 | if (dig[0]==-1||dig[1]==-1||dig[2]==-1||dig[3]==-1||dig[4]==-1) continue; | |
402 | ||
56483762 | 403 | // Do not reconstruct anything in the holes |
404 | if (dig[0]==13 || dig[0]==14 || dig[0]==15 ) { // sectors with holes | |
405 | if (dig[1]==2) { // plate with holes | |
406 | inholes++; | |
407 | continue; | |
408 | } | |
409 | } | |
410 | ||
2bf66a2d | 411 | // AliDebug(2,Form(" %2d %1d %2d %1d %2d ",dig[0],dig[1],dig[2],dig[3],dig[4])); |
94f5f8f2 | 412 | |
94f5f8f2 | 413 | parTOF[0] = d->GetTdc(); //the TDC signal |
414 | parTOF[1] = d->GetToT(); //the ToT signal | |
415 | parTOF[2] = d->GetAdc(); // the adc charge | |
416 | parTOF[3] = d->GetTdcND(); // non decalibrated sim time | |
417 | parTOF[4] = d->GetTdc(); // raw time, == Tdc time for the moment | |
2bf4d9d6 | 418 | parTOF[5] = 0; // deltaBC |
419 | parTOF[6] = 0; // L0-L1 latency | |
ac359ffe | 420 | |
421 | Double_t posClus[3]; | |
422 | Double_t covClus[6]; | |
423 | UShort_t volIdClus=GetClusterVolIndex(dig); | |
424 | GetClusterPars(dig,posClus,covClus); | |
2bf66a2d | 425 | AliTOFcluster *tofCluster = new AliTOFcluster(volIdClus,posClus[0],posClus[1],posClus[2],covClus[0],covClus[1],covClus[2],covClus[3],covClus[4],covClus[5],d->GetTracks(),dig,parTOF,status,ii); |
94f5f8f2 | 426 | InsertCluster(tofCluster); |
427 | ||
428 | } | |
429 | ||
bafe290d | 430 | AliDebug(1,Form("Number of found clusters: %d", fNumberOfTofClusters)); |
94f5f8f2 | 431 | |
432 | CalibrateRecPoint(); | |
433 | FillRecPoint(); | |
434 | ||
435 | clusterTree->Fill(); | |
436 | ResetRecpoint(); | |
437 | ||
bafe290d | 438 | AliDebug(1,Form("Execution time to read TOF digits and to write TOF clusters : R:%.4fs C:%.4fs", |
439 | stopwatch.RealTime(),stopwatch.CpuTime())); | |
56483762 | 440 | if (inholes) AliWarning(Form("Clusters in the TOF holes: %d",inholes)); |
94f5f8f2 | 441 | |
d08a92dd | 442 | } |
443 | //______________________________________________________________________________ | |
444 | ||
445 | void AliTOFClusterFinder::Digits2RecPoints(AliRawReader *rawReader, | |
446 | TTree *clustersTree) | |
447 | { | |
448 | // | |
449 | // Converts RAW data to recpoints for TOF | |
450 | // | |
451 | ||
515faf5d | 452 | TStopwatch stopwatch; |
453 | stopwatch.Start(); | |
454 | ||
56483762 | 455 | Int_t inholes = 0; |
456 | ||
d0eb8f39 | 457 | const Int_t kDDL = AliDAQ::NumberOfDdls("TOF"); |
d08a92dd | 458 | |
459 | ResetRecpoint(); | |
460 | ||
461 | Int_t bufsize = 32000; | |
462 | clustersTree->Branch("TOF", &fRecPoints, bufsize); | |
463 | ||
15ec34b9 | 464 | TClonesArray * clonesRawData; |
465 | ||
15ec34b9 | 466 | Int_t dummy = -1; |
d08a92dd | 467 | |
468 | Int_t detectorIndex[5]; | |
2bf4d9d6 | 469 | Int_t parTOF[7]; |
d08a92dd | 470 | |
15ec34b9 | 471 | ofstream ftxt; |
472 | if (fVerbose==2) ftxt.open("TOFdigitsRead.txt",ios::app); | |
473 | ||
0275b7df | 474 | //AliTOFRawStream tofInput(rawReader); |
475 | fTOFRawStream.Clear(); | |
476 | fTOFRawStream.SetRawReader(rawReader); | |
ef58b2af | 477 | |
bafe290d | 478 | if (fDecoderVersion) |
479 | AliInfo("Using New Decoder"); | |
480 | ||
15ec34b9 | 481 | Int_t indexDDL = 0; |
482 | for (indexDDL = 0; indexDDL < kDDL; indexDDL++) { | |
483 | ||
484 | rawReader->Reset(); | |
bafe290d | 485 | if (fDecoderVersion) |
0275b7df | 486 | fTOFRawStream.LoadRawDataBuffers(indexDDL,fVerbose); |
0275b7df | 487 | else fTOFRawStream.LoadRawData(indexDDL); |
15ec34b9 | 488 | |
0275b7df | 489 | clonesRawData = (TClonesArray*)fTOFRawStream.GetRawData(); |
15ec34b9 | 490 | |
491 | for (Int_t iRawData = 0; iRawData<clonesRawData->GetEntriesFast(); iRawData++) { | |
492 | ||
493 | AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData); | |
494 | ||
c3891b7a | 495 | //if (tofRawDatum->GetTOT()==-1 || tofRawDatum->GetTOF()==-1) continue; |
496 | if (tofRawDatum->GetTOF()==-1) continue; | |
15ec34b9 | 497 | |
498 | if (fVerbose==2) { | |
499 | if (indexDDL<10) ftxt << " " << indexDDL; | |
500 | else ftxt << " " << indexDDL; | |
501 | if (tofRawDatum->GetTRM()<10) ftxt << " " << tofRawDatum->GetTRM(); | |
502 | else ftxt << " " << tofRawDatum->GetTRM(); | |
503 | ftxt << " " << tofRawDatum->GetTRMchain(); | |
504 | if (tofRawDatum->GetTDC()<10) ftxt << " " << tofRawDatum->GetTDC(); | |
505 | else ftxt << " " << tofRawDatum->GetTDC(); | |
506 | ftxt << " " << tofRawDatum->GetTDCchannel(); | |
507 | } | |
508 | ||
0275b7df | 509 | fTOFRawStream.EquipmentId2VolumeId(indexDDL, tofRawDatum->GetTRM(), tofRawDatum->GetTRMchain(), |
510 | tofRawDatum->GetTDC(), tofRawDatum->GetTDCchannel(), detectorIndex); | |
15ec34b9 | 511 | dummy = detectorIndex[3]; |
512 | detectorIndex[3] = detectorIndex[4]; | |
513 | detectorIndex[4] = dummy; | |
514 | ||
515 | if (fVerbose==2) { | |
516 | if (detectorIndex[0]<10) ftxt << " -> " << detectorIndex[0]; | |
517 | else ftxt << " -> " << detectorIndex[0]; | |
518 | ftxt << " " << detectorIndex[1]; | |
519 | if (detectorIndex[2]<10) ftxt << " " << detectorIndex[2]; | |
520 | else ftxt << " " << detectorIndex[2]; | |
521 | ftxt << " " << detectorIndex[3]; | |
522 | if (detectorIndex[4]<10) ftxt << " " << detectorIndex[4]; | |
523 | else ftxt << " " << detectorIndex[4]; | |
524 | } | |
525 | ||
729f0d7f | 526 | /* check valid index */ |
527 | if (detectorIndex[0]==-1||detectorIndex[1]==-1||detectorIndex[2]==-1||detectorIndex[3]==-1||detectorIndex[4]==-1) continue; | |
528 | ||
56483762 | 529 | // Do not reconstruct anything in the holes |
530 | if (detectorIndex[0]==13 || detectorIndex[0]==14 || detectorIndex[0]==15 ) { // sectors with holes | |
531 | if (detectorIndex[1]==2) { // plate with holes | |
532 | inholes++; | |
533 | continue; | |
534 | } | |
535 | } | |
536 | ||
bf33f8f0 | 537 | parTOF[0] = tofRawDatum->GetTOF(); //TDC |
538 | parTOF[1] = tofRawDatum->GetTOT(); // TOT | |
539 | parTOF[2] = tofRawDatum->GetTOT(); //ADC==TOF | |
540 | parTOF[3] = -1;//raw data: no track of undecalib sim time | |
541 | parTOF[4] = tofRawDatum->GetTOF(); // RAW time | |
2bf4d9d6 | 542 | parTOF[5] = tofRawDatum->GetDeltaBC(); // deltaBC |
543 | parTOF[6] = tofRawDatum->GetL0L1Latency(); // L0-L1 latency | |
ac359ffe | 544 | Double_t posClus[3]; |
545 | Double_t covClus[6]; | |
546 | UShort_t volIdClus=GetClusterVolIndex(detectorIndex); | |
547 | Int_t lab[3]={-1,-1,-1}; | |
548 | Bool_t status=kTRUE; | |
549 | GetClusterPars(detectorIndex,posClus,covClus); | |
2bf66a2d | 550 | AliTOFcluster *tofCluster = new AliTOFcluster(volIdClus,posClus[0],posClus[1],posClus[2],covClus[0],covClus[1],covClus[2],covClus[3],covClus[4],covClus[5],lab,detectorIndex,parTOF,status,-1); |
15ec34b9 | 551 | InsertCluster(tofCluster); |
552 | ||
553 | if (fVerbose==2) { | |
bf33f8f0 | 554 | if (parTOF[1]<10)ftxt << " " << parTOF[1]; |
555 | else if (parTOF[1]>=10 && parTOF[1]<100) ftxt << " " << parTOF[1]; | |
556 | else ftxt << " " << parTOF[1]; | |
557 | if (parTOF[0]<10) ftxt << " " << parTOF[0] << endl; | |
558 | else if (parTOF[0]>=10 && parTOF[0]<100) ftxt << " " << parTOF[0] << endl; | |
559 | else if (parTOF[0]>=100 && parTOF[0]<1000) ftxt << " " << parTOF[0] << endl; | |
560 | else ftxt << " " << parTOF[3] << endl; | |
15ec34b9 | 561 | } |
562 | ||
563 | } // closed loop on TOF raw data per current DDL file | |
564 | ||
565 | clonesRawData->Clear(); | |
566 | ||
567 | } // closed loop on DDL index | |
568 | ||
15ec34b9 | 569 | if (fVerbose==2) ftxt.close(); |
d08a92dd | 570 | |
bafe290d | 571 | AliDebug(1,Form("Number of found clusters: %d", fNumberOfTofClusters)); |
d08a92dd | 572 | |
37879eed | 573 | CalibrateRecPoint(); |
d08a92dd | 574 | FillRecPoint(); |
575 | ||
576 | clustersTree->Fill(); | |
37879eed | 577 | |
d08a92dd | 578 | ResetRecpoint(); |
579 | ||
515faf5d | 580 | AliDebug(1, Form("Execution time to read TOF raw data and to write TOF clusters : R:%.4fs C:%.4fs", |
581 | stopwatch.RealTime(),stopwatch.CpuTime())); | |
56483762 | 582 | if (inholes) AliWarning(Form("Clusters in the TOF holes: %d",inholes)); |
515faf5d | 583 | |
d08a92dd | 584 | } |
585 | //______________________________________________________________________________ | |
586 | ||
587 | void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent, AliRawReader *rawReader) | |
588 | { | |
589 | // | |
590 | // Converts RAW data to recpoints for TOF | |
591 | // | |
592 | ||
515faf5d | 593 | TStopwatch stopwatch; |
594 | stopwatch.Start(); | |
595 | ||
56483762 | 596 | Int_t inholes = 0; |
597 | ||
d0eb8f39 | 598 | const Int_t kDDL = AliDAQ::NumberOfDdls("TOF"); |
d08a92dd | 599 | |
600 | fRunLoader->GetEvent(iEvent); | |
601 | ||
2bf66a2d | 602 | AliDebug(2,Form(" Event number %2d ", iEvent)); |
d08a92dd | 603 | |
604 | fTreeR = fTOFLoader->TreeR(); | |
605 | ||
606 | if (fTreeR == 0x0){ | |
607 | fTOFLoader->MakeTree("R"); | |
608 | fTreeR = fTOFLoader->TreeR(); | |
609 | } | |
610 | ||
611 | Int_t bufsize = 32000; | |
612 | fTreeR->Branch("TOF", &fRecPoints, bufsize); | |
613 | ||
15ec34b9 | 614 | TClonesArray * clonesRawData; |
615 | ||
15ec34b9 | 616 | Int_t dummy = -1; |
d08a92dd | 617 | |
d0eb8f39 | 618 | Int_t detectorIndex[5] = {-1, -1, -1, -1, -1}; |
2bf4d9d6 | 619 | Int_t parTOF[7]; |
15ec34b9 | 620 | ofstream ftxt; |
621 | if (fVerbose==2) ftxt.open("TOFdigitsRead.txt",ios::app); | |
622 | ||
0275b7df | 623 | //AliTOFRawStream tofInput(rawReader); |
624 | fTOFRawStream.Clear(); | |
625 | fTOFRawStream.SetRawReader(rawReader); | |
ef58b2af | 626 | |
bafe290d | 627 | if (fDecoderVersion) |
628 | AliInfo("Using New Decoder"); | |
629 | ||
15ec34b9 | 630 | Int_t indexDDL = 0; |
d08a92dd | 631 | for (indexDDL = 0; indexDDL < kDDL; indexDDL++) { |
632 | ||
633 | rawReader->Reset(); | |
bafe290d | 634 | if (fDecoderVersion) |
0275b7df | 635 | fTOFRawStream.LoadRawDataBuffers(indexDDL,fVerbose); |
0275b7df | 636 | else fTOFRawStream.LoadRawData(indexDDL); |
15ec34b9 | 637 | |
0275b7df | 638 | clonesRawData = (TClonesArray*)fTOFRawStream.GetRawData(); |
15ec34b9 | 639 | |
640 | for (Int_t iRawData = 0; iRawData<clonesRawData->GetEntriesFast(); iRawData++) { | |
641 | ||
642 | AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData); | |
643 | ||
c3891b7a | 644 | //if (tofRawDatum->GetTOT()==-1 || tofRawDatum->GetTOF()==-1) continue; |
645 | if (tofRawDatum->GetTOF()==-1) continue; | |
15ec34b9 | 646 | |
647 | if (fVerbose==2) { | |
648 | if (indexDDL<10) ftxt << " " << indexDDL; | |
649 | else ftxt << " " << indexDDL; | |
650 | if (tofRawDatum->GetTRM()<10) ftxt << " " << tofRawDatum->GetTRM(); | |
651 | else ftxt << " " << tofRawDatum->GetTRM(); | |
652 | ftxt << " " << tofRawDatum->GetTRMchain(); | |
653 | if (tofRawDatum->GetTDC()<10) ftxt << " " << tofRawDatum->GetTDC(); | |
654 | else ftxt << " " << tofRawDatum->GetTDC(); | |
655 | ftxt << " " << tofRawDatum->GetTDCchannel(); | |
656 | } | |
657 | ||
0275b7df | 658 | fTOFRawStream.EquipmentId2VolumeId(indexDDL, tofRawDatum->GetTRM(), tofRawDatum->GetTRMchain(), |
659 | tofRawDatum->GetTDC(), tofRawDatum->GetTDCchannel(), detectorIndex); | |
15ec34b9 | 660 | dummy = detectorIndex[3]; |
661 | detectorIndex[3] = detectorIndex[4]; | |
662 | detectorIndex[4] = dummy; | |
663 | ||
664 | if (fVerbose==2) { | |
665 | if (detectorIndex[0]<10) ftxt << " -> " << detectorIndex[0]; | |
666 | else ftxt << " -> " << detectorIndex[0]; | |
667 | ftxt << " " << detectorIndex[1]; | |
668 | if (detectorIndex[2]<10) ftxt << " " << detectorIndex[2]; | |
669 | else ftxt << " " << detectorIndex[2]; | |
670 | ftxt << " " << detectorIndex[3]; | |
671 | if (detectorIndex[4]<10) ftxt << " " << detectorIndex[4]; | |
672 | else ftxt << " " << detectorIndex[4]; | |
673 | } | |
d0eb8f39 | 674 | |
729f0d7f | 675 | /* check valid index */ |
676 | if (detectorIndex[0]==-1||detectorIndex[1]==-1||detectorIndex[2]==-1||detectorIndex[3]==-1||detectorIndex[4]==-1) continue; | |
677 | ||
56483762 | 678 | // Do not reconstruct anything in the holes |
679 | if (detectorIndex[0]==13 || detectorIndex[0]==14 || detectorIndex[0]==15 ) { // sectors with holes | |
680 | if (detectorIndex[1]==2) { // plate with holes | |
681 | inholes++; | |
682 | continue; | |
683 | } | |
684 | } | |
685 | ||
bf33f8f0 | 686 | parTOF[0] = tofRawDatum->GetTOF(); // TDC |
687 | parTOF[1] = tofRawDatum->GetTOT(); // TOT | |
688 | parTOF[2] = tofRawDatum->GetTOT(); // raw data have ADC=TOT | |
689 | parTOF[3] = -1; //raw data: no track of the undecalib sim time | |
690 | parTOF[4] = tofRawDatum->GetTOF(); // Raw time == TDC | |
2bf4d9d6 | 691 | parTOF[5] = tofRawDatum->GetDeltaBC(); // deltaBC |
692 | parTOF[6] = tofRawDatum->GetL0L1Latency(); // L0-L1 latency | |
ac359ffe | 693 | Double_t posClus[3]; |
694 | Double_t covClus[6]; | |
695 | UShort_t volIdClus=GetClusterVolIndex(detectorIndex); | |
696 | Int_t lab[3]={-1,-1,-1}; | |
697 | Bool_t status=kTRUE; | |
698 | GetClusterPars(detectorIndex,posClus,covClus); | |
699 | AliTOFcluster *tofCluster = new AliTOFcluster(volIdClus,posClus[0],posClus[1],posClus[2],covClus[0],covClus[1],covClus[2],covClus[3],covClus[4],covClus[5],lab,detectorIndex,parTOF,status,-1); | |
d08a92dd | 700 | InsertCluster(tofCluster); |
701 | ||
15ec34b9 | 702 | if (fVerbose==2) { |
bf33f8f0 | 703 | if (parTOF[1]<10)ftxt << " " << parTOF[1]; |
704 | else if (parTOF[1]>=10 && parTOF[1]<100) ftxt << " " << parTOF[1]; | |
705 | else ftxt << " " << parTOF[1]; | |
706 | if (parTOF[0]<10) ftxt << " " << parTOF[0] << endl; | |
707 | else if (parTOF[0]>=10 && parTOF[0]<100) ftxt << " " << parTOF[0] << endl; | |
708 | else if (parTOF[0]>=100 && parTOF[0]<1000) ftxt << " " << parTOF[0] << endl; | |
709 | else ftxt << " " << parTOF[3] << endl; | |
15ec34b9 | 710 | } |
d08a92dd | 711 | |
15ec34b9 | 712 | } // closed loop on TOF raw data per current DDL file |
713 | ||
714 | clonesRawData->Clear(); | |
715 | ||
716 | } // closed loop on DDL index | |
717 | ||
718 | if (fVerbose==2) ftxt.close(); | |
d08a92dd | 719 | |
bafe290d | 720 | AliDebug(1,Form("Number of found clusters: %d for event: %d", fNumberOfTofClusters, iEvent)); |
d08a92dd | 721 | |
37879eed | 722 | CalibrateRecPoint(); |
d08a92dd | 723 | FillRecPoint(); |
724 | ||
725 | fTreeR->Fill(); | |
726 | ResetRecpoint(); | |
727 | ||
728 | fTOFLoader = fRunLoader->GetLoader("TOFLoader"); | |
729 | fTOFLoader->WriteRecPoints("OVERWRITE"); | |
730 | ||
515faf5d | 731 | AliDebug(1, Form("Execution time to read TOF raw data and to write TOF clusters : R:%.4fs C:%.4fs", |
732 | stopwatch.RealTime(),stopwatch.CpuTime())); | |
56483762 | 733 | if (inholes) AliWarning(Form("Clusters in the TOF holes: %d",inholes)); |
515faf5d | 734 | |
d08a92dd | 735 | } |
736 | //______________________________________________________________________________ | |
737 | ||
738 | void AliTOFClusterFinder::Raw2Digits(Int_t iEvent, AliRawReader *rawReader) | |
739 | { | |
740 | // | |
741 | // Converts RAW data to MC digits for TOF | |
742 | // | |
743 | // (temporary solution) | |
744 | // | |
745 | ||
515faf5d | 746 | TStopwatch stopwatch; |
747 | stopwatch.Start(); | |
748 | ||
ba66add8 | 749 | const Int_t kDDL = AliTOFGeometry::NDDL()*AliTOFGeometry::NSectors(); |
15ec34b9 | 750 | |
d08a92dd | 751 | fRunLoader->GetEvent(iEvent); |
752 | ||
753 | fTreeD = fTOFLoader->TreeD(); | |
754 | if (fTreeD) | |
755 | { | |
d0eb8f39 | 756 | AliInfo("TreeD re-creation"); |
d08a92dd | 757 | fTreeD = 0x0; |
758 | fTOFLoader->MakeTree("D"); | |
759 | fTreeD = fTOFLoader->TreeD(); | |
760 | } | |
761 | ||
15ec34b9 | 762 | TClonesArray *tofDigits = new TClonesArray("AliTOFdigit",10000); |
d08a92dd | 763 | Int_t bufsize = 32000; |
764 | fTreeD->Branch("TOF", &tofDigits, bufsize); | |
765 | ||
d08a92dd | 766 | fRunLoader->GetEvent(iEvent); |
767 | ||
2bf66a2d | 768 | AliDebug(2,Form(" Event number %2d ", iEvent)); |
d08a92dd | 769 | |
15ec34b9 | 770 | TClonesArray * clonesRawData; |
771 | ||
772 | Int_t dummy = -1; | |
d08a92dd | 773 | |
774 | Int_t detectorIndex[5]; | |
bf33f8f0 | 775 | Int_t digit[4]; |
d08a92dd | 776 | |
0275b7df | 777 | //AliTOFRawStream tofInput(rawReader); |
778 | fTOFRawStream.Clear(); | |
779 | fTOFRawStream.SetRawReader(rawReader); | |
ef58b2af | 780 | |
bafe290d | 781 | if (fDecoderVersion) |
782 | AliInfo("Using New Decoder"); | |
783 | ||
15ec34b9 | 784 | Int_t indexDDL = 0; |
d08a92dd | 785 | for (indexDDL = 0; indexDDL < kDDL; indexDDL++) { |
786 | ||
787 | rawReader->Reset(); | |
bafe290d | 788 | if (fDecoderVersion) |
0275b7df | 789 | fTOFRawStream.LoadRawDataBuffers(indexDDL,fVerbose); |
0275b7df | 790 | else fTOFRawStream.LoadRawData(indexDDL); |
d08a92dd | 791 | |
0275b7df | 792 | clonesRawData = (TClonesArray*)fTOFRawStream.GetRawData(); |
d08a92dd | 793 | |
15ec34b9 | 794 | for (Int_t iRawData = 0; iRawData<clonesRawData->GetEntriesFast(); iRawData++) { |
d0eb8f39 | 795 | |
15ec34b9 | 796 | AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData); |
d0eb8f39 | 797 | |
3e2f0097 | 798 | //if (!tofRawDatum->GetTOT() || !tofRawDatum->GetTOF()) continue; |
799 | if (tofRawDatum->GetTOF()==-1) continue; | |
15ec34b9 | 800 | |
0275b7df | 801 | fTOFRawStream.EquipmentId2VolumeId(indexDDL, tofRawDatum->GetTRM(), tofRawDatum->GetTRMchain(), |
802 | tofRawDatum->GetTDC(), tofRawDatum->GetTDCchannel(), detectorIndex); | |
15ec34b9 | 803 | dummy = detectorIndex[3]; |
804 | detectorIndex[3] = detectorIndex[4]; | |
805 | detectorIndex[4] = dummy; | |
d0eb8f39 | 806 | |
0275b7df | 807 | digit[0] = fTOFRawStream.GetTofBin(); |
808 | digit[1] = fTOFRawStream.GetToTbin(); | |
809 | digit[2] = fTOFRawStream.GetToTbin(); | |
bf33f8f0 | 810 | digit[3] = -1; |
d08a92dd | 811 | |
812 | Int_t tracknum[3]={-1,-1,-1}; | |
813 | ||
814 | TClonesArray &aDigits = *tofDigits; | |
815 | Int_t last=tofDigits->GetEntriesFast(); | |
816 | new (aDigits[last]) AliTOFdigit(tracknum, detectorIndex, digit); | |
817 | ||
818 | } // while loop | |
819 | ||
15ec34b9 | 820 | clonesRawData->Clear(); |
821 | ||
d08a92dd | 822 | } // DDL Loop |
823 | ||
824 | fTreeD->Fill(); | |
825 | ||
826 | fTOFLoader = fRunLoader->GetLoader("TOFLoader"); | |
827 | fTOFLoader->WriteDigits("OVERWRITE"); | |
2bf66a2d | 828 | |
829 | delete tofDigits; | |
830 | ||
515faf5d | 831 | AliDebug(1, Form("Execution time to read TOF raw data and to write TOF clusters : R:%.2fs C:%.2fs", |
832 | stopwatch.RealTime(),stopwatch.CpuTime())); | |
833 | ||
94f5f8f2 | 834 | } |
835 | ||
836 | //______________________________________________________________________________ | |
837 | ||
838 | void AliTOFClusterFinder::Raw2Digits(AliRawReader *rawReader, TTree* digitsTree) | |
839 | { | |
840 | // | |
841 | // Converts RAW data to MC digits for TOF for the current event | |
842 | // | |
843 | // | |
844 | ||
845 | TStopwatch stopwatch; | |
846 | stopwatch.Start(); | |
847 | ||
ba66add8 | 848 | const Int_t kDDL = AliTOFGeometry::NDDL()*AliTOFGeometry::NSectors(); |
94f5f8f2 | 849 | |
850 | if (!digitsTree) | |
851 | { | |
852 | AliError("No input digits Tree"); | |
853 | return; | |
854 | } | |
855 | ||
856 | TClonesArray *tofDigits = new TClonesArray("AliTOFdigit",10000); | |
857 | Int_t bufsize = 32000; | |
858 | digitsTree->Branch("TOF", &tofDigits, bufsize); | |
859 | ||
94f5f8f2 | 860 | TClonesArray * clonesRawData; |
861 | ||
862 | Int_t dummy = -1; | |
863 | ||
864 | Int_t detectorIndex[5]; | |
865 | Int_t digit[4]; | |
866 | ||
0275b7df | 867 | //AliTOFRawStream tofInput(rawReader); |
868 | fTOFRawStream.Clear(); | |
869 | fTOFRawStream.SetRawReader(rawReader); | |
ef58b2af | 870 | |
bafe290d | 871 | if (fDecoderVersion) |
872 | AliInfo("Using New Decoder"); | |
873 | ||
94f5f8f2 | 874 | Int_t indexDDL = 0; |
875 | for (indexDDL = 0; indexDDL < kDDL; indexDDL++) { | |
876 | ||
877 | rawReader->Reset(); | |
bafe290d | 878 | if (fDecoderVersion) |
0275b7df | 879 | fTOFRawStream.LoadRawDataBuffers(indexDDL,fVerbose); |
0275b7df | 880 | else fTOFRawStream.LoadRawData(indexDDL); |
94f5f8f2 | 881 | |
0275b7df | 882 | clonesRawData = (TClonesArray*)fTOFRawStream.GetRawData(); |
94f5f8f2 | 883 | |
884 | for (Int_t iRawData = 0; iRawData<clonesRawData->GetEntriesFast(); iRawData++) { | |
885 | ||
886 | AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData); | |
887 | ||
3e2f0097 | 888 | //if (!tofRawDatum->GetTOT() || !tofRawDatum->GetTOF()) continue; |
889 | if (tofRawDatum->GetTOF()==-1) continue; | |
94f5f8f2 | 890 | |
0275b7df | 891 | fTOFRawStream.EquipmentId2VolumeId(indexDDL, tofRawDatum->GetTRM(), tofRawDatum->GetTRMchain(), |
892 | tofRawDatum->GetTDC(), tofRawDatum->GetTDCchannel(), detectorIndex); | |
94f5f8f2 | 893 | dummy = detectorIndex[3]; |
894 | detectorIndex[3] = detectorIndex[4]; | |
895 | detectorIndex[4] = dummy; | |
896 | ||
0275b7df | 897 | digit[0] = fTOFRawStream.GetTofBin(); |
898 | digit[1] = fTOFRawStream.GetToTbin(); | |
899 | digit[2] = fTOFRawStream.GetToTbin(); | |
94f5f8f2 | 900 | digit[3] = -1; |
901 | ||
902 | Int_t tracknum[3]={-1,-1,-1}; | |
903 | ||
904 | TClonesArray &aDigits = *tofDigits; | |
905 | Int_t last=tofDigits->GetEntriesFast(); | |
906 | new (aDigits[last]) AliTOFdigit(tracknum, detectorIndex, digit); | |
907 | ||
908 | } // while loop | |
909 | ||
910 | clonesRawData->Clear(); | |
911 | ||
912 | } // DDL Loop | |
913 | ||
914 | digitsTree->Fill(); | |
915 | ||
2bf66a2d | 916 | delete tofDigits; |
917 | ||
918 | AliDebug(1, Form("Got %d digits: ", fDigits->GetEntries())); | |
94f5f8f2 | 919 | AliDebug(1, Form("Execution time to read TOF raw data and fill TOF digit tree : R:%.2fs C:%.2fs", |
920 | stopwatch.RealTime(),stopwatch.CpuTime())); | |
921 | ||
d08a92dd | 922 | } |
923 | //______________________________________________________________________________ | |
924 | ||
925 | Int_t AliTOFClusterFinder::InsertCluster(AliTOFcluster *tofCluster) { | |
926 | //---------------------------------------------------------------------------// | |
927 | // This function adds a TOF cluster to the array of TOF clusters sorted in Z // | |
928 | //---------------------------------------------------------------------------// | |
929 | if (fNumberOfTofClusters==kTofMaxCluster) { | |
930 | AliError("Too many clusters !"); | |
931 | return 1; | |
932 | } | |
933 | ||
934 | if (fNumberOfTofClusters==0) { | |
935 | fTofClusters[fNumberOfTofClusters++] = tofCluster; | |
936 | return 0; | |
937 | } | |
938 | ||
939 | Int_t ii = FindClusterIndex(tofCluster->GetZ()); | |
940 | memmove(fTofClusters+ii+1 ,fTofClusters+ii,(fNumberOfTofClusters-ii)*sizeof(AliTOFcluster*)); | |
941 | fTofClusters[ii] = tofCluster; | |
942 | fNumberOfTofClusters++; | |
943 | ||
944 | return 0; | |
945 | ||
946 | } | |
947 | //_________________________________________________________________________ | |
948 | ||
949 | Int_t AliTOFClusterFinder::FindClusterIndex(Double_t z) const { | |
950 | //-------------------------------------------------------------------- | |
ac359ffe | 951 | // This function returns the index of the nearest cluster in z |
d08a92dd | 952 | //-------------------------------------------------------------------- |
953 | if (fNumberOfTofClusters==0) return 0; | |
954 | if (z <= fTofClusters[0]->GetZ()) return 0; | |
955 | if (z > fTofClusters[fNumberOfTofClusters-1]->GetZ()) return fNumberOfTofClusters; | |
956 | Int_t b = 0, e = fNumberOfTofClusters-1, m = (b+e)/2; | |
957 | for (; b<e; m=(b+e)/2) { | |
958 | if (z > fTofClusters[m]->GetZ()) b=m+1; | |
959 | else e=m; | |
960 | } | |
961 | ||
962 | return m; | |
963 | ||
964 | } | |
965 | //_________________________________________________________________________ | |
966 | ||
967 | void AliTOFClusterFinder::FillRecPoint() | |
968 | { | |
969 | // | |
970 | // Copy the global array of AliTOFcluster, i.e. fTofClusters (sorted | |
971 | // in Z) in the global TClonesArray of AliTOFcluster, | |
972 | // i.e. fRecPoints. | |
973 | // | |
974 | ||
975 | Int_t ii, jj; | |
976 | ||
977 | Int_t detectorIndex[5]; | |
2bf4d9d6 | 978 | Int_t parTOF[7]; |
d08a92dd | 979 | Int_t trackLabels[3]; |
980 | Int_t digitIndex = -1; | |
bf33f8f0 | 981 | Bool_t status=kTRUE; |
d08a92dd | 982 | |
983 | TClonesArray &lRecPoints = *fRecPoints; | |
984 | ||
985 | for (ii=0; ii<fNumberOfTofClusters; ii++) { | |
986 | ||
987 | digitIndex = fTofClusters[ii]->GetIndex(); | |
988 | for(jj=0; jj<5; jj++) detectorIndex[jj] = fTofClusters[ii]->GetDetInd(jj); | |
989 | for(jj=0; jj<3; jj++) trackLabels[jj] = fTofClusters[ii]->GetLabel(jj); | |
bf33f8f0 | 990 | parTOF[0] = fTofClusters[ii]->GetTDC(); // TDC |
991 | parTOF[1] = fTofClusters[ii]->GetToT(); // TOT | |
992 | parTOF[2] = fTofClusters[ii]->GetADC(); // ADC=TOT | |
993 | parTOF[3] = fTofClusters[ii]->GetTDCND(); // TDCND | |
994 | parTOF[4] = fTofClusters[ii]->GetTDCRAW();//RAW | |
2bf4d9d6 | 995 | parTOF[5] = fTofClusters[ii]->GetDeltaBC();//deltaBC |
996 | parTOF[6] = fTofClusters[ii]->GetL0L1Latency();//L0-L1 latency | |
bf33f8f0 | 997 | status=fTofClusters[ii]->GetStatus(); |
ac359ffe | 998 | Double_t posClus[3]; |
999 | Double_t covClus[6]; | |
1000 | UShort_t volIdClus=GetClusterVolIndex(detectorIndex); | |
1001 | GetClusterPars(detectorIndex,posClus,covClus); | |
1002 | new(lRecPoints[ii]) AliTOFcluster(volIdClus,posClus[0],posClus[1],posClus[2],covClus[0],covClus[1],covClus[2],covClus[3],covClus[4],covClus[5],trackLabels,detectorIndex, parTOF,status,digitIndex); | |
d08a92dd | 1003 | |
2bf66a2d | 1004 | AliDebug(2, Form(" %4d %4d %f %f %f %f %f %f %f %f %f %3d %3d %3d %2d %1d %2d %1d %2d %4d %3d %3d %4d %4d %1d %4d", |
3e2f0097 | 1005 | ii, volIdClus, posClus[0], posClus[1], posClus[2], |
1006 | fTofClusters[ii]->GetSigmaX2(), | |
1007 | fTofClusters[ii]->GetSigmaXY(), | |
1008 | fTofClusters[ii]->GetSigmaXZ(), | |
1009 | fTofClusters[ii]->GetSigmaY2(), | |
1010 | fTofClusters[ii]->GetSigmaYZ(), | |
1011 | fTofClusters[ii]->GetSigmaZ2(), | |
1012 | trackLabels[0], trackLabels[1], trackLabels[2], | |
1013 | detectorIndex[0], detectorIndex[1], detectorIndex[2], detectorIndex[3], detectorIndex[4], | |
1014 | parTOF[0], parTOF[1], parTOF[2], parTOF[3], parTOF[4], | |
1015 | status, digitIndex)); | |
1016 | ||
d08a92dd | 1017 | } // loop on clusters |
1018 | ||
1019 | } | |
37879eed | 1020 | |
1021 | //_________________________________________________________________________ | |
1022 | void AliTOFClusterFinder::CalibrateRecPoint() | |
1023 | { | |
1024 | // | |
1025 | // Copy the global array of AliTOFcluster, i.e. fTofClusters (sorted | |
1026 | // in Z) in the global TClonesArray of AliTOFcluster, | |
1027 | // i.e. fRecPoints. | |
1028 | // | |
1029 | ||
1030 | Int_t ii, jj; | |
1031 | ||
1032 | Int_t detectorIndex[5]; | |
1033 | Int_t digitIndex = -1; | |
a33fec85 | 1034 | Double_t tToT; |
1035 | Double_t timeCorr; | |
bf33f8f0 | 1036 | Int_t tdcCorr; |
2bf4d9d6 | 1037 | Float_t tdcLatencyWindow; |
bafe290d | 1038 | AliDebug(1," Calibrating TOF Clusters"); |
1039 | ||
17149e6b | 1040 | AliTOFChannelOnlineArray *calDelay = fTOFcalib->GetTOFOnlineDelay(); |
1041 | AliTOFChannelOnlineStatusArray *calStatus = fTOFcalib->GetTOFOnlineStatus(); | |
ba66add8 | 1042 | TObjArray *calTOFArrayOffline = fTOFcalib->GetTOFCalArrayOffline(); |
2bf4d9d6 | 1043 | |
1044 | AliTOFDeltaBCOffset *deltaBCOffsetObj = fTOFcalib->GetDeltaBCOffset(); | |
1045 | Int_t deltaBCOffset = deltaBCOffsetObj->GetDeltaBCOffset(); | |
1046 | AliTOFCTPLatency *ctpLatencyObj = fTOFcalib->GetCTPLatency(); | |
1047 | Float_t ctpLatency = ctpLatencyObj->GetCTPLatency(); | |
1048 | AliTOFT0Fill *t0FillObj = fTOFcalib->GetT0Fill(); | |
1049 | Float_t t0Fill = t0FillObj->GetT0Fill(); | |
bafe290d | 1050 | |
ba66add8 | 1051 | TString validity = (TString)fTOFcalib->GetOfflineValidity(); |
ba66add8 | 1052 | Int_t calibration = -1; |
1053 | if (validity.CompareTo("valid")==0) { | |
bafe290d | 1054 | AliInfo(Form(" validity = %s - Using offline calibration parameters",validity.Data())); |
ba66add8 | 1055 | calibration = 1; |
bafe290d | 1056 | } else { |
1057 | AliInfo(Form(" validity = %s - Using online calibration parameters",validity.Data())); | |
ba66add8 | 1058 | calibration = 0 ; |
1059 | } | |
bafe290d | 1060 | |
37879eed | 1061 | for (ii=0; ii<fNumberOfTofClusters; ii++) { |
1062 | digitIndex = fTofClusters[ii]->GetIndex(); | |
1063 | for(jj=0; jj<5; jj++) detectorIndex[jj] = fTofClusters[ii]->GetDetInd(jj); | |
1064 | ||
ba66add8 | 1065 | Int_t index = AliTOFGeometry::GetIndex(detectorIndex); |
37879eed | 1066 | |
17149e6b | 1067 | UChar_t statusPulser=calStatus->GetPulserStatus(index); |
1068 | UChar_t statusNoise=calStatus->GetNoiseStatus(index); | |
1069 | UChar_t statusHW=calStatus->GetHWStatus(index); | |
1070 | UChar_t status=calStatus->GetStatus(index); | |
2bf4d9d6 | 1071 | tdcLatencyWindow = calStatus->GetLatencyWindow(index) * 1.e3; /* ns -> ps */ |
1072 | ||
17149e6b | 1073 | //check the status, also unknown is fine!!!!!!! |
1074 | ||
2bf66a2d | 1075 | AliDebug(2, Form(" Status for channel %d = %d",index, (Int_t)status)); |
17149e6b | 1076 | if((statusPulser & AliTOFChannelOnlineStatusArray::kTOFPulserBad)==(AliTOFChannelOnlineStatusArray::kTOFPulserBad)||(statusNoise & AliTOFChannelOnlineStatusArray::kTOFNoiseBad)==(AliTOFChannelOnlineStatusArray::kTOFNoiseBad)||(statusHW & AliTOFChannelOnlineStatusArray::kTOFHWBad)==(AliTOFChannelOnlineStatusArray::kTOFHWBad)){ |
2bf66a2d | 1077 | AliDebug(2, Form(" Bad Status for channel %d",index)); |
7fffa85b | 1078 | fTofClusters[ii]->SetStatus(kFALSE); //odd convention, to avoid conflict with calibration objects currently in the db (temporary solution). |
1079 | } | |
1080 | else { | |
2bf66a2d | 1081 | AliDebug(2, Form(" Good Status for channel %d",index)); |
7fffa85b | 1082 | } |
58d8d9a3 | 1083 | // Get Rough channel online equalization |
17149e6b | 1084 | Double_t roughDelay=(Double_t)calDelay->GetDelay(index); // in ns |
ba66add8 | 1085 | AliDebug(2,Form(" channel delay (ns) = %f", roughDelay)); |
58d8d9a3 | 1086 | // Get Refined channel offline calibration parameters |
ba66add8 | 1087 | if (calibration ==1){ |
1088 | AliTOFChannelOffline * calChannelOffline = (AliTOFChannelOffline*)calTOFArrayOffline->At(index); | |
1089 | Double_t par[6]; | |
1090 | for (Int_t j = 0; j<6; j++){ | |
1091 | par[j]=(Double_t)calChannelOffline->GetSlewPar(j); | |
1092 | } | |
bf33f8f0 | 1093 | AliDebug(2,Form(" Calib Pars = %f, %f, %f, %f, %f, %f ",par[0],par[1],par[2],par[3],par[4],par[5])); |
2bf66a2d | 1094 | AliDebug(2,Form(" The ToT and Time, uncorr (counts) = %d , %d", fTofClusters[ii]->GetToT(),fTofClusters[ii]->GetTDC())); |
ba66add8 | 1095 | tToT = (Double_t)(fTofClusters[ii]->GetToT()*AliTOFGeometry::ToTBinWidth()); |
1096 | tToT*=1.E-3; //ToT in ns | |
104ba366 | 1097 | |
1098 | /* check TOT limits and set new TOT in case */ | |
1099 | if (tToT < AliTOFGeometry::SlewTOTMin()) tToT = AliTOFGeometry::SlewTOTMin(); | |
1100 | if (tToT > AliTOFGeometry::SlewTOTMax()) tToT = AliTOFGeometry::SlewTOTMax(); | |
1101 | ||
ba66add8 | 1102 | AliDebug(2,Form(" The ToT and Time, uncorr (ns)= %e, %e",fTofClusters[ii]->GetTDC()*AliTOFGeometry::TdcBinWidth()*1.E-3,tToT)); |
1103 | timeCorr=par[0]+par[1]*tToT+par[2]*tToT*tToT+par[3]*tToT*tToT*tToT+par[4]*tToT*tToT*tToT*tToT+par[5]*tToT*tToT*tToT*tToT*tToT; // the time correction (ns) | |
1104 | } | |
1105 | else { | |
1106 | timeCorr = roughDelay; // correction in ns | |
1107 | } | |
1108 | AliDebug(2,Form(" The ToT and Time, uncorr (ns)= %e, %e",fTofClusters[ii]->GetTDC()*AliTOFGeometry::TdcBinWidth()*1.E-3,fTofClusters[ii]->GetToT()*AliTOFGeometry::ToTBinWidth())); | |
bf33f8f0 | 1109 | AliDebug(2,Form(" The time correction (ns) = %f", timeCorr)); |
a33fec85 | 1110 | timeCorr=(Double_t)(fTofClusters[ii]->GetTDC())*AliTOFGeometry::TdcBinWidth()*1.E-3-timeCorr;//redefine the time |
1111 | timeCorr*=1.E3; | |
1112 | AliDebug(2,Form(" The channel time, corr (ps)= %e",timeCorr )); | |
2bf4d9d6 | 1113 | |
1114 | /* here timeCorr should be already corrected for calibration. | |
1115 | * we now go into further corrections keeping in mind that timeCorr | |
1116 | * is in ps. | |
1117 | * | |
1118 | * the following corrections are performed in this way: | |
1119 | * | |
1120 | * time = timeRaw - deltaBC + L0L1Latency + CTPLatency - TDCLatencyWindow - T0Fill | |
1121 | * | |
1122 | */ | |
1123 | ||
1124 | AliDebug(2, Form("applying further corrections (DeltaBC): DeltaBC=%d (BC bins), DeltaBCoffset=%d (BC bins)", fTofClusters[ii]->GetDeltaBC(), deltaBCOffset)); | |
1125 | AliDebug(2, Form("applying further corrections (L0L1Latency): L0L1Latency=%d (BC bins)", fTofClusters[ii]->GetL0L1Latency())); | |
1126 | AliDebug(2, Form("applying further corrections (CTPLatency): CTPLatency=%f (ps)", ctpLatency)); | |
1127 | AliDebug(2, Form("applying further corrections (TDCLatencyWindow): TDCLatencyWindow=%f (ps)", tdcLatencyWindow)); | |
1128 | AliDebug(2, Form("applying further corrections (T0Fill): T0Fill=%f (ps)", t0Fill)); | |
1129 | ||
1130 | /* deltaBC correction */ | |
1131 | timeCorr -= (fTofClusters[ii]->GetDeltaBC() - deltaBCOffset) * AliTOFGeometry::BunchCrossingBinWidth(); | |
1132 | /* L0L1-latency correction */ | |
1133 | timeCorr += fTofClusters[ii]->GetL0L1Latency() * AliTOFGeometry::BunchCrossingBinWidth(); | |
1134 | /* CTP-latency correction (from OCDB) */ | |
1135 | timeCorr += ctpLatency; | |
1136 | /* TDC latency-window correction (from OCDB) */ | |
1137 | timeCorr -= tdcLatencyWindow; | |
1138 | /* T0Fill correction (from OCDB) */ | |
1139 | timeCorr -= t0Fill; | |
1140 | ||
1141 | /* | |
1142 | * end of furhter corrections | |
1143 | */ | |
1144 | ||
a33fec85 | 1145 | tdcCorr=(Int_t)(timeCorr/AliTOFGeometry::TdcBinWidth()); //the corrected time (tdc counts) |
340693af | 1146 | fTofClusters[ii]->SetTDC(tdcCorr); |
37879eed | 1147 | } // loop on clusters |
1148 | ||
37879eed | 1149 | } |
d08a92dd | 1150 | //______________________________________________________________________________ |
1151 | ||
1152 | void AliTOFClusterFinder::ResetRecpoint() | |
1153 | { | |
1154 | // | |
1155 | // Clear the list of reconstructed points | |
1156 | // | |
1157 | ||
1158 | fNumberOfTofClusters = 0; | |
1159 | if (fRecPoints) fRecPoints->Clear(); | |
1160 | ||
1161 | } | |
1162 | //______________________________________________________________________________ | |
1163 | ||
1164 | void AliTOFClusterFinder::Load() | |
1165 | { | |
1166 | // | |
1167 | // Load TOF.Digits.root and TOF.RecPoints.root files | |
1168 | // | |
1169 | ||
1170 | fTOFLoader->LoadDigits("READ"); | |
1171 | fTOFLoader->LoadRecPoints("recreate"); | |
1172 | ||
1173 | } | |
1174 | //______________________________________________________________________________ | |
1175 | ||
1176 | void AliTOFClusterFinder::LoadClusters() | |
1177 | { | |
1178 | // | |
1179 | // Load TOF.RecPoints.root file | |
1180 | // | |
1181 | ||
1182 | fTOFLoader->LoadRecPoints("recreate"); | |
1183 | ||
1184 | } | |
1185 | //______________________________________________________________________________ | |
1186 | ||
1187 | void AliTOFClusterFinder::UnLoad() | |
1188 | { | |
1189 | // | |
1190 | // Unload TOF.Digits.root and TOF.RecPoints.root files | |
1191 | // | |
1192 | ||
1193 | fTOFLoader->UnloadDigits(); | |
1194 | fTOFLoader->UnloadRecPoints(); | |
1195 | ||
1196 | } | |
1197 | //______________________________________________________________________________ | |
1198 | ||
1199 | void AliTOFClusterFinder::UnLoadClusters() | |
1200 | { | |
1201 | // | |
1202 | // Unload TOF.RecPoints.root file | |
1203 | // | |
1204 | ||
1205 | fTOFLoader->UnloadRecPoints(); | |
1206 | ||
1207 | } | |
ac359ffe | 1208 | //------------------------------------------------------------------------- |
0e74c396 | 1209 | UShort_t AliTOFClusterFinder::GetClusterVolIndex(const Int_t * const ind) const { |
ac359ffe | 1210 | |
1211 | //First of all get the volume ID to retrieve the l2t transformation... | |
1212 | // | |
1213 | // Detector numbering scheme | |
1214 | Int_t nSector = 18; | |
1215 | Int_t nPlate = 5; | |
1216 | Int_t nStripA = 15; | |
1217 | Int_t nStripB = 19; | |
1218 | Int_t nStripC = 19; | |
1219 | ||
1220 | Int_t isector =ind[0]; | |
1221 | if (isector >= nSector) | |
1222 | AliError(Form("Wrong sector number in TOF (%d) !",isector)); | |
1223 | Int_t iplate = ind[1]; | |
1224 | if (iplate >= nPlate) | |
1225 | AliError(Form("Wrong plate number in TOF (%d) !",iplate)); | |
1226 | Int_t istrip = ind[2]; | |
1227 | ||
1228 | Int_t stripOffset = 0; | |
1229 | switch (iplate) { | |
1230 | case 0: | |
1231 | stripOffset = 0; | |
1232 | break; | |
1233 | case 1: | |
1234 | stripOffset = nStripC; | |
1235 | break; | |
1236 | case 2: | |
1237 | stripOffset = nStripC+nStripB; | |
1238 | break; | |
1239 | case 3: | |
1240 | stripOffset = nStripC+nStripB+nStripA; | |
1241 | break; | |
1242 | case 4: | |
1243 | stripOffset = nStripC+nStripB+nStripA+nStripB; | |
1244 | break; | |
1245 | default: | |
1246 | AliError(Form("Wrong plate number in TOF (%d) !",iplate)); | |
1247 | break; | |
1248 | }; | |
1249 | ||
1250 | Int_t index= (2*(nStripC+nStripB)+nStripA)*isector + | |
1251 | stripOffset + | |
1252 | istrip; | |
1253 | ||
1254 | UShort_t volIndex = AliGeomManager::LayerToVolUID(AliGeomManager::kTOF,index); | |
1255 | return volIndex; | |
1256 | } | |
1257 | // | |
1258 | //------------------------------------------------------------------------- | |
1259 | void AliTOFClusterFinder::GetClusterPars(Int_t *ind, Double_t* pos,Double_t* cov) const { | |
1260 | ||
1261 | //First of all get the volume ID to retrieve the l2t transformation... | |
1262 | // | |
1263 | UShort_t volIndex = GetClusterVolIndex(ind); | |
1264 | // | |
1265 | // | |
1266 | //we now go in the system of the strip: determine the local coordinates | |
1267 | // | |
1268 | // | |
1269 | // 47---------------------------------------------------0 ^ z | |
1270 | // | | | | | | | | | | | | | | | | | | | | | | | | | | | 1 | | |
1271 | // ----------------------------------------------------- | y going outwards | |
1272 | // | | | | | | | | | | | | | | | | | | | | | | | | | | | 0 | par[0]=0; | |
1273 | ||
1274 | // ----------------------------------------------------- | | |
1275 | // x <----------------------------------------------------- | |
1276 | ||
b3e52baa | 1277 | /* |
1278 | Float_t localX = (ind[4]-23.5)*AliTOFGeometry::XPad(); | |
1279 | Float_t localY = 0; | |
1280 | Float_t localZ = (ind[3]- 0.5)*AliTOFGeometry::ZPad(); | |
1281 | */ | |
1282 | Float_t localX = (ind[4]-AliTOFGeometry::NpadX()/2)*AliTOFGeometry::XPad()+AliTOFGeometry::XPad()/2.; | |
1283 | Float_t localY = 0; | |
1284 | Float_t localZ = (ind[3]-AliTOFGeometry::NpadZ()/2)*AliTOFGeometry::ZPad()+AliTOFGeometry::ZPad()/2.; | |
ac359ffe | 1285 | //move to the tracking ref system |
1286 | ||
1287 | Double_t lpos[3]; | |
b3e52baa | 1288 | lpos[0] = localX; |
1289 | lpos[1] = localY; | |
1290 | lpos[2] = localZ; | |
ac359ffe | 1291 | |
1292 | const TGeoHMatrix *l2t= AliGeomManager::GetTracking2LocalMatrix(volIndex); | |
1293 | // Get The position in the track ref system | |
1294 | Double_t tpos[3]; | |
1295 | l2t->MasterToLocal(lpos,tpos); | |
b3e52baa | 1296 | pos[0] = tpos[0]; |
1297 | pos[1] = tpos[1]; | |
1298 | pos[2] = tpos[2]; | |
ac359ffe | 1299 | |
1300 | //Get The cluster covariance in the track ref system | |
1301 | Double_t lcov[9]; | |
1302 | ||
1303 | //cluster covariance in the local system: | |
1304 | // sx2 0 0 | |
1305 | // 0 0 0 | |
1306 | // 0 0 sz2 | |
1307 | ||
b3e52baa | 1308 | lcov[0] = AliTOFGeometry::XPad()*AliTOFGeometry::XPad()/12.; |
1309 | lcov[1] = 0; | |
1310 | lcov[2] = 0; | |
1311 | lcov[3] = 0; | |
1312 | lcov[4] = 0; | |
1313 | lcov[5] = 0; | |
1314 | lcov[6] = 0; | |
1315 | lcov[7] = 0; | |
1316 | lcov[8] = AliTOFGeometry::ZPad()*AliTOFGeometry::ZPad()/12.; | |
ac359ffe | 1317 | |
1318 | //cluster covariance in the tracking system: | |
1319 | TGeoHMatrix m; | |
1320 | m.SetRotation(lcov); | |
1321 | m.Multiply(l2t); | |
1322 | m.MultiplyLeft(&l2t->Inverse()); | |
1323 | Double_t *tcov = m.GetRotationMatrix(); | |
1324 | cov[0] = tcov[0]; cov[1] = tcov[1]; cov[2] = tcov[2]; | |
1325 | cov[3] = tcov[4]; cov[4] = tcov[5]; | |
1326 | cov[5] = tcov[8]; | |
1327 | ||
1328 | return; | |
1329 | ||
1330 | } |