default directory is set correctly
[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"
920e13db 42#include "AliPMDisocell.h"
5f55af10 43#include "AliPMDRawStream.h"
09a06455 44#include "AliPMDCalibData.h"
35535af7 45#include "AliPMDPedestal.h"
df42ab21 46#include "AliPMDddldata.h"
b9e2f33c 47#include "AliPMDRecoParam.h"
48#include "AliPMDReconstructor.h"
09a06455 49
2332574a 50#include "AliDAQ.h"
09a06455 51#include "AliCDBManager.h"
52#include "AliCDBEntry.h"
01709453 53
7e9508a7 54
55
01709453 56ClassImp(AliPMDClusterFinder)
b208c6a3 57
7e9508a7 58AliPMDClusterFinder::AliPMDClusterFinder():
59 fRunLoader(0),
60 fPMDLoader(0),
35535af7 61 fCalibGain(GetCalibGain()),
62 fCalibPed(GetCalibPed()),
b9e2f33c 63 fRecoParam(0x0),
7e9508a7 64 fTreeD(0),
65 fTreeR(0),
66 fDigits(new TClonesArray("AliPMDdigit", 1000)),
67 fRecpoints(new TClonesArray("AliPMDrecpoint1", 1000)),
5c5cadd5 68 fRechits(new TClonesArray("AliPMDrechit", 1000)),
7e9508a7 69 fNpoint(0),
5c5cadd5 70 fNhit(0),
a48edddd 71 fDetNo(0),
7e9508a7 72 fEcut(0.)
73{
74//
75// Constructor
76//
77}
78// ------------------------------------------------------------------------- //
dfaeee5f 79AliPMDClusterFinder::AliPMDClusterFinder(AliRunLoader* runLoader):
80 fRunLoader(runLoader),
81 fPMDLoader(runLoader->GetLoader("PMDLoader")),
35535af7 82 fCalibGain(GetCalibGain()),
83 fCalibPed(GetCalibPed()),
b9e2f33c 84 fRecoParam(0x0),
1758e4fe 85 fTreeD(0),
86 fTreeR(0),
ebd83c56 87 fDigits(new TClonesArray("AliPMDdigit", 1000)),
1758e4fe 88 fRecpoints(new TClonesArray("AliPMDrecpoint1", 1000)),
5c5cadd5 89 fRechits(new TClonesArray("AliPMDrechit", 1000)),
1758e4fe 90 fNpoint(0),
5c5cadd5 91 fNhit(0),
a48edddd 92 fDetNo(0),
1758e4fe 93 fEcut(0.)
01709453 94{
b208c6a3 95//
dfaeee5f 96// Constructor
b208c6a3 97//
a48edddd 98}
99// ------------------------------------------------------------------------- //
2332574a 100AliPMDClusterFinder::AliPMDClusterFinder(const AliPMDClusterFinder & finder):
101 TObject(finder),
102 fRunLoader(0),
103 fPMDLoader(0),
35535af7 104 fCalibGain(GetCalibGain()),
105 fCalibPed(GetCalibPed()),
b9e2f33c 106 fRecoParam(0x0),
2332574a 107 fTreeD(0),
108 fTreeR(0),
109 fDigits(NULL),
110 fRecpoints(NULL),
111 fRechits(NULL),
112 fNpoint(0),
113 fNhit(0),
114 fDetNo(0),
115 fEcut(0.)
a48edddd 116{
117 // copy constructor
118 AliError("Copy constructor not allowed");
119}
120// ------------------------------------------------------------------------- //
121AliPMDClusterFinder &AliPMDClusterFinder::operator=(const AliPMDClusterFinder & /*finder*/)
122{
123 // assignment op
124 AliError("Assignment Operator not allowed");
125 return *this;
01709453 126}
1758e4fe 127// ------------------------------------------------------------------------- //
01709453 128AliPMDClusterFinder::~AliPMDClusterFinder()
129{
b208c6a3 130 // Destructor
ebd83c56 131 if (fDigits)
132 {
b9e2f33c 133 fDigits->Clear();
ebd83c56 134 }
1758e4fe 135 if (fRecpoints)
136 {
722ccc67 137 fRecpoints->Clear();
1758e4fe 138 }
5c5cadd5 139 if (fRechits)
140 {
722ccc67 141 fRechits->Clear();
5c5cadd5 142 }
5254fcca 143
01709453 144}
1758e4fe 145// ------------------------------------------------------------------------- //
b208c6a3 146
01709453 147void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt)
148{
b208c6a3 149 // Converts digits to recpoints after running clustering
150 // algorithm on CPV plane and PREshower plane
151 //
2332574a 152
ed228cbc 153 Int_t det = 0,smn = 0;
01709453 154 Int_t xpos,ypos;
155 Float_t adc;
1758e4fe 156 Int_t ismn;
01709453 157 Int_t idet;
5c5cadd5 158 Float_t clusdata[6];
ed228cbc 159
920e13db 160 AliPMDisocell *pmdiso = 0x0;
161
ed228cbc 162 TObjArray *pmdcont = new TObjArray();
920e13db 163 TObjArray *pmdisocell = new TObjArray();
164
5c5cadd5 165 AliPMDClustering *pmdclust = new AliPMDClusteringV1();
7e9508a7 166
b9e2f33c 167 // fetch the recoparam object from database
168 fRecoParam = AliPMDReconstructor::GetRecoParam();
169
170 if(fRecoParam == 0x0)
171 {
172 AliFatal("No Reco Param found for PMD!!!");
173 }
174
01709453 175
176 fRunLoader->GetEvent(ievt);
7e9508a7 177
01b56f5c 178
b208c6a3 179 fTreeD = fPMDLoader->TreeD();
180 if (fTreeD == 0x0)
01709453 181 {
7e9508a7 182 AliFatal("AliPMDClusterFinder: Can not get TreeD");
183
01709453 184 }
185 AliPMDdigit *pmddigit;
b208c6a3 186 TBranch *branch = fTreeD->GetBranch("PMDDigit");
01709453 187 branch->SetAddress(&fDigits);
188
189 ResetRecpoint();
01b56f5c 190
b208c6a3 191 fTreeR = fPMDLoader->TreeR();
192 if (fTreeR == 0x0)
01709453 193 {
b208c6a3 194 fPMDLoader->MakeTree("R");
195 fTreeR = fPMDLoader->TreeR();
01709453 196 }
197
198 Int_t bufsize = 16000;
5c5cadd5 199 TBranch * branch1 = fTreeR->Branch("PMDRecpoint", &fRecpoints, bufsize);
200 TBranch * branch2 = fTreeR->Branch("PMDRechit", &fRechits, bufsize);
01709453 201
b208c6a3 202 Int_t nmodules = (Int_t) fTreeD->GetEntries();
01b56f5c 203
01709453 204 for (Int_t imodule = 0; imodule < nmodules; imodule++)
205 {
ed228cbc 206 ResetCellADC();
b208c6a3 207 fTreeD->GetEntry(imodule);
01709453 208 Int_t nentries = fDigits->GetLast();
209 for (Int_t ient = 0; ient < nentries+1; ient++)
210 {
211 pmddigit = (AliPMDdigit*)fDigits->UncheckedAt(ient);
212
213 det = pmddigit->GetDetector();
214 smn = pmddigit->GetSMNumber();
5e6a9312 215 xpos = pmddigit->GetRow();
216 ypos = pmddigit->GetColumn();
01709453 217 adc = pmddigit->GetADC();
f0290c15 218 if(xpos < 0 || xpos > 48 || ypos < 0 || ypos > 96)
219 {
220 AliError(Form("*Row %d and Column NUMBER %d NOT Valid *",
221 xpos, ypos));
222 continue;
223 }
09a06455 224 // CALIBRATION
35535af7 225 Float_t gain = fCalibGain->GetGainFact(det,smn,xpos,ypos);
2332574a 226 // printf("adc = %d gain = %f\n",adc,gain);
09a06455 227
228 adc = adc*gain;
229
ed228cbc 230 //Int_t trno = pmddigit->GetTrackNumber();
920e13db 231 fCellTrack[xpos][ypos] = pmddigit->GetTrackNumber();
232 fCellPid[xpos][ypos] = pmddigit->GetTrackPid();
233 fCellADC[xpos][ypos] = (Double_t) adc;
01709453 234 }
01709453 235
ed228cbc 236 idet = det;
1758e4fe 237 ismn = smn;
b9e2f33c 238
239 // Set the minimum noise cut per module before clustering
240
241 Int_t imod = idet*24 + ismn;
242 fEcut = fRecoParam->GetNoiseCut(imod); // default
243 // fEcut = fRecoParam->GetPbPbParam()->GetNoiseCut(imod);
244 // fEcut = fRecoParam->GetPPParam()->GetNoiseCut(imod);
245 // fEcut = fRecoParam->GetCosmicParam()->GetNoiseCut(imod);
246
247 pmdclust->SetEdepCut(fEcut);
248
249
920e13db 250 pmdclust->DoClust(idet,ismn,fCellTrack,fCellPid,fCellADC,
251 pmdisocell,pmdcont);
252
ed228cbc 253 Int_t nentries1 = pmdcont->GetEntries();
7e9508a7 254
255 AliDebug(1,Form("Total number of clusters/module = %d",nentries1));
256
ed228cbc 257 for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
01709453 258 {
ebd83c56 259 AliPMDcluster *pmdcl = (AliPMDcluster*)pmdcont->UncheckedAt(ient1);
1758e4fe 260 idet = pmdcl->GetDetector();
261 ismn = pmdcl->GetSMN();
262 clusdata[0] = pmdcl->GetClusX();
263 clusdata[1] = pmdcl->GetClusY();
264 clusdata[2] = pmdcl->GetClusADC();
265 clusdata[3] = pmdcl->GetClusCells();
5c5cadd5 266 clusdata[4] = pmdcl->GetClusSigmaX();
267 clusdata[5] = pmdcl->GetClusSigmaY();
01b56f5c 268
1758e4fe 269 AddRecPoint(idet,ismn,clusdata);
5c5cadd5 270
5c5cadd5 271 Int_t ncell = (Int_t) clusdata[3];
272 for(Int_t ihit = 0; ihit < ncell; ihit++)
273 {
274 Int_t celldataX = pmdcl->GetClusCellX(ihit);
275 Int_t celldataY = pmdcl->GetClusCellY(ihit);
920e13db 276 Int_t celldataTr = pmdcl->GetClusCellTrack(ihit);
277 Int_t celldataPid = pmdcl->GetClusCellPid(ihit);
b0e4d1e1 278 Float_t celldataAdc = pmdcl->GetClusCellAdc(ihit);
279 AddRecHit(celldataX, celldataY, celldataTr, celldataPid, celldataAdc);
5c5cadd5 280 }
281 branch2->Fill();
282 ResetRechit();
ed228cbc 283 }
26e08752 284 pmdcont->Delete();
920e13db 285
286 // Added single isolated cell for offline gain calibration
287 nentries1 = pmdisocell->GetEntries();
288 AliDebug(1,Form("Total number of isolated single cell clusters = %d",nentries1));
289
290 for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
291 {
292 pmdiso = (AliPMDisocell*)pmdisocell->UncheckedAt(ient1);
293 idet = pmdiso->GetDetector();
294 ismn = pmdiso->GetSmn();
295 clusdata[0] = (Float_t) pmdiso->GetRow();
296 clusdata[1] = (Float_t) pmdiso->GetCol();
297 clusdata[2] = pmdiso->GetADC();
298 clusdata[3] = 1.;
299 clusdata[4] = -99.;
300 clusdata[5] = -99.;
301
302 AddRecPoint(idet,ismn,clusdata);
303 }
304 pmdisocell->Delete();
ed228cbc 305
5c5cadd5 306 branch1->Fill();
ed228cbc 307 ResetRecpoint();
308
309 } // modules
310
01709453 311 ResetCellADC();
e1287360 312 fPMDLoader = fRunLoader->GetLoader("PMDLoader");
b208c6a3 313 fPMDLoader->WriteRecPoints("OVERWRITE");
01709453 314
315 // delete the pointers
316 delete pmdclust;
317 delete pmdcont;
920e13db 318 delete pmdisocell;
01709453 319
7e9508a7 320}
321// ------------------------------------------------------------------------- //
322
8fbad6d3 323void AliPMDClusterFinder::Digits2RecPoints(TTree *digitsTree,
324 TTree *clustersTree)
325{
326 // Converts digits to recpoints after running clustering
327 // algorithm on CPV plane and PREshower plane
2c1131dd 328 //
f0290c15 329 // This algorithm is called during the reconstruction from digits
8fbad6d3 330
331 Int_t det = 0,smn = 0;
332 Int_t xpos,ypos;
333 Float_t adc;
334 Int_t ismn;
335 Int_t idet;
336 Float_t clusdata[6];
337
5254fcca 338 AliPMDcluster *pmdcl = 0x0;
920e13db 339 AliPMDisocell *pmdiso = 0x0;
5254fcca 340
8fbad6d3 341 TObjArray *pmdcont = new TObjArray();
920e13db 342 TObjArray *pmdisocell = new TObjArray();
8fbad6d3 343 AliPMDClustering *pmdclust = new AliPMDClusteringV1();
344
b9e2f33c 345 // Fetch the reco param object
346
347 fRecoParam = AliPMDReconstructor::GetRecoParam();
348 if(fRecoParam == 0x0)
349 {
350 AliFatal("No Reco Param found for PMD!!!");
351 }
352
8fbad6d3 353
8fbad6d3 354 AliPMDdigit *pmddigit;
355 TBranch *branch = digitsTree->GetBranch("PMDDigit");
356 branch->SetAddress(&fDigits);
357
358 ResetRecpoint();
359
8fbad6d3 360 Int_t bufsize = 16000;
361 TBranch * branch1 = clustersTree->Branch("PMDRecpoint", &fRecpoints, bufsize);
362 TBranch * branch2 = clustersTree->Branch("PMDRechit", &fRechits, bufsize);
363
364 Int_t nmodules = (Int_t) digitsTree->GetEntries();
365
366 for (Int_t imodule = 0; imodule < nmodules; imodule++)
367 {
5254fcca 368
369 Int_t totADCMod = 0;
8fbad6d3 370 ResetCellADC();
371 digitsTree->GetEntry(imodule);
372 Int_t nentries = fDigits->GetLast();
373 for (Int_t ient = 0; ient < nentries+1; ient++)
374 {
375 pmddigit = (AliPMDdigit*)fDigits->UncheckedAt(ient);
376
377 det = pmddigit->GetDetector();
378 smn = pmddigit->GetSMNumber();
379 xpos = pmddigit->GetRow();
380 ypos = pmddigit->GetColumn();
381 adc = pmddigit->GetADC();
f0290c15 382 if(xpos < 0 || xpos > 48 || ypos < 0 || ypos > 96)
383 {
384 AliError(Form("*Row %d and Column NUMBER %d NOT Valid *",
385 xpos, ypos));
386 continue;
387 }
388
35535af7 389 // Pedestal Subtraction
390 Int_t pedmeanrms = fCalibPed->GetPedMeanRms(det,smn,xpos,ypos);
37edc588 391 Int_t pedrms1 = (Int_t) pedmeanrms%100;
35535af7 392 Float_t pedrms = (Float_t)pedrms1/10.;
393 Float_t pedmean = (Float_t) (pedmeanrms - pedrms1)/1000.0;
394 //printf("%f %f\n",pedmean, pedrms);
395
396 Float_t adc1 = adc - (pedmean + 3.0*pedrms);
397
8fbad6d3 398 // CALIBRATION
35535af7 399 Float_t gain = fCalibGain->GetGainFact(det,smn,xpos,ypos);
8fbad6d3 400 // printf("adc = %d gain = %f\n",adc,gain);
35535af7 401
402 adc = adc1*gain;
8fbad6d3 403
920e13db 404 fCellTrack[xpos][ypos] = pmddigit->GetTrackNumber();
405 fCellPid[xpos][ypos] = pmddigit->GetTrackPid();
8fbad6d3 406 fCellADC[xpos][ypos] = (Double_t) adc;
5254fcca 407
5fbd2db1 408 totADCMod += (Int_t) adc;
5254fcca 409
8fbad6d3 410 }
411
412 idet = det;
413 ismn = smn;
5254fcca 414
415 if (totADCMod <= 0) continue;
416
b9e2f33c 417 // Set the minimum noise cut per module before clustering
418
419 Int_t imod = idet*24 + ismn;
420 fEcut = fRecoParam->GetNoiseCut(imod); // default
421 // fEcut = fRecoParam->GetPbPbParam()->GetNoiseCut(imod);
422 // fEcut = fRecoParam->GetPPParam()->GetNoiseCut(imod);
423 // fEcut = fRecoParam->GetCosmicParam()->GetNoiseCut(imod);
424
425
426 pmdclust->SetEdepCut(fEcut);
427
920e13db 428 pmdclust->DoClust(idet,ismn,fCellTrack,fCellPid,fCellADC,
429 pmdisocell,pmdcont);
8fbad6d3 430
431 Int_t nentries1 = pmdcont->GetEntries();
432
433 AliDebug(1,Form("Total number of clusters/module = %d",nentries1));
434
435 for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
436 {
920e13db 437 pmdcl = (AliPMDcluster*)pmdcont->UncheckedAt(ient1);
8fbad6d3 438 idet = pmdcl->GetDetector();
439 ismn = pmdcl->GetSMN();
440 clusdata[0] = pmdcl->GetClusX();
441 clusdata[1] = pmdcl->GetClusY();
442 clusdata[2] = pmdcl->GetClusADC();
443 clusdata[3] = pmdcl->GetClusCells();
444 clusdata[4] = pmdcl->GetClusSigmaX();
445 clusdata[5] = pmdcl->GetClusSigmaY();
446
447 AddRecPoint(idet,ismn,clusdata);
448
449 Int_t ncell = (Int_t) clusdata[3];
450 for(Int_t ihit = 0; ihit < ncell; ihit++)
451 {
452 Int_t celldataX = pmdcl->GetClusCellX(ihit);
453 Int_t celldataY = pmdcl->GetClusCellY(ihit);
920e13db 454 Int_t celldataTr = pmdcl->GetClusCellTrack(ihit);
455 Int_t celldataPid = pmdcl->GetClusCellPid(ihit);
b0e4d1e1 456 Float_t celldataAdc = pmdcl->GetClusCellAdc(ihit);
457 AddRecHit(celldataX, celldataY, celldataTr, celldataPid, celldataAdc);
8fbad6d3 458 }
459 branch2->Fill();
460 ResetRechit();
461 }
26e08752 462 pmdcont->Delete();
920e13db 463
464 // Added single isolated cell for offline gain calibration
465 nentries1 = pmdisocell->GetEntries();
466 AliDebug(1,Form("Total number of isolated single cell clusters = %d",nentries1));
467
468 for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
469 {
470 pmdiso = (AliPMDisocell*)pmdisocell->UncheckedAt(ient1);
471 idet = pmdiso->GetDetector();
472 ismn = pmdiso->GetSmn();
473 clusdata[0] = (Float_t) pmdiso->GetRow();
474 clusdata[1] = (Float_t) pmdiso->GetCol();
475 clusdata[2] = pmdiso->GetADC();
476 clusdata[3] = 1.;
477 clusdata[4] = -99.;
478 clusdata[5] = -99.;
479
480 AddRecPoint(idet,ismn,clusdata);
481 }
482 pmdisocell->Delete();
8fbad6d3 483
484 branch1->Fill();
485 ResetRecpoint();
486
487 } // modules
488
920e13db 489
8fbad6d3 490 ResetCellADC();
8fbad6d3 491
492 // delete the pointers
493 delete pmdclust;
494 delete pmdcont;
920e13db 495 delete pmdisocell;
8fbad6d3 496}
497// ------------------------------------------------------------------------- //
498
7e9508a7 499void AliPMDClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
500 TTree *clustersTree)
501{
502 // Converts RAW data to recpoints after running clustering
503 // algorithm on CPV and PREshower plane
504 //
2c1131dd 505 // This method is called at the time of reconstruction from RAW data
2332574a 506
7e9508a7 507
920e13db 508 AliPMDddldata *pmdddl = 0x0;
509 AliPMDcluster *pmdcl = 0x0;
510 AliPMDisocell *pmdiso = 0x0;
5254fcca 511
512
5c5cadd5 513 Float_t clusdata[6];
df42ab21 514 TObjArray pmdddlcont;
7e9508a7 515
516 TObjArray *pmdcont = new TObjArray();
920e13db 517 TObjArray *pmdisocell = new TObjArray();
5254fcca 518
5c5cadd5 519 AliPMDClustering *pmdclust = new AliPMDClusteringV1();
7e9508a7 520
b9e2f33c 521 // Set the minimum noise cut per module before clustering
522
523 fRecoParam = AliPMDReconstructor::GetRecoParam();
524
525 if(fRecoParam == 0x0)
526 {
527 AliFatal("No Reco Param found for PMD!!!");
528 }
529
7e9508a7 530
531 ResetRecpoint();
532
533 Int_t bufsize = 16000;
5c5cadd5 534 TBranch *branch1 = clustersTree->Branch("PMDRecpoint", &fRecpoints, bufsize);
535
536 TBranch * branch2 = clustersTree->Branch("PMDRechit", &fRechits, bufsize);
7e9508a7 537
7e9508a7 538 const Int_t kRow = 48;
539 const Int_t kCol = 96;
540
541 Int_t idet = 0;
542 Int_t iSMN = 0;
2332574a 543
722ccc67 544 Int_t indexDDL = -1;
545 AliPMDRawStream pmdinput(rawReader);
8fbad6d3 546
722ccc67 547 while ((indexDDL = pmdinput.DdlData(&pmdddlcont)) >=0)
548 {
7e9508a7 549 if (indexDDL < 4)
550 {
551 iSMN = 6;
552 }
553 else if (indexDDL >= 4)
554 {
555 iSMN = 12;
556 }
557 Int_t ***precpvADC;
558 precpvADC = new int **[iSMN];
559 for (Int_t i=0; i<iSMN; i++) precpvADC[i] = new int *[kRow];
560 for (Int_t i=0; i<iSMN;i++)
561 {
562 for (Int_t j=0; j<kRow; j++) precpvADC[i][j] = new int [kCol];
563 }
564 for (Int_t i = 0; i < iSMN; i++)
565 {
566 for (Int_t j = 0; j < kRow; j++)
567 {
568 for (Int_t k = 0; k < kCol; k++)
569 {
570 precpvADC[i][j][k] = 0;
571 }
572 }
573 }
574 ResetCellADC();
2332574a 575
df42ab21 576 Int_t indexsmn = 0;
577 Int_t ientries = pmdddlcont.GetEntries();
578 for (Int_t ient = 0; ient < ientries; ient++)
7e9508a7 579 {
920e13db 580 pmdddl = (AliPMDddldata*)pmdddlcont.UncheckedAt(ient);
7e9508a7 581
df42ab21 582 Int_t det = pmdddl->GetDetector();
583 Int_t smn = pmdddl->GetSMN();
584 //Int_t mcm = pmdddl->GetMCM();
585 //Int_t chno = pmdddl->GetChannel();
586 Int_t row = pmdddl->GetRow();
587 Int_t col = pmdddl->GetColumn();
588 Int_t sig = pmdddl->GetSignal();
2c1131dd 589
590 if(smn == -1)
591 {
592 AliError(Form("*MODULE NUMBER WRONG %d *",smn));
593 continue;
594 }
f0290c15 595 if(row < 0 || row > 48 || col < 0 || col > 96)
596 {
597 AliError(Form("*Row %d and Column NUMBER %d NOT Valid *",
598 row, col));
599 continue;
600 }
2c1131dd 601
35535af7 602 // Pedestal Subtraction
603 Int_t pedmeanrms = fCalibPed->GetPedMeanRms(det,smn,row,col);
37edc588 604 Int_t pedrms1 = (Int_t) pedmeanrms%100;
35535af7 605 Float_t pedrms = (Float_t)pedrms1/10.;
606 Float_t pedmean = (Float_t) (pedmeanrms - pedrms1)/1000.0;
607
608 //printf("%f %f\n",pedmean, pedrms);
609
610 // Float_t sig1 = (Float_t) sig;
611 Float_t sig1 = (Float_t) sig - (pedmean + 3.0*pedrms);
612
09a06455 613 // CALIBRATION
35535af7 614 Float_t gain = fCalibGain->GetGainFact(det,smn,row,col);
df42ab21 615 //printf("sig = %d gain = %f\n",sig,gain);
09a06455 616 sig = (Int_t) (sig1*gain);
7e9508a7 617
618 if (indexDDL < 4)
619 {
620 if (det != 0)
621 AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
622 indexDDL, det));
623 indexsmn = smn - indexDDL * 6;
624 }
625 else if (indexDDL == 4)
626 {
627 if (det != 1)
628 AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
629 indexDDL, det));
630 if (smn < 6)
631 {
632 indexsmn = smn;
633 }
df42ab21 634 else if (smn >= 18 && smn < 24)
7e9508a7 635 {
df42ab21 636 indexsmn = smn - 12;
7e9508a7 637 }
638 }
639 else if (indexDDL == 5)
640 {
641 if (det != 1)
642 AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
643 indexDDL, det));
644 if (smn >= 6 && smn < 12)
645 {
646 indexsmn = smn - 6;
647 }
df42ab21 648 else if (smn >= 12 && smn < 18)
7e9508a7 649 {
df42ab21 650 indexsmn = smn - 6;
7e9508a7 651 }
652 }
653 precpvADC[indexsmn][row][col] = sig;
df42ab21 654 }
655
26e08752 656 pmdddlcont.Delete();
7e9508a7 657
5254fcca 658 Int_t totAdcMod = 0;
659
7e9508a7 660 Int_t ismn = 0;
78fc1b96 661 for (indexsmn = 0; indexsmn < iSMN; indexsmn++)
7e9508a7 662 {
663 ResetCellADC();
5254fcca 664 totAdcMod = 0;
7e9508a7 665 for (Int_t irow = 0; irow < kRow; irow++)
666 {
667 for (Int_t icol = 0; icol < kCol; icol++)
668 {
920e13db 669 fCellTrack[irow][icol] = -1;
670 fCellPid[irow][icol] = -1;
671
7e9508a7 672 fCellADC[irow][icol] =
673 (Double_t) precpvADC[indexsmn][irow][icol];
5254fcca 674 totAdcMod += precpvADC[indexsmn][irow][icol];
7e9508a7 675 } // row
676 } // col
df42ab21 677
7e9508a7 678 if (indexDDL < 4)
679 {
680 ismn = indexsmn + indexDDL * 6;
681 idet = 0;
682 }
683 else if (indexDDL == 4)
684 {
685 if (indexsmn < 6)
686 {
687 ismn = indexsmn;
688 }
689 else if (indexsmn >= 6 && indexsmn < 12)
690 {
df42ab21 691 ismn = indexsmn + 12;
7e9508a7 692 }
693 idet = 1;
694 }
695 else if (indexDDL == 5)
696 {
697 if (indexsmn < 6)
698 {
699 ismn = indexsmn + 6;
700 }
701 else if (indexsmn >= 6 && indexsmn < 12)
702 {
df42ab21 703 ismn = indexsmn + 6;
7e9508a7 704 }
705 idet = 1;
706 }
707
5254fcca 708 if (totAdcMod <= 0) continue;
920e13db 709
b9e2f33c 710 Int_t imod = idet*24 + ismn;
711
712 fEcut = fRecoParam->GetNoiseCut(imod); // default
713 // fEcut = fRecoParam->GetPbPbParam()->GetNoiseCut(imod);
714 // fEcut = fRecoParam->GetPPParam()->GetNoiseCut(imod);
715 // fEcut = fRecoParam->GetCosmicParam()->GetNoiseCut(imod);
716
717
718 pmdclust->SetEdepCut(fEcut);
920e13db 719
920e13db 720 pmdclust->DoClust(idet,ismn,fCellTrack,fCellPid,fCellADC,
721 pmdisocell,pmdcont);
722
7e9508a7 723 Int_t nentries1 = pmdcont->GetEntries();
724
725 AliDebug(1,Form("Total number of clusters/module = %d",nentries1));
726
727 for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
728 {
920e13db 729 pmdcl = (AliPMDcluster*)pmdcont->UncheckedAt(ient1);
7e9508a7 730 idet = pmdcl->GetDetector();
731 ismn = pmdcl->GetSMN();
732 clusdata[0] = pmdcl->GetClusX();
733 clusdata[1] = pmdcl->GetClusY();
734 clusdata[2] = pmdcl->GetClusADC();
735 clusdata[3] = pmdcl->GetClusCells();
5c5cadd5 736 clusdata[4] = pmdcl->GetClusSigmaX();
737 clusdata[5] = pmdcl->GetClusSigmaY();
7e9508a7 738
739 AddRecPoint(idet,ismn,clusdata);
09a06455 740
5c5cadd5 741 Int_t ncell = (Int_t) clusdata[3];
742 for(Int_t ihit = 0; ihit < ncell; ihit++)
743 {
744 Int_t celldataX = pmdcl->GetClusCellX(ihit);
745 Int_t celldataY = pmdcl->GetClusCellY(ihit);
920e13db 746 Int_t celldataTr = pmdcl->GetClusCellTrack(ihit);
747 Int_t celldataPid = pmdcl->GetClusCellPid(ihit);
b0e4d1e1 748 Float_t celldataAdc = pmdcl->GetClusCellAdc(ihit);
749 AddRecHit(celldataX, celldataY, celldataTr, celldataPid, celldataAdc);
5c5cadd5 750 }
751 branch2->Fill();
752 ResetRechit();
753
7e9508a7 754 }
26e08752 755 pmdcont->Delete();
920e13db 756
757
758 // Added single isolated cell for offline gain calibration
759 nentries1 = pmdisocell->GetEntries();
760 AliDebug(1,Form("Total number of isolated single cell clusters = %d",nentries1));
761
762 for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
763 {
764 pmdiso = (AliPMDisocell*)pmdisocell->UncheckedAt(ient1);
765 idet = pmdiso->GetDetector();
766 ismn = pmdiso->GetSmn();
767 clusdata[0] = (Float_t) pmdiso->GetRow();
768 clusdata[1] = (Float_t) pmdiso->GetCol();
769 clusdata[2] = pmdiso->GetADC();
770 clusdata[3] = 1.;
771 clusdata[4] = -99.;
772 clusdata[5] = -99.;
773
774 AddRecPoint(idet,ismn,clusdata);
775 }
776 pmdisocell->Delete();
7e9508a7 777
5c5cadd5 778 branch1->Fill();
7e9508a7 779 ResetRecpoint();
780
781
782 } // smn
783
784 for (Int_t i=0; i<iSMN; i++)
785 {
786 for (Int_t j=0; j<kRow; j++) delete [] precpvADC[i][j];
787 }
788 for (Int_t i=0; i<iSMN; i++) delete [] precpvADC[i];
c9e0bd24 789 delete [] precpvADC;
722ccc67 790
7e9508a7 791 } // DDL Loop
920e13db 792
7e9508a7 793
794 ResetCellADC();
795
796 // delete the pointers
797 delete pmdclust;
798 delete pmdcont;
920e13db 799 delete pmdisocell;
7e9508a7 800
01709453 801}
1758e4fe 802// ------------------------------------------------------------------------- //
5f55af10 803
804void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt, AliRawReader *rawReader)
805{
01b56f5c 806 // Converts RAW data to recpoints after running clustering
807 // algorithm on CPV and PREshower plane
5f55af10 808 //
809
5c5cadd5 810 Float_t clusdata[6];
920e13db 811
df42ab21 812 TObjArray pmdddlcont;
920e13db 813
b0e4d1e1 814 AliPMDcluster *pmdcl = 0x0;
920e13db 815 AliPMDisocell *pmdiso = 0x0;
816
817
5f55af10 818 TObjArray *pmdcont = new TObjArray();
920e13db 819 TObjArray *pmdisocell = new TObjArray();
5c5cadd5 820
821 AliPMDClustering *pmdclust = new AliPMDClusteringV1();
7e9508a7 822
b9e2f33c 823 // Set the minimum noise cut per module before clustering
824
825 fRecoParam = AliPMDReconstructor::GetRecoParam();
826
827 if(fRecoParam == 0x0)
828 {
829 AliFatal("No Reco Param found for PMD!!!");
830 }
831
5f55af10 832
833 fRunLoader->GetEvent(ievt);
834
835 ResetRecpoint();
01b56f5c 836
5f55af10 837 fTreeR = fPMDLoader->TreeR();
838 if (fTreeR == 0x0)
839 {
840 fPMDLoader->MakeTree("R");
841 fTreeR = fPMDLoader->TreeR();
842 }
5f55af10 843 Int_t bufsize = 16000;
5c5cadd5 844 TBranch *branch1 = fTreeR->Branch("PMDRecpoint", &fRecpoints, bufsize);
845 TBranch *branch2 = fTreeR->Branch("PMDRechit", &fRechits, bufsize);
01b56f5c 846
5f55af10 847 const Int_t kRow = 48;
848 const Int_t kCol = 96;
5f55af10 849
01b56f5c 850 Int_t idet = 0;
851 Int_t iSMN = 0;
722ccc67 852
853 AliPMDRawStream pmdinput(rawReader);
854 Int_t indexDDL = -1;
855
856 while ((indexDDL = pmdinput.DdlData(&pmdddlcont)) >=0) {
857
01b56f5c 858 if (indexDDL < 4)
5f55af10 859 {
01b56f5c 860 iSMN = 6;
5f55af10 861 }
01b56f5c 862 else if (indexDDL >= 4)
5f55af10 863 {
01b56f5c 864 iSMN = 12;
5f55af10 865 }
01b56f5c 866 Int_t ***precpvADC;
867 precpvADC = new int **[iSMN];
868 for (Int_t i=0; i<iSMN; i++) precpvADC[i] = new int *[kRow];
869 for (Int_t i=0; i<iSMN;i++)
5f55af10 870 {
01b56f5c 871 for (Int_t j=0; j<kRow; j++) precpvADC[i][j] = new int [kCol];
5f55af10 872 }
01b56f5c 873 for (Int_t i = 0; i < iSMN; i++)
874 {
875 for (Int_t j = 0; j < kRow; j++)
876 {
877 for (Int_t k = 0; k < kCol; k++)
878 {
879 precpvADC[i][j][k] = 0;
880 }
881 }
882 }
883 ResetCellADC();
2332574a 884
df42ab21 885
886 Int_t indexsmn = 0;
887 Int_t ientries = pmdddlcont.GetEntries();
888 for (Int_t ient = 0; ient < ientries; ient++)
01b56f5c 889 {
df42ab21 890 AliPMDddldata *pmdddl = (AliPMDddldata*)pmdddlcont.UncheckedAt(ient);
891
892 Int_t det = pmdddl->GetDetector();
893 Int_t smn = pmdddl->GetSMN();
894 //Int_t mcm = pmdddl->GetMCM();
895 //Int_t chno = pmdddl->GetChannel();
896 Int_t row = pmdddl->GetRow();
897 Int_t col = pmdddl->GetColumn();
898 Int_t sig = pmdddl->GetSignal();
f0290c15 899 if(row < 0 || row > 48 || col < 0 || col > 96)
900 {
901 AliError(Form("*Row %d and Column NUMBER %d NOT Valid *",
902 row, col));
903 continue;
904 }
35535af7 905 // Pedestal Subtraction
906 Int_t pedmeanrms = fCalibPed->GetPedMeanRms(det,smn,row,col);
37edc588 907 Int_t pedrms1 = (Int_t) pedmeanrms%100;
35535af7 908 Float_t pedrms = (Float_t)pedrms1/10.;
909 Float_t pedmean = (Float_t) (pedmeanrms - pedrms1)/1000.0;
910
911 //printf("%f %f\n",pedmean, pedrms);
912
913 //Float_t sig1 = (Float_t) sig;
914 Float_t sig1 = (Float_t) sig - (pedmean + 3.0*pedrms);
09a06455 915 // CALIBRATION
35535af7 916 Float_t gain = fCalibGain->GetGainFact(det,smn,row,col);
2332574a 917
df42ab21 918 //printf("sig = %d gain = %f\n",sig,gain);
09a06455 919 sig = (Int_t) (sig1*gain);
df42ab21 920
5f55af10 921
01b56f5c 922 if (indexDDL < 4)
923 {
924 if (det != 0)
7e9508a7 925 AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
926 indexDDL, det));
01b56f5c 927 indexsmn = smn - indexDDL * 6;
928 }
929 else if (indexDDL == 4)
930 {
931 if (det != 1)
7e9508a7 932 AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
933 indexDDL, det));
01b56f5c 934 if (smn < 6)
935 {
936 indexsmn = smn;
937 }
df42ab21 938 else if (smn >= 18 && smn < 24)
01b56f5c 939 {
df42ab21 940 indexsmn = smn - 12;
01b56f5c 941 }
942 }
943 else if (indexDDL == 5)
944 {
945 if (det != 1)
7e9508a7 946 AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
947 indexDDL, det));
01b56f5c 948 if (smn >= 6 && smn < 12)
949 {
950 indexsmn = smn - 6;
951 }
df42ab21 952 else if (smn >= 12 && smn < 18)
01b56f5c 953 {
df42ab21 954 indexsmn = smn - 6;
01b56f5c 955 }
956 }
957 precpvADC[indexsmn][row][col] = sig;
df42ab21 958
959 }
960
26e08752 961 pmdddlcont.Delete();
01b56f5c 962
963 Int_t ismn = 0;
78fc1b96 964 for (indexsmn = 0; indexsmn < iSMN; indexsmn++)
5f55af10 965 {
01b56f5c 966 ResetCellADC();
5f55af10 967 for (Int_t irow = 0; irow < kRow; irow++)
968 {
969 for (Int_t icol = 0; icol < kCol; icol++)
970 {
920e13db 971 fCellTrack[irow][icol] = -1;
972 fCellPid[irow][icol] = -1;
01b56f5c 973 fCellADC[irow][icol] =
974 (Double_t) precpvADC[indexsmn][irow][icol];
5f55af10 975 } // row
976 } // col
df42ab21 977
978
01b56f5c 979 if (indexDDL < 4)
980 {
981 ismn = indexsmn + indexDDL * 6;
982 idet = 0;
983 }
984 else if (indexDDL == 4)
985 {
986 if (indexsmn < 6)
987 {
988 ismn = indexsmn;
989 }
990 else if (indexsmn >= 6 && indexsmn < 12)
991 {
df42ab21 992 ismn = indexsmn + 12;
01b56f5c 993 }
994 idet = 1;
995 }
996 else if (indexDDL == 5)
997 {
998 if (indexsmn < 6)
999 {
1000 ismn = indexsmn + 6;
1001 }
1002 else if (indexsmn >= 6 && indexsmn < 12)
1003 {
df42ab21 1004 ismn = indexsmn + 6;
01b56f5c 1005 }
1006 idet = 1;
1007 }
1008
b9e2f33c 1009 Int_t imod = idet*24 + ismn;
1010 fEcut = fRecoParam->GetNoiseCut(imod); // default
1011 // fEcut = fRecoParam->GetPbPbParam()->GetNoiseCut(imod);
1012 // fEcut = fRecoParam->GetPPParam()->GetNoiseCut(imod);
1013 // fEcut = fRecoParam->GetCosmicParam()->GetNoiseCut(imod);
1014
1015 pmdclust->SetEdepCut(fEcut);
1016
920e13db 1017 pmdclust->DoClust(idet,ismn,fCellTrack,fCellPid,fCellADC,
1018 pmdisocell,pmdcont);
1019
5f55af10 1020 Int_t nentries1 = pmdcont->GetEntries();
7e9508a7 1021
1022 AliDebug(1,Form("Total number of clusters/module = %d",nentries1));
1023
5f55af10 1024 for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
1025 {
b0e4d1e1 1026 pmdcl = (AliPMDcluster*)pmdcont->UncheckedAt(ient1);
5f55af10 1027 idet = pmdcl->GetDetector();
1028 ismn = pmdcl->GetSMN();
1029 clusdata[0] = pmdcl->GetClusX();
1030 clusdata[1] = pmdcl->GetClusY();
1031 clusdata[2] = pmdcl->GetClusADC();
1032 clusdata[3] = pmdcl->GetClusCells();
5c5cadd5 1033 clusdata[4] = pmdcl->GetClusSigmaX();
1034 clusdata[5] = pmdcl->GetClusSigmaY();
01b56f5c 1035
5f55af10 1036 AddRecPoint(idet,ismn,clusdata);
5c5cadd5 1037
5c5cadd5 1038 Int_t ncell = (Int_t) clusdata[3];
1039 for(Int_t ihit = 0; ihit < ncell; ihit++)
1040 {
1041 Int_t celldataX = pmdcl->GetClusCellX(ihit);
1042 Int_t celldataY = pmdcl->GetClusCellY(ihit);
920e13db 1043 Int_t celldataTr = pmdcl->GetClusCellTrack(ihit);
1044 Int_t celldataPid = pmdcl->GetClusCellPid(ihit);
b0e4d1e1 1045 Float_t celldataAdc = pmdcl->GetClusCellAdc(ihit);
1046 AddRecHit(celldataX, celldataY, celldataTr, celldataPid, celldataAdc);
5c5cadd5 1047 }
1048 branch2->Fill();
1049 ResetRechit();
1050
5f55af10 1051 }
26e08752 1052 pmdcont->Delete();
920e13db 1053
1054 // Added single isolated cell for offline gain calibration
1055 nentries1 = pmdisocell->GetEntries();
1056 AliDebug(1,Form("Total number of isolated single cell clusters = %d",nentries1));
1057
1058 for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
1059 {
1060 pmdiso = (AliPMDisocell*)pmdisocell->UncheckedAt(ient1);
1061 idet = pmdiso->GetDetector();
1062 ismn = pmdiso->GetSmn();
1063 clusdata[0] = (Float_t) pmdiso->GetRow();
1064 clusdata[1] = (Float_t) pmdiso->GetCol();
1065 clusdata[2] = pmdiso->GetADC();
1066 clusdata[3] = 1.;
1067 clusdata[4] = -99.;
1068 clusdata[5] = -99.;
1069
1070 AddRecPoint(idet,ismn,clusdata);
1071 }
1072 pmdisocell->Delete();
5f55af10 1073
5c5cadd5 1074 branch1->Fill();
5f55af10 1075 ResetRecpoint();
01b56f5c 1076
1077
5f55af10 1078 } // smn
5f55af10 1079
01b56f5c 1080 for (Int_t i=0; i<iSMN; i++)
1081 {
1082 for (Int_t j=0; j<kRow; j++) delete [] precpvADC[i][j];
1083 }
1084 for (Int_t i=0; i<iSMN; i++) delete [] precpvADC[i];
1085 delete precpvADC;
1086 } // DDL Loop
920e13db 1087
1088
5f55af10 1089 ResetCellADC();
01b56f5c 1090
5f55af10 1091 fPMDLoader = fRunLoader->GetLoader("PMDLoader");
1092 fPMDLoader->WriteRecPoints("OVERWRITE");
1093
1094 // delete the pointers
1095 delete pmdclust;
1096 delete pmdcont;
920e13db 1097 delete pmdisocell;
5f55af10 1098}
1099// ------------------------------------------------------------------------- //
ed228cbc 1100void AliPMDClusterFinder::SetCellEdepCut(Float_t ecut)
1101{
1102 fEcut = ecut;
1103}
1758e4fe 1104// ------------------------------------------------------------------------- //
1758e4fe 1105void AliPMDClusterFinder::AddRecPoint(Int_t idet,Int_t ismn,Float_t *clusdata)
01709453 1106{
b208c6a3 1107 // Add Reconstructed points
1108 //
01709453 1109 TClonesArray &lrecpoints = *fRecpoints;
ed228cbc 1110 AliPMDrecpoint1 *newrecpoint;
1758e4fe 1111 newrecpoint = new AliPMDrecpoint1(idet, ismn, clusdata);
ed228cbc 1112 new(lrecpoints[fNpoint++]) AliPMDrecpoint1(newrecpoint);
01709453 1113 delete newrecpoint;
1114}
1758e4fe 1115// ------------------------------------------------------------------------- //
920e13db 1116void AliPMDClusterFinder::AddRecHit(Int_t celldataX,Int_t celldataY,
b0e4d1e1 1117 Int_t celldataTr, Int_t celldataPid,
1118 Float_t celldataAdc)
5c5cadd5 1119{
1120 // Add associated cell hits to the Reconstructed points
1121 //
1122 TClonesArray &lrechits = *fRechits;
1123 AliPMDrechit *newrechit;
b0e4d1e1 1124 newrechit = new AliPMDrechit(celldataX, celldataY, celldataTr, celldataPid, celldataAdc);
5c5cadd5 1125 new(lrechits[fNhit++]) AliPMDrechit(newrechit);
1126 delete newrechit;
1127}
1128// ------------------------------------------------------------------------- //
01709453 1129void AliPMDClusterFinder::ResetCellADC()
1130{
b208c6a3 1131 // Reset the individual cell ADC value to zero
1132 //
5e6a9312 1133 for(Int_t irow = 0; irow < fgkRow; irow++)
01709453 1134 {
5e6a9312 1135 for(Int_t icol = 0; icol < fgkCol; icol++)
01709453 1136 {
920e13db 1137 fCellTrack[irow][icol] = -1;
1138 fCellPid[irow][icol] = -1;
1139 fCellADC[irow][icol] = 0.;
01709453 1140 }
1141 }
1142}
1758e4fe 1143// ------------------------------------------------------------------------- //
01709453 1144void AliPMDClusterFinder::ResetRecpoint()
1145{
b208c6a3 1146 // Clear the list of reconstructed points
01709453 1147 fNpoint = 0;
1148 if (fRecpoints) fRecpoints->Clear();
1149}
1758e4fe 1150// ------------------------------------------------------------------------- //
5c5cadd5 1151void AliPMDClusterFinder::ResetRechit()
1152{
1153 // Clear the list of reconstructed points
1154 fNhit = 0;
1155 if (fRechits) fRechits->Clear();
1156}
1157// ------------------------------------------------------------------------- //
55601d47 1158void AliPMDClusterFinder::Load()
1159{
ebd83c56 1160 // Load all the *.root files
55601d47 1161 //
1162 fPMDLoader->LoadDigits("READ");
1163 fPMDLoader->LoadRecPoints("recreate");
1164}
1165// ------------------------------------------------------------------------- //
01b56f5c 1166void AliPMDClusterFinder::LoadClusters()
1167{
1168 // Load all the *.root files
1169 //
1170 fPMDLoader->LoadRecPoints("recreate");
1171}
1172// ------------------------------------------------------------------------- //
ebd83c56 1173void AliPMDClusterFinder::UnLoad()
01709453 1174{
b208c6a3 1175 // Unload all the *.root files
1176 //
ebd83c56 1177 fPMDLoader->UnloadDigits();
1178 fPMDLoader->UnloadRecPoints();
01709453 1179}
1758e4fe 1180// ------------------------------------------------------------------------- //
01b56f5c 1181void AliPMDClusterFinder::UnLoadClusters()
1182{
1183 // Unload all the *.root files
1184 //
1185 fPMDLoader->UnloadRecPoints();
1186}
1187// ------------------------------------------------------------------------- //
35535af7 1188AliPMDCalibData* AliPMDClusterFinder::GetCalibGain() const
09a06455 1189{
1190 // The run number will be centralized in AliCDBManager,
1191 // you don't need to set it here!
1192 // Added by ZA
35535af7 1193 AliCDBEntry *entry = AliCDBManager::Instance()->Get("PMD/Calib/Gain");
09a06455 1194
0dd3d6f9 1195 if(!entry) AliFatal("Calibration object retrieval failed! ");
09a06455 1196
1197 AliPMDCalibData *calibdata=0;
1198 if (entry) calibdata = (AliPMDCalibData*) entry->GetObject();
1199
0dd3d6f9 1200 if (!calibdata) AliFatal("No calibration data from calibration database !");
09a06455 1201
1202 return calibdata;
1203}
35535af7 1204// ------------------------------------------------------------------------- //
35535af7 1205AliPMDPedestal* AliPMDClusterFinder::GetCalibPed() const
1206{
1207 // The run number will be centralized in AliCDBManager,
1208 // you don't need to set it here!
1209 AliCDBEntry *entry = AliCDBManager::Instance()->Get("PMD/Calib/Ped");
1210
1211 if(!entry) AliFatal("Pedestal object retrieval failed!");
1212
1213 AliPMDPedestal *pedestal = 0;
1214 if (entry) pedestal = (AliPMDPedestal*) entry->GetObject();
1215
1216 if (!pedestal) AliFatal("No pedestal data from pedestal database !");
1217
1218 return pedestal;
1219}