]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changed interface to allow combined tracking (Laurent)
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Nov 2007 17:20:43 +0000 (17:20 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Nov 2007 17:20:43 +0000 (17:20 +0000)
12 files changed:
MUON/AliMUONClusterFinderCOG.cxx
MUON/AliMUONClusterFinderCOG.h
MUON/AliMUONClusterFinderMLEM.cxx
MUON/AliMUONClusterFinderMLEM.h
MUON/AliMUONClusterFinderSimpleFit.cxx
MUON/AliMUONClusterFinderSimpleFit.h
MUON/AliMUONPreClusterFinderV2.cxx
MUON/AliMUONPreClusterFinderV2.h
MUON/AliMUONPreClusterFinderV3.cxx
MUON/AliMUONPreClusterFinderV3.h
MUON/AliMUONVClusterFinder.cxx
MUON/AliMUONVClusterFinder.h

index 1e1143d97f5b7ed2010694206e801c7327629693..2ae2126ff22f817ff011941dfb0979f75d2298c3 100644 (file)
@@ -61,31 +61,13 @@ AliMUONClusterFinderCOG::~AliMUONClusterFinderCOG()
 
 //_____________________________________________________________________________
 Bool_t 
-AliMUONClusterFinderCOG::Prepare(const AliMpVSegmentation* segmentations[2],
-                                 const AliMUONVDigitStore& digitStore)
+AliMUONClusterFinderCOG::Prepare(Int_t detElemId,
+                                 TClonesArray* 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);
 }
 
 //_____________________________________________________________________________
index 3891987502cb788bd919d7ebbb429d3251e8c9d2..3cadac8025b7605dd2b8d76cb197c401c55d7369 100644 (file)
@@ -21,9 +21,12 @@ class AliMUONClusterFinderCOG : public AliMUONVClusterFinder
 public:
   AliMUONClusterFinderCOG(AliMUONVClusterFinder* clusterFinder);
   virtual ~AliMUONClusterFinderCOG();
+
+  using AliMUONVClusterFinder::Prepare;
   
-  virtual Bool_t Prepare(const AliMpVSegmentation* segmentations[2],
-                         const AliMUONVDigitStore& digitStore);
+  virtual Bool_t Prepare(Int_t detElemId,
+                         TClonesArray* pads[2],
+                         const AliMpArea& area);
   
   virtual AliMUONCluster* NextCluster();
   
index 8a9cd440c699ca0c07c0c0c10f1d74b8e9553079..4fb83caa3787bc4502664280c762622dfff56c42 100644 (file)
@@ -109,33 +109,21 @@ AliMUONClusterFinderMLEM::~AliMUONClusterFinderMLEM()
 
 //_____________________________________________________________________________
 Bool_t 
-AliMUONClusterFinderMLEM::Prepare(const AliMpVSegmentation* segmentations[2],
-                                  const AliMUONVDigitStore& digitStore)
+AliMUONClusterFinderMLEM::Prepare(Int_t detElemId,
+                                  TClonesArray* pads[2],
+                                  const AliMpArea& area,
+                                  const AliMpVSegmentation* seg[2])
 {
   /// Prepare for clustering
 //  AliCodeTimerAuto("")
   
   for ( Int_t i = 0; i < 2; ++i )
   {
-    fSegmentation[i] = segmentations[i];
+    fSegmentation[i] = seg[i];
   }
   
   // Find out the DetElemId
-  fDetElemId = -1;
-  
-  TIter next(digitStore.CreateIterator());
-  AliMUONVDigit* d = static_cast<AliMUONVDigit*>(next());
-  
-  if (d)
-  {
-    fDetElemId = d->DetElemId();
-  }
-  
-  if ( fDetElemId < 0 )
-  {
-    AliWarning("Could not find DE. Probably no digits at all ?");
-    return kFALSE;
-  }
+  fDetElemId = detElemId;
   
   delete fSplitter;
   fSplitter = new AliMUONClusterSplitterMLEM(fDetElemId,fPixArray);
@@ -148,7 +136,14 @@ AliMUONClusterFinderMLEM::Prepare(const AliMpVSegmentation* segmentations[2],
   
   AliDebug(3,Form("EVT %d DE %d",fEventNumber,fDetElemId));
   
-  return fPreClusterFinder->Prepare(segmentations,digitStore);
+  if ( fPreClusterFinder->NeedSegmentation() )
+  {
+    return fPreClusterFinder->Prepare(detElemId,pads,area,seg);
+  }
+  else
+  {
+    return fPreClusterFinder->Prepare(detElemId,pads,area);
+  }
 }
 
 //_____________________________________________________________________________
@@ -303,7 +298,7 @@ AliMUONClusterFinderMLEM::CheckPrecluster(const AliMUONCluster& origCluster)
   /// Check precluster in order to attempt to simplify it (mostly for
   /// two-cathode preclusters)
     
-  //  AliCodeTimerAuto("")
+  AliCodeTimerAuto("")
 
   // Disregard small clusters (leftovers from splitting or noise)
   if ((origCluster.Multiplicity()==1 || origCluster.Multiplicity()==2) &&
@@ -312,7 +307,6 @@ AliMUONClusterFinderMLEM::CheckPrecluster(const AliMUONCluster& origCluster)
     return 0x0;
   }
 
-  //AliMUONCluster* cluster = static_cast<AliMUONCluster*>(origCluster.Clone());
   AliMUONCluster* cluster = new AliMUONCluster(origCluster);
 
   AliDebug(2,"Start of CheckPreCluster=");
index 4c25536d1081d4a30e1f4af36d2161c3651f3791..727f0ca195f69486c6d678c09c7929bd4e623340 100644 (file)
@@ -35,8 +35,14 @@ public:
   AliMUONClusterFinderMLEM(Bool_t plot, AliMUONVClusterFinder* clusterFinder); // Constructor
   virtual ~AliMUONClusterFinderMLEM(); // Destructor
 
-  virtual Bool_t Prepare(const AliMpVSegmentation* segmentations[2],
-                         const AliMUONVDigitStore& digitStore);
+  virtual Bool_t NeedSegmentation() const { return kTRUE; }
+  
+  using AliMUONVClusterFinder::Prepare;
+
+  virtual Bool_t Prepare(Int_t detElemId,
+                         TClonesArray* pads[2],
+                         const AliMpArea& area,
+                         const AliMpVSegmentation* segmentations[2]);
   
   virtual AliMUONCluster* NextCluster();
   
index ce5827693d1920019ba5c31c2b93ef01ffcdcb46..b2b126cdf06458b77d1a0ba5804a88196b837006 100644 (file)
@@ -110,30 +110,15 @@ AliMUONClusterFinderSimpleFit::~AliMUONClusterFinderSimpleFit()
 
 //_____________________________________________________________________________
 Bool_t 
-AliMUONClusterFinderSimpleFit::Prepare(const AliMpVSegmentation* segmentations[2],
-                                       const AliMUONVDigitStore& digitStore)
+AliMUONClusterFinderSimpleFit::Prepare(Int_t detElemId,
+                                       TClonesArray* pads[2],
+                                       const AliMpArea& area)
 {
   /// Prepare for clustering
 
   // FIXME: should we get the Mathieson from elsewhere ?
   
   // Find out the DetElemId
-  Int_t detElemId(-1);
-  
-  TIter next(digitStore.CreateIterator());
-  AliMUONVDigit* d = static_cast<AliMUONVDigit*>(next());
-  
-  if (d)
-  {
-    detElemId = d->DetElemId();
-  }
-  else
-  {
-    AliWarning("Could not find DE. Probably no digits at all : here's the digitStore :");
-    StdoutToAliWarning(digitStore.Print(););
-    return kFALSE;
-  }
-  
   AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
   
   Float_t kx3 = AliMUONConstants::SqrtKx3();
@@ -154,7 +139,7 @@ AliMUONClusterFinderSimpleFit::Prepare(const AliMpVSegmentation* segmentations[2
   fMathieson->SetSqrtKx3AndDeriveKx2Kx4(kx3);
   fMathieson->SetSqrtKy3AndDeriveKy2Ky4(ky3);
 
-  return fClusterFinder->Prepare(segmentations,digitStore);
+  return fClusterFinder->Prepare(detElemId,pads,area);
 }
 
 //_____________________________________________________________________________
index 31768e149f0c8422c3c70d5cc8de3807f6f9a4f9..837ebac6b1e335d3a3a1132af911106cc9ccbf1d 100644 (file)
@@ -24,8 +24,11 @@ public:
   AliMUONClusterFinderSimpleFit(AliMUONVClusterFinder* clusterFinder);
   virtual ~AliMUONClusterFinderSimpleFit();
   
-  virtual Bool_t Prepare(const AliMpVSegmentation* segmentations[2],
-                         const AliMUONVDigitStore& digitStore);
+  using AliMUONVClusterFinder::Prepare;
+
+  virtual Bool_t Prepare(Int_t detElemId,
+                         TClonesArray* pads[2],
+                         const AliMpArea& area);
   
   virtual AliMUONCluster* NextCluster();
   
index 21f5e44dc78db0b879b36139202e53e9bb6b0b4e..f830ece79706d51c365960d9f9bc47cc6bc0515c 100644 (file)
@@ -43,25 +43,17 @@ AliMUONPreClusterFinderV2::AliMUONPreClusterFinderV2()
 : AliMUONVClusterFinder(),
   fClusters(0x0),
   fSegmentations(0x0),
+  fPads(0x0),
   fDetElemId(0)
 {
     /// ctor
-  for ( Int_t i = 0; i < 2; ++i )
-  {
-    fPads[i] = 0x0;
-  } 
 }
 
 //_____________________________________________________________________________
 AliMUONPreClusterFinderV2::~AliMUONPreClusterFinderV2()
 {
-  /// dtor : note we're owner of the pads and the clusters, but not of
-  /// the remaining objects (digits, segmentations)
+  /// dtor : note we're owner of the clusters, but not of the pads
   delete fClusters;
-  for ( Int_t i = 0; i < 2; ++i )
-  {
-    delete fPads[i];
-  }  
 }
 
 //_____________________________________________________________________________
@@ -83,55 +75,26 @@ AliMUONPreClusterFinderV2::UsePad(const AliMUONPad& pad)
 
 //_____________________________________________________________________________
 Bool_t
-AliMUONPreClusterFinderV2::Prepare(const AliMpVSegmentation* segmentations[2],
-                                 const AliMUONVDigitStore& digitStore)
-// FIXME : add area on which to look for clusters here.
+AliMUONPreClusterFinderV2::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
   
-  fSegmentations = segmentations;
-  
-  delete fClusters;
-  fClusters = new TClonesArray("AliMUONCluster");
-  for ( Int_t i = 0; i < 2; ++i )
+  if ( area.IsValid() ) 
   {
-    delete fPads[i];
-    fPads[i] = new TClonesArray("AliMUONPad");
+    AliError("Handling of area not yet implemented for this class. Please check");
   }
   
-  fDetElemId = -1;
+  delete fClusters;
+  fClusters = new TClonesArray("AliMUONCluster");
+
+  fPads = pads;
+  fSegmentations = seg;
   
-  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); 
-    mpad.SetUniqueID(d->GetUniqueID());
-    new (padArray[padArray.GetLast()+1]) AliMUONPad(mpad);      
-  }
   if ( fPads[0]->GetLast() < 0 && fPads[1]->GetLast() < 0 )
   {
     // no pad at all, nothing to do...
index 6fb0736eb0f1353d16fad7850ac210c81032f6f6..01268428641197e1b2131bdc694280cf459785b9 100644 (file)
@@ -25,8 +25,14 @@ public:
   AliMUONPreClusterFinderV2();
   virtual ~AliMUONPreClusterFinderV2();
   
-  virtual Bool_t Prepare(const AliMpVSegmentation* segmentations[2],
-                         const AliMUONVDigitStore& digitStore);
+  Bool_t NeedSegmentation() const { return kTRUE; }
+  
+  using AliMUONVClusterFinder::Prepare;
+
+  virtual Bool_t Prepare(Int_t detElemId,                         
+                         TClonesArray* pads[2],
+                         const AliMpArea& area,
+                         const AliMpVSegmentation* seg[2]);
   
   virtual AliMUONCluster* NextCluster();
 
@@ -43,10 +49,10 @@ private:
 private:
   TClonesArray* fClusters; //!< the clusters we've found (owner)
   const AliMpVSegmentation** fSegmentations; //!< segmentations (not owner)
-  TClonesArray* fPads[2]; //!< the pads corresponding to the digits (owner)
+  TClonesArray** fPads; //!< the pads corresponding to the digits (not owner)
   Int_t fDetElemId; //!< which DE we're considering
   
-  ClassDef(AliMUONPreClusterFinderV2,1) // A basic pre-cluster finder
+  ClassDef(AliMUONPreClusterFinderV2,2) // A basic pre-cluster finder
 };
 
 #endif
index 400c6fad8cb8278dc7062b2112c89c718fae571a..036ef66de63878aaa83114036f2a51007a9bd913 100644 (file)
@@ -81,6 +81,7 @@ AliMUONPreClusterFinderV3::AliMUONPreClusterFinderV3()
 : AliMUONVClusterFinder(),
   fClusters(new TClonesArray("AliMUONCluster",10)),
   fSegmentations(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,54 +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.");
+  }
+  
+  fSegmentations = 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); 
-    mpad.SetUniqueID(d->GetUniqueID());
-    new (padArray[padArray.GetLast()+1]) AliMUONPad(mpad);      
-  }
   if ( fPads[0]->GetLast() < 0 && fPads[1]->GetLast() < 0 )
   {
     // no pad at all, nothing to do...
index 7940ba098a28673b6a4ddada0116c080560b1f3d..9ca25f69f01bbc00dd1ee2a9e3dc0ced00d3d04c 100644 (file)
@@ -25,8 +25,14 @@ public:
   AliMUONPreClusterFinderV3();
   virtual ~AliMUONPreClusterFinderV3();
   
-  virtual Bool_t Prepare(const AliMpVSegmentation* segmentations[2],
-                         const AliMUONVDigitStore& digitStore);
+  virtual Bool_t NeedSegmentation() const { return kTRUE; }
+  
+  using AliMUONVClusterFinder::Prepare;
+
+  virtual Bool_t Prepare(Int_t detElemId,                         
+                         TClonesArray* pads[2],
+                         const AliMpArea& area,
+                         const AliMpVSegmentation* seg[2]);
   
   virtual AliMUONCluster* NextCluster();
 
@@ -48,12 +54,12 @@ private:
 private:
   TClonesArray* fClusters; //!< the clusters we've found (owner)
   const AliMpVSegmentation** fSegmentations; //!< segmentations (not owner)
-  TClonesArray* fPads[2]; //!< the pads corresponding to the digits (owner)
+  TClonesArray** fPads; //!< the pads corresponding to the digits (not owner)
   TClonesArray* fPreClusters[2]; //!< the preclusters per cathode (owner)
   Int_t fDetElemId; //!< which DE we're considering
   TIterator* fIterator; //!< iterator on fClusters
   
-  ClassDef(AliMUONPreClusterFinderV3,1) // A basic pre-cluster finder
+  ClassDef(AliMUONPreClusterFinderV3,2) // A basic pre-cluster finder
 };
 
 #endif
index 15d2ea1d8b825b59e94c4d3c271ed377277d759c..73791085d99f5f1fda427fc9aeba0db4e3662bf3 100644 (file)
@@ -46,10 +46,37 @@ AliMUONVClusterFinder::~AliMUONVClusterFinder()
 /// Destructor
 }
 
+//_____________________________________________________________________________
+Bool_t 
+AliMUONVClusterFinder::Prepare(Int_t /*detElemId*/,
+                               TClonesArray* /*pads*/[2],
+                               const AliMpArea& /*area*/)
+{
+/// Not implemented
+
+  AliError("Not implemented");
+  return kFALSE;
+}
+
+//_____________________________________________________________________________
+Bool_t 
+AliMUONVClusterFinder::Prepare(Int_t /*detElemId*/,
+                               TClonesArray* /*pads*/[2],
+                               const AliMpArea& /*area*/,
+                               const AliMpVSegmentation* /*segmentations*/[2])
+{
+/// Not implemented
+
+  AliError("Not implemented");
+  return kFALSE;
+}
+
 //_____________________________________________________________________________
 Bool_t
 AliMUONVClusterFinder::UsePad(const AliMUONPad&)
 {
+/// Not implemented
+
   AliError("Not implemented");
   return kFALSE;
 }
index 3015738fa786956a5be9743c93d5db7ea00d1596..93f92c8d899e482eee6c5fdf0d6ed30c77edbf22 100644 (file)
@@ -19,7 +19,7 @@
 class AliMUONCluster;
 class AliMpVSegmentation;
 class AliMUONPad;
-class AliMUONVDigitStore;
+class AliMpArea;
 
 class AliMUONVClusterFinder : public TObject
 {
@@ -28,8 +28,17 @@ public:
   virtual ~AliMUONVClusterFinder();
   
   /// \todo add comment
-  virtual Bool_t Prepare(const AliMpVSegmentation* segmentations[2],
-                         const AliMUONVDigitStore& digitStore) = 0;
+
+  virtual Bool_t NeedSegmentation() const { return kFALSE; }
+  
+  virtual Bool_t Prepare(Int_t detElemId,
+                         TClonesArray* pads[2],
+                         const AliMpArea& area);
+
+  virtual Bool_t Prepare(Int_t detElemId,
+                         TClonesArray* pads[2],
+                         const AliMpArea& area,
+                         const AliMpVSegmentation* segmentations[2]);  
   
   /// \todo add comment
   virtual AliMUONCluster* NextCluster() = 0;