]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
WriteRawCluster fixed
authorkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 29 Oct 2003 14:58:03 +0000 (14:58 +0000)
committerkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 29 Oct 2003 14:58:03 +0000 (14:58 +0000)
RICH/AliRICHClusterFinder.cxx
RICH/AliRICHClusterFinder.h

index d0f0fdacbdee49d4111a0176c485786f300cbb86..0bdfa1db3702eeb1e14a02816588be0e4f83633d 100644 (file)
@@ -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;iDig1<pRawCluster->Size();iDig1++) {
+  for(Int_t iDig1=0;iDig1<rawCluster.Size();iDig1++) {
     Int_t iNotMax = 0;
-    AliRICHdigit *pDig1 = (AliRICHdigit *)pRawCluster->Digits()->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;iDig2<pRawCluster->Size();iDig2++) {
-      AliRICHdigit *pDig2 = (AliRICHdigit *)pRawCluster->Digits()->At(iDig2);
+    for(Int_t iDig2=0;iDig2<rawCluster.Size();iDig2++) {
+      AliRICHdigit *pDig2 = (AliRICHdigit *)rawCluster.Digits()->At(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;iDig<nDigits;iDig++){    
     AliRICHdigit *dig=(AliRICHdigit*)Rich()->Digits(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;iNeighbour<Rich()->Param()->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()
 //__________________________________________________________________________________________________
index 487efcb3b0b0393d05427b1dbf3d19ba439dc489..0986146fa786f54937c81365eecdbe57e4ddf722 100644 (file)
@@ -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