]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONPreClusterFinderV3.cxx
correct calculation of cluster error for Riemann fit
[u/mrichter/AliRoot.git] / MUON / AliMUONPreClusterFinderV3.cxx
index eead6bc049c3bbae575a899082309e354c0bb884..d95f815c5ee6a40b8e20f83c6f2ca645190dc216 100644 (file)
@@ -80,7 +80,8 @@ namespace
 AliMUONPreClusterFinderV3::AliMUONPreClusterFinderV3()
 : AliMUONVClusterFinder(),
   fClusters(new TClonesArray("AliMUONCluster",10)),
-  fSegmentations(0x0),
+  fkSegmentations(0x0),
+  fPads(0x0),
   fDetElemId(0),
   fIterator(0x0)
 {
@@ -88,7 +89,6 @@ AliMUONPreClusterFinderV3::AliMUONPreClusterFinderV3()
     AliInfo("")
   for ( Int_t i = 0; i < 2; ++i )
   {
-    fPads[i] = new TClonesArray("AliMUONPad",100);
     fPreClusters[i] = new TClonesArray("AliMUONCluster",10);
   } 
 }
@@ -96,12 +96,10 @@ AliMUONPreClusterFinderV3::AliMUONPreClusterFinderV3()
 //_____________________________________________________________________________
 AliMUONPreClusterFinderV3::~AliMUONPreClusterFinderV3()
 {
-  /// dtor : note we're owner of the pads and the clusters, but not of
-  /// the remaining objects (digits, segmentations)
+  /// dtor
   delete fClusters;
   for ( Int_t i = 0; i < 2; ++i )
   {
-    delete fPads[i];
     delete fPreClusters[i];
   } 
 }
@@ -125,53 +123,29 @@ AliMUONPreClusterFinderV3::UsePad(const AliMUONPad& pad)
 
 //_____________________________________________________________________________
 Bool_t
-AliMUONPreClusterFinderV3::Prepare(const AliMpVSegmentation* segmentations[2],
-                                 const AliMUONVDigitStore& digitStore)
+AliMUONPreClusterFinderV3::Prepare(Int_t detElemId,
+                                   TClonesArray* pads[2],
+                                   const AliMpArea& area,
+                                   const AliMpVSegmentation* seg[2])
 {
   /// Prepare for clustering, by giving access to segmentations and digit lists
-  // FIXME : add area on which to look for clusters here.
   
-  fSegmentations = segmentations;
+  if ( area.IsValid() ) 
+  {
+    AliError("Handling of area not yet implemented for this class. Please check.");
+  }
+  
+  fkSegmentations = seg;
+  fPads = pads;
   
   fClusters->Clear("C");
   for ( Int_t i = 0; i < 2; ++i )
   {
-    fPads[i]->Clear("C");
     fPreClusters[i]->Clear("C");
   }
   
-  fDetElemId = -1;
-  
-  TIter next(digitStore.CreateIterator());
-  AliMUONVDigit* d;
+  fDetElemId = detElemId;
   
-  while ( ( d = static_cast<AliMUONVDigit*>(next()) ) )
-  {
-    Int_t ix = d->PadX();
-    Int_t iy = d->PadY();
-    Int_t cathode = d->Cathode();
-    AliMpPad pad = fSegmentations[cathode]->PadByIndices(AliMpIntPair(ix,iy));
-    TClonesArray& padArray = *(fPads[cathode]);
-    if ( fDetElemId == -1 ) 
-    {
-      fDetElemId = d->DetElemId();
-    }
-    else
-    {
-      if ( d->DetElemId() != fDetElemId ) 
-      {
-        AliError("Something is seriously wrong with DE. Aborting clustering");
-        return kFALSE;
-      }
-    }
-    
-    AliMUONPad mpad(fDetElemId,cathode,
-                    ix,iy,pad.Position().X(),pad.Position().Y(),
-                    pad.Dimensions().X(),pad.Dimensions().Y(),
-                    d->Charge());
-    if ( d->IsSaturated() ) mpad.SetSaturated(kTRUE); 
-    new (padArray[padArray.GetLast()+1]) AliMUONPad(mpad);      
-  }
   if ( fPads[0]->GetLast() < 0 && fPads[1]->GetLast() < 0 )
   {
     // no pad at all, nothing to do...