From: basanta Date: Wed, 1 Jul 2009 16:57:36 +0000 (+0000) Subject: In clustering code the method name is changed, Bug fixed in AliPMDrechit, Initializat... X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=d270ca461a6e6fcec47a41ccde784822513632c2 In clustering code the method name is changed, Bug fixed in AliPMDrechit, Initialization is corrected in aliPMDtracker --- diff --git a/PMD/AliPMDClusteringV1.cxx b/PMD/AliPMDClusteringV1.cxx index 09aedb9267c..e5eeb128774 100644 --- a/PMD/AliPMDClusteringV1.cxx +++ b/PMD/AliPMDClusteringV1.cxx @@ -124,7 +124,7 @@ void AliPMDClusteringV1::DoClust(Int_t idet, Int_t ismn, // call the isolated cell search method - CalculateIsoCell(idet, ismn, celladc, pmdisocell); + FindIsoCell(idet, ismn, celladc, pmdisocell); // ndimXr and ndimYr are different because of different module size @@ -270,18 +270,37 @@ void AliPMDClusteringV1::DoClust(Int_t idet, Int_t ismn, Int_t irow = celldataX[ihit]; Int_t icol = celldataY[ihit]; - if ((irow >= 0 && irow < 48) && (icol >= 0 && icol < 96)) + if (ismn < 12) { - celldataTr[ihit] = celltrack[irow][icol]; - celldataPid[ihit] = cellpid[irow][icol]; - celldataAdc[ihit] = (Float_t) celladc[irow][icol]; + if ((irow >= 0 && irow < 96) && (icol >= 0 && icol < 48)) + { + celldataTr[ihit] = celltrack[icol][irow]; + celldataPid[ihit] = cellpid[icol][irow]; + celldataAdc[ihit] = (Float_t) celladc[icol][irow]; + } + else + { + celldataTr[ihit] = -1; + celldataPid[ihit] = -1; + celldataAdc[ihit] = -1; + } } - else + else if (ismn >= 12 && ismn < 24) { - celldataTr[ihit] = -1; - celldataPid[ihit] = -1; - celldataAdc[ihit] = -1; + if ((irow >= 0 && irow < 48) && (icol >= 0 && icol < 96)) + { + celldataTr[ihit] = celltrack[irow][icol]; + celldataPid[ihit] = cellpid[irow][icol]; + celldataAdc[ihit] = (Float_t) celladc[irow][icol]; + } + else + { + celldataTr[ihit] = -1; + celldataPid[ihit] = -1; + celldataAdc[ihit] = -1; + } } + } pmdcl = new AliPMDcluster(idet, ismn, clusdata, celldataX, celldataY, @@ -808,30 +827,16 @@ void AliPMDClusteringV1::RefClust(Int_t incr, Double_t edepcell[]) cellCount[maxweight]++; - for(Int_t kcl = 0; kcl <= ig; kcl++) - { - x2 = xc[kcl]; - y2 = yc[kcl]; - rr = Distance(x1,y1,x2,y2); - t2 = tc[kcl]; - // For calculating weighted mean: - // Weighted_mean = (\sum w_i x_i) / (\sum w_i) - - if(sumweight>0.) - { - totaladc[kcl] = totaladc[kcl] + z1*(weight[kcl]/sumweight); - ncell[kcl] = ncell[kcl] + (weight[kcl]/sumweight); - ax[kcl] = ax[kcl] + (x1 * z1 *weight[kcl]/sumweight); - ay[kcl] = ay[kcl] + (y1 * z1 *weight[kcl]/sumweight); - - // For calculating weighted sigma: - // Wieghted_sigma= ((\sum w_i)/((\sum w_i)^2 - \sum (w_i^2))) \sum w_i (x_i - \Hat\mu)^2 - // I assume here x1,y1 are cluster centers, otherwise life becomes too difficult - totaladc2[kcl] = totaladc2[kcl] + pow((z1*(weight[kcl]/sumweight)),2); - ax2[kcl] = ax2[kcl] + (z1 *weight[kcl]/sumweight) * pow((x1-x2),2); - ay2[kcl] = ay2[kcl] + (z1 *weight[kcl]/sumweight) * pow((y1-y2),2); - } - } + x2 = xc[maxweight]; + y2 = yc[maxweight]; + totaladc[maxweight] += z1; + ax[maxweight] += x1 * z1; + ay[maxweight] += y1 * z1; + totaladc2[maxweight] += pow(z1,2); + ax2[maxweight] += z1 * pow((x1-x2),2); + ay2[maxweight] += z1 * pow((y1-y2),2); + ncell[maxweight]++; + } } @@ -922,7 +927,7 @@ Double_t AliPMDClusteringV1::Distance(Double_t x1, Double_t y1, return TMath::Sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)); } // ------------------------------------------------------------------------ // -void AliPMDClusteringV1::CalculateIsoCell(Int_t idet, Int_t ismn, Double_t celladc[][96], TObjArray *pmdisocell) +void AliPMDClusteringV1::FindIsoCell(Int_t idet, Int_t ismn, Double_t celladc[][96], TObjArray *pmdisocell) { // Does isolated cell search for offline calibration diff --git a/PMD/AliPMDClusteringV1.h b/PMD/AliPMDClusteringV1.h index 165a3d797ba..01b3d981403 100644 --- a/PMD/AliPMDClusteringV1.h +++ b/PMD/AliPMDClusteringV1.h @@ -39,8 +39,8 @@ class AliPMDClusteringV1: public AliPMDClustering void RefClust(Int_t incr, Double_t edepcell[]); Double_t Distance(Double_t x1, Double_t y1, Double_t x2, Double_t y2); - void CalculateIsoCell(Int_t idet, Int_t ism, - Double_t celladc[][96], TObjArray *pmdisocell); + void FindIsoCell(Int_t idet, Int_t ism, + Double_t celladc[][96], TObjArray *pmdisocell); void SetEdepCut(Float_t decut); protected: @@ -64,6 +64,6 @@ class AliPMDClusteringV1: public AliPMDClustering Float_t fCutoff; // Energy(ADC) cutoff per cell before clustering - ClassDef(AliPMDClusteringV1,6) // Does clustering for PMD + ClassDef(AliPMDClusteringV1,7) // Does clustering for PMD }; #endif diff --git a/PMD/AliPMDClusteringV2.cxx b/PMD/AliPMDClusteringV2.cxx index dbbb09cc9a5..dd199783f8a 100644 --- a/PMD/AliPMDClusteringV2.cxx +++ b/PMD/AliPMDClusteringV2.cxx @@ -117,7 +117,7 @@ void AliPMDClusteringV2::DoClust(Int_t idet, Int_t ismn, // call the isolated cell search method - CalculateIsoCell(idet, ismn, celladc, pmdisocell); + FindIsoCell(idet, ismn, celladc, pmdisocell); @@ -1069,7 +1069,7 @@ Double_t AliPMDClusteringV2::Distance(Double_t x1, Double_t y1, return TMath::Sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)); } // ------------------------------------------------------------------------ // -void AliPMDClusteringV2::CalculateIsoCell(Int_t idet, Int_t ismn, Double_t celladc[][96], TObjArray *pmdisocell) +void AliPMDClusteringV2::FindIsoCell(Int_t idet, Int_t ismn, Double_t celladc[][96], TObjArray *pmdisocell) { // Does isolated cell search for offline calibration diff --git a/PMD/AliPMDClusteringV2.h b/PMD/AliPMDClusteringV2.h index 339e358ada5..4cce1fbcaf6 100644 --- a/PMD/AliPMDClusteringV2.h +++ b/PMD/AliPMDClusteringV2.h @@ -41,7 +41,7 @@ class AliPMDClusteringV2 : public AliPMDClustering Double_t rcl[], Double_t rcs[], Double_t cells[], TArrayI &testncl, TArrayI &testindex); Double_t Distance(Double_t x1, Double_t y1, Double_t x2, Double_t y2); - void CalculateIsoCell(Int_t idet, Int_t ismn, Double_t celladc[][96], TObjArray *pmdisocell); + void FindIsoCell(Int_t idet, Int_t ismn, Double_t celladc[][96], TObjArray *pmdisocell); void SetEdepCut(Float_t decut); protected: @@ -62,7 +62,7 @@ class AliPMDClusteringV2 : public AliPMDClustering Float_t fCutoff; // Energy(ADC) cutoff per cell before clustering - ClassDef(AliPMDClusteringV2,5) // Does clustering for PMD + ClassDef(AliPMDClusteringV2,6) // Does clustering for PMD }; #endif diff --git a/PMD/AliPMDrechit.cxx b/PMD/AliPMDrechit.cxx index 09f2b782d48..3440748553c 100644 --- a/PMD/AliPMDrechit.cxx +++ b/PMD/AliPMDrechit.cxx @@ -79,7 +79,7 @@ AliPMDrechit& AliPMDrechit::operator=(const AliPMDrechit& source) fYcell = source.fYcell; fTrcell = source.fTrcell; fPidcell = source.fPidcell; - fAdccell = source.fPidcell; + fAdccell = source.fAdccell; } return *this; } diff --git a/PMD/AliPMDtracker.cxx b/PMD/AliPMDtracker.cxx index a923a37cd31..92eff59467a 100644 --- a/PMD/AliPMDtracker.cxx +++ b/PMD/AliPMDtracker.cxx @@ -170,7 +170,8 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event) return; } branch1->SetAddress(&fRechits); - + + Int_t ncrhit = 0; Int_t nmodules = (Int_t) branch->GetEntries(); AliDebug(1,Form("Number of modules filled in treeR = %d",nmodules)); @@ -181,8 +182,6 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event) AliDebug(2,Form("Number of clusters per modules filled in treeR = %d" ,nentries)); - Int_t ncrhit = 0; - for(Int_t ient = 0; ient < nentries+1; ient++) { fPMDrecpoint = (AliPMDrecpoint1*)fRecpoints->UncheckedAt(ient); @@ -195,7 +194,7 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event) clusdata[4] = fPMDrecpoint->GetClusSigmaX(); clusdata[5] = fPMDrecpoint->GetClusSigmaY(); - if (clusdata[4] != -99. && clusdata[5] != -99.) + if (clusdata[4] < -90. && clusdata[5] < -90.) { // extract the associated cell information branch1->GetEntry(ncrhit);