Replacing TClonesArray with TObjArray in cluster finder classes.
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 12 Nov 2010 15:26:10 +0000 (15:26 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 12 Nov 2010 15:26:10 +0000 (15:26 +0000)
20 files changed:
MUON/AliMUONClusterFinderCOG.cxx
MUON/AliMUONClusterFinderCOG.h
MUON/AliMUONClusterFinderMLEM.cxx
MUON/AliMUONClusterFinderMLEM.h
MUON/AliMUONClusterFinderPeakCOG.cxx
MUON/AliMUONClusterFinderPeakCOG.h
MUON/AliMUONClusterFinderPeakFit.cxx
MUON/AliMUONClusterFinderPeakFit.h
MUON/AliMUONClusterFinderSimpleFit.cxx
MUON/AliMUONClusterFinderSimpleFit.h
MUON/AliMUONPreClusterFinder.cxx
MUON/AliMUONPreClusterFinder.h
MUON/AliMUONPreClusterFinderV2.cxx
MUON/AliMUONPreClusterFinderV2.h
MUON/AliMUONPreClusterFinderV3.cxx
MUON/AliMUONPreClusterFinderV3.h
MUON/AliMUONSimpleClusterServer.cxx
MUON/AliMUONSimpleClusterServer.h
MUON/AliMUONVClusterFinder.cxx
MUON/AliMUONVClusterFinder.h

index 8657b74..7bd0b8a 100644 (file)
@@ -62,7 +62,7 @@ AliMUONClusterFinderCOG::~AliMUONClusterFinderCOG()
 //_____________________________________________________________________________
 Bool_t 
 AliMUONClusterFinderCOG::Prepare(Int_t detElemId,
-                                 TClonesArray* pads[2],
+                                 TObjArray* pads[2],
                                  const AliMpArea& area)
 {
   /// Prepare for clustering
index 3cadac8..8397485 100644 (file)
@@ -25,7 +25,7 @@ public:
   using AliMUONVClusterFinder::Prepare;
   
   virtual Bool_t Prepare(Int_t detElemId,
-                         TClonesArray* pads[2],
+                         TObjArray* pads[2],
                          const AliMpArea& area);
   
   virtual AliMUONCluster* NextCluster();
index 66e6895..21d26f5 100644 (file)
@@ -106,7 +106,7 @@ AliMUONClusterFinderMLEM::~AliMUONClusterFinderMLEM()
 //_____________________________________________________________________________
 Bool_t 
 AliMUONClusterFinderMLEM::Prepare(Int_t detElemId,
-                                  TClonesArray* pads[2],
+                                  TObjArray* pads[2],
                                   const AliMpArea& area,
                                   const AliMpVSegmentation* seg[2])
 {
index 40178dd..6267687 100644 (file)
@@ -13,7 +13,6 @@
 //
 
 class TH2D;
-class TClonesArray;
 class TMinuit;
 
 #ifndef ROOT_TObjArray
@@ -40,7 +39,7 @@ public:
   using AliMUONVClusterFinder::Prepare;
 
   virtual Bool_t Prepare(Int_t detElemId,
-                         TClonesArray* pads[2],
+                         TObjArray* pads[2],
                          const AliMpArea& area,
                          const AliMpVSegmentation* segmentations[2]);
   
index 1291468..8babf5a 100644 (file)
@@ -98,7 +98,7 @@ AliMUONClusterFinderPeakCOG::~AliMUONClusterFinderPeakCOG()
 
 //_____________________________________________________________________________
 Bool_t 
-AliMUONClusterFinderPeakCOG::Prepare(Int_t detElemId, TClonesArray* pads[2],
+AliMUONClusterFinderPeakCOG::Prepare(Int_t detElemId, TObjArray* pads[2],
                                      const AliMpArea& area, 
                                      const AliMpVSegmentation* seg[2])
 {
index 1501cee..9c534f4 100644 (file)
@@ -24,7 +24,6 @@
 class AliMUONPad;
 
 class TH2D;
-class TClonesArray;
 
 class AliMUONClusterFinderPeakCOG : public AliMUONVClusterFinder
 {
@@ -37,7 +36,7 @@ public:
 
   using AliMUONVClusterFinder::Prepare;
 
-  virtual Bool_t Prepare(Int_t detElemId, TClonesArray* pads[2],
+  virtual Bool_t Prepare(Int_t detElemId, TObjArray* pads[2],
                          const AliMpArea& area, const AliMpVSegmentation* seg[2]);
   
   virtual AliMUONCluster* NextCluster();
index c21c1ce..43ed7d9 100644 (file)
@@ -170,7 +170,7 @@ AliMUONClusterFinderPeakFit::~AliMUONClusterFinderPeakFit()
 
 //_____________________________________________________________________________
 Bool_t 
-AliMUONClusterFinderPeakFit::Prepare(Int_t detElemId, TClonesArray* pads[2],
+AliMUONClusterFinderPeakFit::Prepare(Int_t detElemId, TObjArray* pads[2],
                                      const AliMpArea& area, 
                                      const AliMpVSegmentation* seg[2])
 {
index 1974aca..29d0232 100644 (file)
@@ -25,7 +25,6 @@ class AliMUONMathieson;
 //class AliMUONPad;
 
 class TH2D;
-//class TClonesArray;
 
 class AliMUONClusterFinderPeakFit : public AliMUONVClusterFinder
 {
@@ -38,7 +37,7 @@ public:
 
   using AliMUONVClusterFinder::Prepare;
 
-  virtual Bool_t Prepare(Int_t detElemId, TClonesArray* pads[2],
+  virtual Bool_t Prepare(Int_t detElemId, TObjArray* pads[2],
                          const AliMpArea& area, const AliMpVSegmentation* seg[2]);
 
   virtual AliMUONCluster* NextCluster();
index bf59a28..3886a5f 100644 (file)
@@ -25,7 +25,6 @@
 #include "AliMUONMathieson.h"
 #include "AliMUONPad.h"
 #include "AliMpArea.h"
-#include "TClonesArray.h"
 #include "TObjArray.h"
 #include "TVector2.h"
 #include "TVirtualFitter.h"
@@ -111,7 +110,7 @@ AliMUONClusterFinderSimpleFit::~AliMUONClusterFinderSimpleFit()
 //_____________________________________________________________________________
 Bool_t 
 AliMUONClusterFinderSimpleFit::Prepare(Int_t detElemId,
-                                       TClonesArray* pads[2],
+                                       TObjArray* pads[2],
                                        const AliMpArea& area)
 {
   /// Prepare for clustering
index a7532a3..ac90dc2 100644 (file)
@@ -27,7 +27,7 @@ public:
   using AliMUONVClusterFinder::Prepare;
 
   virtual Bool_t Prepare(Int_t detElemId,
-                         TClonesArray* pads[2],
+                         TObjArray* pads[2],
                          const AliMpArea& area);
   
   virtual AliMUONCluster* NextCluster();
index 35422cf..1badcb0 100644 (file)
@@ -31,7 +31,7 @@
 #include "AliLog.h"
 
 #include <Riostream.h>
-#include <TClonesArray.h>
+#include <TObjArray.h>
 #include <TVector2.h>
 
 //-----------------------------------------------------------------------------
@@ -76,7 +76,7 @@ AliMUONPreClusterFinder::UsePad(const AliMUONPad& pad)
     return kFALSE;
   }
   
-  new ((*fPads[pad.Cathode()])[fPads[pad.Cathode()]->GetLast()+1]) AliMUONPad(pad); 
+  fPads[pad.Cathode()]->Add(new AliMUONPad(pad)); 
   // FIXME: should set the ClusterId of that new pad to be -1
   return kTRUE;
 }
@@ -84,7 +84,7 @@ AliMUONPreClusterFinder::UsePad(const AliMUONPad& pad)
 //_____________________________________________________________________________
 Bool_t
 AliMUONPreClusterFinder::Prepare(Int_t detElemId,
-                                 TClonesArray* pads[2],
+                                 TObjArray* pads[2],
                                  const AliMpArea& area)
 {
   /// Prepare for clustering, by giving access to segmentations and digit lists
@@ -119,7 +119,7 @@ AliMUONPreClusterFinder::AddPad(AliMUONCluster& cluster, AliMUONPad* pad)
   cluster.AddPad(*pad);
   
   Int_t cathode = pad->Cathode();
-  TClonesArray& padArray = *fPads[cathode];
+  TObjArray& padArray = *fPads[cathode];
   // WARNING: this Remove method uses the AliMUONPad::IsEqual if that method is
   // present (otherwise just compares pointers) : so that one must be correct
   // if implemented !
@@ -251,7 +251,7 @@ AliMUONPreClusterFinder::NextCluster()
     if ( !ShouldAbort() ) 
     {
       // On the 2nd cathode, only add pads overlapping with the current cluster
-      TClonesArray& padArray = *fPads[1];
+      TObjArray& padArray = *fPads[1];
       TIter next(&padArray);
       AliMUONPad* testPad;
       
index 3d5254e..9983f95 100644 (file)
@@ -24,6 +24,7 @@
 
 class TStopwatch;
 class AliMUONPad;
+class TObjArray;
 
 class AliMUONPreClusterFinder : public AliMUONVClusterFinder
 {
@@ -34,7 +35,7 @@ public:
   using AliMUONVClusterFinder::Prepare;
 
   virtual Bool_t Prepare(Int_t detElemId,
-                         TClonesArray* pads[2],
+                         TObjArray* pads[2],
                          const AliMpArea& area);
   
   virtual AliMUONCluster* NextCluster();
@@ -59,7 +60,7 @@ private:
   
 private:
   TClonesArray fClusters; //!< the clusters we've found (owner)
-  TClonesArray** fPads; //!< the pads corresponding to the digits (not owner)
+  TObjArray** fPads; //!< the pads corresponding to the digits (not owner)
   Int_t fDetElemId; //!< which DE we're considering
   AliMpArea fArea; //!< area into which to consider pads to *start* a cluster
   Bool_t fShouldAbort; //!< to indicate clustering should stop right now
index 143373c..4686031 100644 (file)
@@ -21,7 +21,7 @@
 #include "AliMUONCluster.h"
 #include "AliMpVSegmentation.h"
 #include "AliMpPad.h"
-#include "TClonesArray.h"
+#include "TObjArray.h"
 #include "TVector2.h"
 #include "AliMUONPad.h"
 #include "AliMUONVDigit.h"
@@ -69,7 +69,7 @@ AliMUONPreClusterFinderV2::UsePad(const AliMUONPad& pad)
     return kFALSE;
   }
   
-  new ((*fPads[pad.Cathode()])[fPads[pad.Cathode()]->GetLast()+1]) AliMUONPad(pad); 
+  fPads[pad.Cathode()]->Add(new AliMUONPad(pad)); 
   // FIXME: should set the ClusterId of that new pad to be -1
   return kTRUE;
 }
@@ -77,7 +77,7 @@ AliMUONPreClusterFinderV2::UsePad(const AliMUONPad& pad)
 //_____________________________________________________________________________
 Bool_t
 AliMUONPreClusterFinderV2::Prepare(Int_t detElemId,
-                                   TClonesArray* pads[2],
+                                   TObjArray* pads[2],
                                    const AliMpArea& area,
                                    const AliMpVSegmentation* seg[2])
 {
@@ -115,7 +115,7 @@ AliMUONPreClusterFinderV2::AddPad(AliMUONCluster& cluster, AliMUONPad* pad)
   pad->SetClusterId(cluster.GetUniqueID());
   
   Int_t cathode = pad->Cathode();
-  TClonesArray& padArray = *fPads[cathode];
+  TObjArray& padArray = *fPads[cathode];
   padArray.Remove(pad);
   TIter next(&padArray);
   
index 3e771ee..c94fae9 100644 (file)
@@ -30,7 +30,7 @@ public:
   using AliMUONVClusterFinder::Prepare;
 
   virtual Bool_t Prepare(Int_t detElemId,                         
-                         TClonesArray* pads[2],
+                         TObjArray* pads[2],
                          const AliMpArea& area,
                          const AliMpVSegmentation* seg[2]);
   
@@ -49,7 +49,7 @@ private:
 private:
   TClonesArray* fClusters; //!< the clusters we've found (owner)
   const AliMpVSegmentation** fkSegmentations; //!< segmentations (not owner)
-  TClonesArray** fPads; //!< the pads corresponding to the digits (not owner)
+  TObjArray** fPads; //!< the pads corresponding to the digits (not owner)
   Int_t fDetElemId; //!< which DE we're considering
   
   ClassDef(AliMUONPreClusterFinderV2,2) // A basic pre-cluster finder
index d158515..6f438b6 100644 (file)
@@ -20,7 +20,7 @@
 #include "AliLog.h"
 #include "AliMUONCluster.h"
 #include "AliMpVSegmentation.h"
-#include "TClonesArray.h"
+#include "TObjArray.h"
 #include "AliMpArea.h"
 #include "TVector2.h"
 #include "AliMUONPad.h"
@@ -116,15 +116,16 @@ AliMUONPreClusterFinderV3::UsePad(const AliMUONPad& pad)
     return kFALSE;
   }
   
-  AliMUONPad* p = new ((*fPads[pad.Cathode()])[fPads[pad.Cathode()]->GetLast()+1]) AliMUONPad(pad); 
+  AliMUONPad* p = new AliMUONPad(pad); 
   p->SetClusterId(-1);
+  fPads[pad.Cathode()]->Add(p); 
   return kTRUE;
 }
 
 //_____________________________________________________________________________
 Bool_t
 AliMUONPreClusterFinderV3::Prepare(Int_t detElemId,
-                                   TClonesArray* pads[2],
+                                   TObjArray* pads[2],
                                    const AliMpArea& area,
                                    const AliMpVSegmentation* seg[2])
 {
@@ -230,7 +231,7 @@ AliMUONPreClusterFinderV3::AddPad(AliMUONCluster& cluster, AliMUONPad* pad)
   AliMUONPad* addedPad = cluster.AddPad(*pad);
   
   Int_t cathode = pad->Cathode();
-  TClonesArray& padArray = *fPads[cathode];
+  TObjArray& padArray = *fPads[cathode];
   padArray.Remove(pad);
   TIter next(&padArray);
   AliMUONPad* testPad;
index 4fd028d..522966b 100644 (file)
@@ -30,7 +30,7 @@ public:
   using AliMUONVClusterFinder::Prepare;
 
   virtual Bool_t Prepare(Int_t detElemId,                         
-                         TClonesArray* pads[2],
+                         TObjArray* pads[2],
                          const AliMpArea& area,
                          const AliMpVSegmentation* seg[2]);
   
@@ -54,7 +54,7 @@ private:
 private:
   TClonesArray* fClusters; //!< the clusters we've found (owner)
   const AliMpVSegmentation** fkSegmentations; //!< segmentations (not owner)
-  TClonesArray** fPads; //!< the pads corresponding to the digits (not owner)
+  TObjArray** 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
index de29507..01c5d17 100644 (file)
@@ -38,7 +38,7 @@
 #include "AliMpSegmentation.h"
 #include "AliMpVSegmentation.h"
 #include <Riostream.h>
-#include <TClonesArray.h>
+#include <TObjArray.h>
 #include <TString.h>
 #include <float.h>
 
@@ -137,10 +137,10 @@ AliMUONSimpleClusterServer::Clusterize(Int_t chamberId,
   {
     Int_t detElemId = it.CurrentDEId();
     
-    TClonesArray* pads[2] = 
+    TObjArray* pads[2] = 
     { 
-      static_cast<TClonesArray*>(fPads[0]->GetValue(detElemId)),
-      static_cast<TClonesArray*>(fPads[1]->GetValue(detElemId)) 
+      static_cast<TObjArray*>(fPads[0]->GetValue(detElemId)),
+      static_cast<TObjArray*>(fPads[1]->GetValue(detElemId)) 
     };
     
     if ( ( pads[0] && pads[0]->GetLast()>=0 ) || 
@@ -299,12 +299,12 @@ AliMUONSimpleClusterServer::Overlap(Int_t detElemId,
 }
 
 //_____________________________________________________________________________
-TClonesArray* 
+TObjArray* 
 AliMUONSimpleClusterServer::PadArray(Int_t detElemId, Int_t cathode) const
 {
   /// Return array for given cathode of given DE
   
-  return static_cast<TClonesArray*>(fPads[cathode]->GetValue(detElemId));
+  return static_cast<TObjArray*>(fPads[cathode]->GetValue(detElemId));
 }
 
 //_____________________________________________________________________________
@@ -349,20 +349,20 @@ AliMUONSimpleClusterServer::UseDigits(TIter& next, AliMUONVDigitStore* digitStor
       GetMpSegmentation(detElemId,AliMp::GetCathodType(cathode));
     AliMpPad pad = seg->PadByIndices(ix,iy);
     
-    TClonesArray* padArray = PadArray(detElemId,cathode);
+    TObjArray* padArray = PadArray(detElemId,cathode);
     if (!padArray)
     {
-      padArray = new TClonesArray("AliMUONPad",100);
+      padArray = new TObjArray(100);
       fPads[cathode]->Add(detElemId,padArray);
     }
     
-    AliMUONPad mpad(detElemId,cathode,
+    AliMUONPad* mpad = new AliMUONPad(detElemId,cathode,
                     ix,iy,pad.GetPositionX(),pad.GetPositionY(),
                     pad.GetDimensionX(),pad.GetDimensionY(),
                     d->Charge());
-    if ( d->IsSaturated() ) mpad.SetSaturated(kTRUE);
-    mpad.SetUniqueID(d->GetUniqueID());
-    new ((*padArray)[padArray->GetLast()+1]) AliMUONPad(mpad);      
+    if ( d->IsSaturated() ) mpad->SetSaturated(kTRUE);
+    mpad->SetUniqueID(d->GetUniqueID());
+    padArray->Add(mpad);      
   }
 }
 
@@ -461,7 +461,7 @@ AliMUONSimpleClusterServer::Print(Option_t*) const
       {
         cout << Form("  -- Cathode %1d",cathode) << endl;
         
-        TClonesArray* padArray = PadArray(detElemId,cathode);
+        TObjArray* padArray = PadArray(detElemId,cathode);
         
         if (!padArray)
         {
index 6dbbf85..d88820b 100644 (file)
@@ -56,7 +56,7 @@ private:
     
   void Global2Local(Int_t detElemId, const AliMpArea& globalArea, AliMpArea& localArea) const;
 
-  TClonesArray* PadArray(Int_t detElemId, Int_t cathode) const;
+  TObjArray* PadArray(Int_t detElemId, Int_t cathode) const;
   
   Int_t FindMCLabel(const AliMUONCluster& cluster, Int_t detElemId, const AliMpVSegmentation* seg[2]) const;
   
index 7379108..d585157 100644 (file)
@@ -49,7 +49,7 @@ AliMUONVClusterFinder::~AliMUONVClusterFinder()
 //_____________________________________________________________________________
 Bool_t 
 AliMUONVClusterFinder::Prepare(Int_t /*detElemId*/,
-                               TClonesArray* /*pads*/[2],
+                               TObjArray* /*pads*/[2],
                                const AliMpArea& /*area*/)
 {
 /// Not implemented
@@ -61,7 +61,7 @@ AliMUONVClusterFinder::Prepare(Int_t /*detElemId*/,
 //_____________________________________________________________________________
 Bool_t 
 AliMUONVClusterFinder::Prepare(Int_t /*detElemId*/,
-                               TClonesArray* /*pads*/[2],
+                               TObjArray* /*pads*/[2],
                                const AliMpArea& /*area*/,
                                const AliMpVSegmentation* /*segmentations*/[2])
 {
index 9d0aeab..7e4f7db 100644 (file)
@@ -33,11 +33,11 @@ public:
   virtual Bool_t NeedSegmentation() const { return kFALSE; }
   
   virtual Bool_t Prepare(Int_t detElemId,
-                         TClonesArray* pads[2],
+                         TObjArray* pads[2],
                          const AliMpArea& area);
 
   virtual Bool_t Prepare(Int_t detElemId,
-                         TClonesArray* pads[2],
+                         TObjArray* pads[2],
                          const AliMpArea& area,
                          const AliMpVSegmentation* segmentations[2]);