Including of Lambda(1520) to the generation. Small fraction of Lambda0 (0.2), Sigma0...
[u/mrichter/AliRoot.git] / PMD / AliPMDClusterFinder.cxx
CommitLineData
ed228cbc 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
01709453 16//-----------------------------------------------------//
17// //
18// Date : August 05 2003 //
19// This reads the file PMD.digits.root(TreeD), //
20// calls the Clustering algorithm and stores the //
21// clustering output in PMD.RecPoints.root(TreeR) //
22// //
23//-----------------------------------------------------//
24
25#include <Riostream.h>
01709453 26#include <TTree.h>
01709453 27#include <TObjArray.h>
28#include <TClonesArray.h>
01709453 29
7e9508a7 30#include "AliLog.h"
01709453 31#include "AliRunLoader.h"
32#include "AliLoader.h"
5f55af10 33#include "AliRawReader.h"
01709453 34
35#include "AliPMDdigit.h"
36#include "AliPMDClusterFinder.h"
37#include "AliPMDClustering.h"
5c5cadd5 38#include "AliPMDClusteringV1.h"
01709453 39#include "AliPMDcluster.h"
96377d57 40#include "AliPMDrecpoint1.h"
5c5cadd5 41#include "AliPMDrechit.h"
5f55af10 42#include "AliPMDRawStream.h"
01709453 43
7e9508a7 44
45
01709453 46ClassImp(AliPMDClusterFinder)
b208c6a3 47
7e9508a7 48AliPMDClusterFinder::AliPMDClusterFinder():
49 fRunLoader(0),
50 fPMDLoader(0),
51 fTreeD(0),
52 fTreeR(0),
53 fDigits(new TClonesArray("AliPMDdigit", 1000)),
54 fRecpoints(new TClonesArray("AliPMDrecpoint1", 1000)),
5c5cadd5 55 fRechits(new TClonesArray("AliPMDrechit", 1000)),
7e9508a7 56 fNpoint(0),
5c5cadd5 57 fNhit(0),
7e9508a7 58 fEcut(0.)
59{
60//
61// Constructor
62//
63}
64// ------------------------------------------------------------------------- //
dfaeee5f 65AliPMDClusterFinder::AliPMDClusterFinder(AliRunLoader* runLoader):
66 fRunLoader(runLoader),
67 fPMDLoader(runLoader->GetLoader("PMDLoader")),
1758e4fe 68 fTreeD(0),
69 fTreeR(0),
ebd83c56 70 fDigits(new TClonesArray("AliPMDdigit", 1000)),
1758e4fe 71 fRecpoints(new TClonesArray("AliPMDrecpoint1", 1000)),
5c5cadd5 72 fRechits(new TClonesArray("AliPMDrechit", 1000)),
1758e4fe 73 fNpoint(0),
5c5cadd5 74 fNhit(0),
1758e4fe 75 fEcut(0.)
01709453 76{
b208c6a3 77//
dfaeee5f 78// Constructor
b208c6a3 79//
01709453 80}
1758e4fe 81// ------------------------------------------------------------------------- //
01709453 82AliPMDClusterFinder::~AliPMDClusterFinder()
83{
b208c6a3 84 // Destructor
ebd83c56 85 if (fDigits)
86 {
87 fDigits->Delete();
88 delete fDigits;
89 fDigits=0;
90 }
1758e4fe 91 if (fRecpoints)
92 {
93 fRecpoints->Delete();
94 delete fRecpoints;
95 fRecpoints=0;
96 }
5c5cadd5 97 if (fRechits)
98 {
99 fRechits->Delete();
100 delete fRechits;
101 fRechits=0;
102 }
01709453 103}
1758e4fe 104// ------------------------------------------------------------------------- //
b208c6a3 105
01709453 106void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt)
107{
b208c6a3 108 // Converts digits to recpoints after running clustering
109 // algorithm on CPV plane and PREshower plane
110 //
ed228cbc 111 Int_t det = 0,smn = 0;
01709453 112 Int_t xpos,ypos;
113 Float_t adc;
1758e4fe 114 Int_t ismn;
01709453 115 Int_t idet;
5c5cadd5 116 Float_t clusdata[6];
ed228cbc 117
118 TObjArray *pmdcont = new TObjArray();
5c5cadd5 119 AliPMDClustering *pmdclust = new AliPMDClusteringV1();
7e9508a7 120
ed228cbc 121 pmdclust->SetEdepCut(fEcut);
01709453 122
123 fRunLoader->GetEvent(ievt);
7e9508a7 124
01b56f5c 125
b208c6a3 126 fTreeD = fPMDLoader->TreeD();
127 if (fTreeD == 0x0)
01709453 128 {
7e9508a7 129 AliFatal("AliPMDClusterFinder: Can not get TreeD");
130
01709453 131 }
132 AliPMDdigit *pmddigit;
b208c6a3 133 TBranch *branch = fTreeD->GetBranch("PMDDigit");
01709453 134 branch->SetAddress(&fDigits);
135
136 ResetRecpoint();
01b56f5c 137
b208c6a3 138 fTreeR = fPMDLoader->TreeR();
139 if (fTreeR == 0x0)
01709453 140 {
b208c6a3 141 fPMDLoader->MakeTree("R");
142 fTreeR = fPMDLoader->TreeR();
01709453 143 }
144
145 Int_t bufsize = 16000;
5c5cadd5 146 TBranch * branch1 = fTreeR->Branch("PMDRecpoint", &fRecpoints, bufsize);
147 TBranch * branch2 = fTreeR->Branch("PMDRechit", &fRechits, bufsize);
01709453 148
b208c6a3 149 Int_t nmodules = (Int_t) fTreeD->GetEntries();
01b56f5c 150
01709453 151 for (Int_t imodule = 0; imodule < nmodules; imodule++)
152 {
ed228cbc 153 ResetCellADC();
b208c6a3 154 fTreeD->GetEntry(imodule);
01709453 155 Int_t nentries = fDigits->GetLast();
156 for (Int_t ient = 0; ient < nentries+1; ient++)
157 {
158 pmddigit = (AliPMDdigit*)fDigits->UncheckedAt(ient);
159
160 det = pmddigit->GetDetector();
161 smn = pmddigit->GetSMNumber();
5e6a9312 162 xpos = pmddigit->GetRow();
163 ypos = pmddigit->GetColumn();
01709453 164 adc = pmddigit->GetADC();
ed228cbc 165 //Int_t trno = pmddigit->GetTrackNumber();
ed228cbc 166 fCellADC[xpos][ypos] = (Double_t) adc;
01709453 167 }
01709453 168
ed228cbc 169 idet = det;
1758e4fe 170 ismn = smn;
8616b098 171 pmdclust->DoClust(idet,ismn,fCellADC,pmdcont);
ed228cbc 172
173 Int_t nentries1 = pmdcont->GetEntries();
7e9508a7 174
175 AliDebug(1,Form("Total number of clusters/module = %d",nentries1));
176
ed228cbc 177 for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
01709453 178 {
ebd83c56 179 AliPMDcluster *pmdcl = (AliPMDcluster*)pmdcont->UncheckedAt(ient1);
1758e4fe 180 idet = pmdcl->GetDetector();
181 ismn = pmdcl->GetSMN();
182 clusdata[0] = pmdcl->GetClusX();
183 clusdata[1] = pmdcl->GetClusY();
184 clusdata[2] = pmdcl->GetClusADC();
185 clusdata[3] = pmdcl->GetClusCells();
5c5cadd5 186 clusdata[4] = pmdcl->GetClusSigmaX();
187 clusdata[5] = pmdcl->GetClusSigmaY();
01b56f5c 188
1758e4fe 189 AddRecPoint(idet,ismn,clusdata);
5c5cadd5 190
191 // This part will be worked out
192 // BKN
193 Int_t ncell = (Int_t) clusdata[3];
194 for(Int_t ihit = 0; ihit < ncell; ihit++)
195 {
196 Int_t celldataX = pmdcl->GetClusCellX(ihit);
197 Int_t celldataY = pmdcl->GetClusCellY(ihit);
198 AddRecHit(celldataX, celldataY);
199 }
200 branch2->Fill();
201 ResetRechit();
ed228cbc 202 }
203 pmdcont->Clear();
204
5c5cadd5 205 branch1->Fill();
ed228cbc 206 ResetRecpoint();
207
208 } // modules
209
01709453 210 ResetCellADC();
e1287360 211 fPMDLoader = fRunLoader->GetLoader("PMDLoader");
b208c6a3 212 fPMDLoader->WriteRecPoints("OVERWRITE");
01709453 213
214 // delete the pointers
215 delete pmdclust;
216 delete pmdcont;
217
7e9508a7 218}
219// ------------------------------------------------------------------------- //
220
221void AliPMDClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
222 TTree *clustersTree)
223{
224 // Converts RAW data to recpoints after running clustering
225 // algorithm on CPV and PREshower plane
226 //
227
5c5cadd5 228 Float_t clusdata[6];
7e9508a7 229
230 TObjArray *pmdcont = new TObjArray();
5c5cadd5 231 AliPMDClustering *pmdclust = new AliPMDClusteringV1();
7e9508a7 232
233 pmdclust->SetEdepCut(fEcut);
234
235 ResetRecpoint();
236
237 Int_t bufsize = 16000;
5c5cadd5 238 TBranch *branch1 = clustersTree->Branch("PMDRecpoint", &fRecpoints, bufsize);
239
240 TBranch * branch2 = clustersTree->Branch("PMDRechit", &fRechits, bufsize);
7e9508a7 241
242 const Int_t kDDL = 6;
243 const Int_t kRow = 48;
244 const Int_t kCol = 96;
245
246 Int_t idet = 0;
247 Int_t iSMN = 0;
248
249 for (Int_t indexDDL = 0; indexDDL < kDDL; indexDDL++)
250 {
251 if (indexDDL < 4)
252 {
253 iSMN = 6;
254 }
255 else if (indexDDL >= 4)
256 {
257 iSMN = 12;
258 }
259 Int_t ***precpvADC;
260 precpvADC = new int **[iSMN];
261 for (Int_t i=0; i<iSMN; i++) precpvADC[i] = new int *[kRow];
262 for (Int_t i=0; i<iSMN;i++)
263 {
264 for (Int_t j=0; j<kRow; j++) precpvADC[i][j] = new int [kCol];
265 }
266 for (Int_t i = 0; i < iSMN; i++)
267 {
268 for (Int_t j = 0; j < kRow; j++)
269 {
270 for (Int_t k = 0; k < kCol; k++)
271 {
272 precpvADC[i][j][k] = 0;
273 }
274 }
275 }
276 ResetCellADC();
277 rawReader->Reset();
278 AliPMDRawStream pmdinput(rawReader);
279 rawReader->Select(12, indexDDL, indexDDL);
280 while(pmdinput.Next())
281 {
282 Int_t det = pmdinput.GetDetector();
283 Int_t smn = pmdinput.GetSMN();
284 //Int_t mcm = pmdinput.GetMCM();
285 //Int_t chno = pmdinput.GetChannel();
286 Int_t row = pmdinput.GetRow();
287 Int_t col = pmdinput.GetColumn();
288 Int_t sig = pmdinput.GetSignal();
289
290 Int_t indexsmn = 0;
291
292 if (indexDDL < 4)
293 {
294 if (det != 0)
295 AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
296 indexDDL, det));
297 indexsmn = smn - indexDDL * 6;
298 }
299 else if (indexDDL == 4)
300 {
301 if (det != 1)
302 AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
303 indexDDL, det));
304 if (smn < 6)
305 {
306 indexsmn = smn;
307 }
308 else if (smn >= 12 && smn < 18)
309 {
310 indexsmn = smn - 6;
311 }
312 }
313 else if (indexDDL == 5)
314 {
315 if (det != 1)
316 AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
317 indexDDL, det));
318 if (smn >= 6 && smn < 12)
319 {
320 indexsmn = smn - 6;
321 }
322 else if (smn >= 18 && smn < 24)
323 {
324 indexsmn = smn - 12;
325 }
326 }
327 precpvADC[indexsmn][row][col] = sig;
328 } // while loop
329
330 Int_t ismn = 0;
331 for (Int_t indexsmn = 0; indexsmn < iSMN; indexsmn++)
332 {
333 ResetCellADC();
334 for (Int_t irow = 0; irow < kRow; irow++)
335 {
336 for (Int_t icol = 0; icol < kCol; icol++)
337 {
338 fCellADC[irow][icol] =
339 (Double_t) precpvADC[indexsmn][irow][icol];
340 } // row
341 } // col
342 if (indexDDL < 4)
343 {
344 ismn = indexsmn + indexDDL * 6;
345 idet = 0;
346 }
347 else if (indexDDL == 4)
348 {
349 if (indexsmn < 6)
350 {
351 ismn = indexsmn;
352 }
353 else if (indexsmn >= 6 && indexsmn < 12)
354 {
355 ismn = indexsmn + 6;
356 }
357 idet = 1;
358 }
359 else if (indexDDL == 5)
360 {
361 if (indexsmn < 6)
362 {
363 ismn = indexsmn + 6;
364 }
365 else if (indexsmn >= 6 && indexsmn < 12)
366 {
367 ismn = indexsmn + 12;
368 }
369 idet = 1;
370 }
371
372
373 pmdclust->DoClust(idet,ismn,fCellADC,pmdcont);
374 Int_t nentries1 = pmdcont->GetEntries();
375
376 AliDebug(1,Form("Total number of clusters/module = %d",nentries1));
377
378 for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
379 {
380 AliPMDcluster *pmdcl =
381 (AliPMDcluster*)pmdcont->UncheckedAt(ient1);
382 idet = pmdcl->GetDetector();
383 ismn = pmdcl->GetSMN();
384 clusdata[0] = pmdcl->GetClusX();
385 clusdata[1] = pmdcl->GetClusY();
386 clusdata[2] = pmdcl->GetClusADC();
387 clusdata[3] = pmdcl->GetClusCells();
5c5cadd5 388 clusdata[4] = pmdcl->GetClusSigmaX();
389 clusdata[5] = pmdcl->GetClusSigmaY();
7e9508a7 390
391 AddRecPoint(idet,ismn,clusdata);
5c5cadd5 392 // BKN
393 Int_t ncell = (Int_t) clusdata[3];
394 for(Int_t ihit = 0; ihit < ncell; ihit++)
395 {
396 Int_t celldataX = pmdcl->GetClusCellX(ihit);
397 Int_t celldataY = pmdcl->GetClusCellY(ihit);
398 AddRecHit(celldataX, celldataY);
399 }
400 branch2->Fill();
401 ResetRechit();
402
7e9508a7 403 }
404 pmdcont->Clear();
405
5c5cadd5 406 branch1->Fill();
7e9508a7 407 ResetRecpoint();
408
409
410 } // smn
411
412 for (Int_t i=0; i<iSMN; i++)
413 {
414 for (Int_t j=0; j<kRow; j++) delete [] precpvADC[i][j];
415 }
416 for (Int_t i=0; i<iSMN; i++) delete [] precpvADC[i];
417 delete precpvADC;
418 } // DDL Loop
419
420 ResetCellADC();
421
422 // delete the pointers
423 delete pmdclust;
424 delete pmdcont;
425
01709453 426}
1758e4fe 427// ------------------------------------------------------------------------- //
5f55af10 428
429void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt, AliRawReader *rawReader)
430{
01b56f5c 431 // Converts RAW data to recpoints after running clustering
432 // algorithm on CPV and PREshower plane
5f55af10 433 //
434
5c5cadd5 435 Float_t clusdata[6];
5f55af10 436
5f55af10 437 TObjArray *pmdcont = new TObjArray();
5c5cadd5 438
439 AliPMDClustering *pmdclust = new AliPMDClusteringV1();
7e9508a7 440
5f55af10 441 pmdclust->SetEdepCut(fEcut);
442
443 fRunLoader->GetEvent(ievt);
444
445 ResetRecpoint();
01b56f5c 446
5f55af10 447 fTreeR = fPMDLoader->TreeR();
448 if (fTreeR == 0x0)
449 {
450 fPMDLoader->MakeTree("R");
451 fTreeR = fPMDLoader->TreeR();
452 }
5f55af10 453 Int_t bufsize = 16000;
5c5cadd5 454 TBranch *branch1 = fTreeR->Branch("PMDRecpoint", &fRecpoints, bufsize);
455 TBranch *branch2 = fTreeR->Branch("PMDRechit", &fRechits, bufsize);
01b56f5c 456
457 const Int_t kDDL = 6;
5f55af10 458 const Int_t kRow = 48;
459 const Int_t kCol = 96;
5f55af10 460
01b56f5c 461 Int_t idet = 0;
462 Int_t iSMN = 0;
463
464 for (Int_t indexDDL = 0; indexDDL < kDDL; indexDDL++)
5f55af10 465 {
01b56f5c 466 if (indexDDL < 4)
5f55af10 467 {
01b56f5c 468 iSMN = 6;
5f55af10 469 }
01b56f5c 470 else if (indexDDL >= 4)
5f55af10 471 {
01b56f5c 472 iSMN = 12;
5f55af10 473 }
01b56f5c 474 Int_t ***precpvADC;
475 precpvADC = new int **[iSMN];
476 for (Int_t i=0; i<iSMN; i++) precpvADC[i] = new int *[kRow];
477 for (Int_t i=0; i<iSMN;i++)
5f55af10 478 {
01b56f5c 479 for (Int_t j=0; j<kRow; j++) precpvADC[i][j] = new int [kCol];
5f55af10 480 }
01b56f5c 481 for (Int_t i = 0; i < iSMN; i++)
482 {
483 for (Int_t j = 0; j < kRow; j++)
484 {
485 for (Int_t k = 0; k < kCol; k++)
486 {
487 precpvADC[i][j][k] = 0;
488 }
489 }
490 }
491 ResetCellADC();
492 rawReader->Reset();
493 AliPMDRawStream pmdinput(rawReader);
494 rawReader->Select(12, indexDDL, indexDDL);
495 while(pmdinput.Next())
496 {
497 Int_t det = pmdinput.GetDetector();
498 Int_t smn = pmdinput.GetSMN();
499 //Int_t mcm = pmdinput.GetMCM();
500 //Int_t chno = pmdinput.GetChannel();
501 Int_t row = pmdinput.GetRow();
502 Int_t col = pmdinput.GetColumn();
503 Int_t sig = pmdinput.GetSignal();
504
505 Int_t indexsmn = 0;
5f55af10 506
01b56f5c 507 if (indexDDL < 4)
508 {
509 if (det != 0)
7e9508a7 510 AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
511 indexDDL, det));
01b56f5c 512 indexsmn = smn - indexDDL * 6;
513 }
514 else if (indexDDL == 4)
515 {
516 if (det != 1)
7e9508a7 517 AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
518 indexDDL, det));
01b56f5c 519 if (smn < 6)
520 {
521 indexsmn = smn;
522 }
523 else if (smn >= 12 && smn < 18)
524 {
525 indexsmn = smn - 6;
526 }
527 }
528 else if (indexDDL == 5)
529 {
530 if (det != 1)
7e9508a7 531 AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
532 indexDDL, det));
01b56f5c 533 if (smn >= 6 && smn < 12)
534 {
535 indexsmn = smn - 6;
536 }
537 else if (smn >= 18 && smn < 24)
538 {
539 indexsmn = smn - 12;
540 }
541 }
542 precpvADC[indexsmn][row][col] = sig;
543 } // while loop
544
545 Int_t ismn = 0;
546 for (Int_t indexsmn = 0; indexsmn < iSMN; indexsmn++)
5f55af10 547 {
01b56f5c 548 ResetCellADC();
5f55af10 549 for (Int_t irow = 0; irow < kRow; irow++)
550 {
551 for (Int_t icol = 0; icol < kCol; icol++)
552 {
01b56f5c 553 fCellADC[irow][icol] =
554 (Double_t) precpvADC[indexsmn][irow][icol];
5f55af10 555 } // row
556 } // col
01b56f5c 557 if (indexDDL < 4)
558 {
559 ismn = indexsmn + indexDDL * 6;
560 idet = 0;
561 }
562 else if (indexDDL == 4)
563 {
564 if (indexsmn < 6)
565 {
566 ismn = indexsmn;
567 }
568 else if (indexsmn >= 6 && indexsmn < 12)
569 {
570 ismn = indexsmn + 6;
571 }
572 idet = 1;
573 }
574 else if (indexDDL == 5)
575 {
576 if (indexsmn < 6)
577 {
578 ismn = indexsmn + 6;
579 }
580 else if (indexsmn >= 6 && indexsmn < 12)
581 {
582 ismn = indexsmn + 12;
583 }
584 idet = 1;
585 }
586
587
5f55af10 588 pmdclust->DoClust(idet,ismn,fCellADC,pmdcont);
589 Int_t nentries1 = pmdcont->GetEntries();
7e9508a7 590
591 AliDebug(1,Form("Total number of clusters/module = %d",nentries1));
592
5f55af10 593 for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
594 {
595 AliPMDcluster *pmdcl =
596 (AliPMDcluster*)pmdcont->UncheckedAt(ient1);
597 idet = pmdcl->GetDetector();
598 ismn = pmdcl->GetSMN();
599 clusdata[0] = pmdcl->GetClusX();
600 clusdata[1] = pmdcl->GetClusY();
601 clusdata[2] = pmdcl->GetClusADC();
602 clusdata[3] = pmdcl->GetClusCells();
5c5cadd5 603 clusdata[4] = pmdcl->GetClusSigmaX();
604 clusdata[5] = pmdcl->GetClusSigmaY();
01b56f5c 605
5f55af10 606 AddRecPoint(idet,ismn,clusdata);
5c5cadd5 607
608 // BKN
609 Int_t ncell = (Int_t) clusdata[3];
610 for(Int_t ihit = 0; ihit < ncell; ihit++)
611 {
612 Int_t celldataX = pmdcl->GetClusCellX(ihit);
613 Int_t celldataY = pmdcl->GetClusCellY(ihit);
614 AddRecHit(celldataX, celldataY);
615 }
616 branch2->Fill();
617 ResetRechit();
618
5f55af10 619 }
620 pmdcont->Clear();
621
5c5cadd5 622 branch1->Fill();
5f55af10 623 ResetRecpoint();
01b56f5c 624
625
5f55af10 626 } // smn
5f55af10 627
01b56f5c 628 for (Int_t i=0; i<iSMN; i++)
629 {
630 for (Int_t j=0; j<kRow; j++) delete [] precpvADC[i][j];
631 }
632 for (Int_t i=0; i<iSMN; i++) delete [] precpvADC[i];
633 delete precpvADC;
634 } // DDL Loop
635
5f55af10 636 ResetCellADC();
01b56f5c 637
5f55af10 638 fPMDLoader = fRunLoader->GetLoader("PMDLoader");
639 fPMDLoader->WriteRecPoints("OVERWRITE");
640
641 // delete the pointers
642 delete pmdclust;
643 delete pmdcont;
644
5f55af10 645}
646// ------------------------------------------------------------------------- //
ed228cbc 647void AliPMDClusterFinder::SetCellEdepCut(Float_t ecut)
648{
649 fEcut = ecut;
650}
1758e4fe 651// ------------------------------------------------------------------------- //
1758e4fe 652void AliPMDClusterFinder::AddRecPoint(Int_t idet,Int_t ismn,Float_t *clusdata)
01709453 653{
b208c6a3 654 // Add Reconstructed points
655 //
01709453 656 TClonesArray &lrecpoints = *fRecpoints;
ed228cbc 657 AliPMDrecpoint1 *newrecpoint;
1758e4fe 658 newrecpoint = new AliPMDrecpoint1(idet, ismn, clusdata);
ed228cbc 659 new(lrecpoints[fNpoint++]) AliPMDrecpoint1(newrecpoint);
01709453 660 delete newrecpoint;
661}
1758e4fe 662// ------------------------------------------------------------------------- //
5c5cadd5 663void AliPMDClusterFinder::AddRecHit(Int_t celldataX,Int_t celldataY)
664{
665 // Add associated cell hits to the Reconstructed points
666 //
667 TClonesArray &lrechits = *fRechits;
668 AliPMDrechit *newrechit;
669 newrechit = new AliPMDrechit(celldataX, celldataY);
670 new(lrechits[fNhit++]) AliPMDrechit(newrechit);
671 delete newrechit;
672}
673// ------------------------------------------------------------------------- //
01709453 674void AliPMDClusterFinder::ResetCellADC()
675{
b208c6a3 676 // Reset the individual cell ADC value to zero
677 //
5e6a9312 678 for(Int_t irow = 0; irow < fgkRow; irow++)
01709453 679 {
5e6a9312 680 for(Int_t icol = 0; icol < fgkCol; icol++)
01709453 681 {
ed228cbc 682 fCellADC[irow][icol] = 0.;
01709453 683 }
684 }
685}
1758e4fe 686// ------------------------------------------------------------------------- //
01709453 687
688void AliPMDClusterFinder::ResetRecpoint()
689{
b208c6a3 690 // Clear the list of reconstructed points
01709453 691 fNpoint = 0;
692 if (fRecpoints) fRecpoints->Clear();
693}
1758e4fe 694// ------------------------------------------------------------------------- //
5c5cadd5 695void AliPMDClusterFinder::ResetRechit()
696{
697 // Clear the list of reconstructed points
698 fNhit = 0;
699 if (fRechits) fRechits->Clear();
700}
701// ------------------------------------------------------------------------- //
55601d47 702void AliPMDClusterFinder::Load()
703{
ebd83c56 704 // Load all the *.root files
55601d47 705 //
706 fPMDLoader->LoadDigits("READ");
707 fPMDLoader->LoadRecPoints("recreate");
708}
709// ------------------------------------------------------------------------- //
01b56f5c 710void AliPMDClusterFinder::LoadClusters()
711{
712 // Load all the *.root files
713 //
714 fPMDLoader->LoadRecPoints("recreate");
715}
716// ------------------------------------------------------------------------- //
ebd83c56 717void AliPMDClusterFinder::UnLoad()
01709453 718{
b208c6a3 719 // Unload all the *.root files
720 //
ebd83c56 721 fPMDLoader->UnloadDigits();
722 fPMDLoader->UnloadRecPoints();
01709453 723}
1758e4fe 724// ------------------------------------------------------------------------- //
01b56f5c 725void AliPMDClusterFinder::UnLoadClusters()
726{
727 // Unload all the *.root files
728 //
729 fPMDLoader->UnloadRecPoints();
730}
731// ------------------------------------------------------------------------- //