- else if (indexDDL == 5)
- {
- if (indexsmn < 6)
- {
- ismn = indexsmn + 6;
- }
- else if (indexsmn >= 6 && indexsmn < 12)
- {
- ismn = indexsmn + 6;
- }
- idet = 1;
- }
-
- pmdclust->DoClust(idet,ismn,fCellADC,pmdcont);
- Int_t nentries1 = pmdcont->GetEntries();
-
- AliDebug(1,Form("Total number of clusters/module = %d",nentries1));
-
- for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
- {
- AliPMDcluster *pmdcl =
- (AliPMDcluster*)pmdcont->UncheckedAt(ient1);
- idet = pmdcl->GetDetector();
- ismn = pmdcl->GetSMN();
- clusdata[0] = pmdcl->GetClusX();
- clusdata[1] = pmdcl->GetClusY();
- clusdata[2] = pmdcl->GetClusADC();
- clusdata[3] = pmdcl->GetClusCells();
- clusdata[4] = pmdcl->GetClusSigmaX();
- clusdata[5] = pmdcl->GetClusSigmaY();
-
- AddRecPoint(idet,ismn,clusdata);
-
- Int_t ncell = (Int_t) clusdata[3];
- for(Int_t ihit = 0; ihit < ncell; ihit++)
- {
- Int_t celldataX = pmdcl->GetClusCellX(ihit);
- Int_t celldataY = pmdcl->GetClusCellY(ihit);
- AddRecHit(celldataX, celldataY);
- }
- branch2->Fill();
- ResetRechit();
-
- }
- pmdcont->Delete();
-
- branch1->Fill();
- ResetRecpoint();
-
-
- } // smn
-
- for (Int_t i=0; i<iSMN; i++)
- {
- for (Int_t j=0; j<kRow; j++) delete [] precpvADC[i][j];
- }
- for (Int_t i=0; i<iSMN; i++) delete [] precpvADC[i];
- delete precpvADC;
-
- } // DDL Loop
-
- ResetCellADC();
-
- // delete the pointers
- delete pmdclust;
- delete pmdcont;
-
-}
-// ------------------------------------------------------------------------- //
-
-void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt, AliRawReader *rawReader)
-{
- // Converts RAW data to recpoints after running clustering
- // algorithm on CPV and PREshower plane
- //
-
- Float_t clusdata[6];
- TObjArray pmdddlcont;
- TObjArray *pmdcont = new TObjArray();
-
- AliPMDClustering *pmdclust = new AliPMDClusteringV1();
-
- pmdclust->SetEdepCut(fEcut);
-
- fRunLoader->GetEvent(ievt);
-
- ResetRecpoint();
-
- fTreeR = fPMDLoader->TreeR();
- if (fTreeR == 0x0)
- {
- fPMDLoader->MakeTree("R");
- fTreeR = fPMDLoader->TreeR();
- }
- Int_t bufsize = 16000;
- TBranch *branch1 = fTreeR->Branch("PMDRecpoint", &fRecpoints, bufsize);
- TBranch *branch2 = fTreeR->Branch("PMDRechit", &fRechits, bufsize);
-
- const Int_t kRow = 48;
- const Int_t kCol = 96;
-
- Int_t idet = 0;
- Int_t iSMN = 0;
-
- AliPMDRawStream pmdinput(rawReader);
- Int_t indexDDL = -1;
-
- while ((indexDDL = pmdinput.DdlData(&pmdddlcont)) >=0) {
-
- if (indexDDL < 4)
- {
- iSMN = 6;
- }
- else if (indexDDL >= 4)
- {
- iSMN = 12;
- }
- Int_t ***precpvADC;
- precpvADC = new int **[iSMN];
- for (Int_t i=0; i<iSMN; i++) precpvADC[i] = new int *[kRow];
- for (Int_t i=0; i<iSMN;i++)
- {
- for (Int_t j=0; j<kRow; j++) precpvADC[i][j] = new int [kCol];
- }
- for (Int_t i = 0; i < iSMN; i++)
- {
- for (Int_t j = 0; j < kRow; j++)
- {
- for (Int_t k = 0; k < kCol; k++)
- {
- precpvADC[i][j][k] = 0;
- }
- }
- }
- ResetCellADC();
-
-
- Int_t indexsmn = 0;
- Int_t ientries = pmdddlcont.GetEntries();
- for (Int_t ient = 0; ient < ientries; ient++)
- {
- AliPMDddldata *pmdddl = (AliPMDddldata*)pmdddlcont.UncheckedAt(ient);
-
- Int_t det = pmdddl->GetDetector();
- Int_t smn = pmdddl->GetSMN();
- //Int_t mcm = pmdddl->GetMCM();
- //Int_t chno = pmdddl->GetChannel();
- Int_t row = pmdddl->GetRow();
- Int_t col = pmdddl->GetColumn();
- Int_t sig = pmdddl->GetSignal();
-
- // Pedestal Subtraction
- Int_t pedmeanrms = fCalibPed->GetPedMeanRms(det,smn,row,col);
- Int_t pedrms1 = (Int_t) pedmeanrms%1000;
- Float_t pedrms = (Float_t)pedrms1/10.;
- Float_t pedmean = (Float_t) (pedmeanrms - pedrms1)/1000.0;
-
- //printf("%f %f\n",pedmean, pedrms);
-
- //Float_t sig1 = (Float_t) sig;
- Float_t sig1 = (Float_t) sig - (pedmean + 3.0*pedrms);
- // CALIBRATION
- Float_t gain = fCalibGain->GetGainFact(det,smn,row,col);
-
- //printf("sig = %d gain = %f\n",sig,gain);
- sig = (Int_t) (sig1*gain);
-
-
- if (indexDDL < 4)