]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONClusterFinderCOG.cxx
Be sure to load mapping when needed
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterFinderCOG.cxx
index 539693cfb29da3b2a2a477c6cf71350d56207e32..7bd0b8a56b98ba9e3c2f8d3121abe0bd15d6b2ca 100644 (file)
@@ -25,6 +25,7 @@
 #include "TVector2.h"
 #include "AliMUONVDigitStore.h"
 
+//-----------------------------------------------------------------------------
 /// \class AliMUONClusterFinderCOG
 ///
 /// A very basic (and mostly useless, probably) cluster finder.
@@ -37,6 +38,7 @@
 /// direction with the better resolution.
 ///
 /// \author Laurent Aphecetche
+//-----------------------------------------------------------------------------
 
 /// \cond CLASSIMP
 ClassImp(AliMUONClusterFinderCOG)
@@ -59,31 +61,13 @@ AliMUONClusterFinderCOG::~AliMUONClusterFinderCOG()
 
 //_____________________________________________________________________________
 Bool_t 
-AliMUONClusterFinderCOG::Prepare(const AliMpVSegmentation* segmentations[2],
-                                 const AliMUONVDigitStore& digitStore)
+AliMUONClusterFinderCOG::Prepare(Int_t detElemId,
+                                 TObjArray* pads[2],
+                                 const AliMpArea& area)
 {
   /// Prepare for clustering
   
-  // Find out the DetElemId
-  Int_t detElemId(-1);
-  
-  TIter next(digitStore.CreateIterator());
-  AliMUONVDigit* d;
-
-  d = static_cast<AliMUONVDigit*>(next());
-
-  if (d)
-  {
-    detElemId = d->DetElemId();
-  }
-  
-  if ( detElemId < 0 )
-  {
-    AliWarning("Could not find DE. Probably no digits at all ?");
-    return kFALSE;
-  }
-  
-  return fPreClusterFinder->Prepare(segmentations,digitStore);
+  return fPreClusterFinder->Prepare(detElemId,pads,area);
 }
 
 //_____________________________________________________________________________
@@ -98,7 +82,7 @@ AliMUONClusterFinderCOG::NextCluster()
   {
     ComputePosition(*cluster);
 
-    if ( cluster->Charge() < 7 )
+    if ( cluster->Charge() < 1.0675 ) // JC: adc -> fc
     {
       // skip that one
       return NextCluster();
@@ -130,7 +114,7 @@ AliMUONClusterFinderCOG::ComputePosition(AliMUONCluster& cluster)
     {
       AliMUONPad* pad = cluster.Pad(i);
       TVector2 padPosition = pad->Position();
-      AliMpArea area(pad->Position(),pad->Dimensions());
+      AliMpArea area(pad->X(), pad->Y(), pad->DX(), pad->DY());
       xmin = TMath::Min(area.LeftBorder(),xmin);
       xmax = TMath::Max(area.RightBorder(),xmax);
       ymin = TMath::Min(area.DownBorder(),ymin);