From: bnandi Date: Wed, 8 Oct 2003 10:21:49 +0000 (+0000) Subject: changes according to NewGeometry X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=ed228cbc01694f82165cfafd0252c6aecd2e32fc changes according to NewGeometry --- diff --git a/PMD/AliPMDClusterFinder.cxx b/PMD/AliPMDClusterFinder.cxx index 48dadf1d06e..8ff353fd886 100644 --- a/PMD/AliPMDClusterFinder.cxx +++ b/PMD/AliPMDClusterFinder.cxx @@ -1,3 +1,18 @@ +/*************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + //-----------------------------------------------------// // // // Date : August 05 2003 // @@ -38,20 +53,11 @@ ClassImp(AliPMDClusterFinder) // AliPMDClusterFinder::AliPMDClusterFinder() { - if (!fRecpoints) fRecpoints = new TClonesArray("AliPMDrecpoint", 1000); + if (!fRecpoints) fRecpoints = new TClonesArray("AliPMDrecpoint1", 1000); fNpoint = 0; - for (Int_t i = 0; i < fTotSM; i++) - { - for (Int_t j = 0; j < fNCell; j++) - { - for (Int_t k = 0; k < fNCell; k++) - { - fCPV[i][j][k] = 0.; - fPMD[i][j][k] = 0.; - } - } - } + fDebug = 0; + fEcut = 0.; } AliPMDClusterFinder::~AliPMDClusterFinder() @@ -106,15 +112,19 @@ void AliPMDClusterFinder::OpengAliceFile(Char_t *file, Option_t *option) void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt) { - Int_t det,smn; + Int_t det = 0,smn = 0; Int_t cellno; Int_t xpos,ypos; Float_t adc; - Int_t isup, ix, iy; + Int_t isup; Int_t idet; - Double_t d[72][72]; Float_t clusdata[7]; - Int_t fMessage = 1; + + TObjArray *pmdcont = new TObjArray(); + AliPMDcluster *pmdcl = new AliPMDcluster; + AliPMDClustering *pmdclust = new AliPMDClustering(); + pmdclust->SetDebug(fDebug); + pmdclust->SetEdepCut(fEcut); fRunLoader->GetEvent(ievt); //cout << " ***** Beginning::Digits2RecPoints *****" << endl; @@ -142,6 +152,7 @@ void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt) for (Int_t imodule = 0; imodule < nmodules; imodule++) { + ResetCellADC(); treeD->GetEntry(imodule); Int_t nentries = fDigits->GetLast(); for (Int_t ient = 0; ient < nentries+1; ient++) @@ -152,77 +163,41 @@ void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt) smn = pmddigit->GetSMNumber(); cellno = pmddigit->GetCellNumber(); adc = pmddigit->GetADC(); + //Int_t trno = pmddigit->GetTrackNumber(); - ypos = cellno/fNCell; - xpos = cellno - ypos*fNCell; - - if (det == 0) - { - fPMD[smn][xpos][ypos] = adc; - } - else if(det == 1) - { - fCPV[smn][xpos][ypos] = adc; - } + xpos = cellno/fCol; + ypos = cellno - xpos*fCol; + fCellADC[xpos][ypos] = (Double_t) adc; } - } // modules - - // - // Clustering started - // - - TObjArray *pmdcont = new TObjArray(); - - AliPMDcluster *pmdcl = new AliPMDcluster; - AliPMDClustering *pmdclust = new AliPMDClustering(); - pmdclust->SetMessage(fMessage); - - for (idet = 0; idet < 2; idet++) - { - for (isup = 0; isup < fTotSM; isup++) + idet = det; + isup = smn; + pmdclust->DoClust(fCellADC,pmdcont); + + Int_t nentries1 = pmdcont->GetEntries(); + cout << " nentries1 = " << nentries1 << endl; + for (Int_t ient1 = 0; ient1 < nentries1; ient1++) { - for (ix = 0; ix < fNCell; ix++) - { - for (iy = 0; iy < fNCell; iy++) - { - if (idet == 0) - { - d[ix][iy] = (Double_t) fPMD[isup][ix][iy]; - } - else if (idet == 1) - { - d[ix][iy] = (Double_t) fCPV[isup][ix][iy]; - } - - } - } - pmdclust->DoClust(idet,isup,d,pmdcont); - - Int_t nentries = pmdcont->GetEntries(); - cout << " nentries = " << nentries << endl; - for (Int_t ient = 0; ient < nentries; ient++) - { - clusdata[0] = (Float_t) idet; - clusdata[1] = (Float_t) isup; - - pmdcl = (AliPMDcluster*)pmdcont->UncheckedAt(ient); + clusdata[0] = (Float_t) idet; + clusdata[1] = (Float_t) isup; - clusdata[2] = pmdcl->GetClusX(); - clusdata[3] = pmdcl->GetClusY(); - clusdata[4] = pmdcl->GetClusADC(); - clusdata[5] = pmdcl->GetClusCells(); - clusdata[6] = pmdcl->GetClusRadius(); + pmdcl = (AliPMDcluster*)pmdcont->UncheckedAt(ient1); - AddRecPoint(clusdata); - } - pmdcont->Clear(); + clusdata[2] = pmdcl->GetClusX(); + clusdata[3] = pmdcl->GetClusY(); + clusdata[4] = pmdcl->GetClusADC(); + clusdata[5] = pmdcl->GetClusCells(); + clusdata[6] = pmdcl->GetClusRadius(); - treeR->Fill(); - ResetRecpoint(); - } // SuperModule - } // Detector - + AddRecPoint(clusdata); + } + pmdcont->Clear(); + + treeR->Fill(); + ResetRecpoint(); + + } // modules + ResetCellADC(); pmdloader->WriteRecPoints("OVERWRITE"); @@ -234,26 +209,30 @@ void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt) // cout << " ***** End::Digits2RecPoints *****" << endl; } +void AliPMDClusterFinder::SetCellEdepCut(Float_t ecut) +{ + fEcut = ecut; +} +void AliPMDClusterFinder::SetDebug(Int_t idebug) +{ + fDebug = idebug; +} void AliPMDClusterFinder::AddRecPoint(Float_t *clusdata) { TClonesArray &lrecpoints = *fRecpoints; - AliPMDrecpoint *newrecpoint; - newrecpoint = new AliPMDrecpoint(clusdata); - new(lrecpoints[fNpoint++]) AliPMDrecpoint(newrecpoint); + AliPMDrecpoint1 *newrecpoint; + newrecpoint = new AliPMDrecpoint1(clusdata); + new(lrecpoints[fNpoint++]) AliPMDrecpoint1(newrecpoint); delete newrecpoint; } void AliPMDClusterFinder::ResetCellADC() { - for (Int_t i = 0; i < fTotSM; i++) + for(Int_t irow = 0; irow < fRow; irow++) { - for (Int_t j = 0; j < fNCell; j++) + for(Int_t icol = 0; icol < fCol; icol++) { - for (Int_t k = 0; k < fNCell; k++) - { - fCPV[i][j][k] = 0.; - fPMD[i][j][k] = 0.; - } + fCellADC[irow][icol] = 0.; } } } diff --git a/PMD/AliPMDClusterFinder.h b/PMD/AliPMDClusterFinder.h index c865d5099c3..e8a6694369c 100644 --- a/PMD/AliPMDClusterFinder.h +++ b/PMD/AliPMDClusterFinder.h @@ -1,5 +1,7 @@ #ifndef PMDClusterFinder_H #define PMDClusterFinder_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ //-----------------------------------------------------// // // // Date : August 05 2003 // @@ -31,9 +33,7 @@ class AliHeader; class AliPMDdigit; class AliPMDClustering; class AliPMDcluster; -class AliPMDrecpoint; - -//using namespace std; +class AliPMDrecpoint1; class AliPMDClusterFinder { @@ -52,11 +52,12 @@ class AliPMDClusterFinder Int_t fNpoint; Int_t fDetNo; + Int_t fDebug; + Float_t fEcut; - static const Int_t fTotSM = 27; - static const Int_t fNCell = 72; - Float_t fCPV[fTotSM][fNCell][fNCell]; - Float_t fPMD[fTotSM][fNCell][fNCell]; + static const Int_t fRow = 48; + static const Int_t fCol = 96; + Double_t fCellADC[fRow][fCol]; public: @@ -66,12 +67,14 @@ class AliPMDClusterFinder void OpengAliceFile(char * /* galice.root */, Option_t * /* option */); void Digits2RecPoints(Int_t /* ievt */); + void SetCellEdepCut(Float_t /* ecut */); + void SetDebug(Int_t /* idebug */); void AddRecPoint(Float_t * /* clusdata */); void ResetCellADC(); void ResetRecpoint(); void UnLoad(Option_t * /* option */); - ClassDef(AliPMDClusterFinder,1) + ClassDef(AliPMDClusterFinder,2) }; #endif diff --git a/PMD/AliPMDClustering.cxx b/PMD/AliPMDClustering.cxx index d3b6d644e2b..d7a9d146b73 100644 --- a/PMD/AliPMDClustering.cxx +++ b/PMD/AliPMDClustering.cxx @@ -1,3 +1,18 @@ +/*************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + //-----------------------------------------------------// // // // Source File : PMDClustering.cxx, Version 00 // @@ -44,7 +59,8 @@ const double AliPMDClustering::sqrth=0.8660254; // sqrth = sqrt(3.)/2. AliPMDClustering::AliPMDClustering() { - fMessage = 0; + fDebug = 0; + fCutoff = 0; for(int i = 0; i < ndimx; i++) { for(int j = 0; j < ndimy; j++) @@ -59,7 +75,7 @@ AliPMDClustering::~AliPMDClustering() } -void AliPMDClustering::DoClust(int idet, int isup, double d1[72][72], TObjArray *pmdcont) +void AliPMDClustering::DoClust(double celladc[48][96], TObjArray *pmdcont) { AliPMDcluster *pmdcl = 0; @@ -70,23 +86,20 @@ void AliPMDClustering::DoClust(int idet, int isup, double d1[72][72], TObjArray const float twobysqrt3 = 1.1547; // 2./sqrt(3.) - // if (fMessage == 1) - { - cout << " supermodule no. " << idet << " " << isup << endl; - } for (i = 0; i < ndimx; i++) { for (j = 0; j < ndimy; j++) { - d[i][j] = d1[i][j]; + d[i][j] = celladc[i][j]; } } - order(idet); // order the data - cutoff=400.; // cutoff used to discard cells having ener. dep. + order(); // order the data + // cutoff=400.; // cutoff used to discard cells having ener. dep. + cutoff = fCutoff; // cutoff used to discard cells having ener. dep. ave=0.; nmx1=-1; - + for(j=0;j= cutoff ) nmx1 = nmx1 + 1; } // nmx1 --- number of cells having ener dep >= cutoff - if (fMessage == 1) + if (fDebug == 1) { cout << " nmx1 " << nmx1 << endl; } ave=ave/nmx1; - if (fMessage == 1) + if (fDebug == 1) { cout <<"nmx " << nmx << " nmx1 " << nmx1<< " ave "<Add(pmdcl); } - delete pmdcl; - } -void AliPMDClustering::order(int /*idet*/) +void AliPMDClustering::order() { // using simple sort double dd[nmx], adum;// matrix d converted into @@ -175,14 +182,131 @@ void AliPMDClustering::order(int /*idet*/) } // store the sorted information in iord for later use for(i=0; i= 0 && jd1 < 72) && (jd2 >= 0 && jd2 < 72) && + if( (jd1 >= 0 && jd1 < ndimx) && (jd2 >= 0 && jd2 < ndimy) && + infocl[0][jd1][jd2] == 0){ + numcell=numcell+1; + infocl[0][jd1][jd2]=2; + infocl[1][jd1][jd2]=icl; + clust[0][numcell]=jd1; + clust[1][numcell]=jd2; + cellcount=cellcount+1; + infcl[0][cellcount]=icl; + infcl[1][cellcount]=jd1; + infcl[2][cellcount]=jd2; + } + } + // --------------------------------------------------------------- + // check adc count for neighbour's neighbours recursively and + // if nonzero, add these to the cluster. + // --------------------------------------------------------------- + for(i=1;i < 5000;i++){ + if(clust[0][i] != 0){ + id1=clust[0][i]; + id2=clust[1][i]; + for(j=0; j<6 ; j++){ + jd1=id1+neibx[j]; + jd2=id2+neiby[j]; + //if( (jd1 >= 0 && jd1 < 72) && (jd2 >= 0 && jd2 < 72) && + if( (jd1 >= 0 && jd1 < ndimx) && (jd2 >= 0 && jd2 < ndimy) && + infocl[0][jd1][jd2] == 0 ){ + infocl[0][jd1][jd2]=2; + infocl[1][jd1][jd2]=icl; + numcell=numcell+1; + clust[0][numcell]=jd1; + clust[1][numcell]=jd2; + cellcount=cellcount+1; + infcl[0][cellcount]=icl; + infcl[1][cellcount]=jd1; + infcl[2][cellcount]=jd2; + } + } + } + } + } + } + // for(icell=0; icell<=cellcount; icell++){ + // ofl0 << infcl[0][icell] << " " << infcl[1][icell] << " " << + // infcl[2][icell] << endl; + // } + return cellcount; +} + +void AliPMDClustering::refclust(int incr) { int i, j, k, i1, i2, id, icl, ncl[4500], iord[4500], itest; int ihld; @@ -204,7 +328,7 @@ void AliPMDClustering::refclust(int incr, int /*supmod*/, int /*idet*/) if(infcl[0][i] != nsupcl){ nsupcl=nsupcl+1; } ncl[nsupcl]=ncl[nsupcl]+1; } - if (fMessage == 1) + if (fDebug == 1) { cout << " # of cells " <= 0 && jd1 < 72) && (jd2 >= 0 && jd2 < 72) && - infocl[0][jd1][jd2] == 0){ - numcell=numcell+1; - infocl[0][jd1][jd2]=2; - infocl[1][jd1][jd2]=icl; - clust[0][numcell]=jd1; - clust[1][numcell]=jd2; - cellcount=cellcount+1; - infcl[0][cellcount]=icl; - infcl[1][cellcount]=jd1; - infcl[2][cellcount]=jd2; - } - } - // --------------------------------------------------------------- - // check adc count for neighbour's neighbours recursively and - // if nonzero, add these to the cluster. - // --------------------------------------------------------------- - for(i=1;i < 5000;i++){ - if(clust[0][i] != 0){ - id1=clust[0][i]; - id2=clust[1][i]; - for(j=0; j<6 ; j++){ - jd1=id1+neibx[j]; - jd2=id2+neiby[j]; - if( (jd1 >= 0 && jd1 < 72) && (jd2 >= 0 && jd2 < 72) && - infocl[0][jd1][jd2] == 0 ){ - infocl[0][jd1][jd2]=2; - infocl[1][jd1][jd2]=icl; - numcell=numcell+1; - clust[0][numcell]=jd1; - clust[1][numcell]=jd2; - cellcount=cellcount+1; - infcl[0][cellcount]=icl; - infcl[1][cellcount]=jd1; - infcl[2][cellcount]=jd2; - } - } - } - } - } - } - // for(icell=0; icell<=cellcount; icell++){ - // ofl0 << infcl[0][icell] << " " << infcl[1][icell] << " " << - // infcl[2][icell] << endl; - // } - return cellcount; -} - double AliPMDClustering::ranmar() { /* C==========================C*/ @@ -678,7 +702,11 @@ double AliPMDClustering::ranmar() } -void AliPMDClustering::SetMessage(Int_t imessage) +void AliPMDClustering::SetEdepCut(Float_t decut) +{ + fCutoff = decut; +} +void AliPMDClustering::SetDebug(Int_t idebug) { - fMessage = imessage; + fDebug = idebug; } diff --git a/PMD/AliPMDClustering.h b/PMD/AliPMDClustering.h index 58901023fb2..377cf0134e7 100644 --- a/PMD/AliPMDClustering.h +++ b/PMD/AliPMDClustering.h @@ -1,5 +1,8 @@ #ifndef PMDClustering_H #define PMDClustering_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + //-----------------------------------------------------// // // // Header File : PMDClustering.h, Version 00 // @@ -47,9 +50,9 @@ class AliPMDClustering static const double pi; static const double sqrth; // sqrth = sqrt(3.)/2. enum { - nmx=5184, - ndimx=72, - ndimy=72 + nmx=4608, + ndimx=48, + ndimy=96 }; /* @@ -89,22 +92,27 @@ class AliPMDClustering coord --- x and y coordinates of center of each cell */ - Int_t fMessage; + Int_t fDebug; + Float_t fCutoff; public: AliPMDClustering(); virtual ~AliPMDClustering(); - void DoClust(int, int, double [][72], TObjArray *); - int crclust(double, double, int, int); - void refclust(int, int, int); + void DoClust(double /*celladc*/[][96], TObjArray * /* pmdcont */); + void order(); + + int crclust(double /* ave */, double /* cutoff */ , int /* nmx1 */); + void refclust(int /* incr */); + void gaussfit(int /*ncell*/, int /*nclust*/, double &/*x*/, + double &/*y*/, double &/*z*/, double &/*xc*/, + double &/*yc*/, double &/*zc*/, double &/*rc*/); + double Dist(double /* x1 */, double /* y1 */ , + double /* x2 */, double /* y2 */); double ranmar(); - void order(int); - double Dist(double, double, double, double); - void gaussfit(int, int, double &, double &, double &, double &, double &, - double &, double &); - void SetMessage(Int_t); + void SetEdepCut(Float_t /* decut */); + void SetDebug(Int_t /* idebug */); - ClassDef(AliPMDClustering,1) + ClassDef(AliPMDClustering,2) }; #endif