]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONClusterFinderPeakFit.cxx
Updated list of classes
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterFinderPeakFit.cxx
index b5a76e14505df645b6207a621e35a20ca04a3f76..24a488104ee84aa1c7ec89a8e96fad1abdd0e0c3 100644 (file)
@@ -38,6 +38,7 @@
 #include "AliMpDEManager.h"
 #include "AliMpPad.h"
 #include "AliMpVSegmentation.h"
+#include "AliMpEncodePair.h"
 
 #include "AliLog.h"
 #include "AliRunLoader.h"
@@ -173,7 +174,7 @@ AliMUONClusterFinderPeakFit::Prepare(Int_t detElemId, TClonesArray* pads[2],
                                     const AliMpArea& area, const AliMpVSegmentation* seg[2])
 {
   /// Prepare for clustering
-//  AliCodeTimerAuto("")
+//  AliCodeTimerAuto("",0)
   
   for ( Int_t i = 0; i < 2; ++i )
   {
@@ -226,7 +227,7 @@ AliMUONCluster*
 AliMUONClusterFinderPeakFit::NextCluster()
 {
   /// Return next cluster
-//  AliCodeTimerAuto("")
+//  AliCodeTimerAuto("",0)
   
   // if the list of clusters is not void, pick one from there
   TObject* o = fClusterList.At(++fClusterNumber);
@@ -239,6 +240,9 @@ AliMUONClusterFinderPeakFit::NextCluster()
   // if the cluster list is exhausted, we need to go to the next
   // pre-cluster and treat it
 
+  fClusterList.Delete(); // reset the list of clusters for this pre-cluster
+  fClusterNumber = -1; 
+    
   fPreCluster = fPreClusterFinder->NextCluster();
   
   if (!fPreCluster)
@@ -247,9 +251,6 @@ AliMUONClusterFinderPeakFit::NextCluster()
     return 0x0;
   }
     
-  fClusterList.Delete(); // reset the list of clusters for this pre-cluster
-  fClusterNumber = -1; 
-  
   WorkOnPreCluster();
 
   // WorkOnPreCluster may have used only part of the pads, so we check that
@@ -275,7 +276,7 @@ AliMUONClusterFinderPeakFit::WorkOnPreCluster()
   /// Starting from a precluster, builds a pixel array, and then
   /// extract clusters from this array
   
-  //  AliCodeTimerAuto("")     
+  //  AliCodeTimerAuto("",0)   
 
   if (fDebug) {
     cout << " *** Event # " << fEventNumber
@@ -345,7 +346,7 @@ AliMUONClusterFinderPeakFit::CheckPrecluster(const AliMUONCluster& origCluster)
   /// Check precluster in order to attempt to simplify it (mostly for
   /// two-cathode preclusters)
     
-  //  AliCodeTimerAuto("")
+  //  AliCodeTimerAuto("",0)
 
   // Disregard small clusters (leftovers from splitting or noise)
   if ((origCluster.Multiplicity()==1 || origCluster.Multiplicity()==2) &&
@@ -415,7 +416,8 @@ AliMUONClusterFinderPeakFit::CheckPreclusterTwoCathodes(AliMUONCluster* cluster)
       Int_t cath = pad->Cathode();
       Int_t cath1 = TMath::Even(cath);
       // Check for edge effect (missing pads on the _other_ cathode)
-      AliMpPad mpPad = fkSegmentation[cath1]->PadByPosition(pad->Position(),kFALSE);
+      AliMpPad mpPad 
+        = fkSegmentation[cath1]->PadByPosition(pad->Position().X(),pad->Position().Y(),kFALSE);
       if (!mpPad.IsValid()) continue;
       //if (nFlags == 1 && pad->Charge() < fgkZeroSuppression * 3) continue;
       if (nFlags == 1 && pad->Charge() < 20) continue;
@@ -643,19 +645,21 @@ void AliMUONClusterFinderPeakFit::BuildPixArrayOneCathode(AliMUONCluster& cluste
   if (cluster.Multiplicity(0) == 0) cath0 = 1;
   else if (cluster.Multiplicity(1) == 0) cath1 = 0;
 
-  TVector2 leftDown = cluster.Area(cath0).LeftDownCorner();
-  TVector2 rightUp = cluster.Area(cath0).RightUpCorner();
-  min[0] = leftDown.X();
-  min[1] = leftDown.Y();
-  max[0] = rightUp.X();
-  max[1] = rightUp.Y();
+  Double_t leftDownX, leftDownY;
+  cluster.Area(cath0).LeftDownCorner(leftDownX, leftDownY);
+  Double_t rightUpX, rightUpY; 
+  cluster.Area(cath0).RightUpCorner(rightUpX, rightUpY);
+  min[0] = leftDownX;
+  min[1] = leftDownY;
+  max[0] = rightUpX;
+  max[1] = rightUpY;
   if (cath1 != cath0) {
-    leftDown = cluster.Area(cath1).LeftDownCorner();
-    rightUp = cluster.Area(cath1).RightUpCorner();
-    min[0] = TMath::Max (min[0], leftDown.X());
-    min[1] = TMath::Max (min[1], leftDown.Y());
-    max[0] = TMath::Min (max[0], rightUp.X());
-    max[1] = TMath::Min (max[1], rightUp.Y());
+    cluster.Area(cath1).LeftDownCorner(leftDownX, leftDownY);
+    cluster.Area(cath1).RightUpCorner(rightUpX, rightUpY);
+    min[0] = TMath::Max (min[0], leftDownX);
+    min[1] = TMath::Max (min[1], leftDownY);
+    max[0] = TMath::Min (max[0], rightUpX);
+    max[1] = TMath::Min (max[1], rightUpY);
   }
 
   // Adjust limits
@@ -1025,8 +1029,8 @@ void AliMUONClusterFinderPeakFit::FindClusterCOG(AliMUONCluster& cluster,
   Double_t yc = fHistAnode->GetYaxis()->GetBinCenter(ic);
   Double_t xc = fHistAnode->GetXaxis()->GetBinCenter(jc);
   Double_t cont = fHistAnode->GetCellContent(jc,ic);
-  AliMUONPad* pixPtr = new AliMUONPad (xc, yc, wx, wy, cont);
-  if (fDebug) pixPtr->Print("full"); 
+  AliMUONPad pixel(xc, yc, wx, wy, cont);
+  if (fDebug) pixel.Print("full"); 
 
   Int_t npad = cluster.Multiplicity();
   
@@ -1036,7 +1040,7 @@ void AliMUONClusterFinderPeakFit::FindClusterCOG(AliMUONCluster& cluster,
   for (Int_t j = 0; j < npad; ++j) 
   {
     AliMUONPad* pad = cluster.Pad(j);
-    if ( Overlap(*pad,*pixPtr) )
+    if ( Overlap(*pad,pixel) )
     {
       if (fDebug) { cout << j << " "; pad->Print("full"); }
       if (pad->Charge() > qMax[pad->Cathode()]) {
@@ -1149,10 +1153,10 @@ void AliMUONClusterFinderPeakFit::PadsInXandY(AliMUONCluster& cluster,
        
   Bool_t mustMatch(kTRUE);
 
-  AliMpIntPair cn = cluster.NofPads(statusToTest,mustMatch);
+  Long_t cn = cluster.NofPads(statusToTest,mustMatch);
   
-  nInX = cn.GetFirst();
-  nInY = cn.GetSecond();
+  nInX = AliMp::PairFirst(cn);
+  nInY = AliMp::PairSecond(cn);
 }
 
 //_____________________________________________________________________________