From: kir Date: Wed, 29 Oct 2003 14:58:03 +0000 (+0000) Subject: WriteRawCluster fixed X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=eaf390d938ee25f8b5374600179ac9910cd47320;p=u%2Fmrichter%2FAliRoot.git WriteRawCluster fixed --- diff --git a/RICH/AliRICHClusterFinder.cxx b/RICH/AliRICHClusterFinder.cxx index d0f0fdacbde..0bdfa1db370 100644 --- a/RICH/AliRICHClusterFinder.cxx +++ b/RICH/AliRICHClusterFinder.cxx @@ -34,19 +34,19 @@ AliRICHClusterFinder::AliRICHClusterFinder(AliRICH *pRICH) }//main ctor //__________________________________________________________________________________________________ -void AliRICHClusterFinder::FindLocalMaxima(AliRICHcluster *pRawCluster) +void AliRICHClusterFinder::FindLocalMaxima(AliRICHcluster &rawCluster) {// Split the cluster according to the number of maxima inside Info("SplitbyLocalMaxima","Start."); Int_t Nlocal = 0; Int_t localX[100],localY[100]; - for(Int_t iDig1=0;iDig1Size();iDig1++) { + for(Int_t iDig1=0;iDig1Digits()->At(iDig1); + AliRICHdigit *pDig1 = (AliRICHdigit *)rawCluster.Digits()->At(iDig1); Int_t padX1 = pDig1->X(); Int_t padY1 = pDig1->Y(); Double_t padQ1 = pDig1->Q(); - for(Int_t iDig2=0;iDig2Size();iDig2++) { - AliRICHdigit *pDig2 = (AliRICHdigit *)pRawCluster->Digits()->At(iDig2); + for(Int_t iDig2=0;iDig2At(iDig2); Int_t padX2 = pDig2->X(); Int_t padY2 = pDig2->Y(); Double_t padQ2 = pDig2->Q(); @@ -98,24 +98,21 @@ void AliRICHClusterFinder::FindRawClusters(Int_t iChamber) Info("FindRawClusters","Start for Chamber %i with %i digits.",iChamber,nDigits); if(nDigits==0)return; - fHitMap=new AliRICHMap(Rich()->Digits(iChamber)); + fHitMap=new AliRICHMap(Rich()->Digits(iChamber));//create digit map for the given chamber - AliRICHcluster *pRawCluster; - for(Int_t iDig=0;iDigDigits(iChamber)->At(iDig); Int_t i=dig->X(); Int_t j=dig->Y(); if(fHitMap->TestHit(i,j)==kUsed) continue; - pRawCluster = new AliRICHcluster; - FormRawCluster(i,j,pRawCluster); + AliRICHcluster rawCluster; + FormRawCluster(i,j,rawCluster); if(AliRICHParam::IsResolveClusters()) { - ResolveCluster(pRawCluster); // ResolveCluster serialization will happen inside + ResolveCluster(rawCluster); // ResolveCluster serialization will happen inside } else { - WriteRawCluster(pRawCluster); // simply output of the RawCluster found without deconvolution + WriteRawCluster(rawCluster); // simply output of the RawCluster found without deconvolution } - delete pRawCluster; }//digits loop @@ -124,36 +121,34 @@ void AliRICHClusterFinder::FindRawClusters(Int_t iChamber) }//FindRawClusters() //__________________________________________________________________________________________________ -void AliRICHClusterFinder::FormRawCluster(Int_t i, Int_t j, AliRICHcluster *pCluster) +void AliRICHClusterFinder::FormRawCluster(Int_t i, Int_t j, AliRICHcluster &rawCluster) {// Builder of the final Raw Cluster (before deconvolution) Info("FormRawCluster","Start with digit(%i,%i)",i,j); -// Int_t idx = fHitMap->GetHitIndex(i,j); - AliRICHdigit* pDigit = (AliRICHdigit*) fHitMap->GetHit(i,j); - pCluster->AddDigit(pDigit); - + rawCluster.AddDigit((AliRICHdigit*) fHitMap->GetHit(i,j)); fHitMap->FlagHit(i,j);// Flag hit as taken Int_t listX[4], listY[4]; // Now look recursively for all neighbours for (Int_t iNeighbour=0;iNeighbourParam()->PadNeighbours(i,j,listX,listY);iNeighbour++) if(fHitMap->TestHit(listX[iNeighbour],listY[iNeighbour])==kUnused) - FormRawCluster(listX[iNeighbour],listY[iNeighbour],pCluster); + FormRawCluster(listX[iNeighbour],listY[iNeighbour],rawCluster); }//AddDigit2Cluster() //__________________________________________________________________________________________________ -void AliRICHClusterFinder::ResolveCluster(AliRICHcluster *pRawCluster) +void AliRICHClusterFinder::ResolveCluster(AliRICHcluster &rawCluster) {// Decluster algorithm Info("ResolveCluster","Start."); - pRawCluster->SetStatus(kRaw);// just dummy to compile... + rawCluster.SetStatus(kRaw);// just dummy to compile... }//ResolveCluster() //__________________________________________________________________________________________________ -void AliRICHClusterFinder::WriteRawCluster(AliRICHcluster *pRawCluster) +void AliRICHClusterFinder::WriteRawCluster(AliRICHcluster &rawCluster) {// out the current RawCluster - Info("ResolveCluster","Start."); + Info("WriteRawCluster","Start."); - pRawCluster->SetStatus(kRaw); + rawCluster.CoG(); + Rich()->AddCluster(rawCluster); }//WriteRawCluster() //__________________________________________________________________________________________________ diff --git a/RICH/AliRICHClusterFinder.h b/RICH/AliRICHClusterFinder.h index 487efcb3b0b..0986146fa78 100644 --- a/RICH/AliRICHClusterFinder.h +++ b/RICH/AliRICHClusterFinder.h @@ -9,27 +9,24 @@ class AliRICH; class AliHitMap; class AliRICHcluster; + class AliRICHClusterFinder : public TTask { -public: - - AliRICHClusterFinder(AliRICH *pRICH); +public: + AliRICHClusterFinder(AliRICH *pRICH); virtual ~AliRICHClusterFinder() {;} - void Exec(); //Loop on events and chambers - void FindRawClusters(Int_t iChamber); //Find initial clusters - void FindLocalMaxima(AliRICHcluster *pCluster); //Find local maxima in a cluster - void ResolveCluster(AliRICHcluster *pCluster); //Try to resolve a cluster with maxima > 2 - void FormRawCluster(Int_t i, Int_t j, AliRICHcluster *pCluster); //form a raw cluster - void CoG(); //Evaluate the CoG as the best - void WriteRawCluster(AliRICHcluster *pRawCluster); //write in the list of the raw clusters - AliRICH *Rich() {return fRICH;} - - protected: - - AliRICH *fRICH; - AliHitMap *fHitMap; //Hit Map with digit positions - - ClassDef(AliRICHClusterFinder,0) //Class for clustering and reconstruction of space points + AliRICH *Rich() {return fRICH;} //Pointer to RICH + void Exec(); //Loop on events and chambers + void FindRawClusters(Int_t iChamber); //Find raw clusters + void FormRawCluster(Int_t i, Int_t j, AliRICHcluster &cluster); //form a raw cluster + void FindLocalMaxima(AliRICHcluster &cluster); //Find local maxima in a cluster + void ResolveCluster(AliRICHcluster &cluster); //Try to resolve a cluster with maxima > 2 + void CoG(); //Evaluate the CoG as the best + void WriteRawCluster(AliRICHcluster &cluster); //write in the list of the raw clusters +protected: + AliRICH *fRICH; //Pointer to RICH + AliHitMap *fHitMap; //Hit Map with digit positions + ClassDef(AliRICHClusterFinder,0) //Finds raw clusters, trasfers them to resolved clusters through declustering. }; #endif