From 9e41a340e3bc3e19ddf539e3d0c0299dd5cb0342 Mon Sep 17 00:00:00 2001 From: ivana Date: Fri, 12 Nov 2010 15:26:10 +0000 Subject: [PATCH] Replacing TClonesArray with TObjArray in cluster finder classes. --- MUON/AliMUONClusterFinderCOG.cxx | 2 +- MUON/AliMUONClusterFinderCOG.h | 2 +- MUON/AliMUONClusterFinderMLEM.cxx | 2 +- MUON/AliMUONClusterFinderMLEM.h | 3 +-- MUON/AliMUONClusterFinderPeakCOG.cxx | 2 +- MUON/AliMUONClusterFinderPeakCOG.h | 3 +-- MUON/AliMUONClusterFinderPeakFit.cxx | 2 +- MUON/AliMUONClusterFinderPeakFit.h | 3 +-- MUON/AliMUONClusterFinderSimpleFit.cxx | 3 +-- MUON/AliMUONClusterFinderSimpleFit.h | 2 +- MUON/AliMUONPreClusterFinder.cxx | 10 +++++----- MUON/AliMUONPreClusterFinder.h | 5 +++-- MUON/AliMUONPreClusterFinderV2.cxx | 8 ++++---- MUON/AliMUONPreClusterFinderV2.h | 4 ++-- MUON/AliMUONPreClusterFinderV3.cxx | 9 +++++---- MUON/AliMUONPreClusterFinderV3.h | 4 ++-- MUON/AliMUONSimpleClusterServer.cxx | 26 +++++++++++++------------- MUON/AliMUONSimpleClusterServer.h | 2 +- MUON/AliMUONVClusterFinder.cxx | 4 ++-- MUON/AliMUONVClusterFinder.h | 4 ++-- 20 files changed, 49 insertions(+), 51 deletions(-) diff --git a/MUON/AliMUONClusterFinderCOG.cxx b/MUON/AliMUONClusterFinderCOG.cxx index 8657b746c08..7bd0b8a56b9 100644 --- a/MUON/AliMUONClusterFinderCOG.cxx +++ b/MUON/AliMUONClusterFinderCOG.cxx @@ -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 diff --git a/MUON/AliMUONClusterFinderCOG.h b/MUON/AliMUONClusterFinderCOG.h index 3cadac8025b..8397485b834 100644 --- a/MUON/AliMUONClusterFinderCOG.h +++ b/MUON/AliMUONClusterFinderCOG.h @@ -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(); diff --git a/MUON/AliMUONClusterFinderMLEM.cxx b/MUON/AliMUONClusterFinderMLEM.cxx index 66e6895dee3..21d26f511bf 100644 --- a/MUON/AliMUONClusterFinderMLEM.cxx +++ b/MUON/AliMUONClusterFinderMLEM.cxx @@ -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]) { diff --git a/MUON/AliMUONClusterFinderMLEM.h b/MUON/AliMUONClusterFinderMLEM.h index 40178dd0c30..6267687d2da 100644 --- a/MUON/AliMUONClusterFinderMLEM.h +++ b/MUON/AliMUONClusterFinderMLEM.h @@ -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]); diff --git a/MUON/AliMUONClusterFinderPeakCOG.cxx b/MUON/AliMUONClusterFinderPeakCOG.cxx index 129146809d5..8babf5aa3b3 100644 --- a/MUON/AliMUONClusterFinderPeakCOG.cxx +++ b/MUON/AliMUONClusterFinderPeakCOG.cxx @@ -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]) { diff --git a/MUON/AliMUONClusterFinderPeakCOG.h b/MUON/AliMUONClusterFinderPeakCOG.h index 1501cee26d9..9c534f4ed1f 100644 --- a/MUON/AliMUONClusterFinderPeakCOG.h +++ b/MUON/AliMUONClusterFinderPeakCOG.h @@ -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(); diff --git a/MUON/AliMUONClusterFinderPeakFit.cxx b/MUON/AliMUONClusterFinderPeakFit.cxx index c21c1ceb1c7..43ed7d9c66b 100644 --- a/MUON/AliMUONClusterFinderPeakFit.cxx +++ b/MUON/AliMUONClusterFinderPeakFit.cxx @@ -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]) { diff --git a/MUON/AliMUONClusterFinderPeakFit.h b/MUON/AliMUONClusterFinderPeakFit.h index 1974acadba9..29d0232fd13 100644 --- a/MUON/AliMUONClusterFinderPeakFit.h +++ b/MUON/AliMUONClusterFinderPeakFit.h @@ -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(); diff --git a/MUON/AliMUONClusterFinderSimpleFit.cxx b/MUON/AliMUONClusterFinderSimpleFit.cxx index bf59a282b02..3886a5f18d9 100644 --- a/MUON/AliMUONClusterFinderSimpleFit.cxx +++ b/MUON/AliMUONClusterFinderSimpleFit.cxx @@ -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 diff --git a/MUON/AliMUONClusterFinderSimpleFit.h b/MUON/AliMUONClusterFinderSimpleFit.h index a7532a31967..ac90dc24da2 100644 --- a/MUON/AliMUONClusterFinderSimpleFit.h +++ b/MUON/AliMUONClusterFinderSimpleFit.h @@ -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(); diff --git a/MUON/AliMUONPreClusterFinder.cxx b/MUON/AliMUONPreClusterFinder.cxx index 35422cf5bca..1badcb0be30 100644 --- a/MUON/AliMUONPreClusterFinder.cxx +++ b/MUON/AliMUONPreClusterFinder.cxx @@ -31,7 +31,7 @@ #include "AliLog.h" #include -#include +#include #include //----------------------------------------------------------------------------- @@ -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; diff --git a/MUON/AliMUONPreClusterFinder.h b/MUON/AliMUONPreClusterFinder.h index 3d5254e4290..9983f95f0e3 100644 --- a/MUON/AliMUONPreClusterFinder.h +++ b/MUON/AliMUONPreClusterFinder.h @@ -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 diff --git a/MUON/AliMUONPreClusterFinderV2.cxx b/MUON/AliMUONPreClusterFinderV2.cxx index 143373c46b1..46860317328 100644 --- a/MUON/AliMUONPreClusterFinderV2.cxx +++ b/MUON/AliMUONPreClusterFinderV2.cxx @@ -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); diff --git a/MUON/AliMUONPreClusterFinderV2.h b/MUON/AliMUONPreClusterFinderV2.h index 3e771ee3b8f..c94fae91e42 100644 --- a/MUON/AliMUONPreClusterFinderV2.h +++ b/MUON/AliMUONPreClusterFinderV2.h @@ -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 diff --git a/MUON/AliMUONPreClusterFinderV3.cxx b/MUON/AliMUONPreClusterFinderV3.cxx index d1585151521..6f438b6ff64 100644 --- a/MUON/AliMUONPreClusterFinderV3.cxx +++ b/MUON/AliMUONPreClusterFinderV3.cxx @@ -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; diff --git a/MUON/AliMUONPreClusterFinderV3.h b/MUON/AliMUONPreClusterFinderV3.h index 4fd028d9f39..522966bb291 100644 --- a/MUON/AliMUONPreClusterFinderV3.h +++ b/MUON/AliMUONPreClusterFinderV3.h @@ -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 diff --git a/MUON/AliMUONSimpleClusterServer.cxx b/MUON/AliMUONSimpleClusterServer.cxx index de29507ba81..01c5d177972 100644 --- a/MUON/AliMUONSimpleClusterServer.cxx +++ b/MUON/AliMUONSimpleClusterServer.cxx @@ -38,7 +38,7 @@ #include "AliMpSegmentation.h" #include "AliMpVSegmentation.h" #include -#include +#include #include #include @@ -137,10 +137,10 @@ AliMUONSimpleClusterServer::Clusterize(Int_t chamberId, { Int_t detElemId = it.CurrentDEId(); - TClonesArray* pads[2] = + TObjArray* pads[2] = { - static_cast(fPads[0]->GetValue(detElemId)), - static_cast(fPads[1]->GetValue(detElemId)) + static_cast(fPads[0]->GetValue(detElemId)), + static_cast(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(fPads[cathode]->GetValue(detElemId)); + return static_cast(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) { diff --git a/MUON/AliMUONSimpleClusterServer.h b/MUON/AliMUONSimpleClusterServer.h index 6dbbf851ad8..d88820b0938 100644 --- a/MUON/AliMUONSimpleClusterServer.h +++ b/MUON/AliMUONSimpleClusterServer.h @@ -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; diff --git a/MUON/AliMUONVClusterFinder.cxx b/MUON/AliMUONVClusterFinder.cxx index 73791085d99..d5851578048 100644 --- a/MUON/AliMUONVClusterFinder.cxx +++ b/MUON/AliMUONVClusterFinder.cxx @@ -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]) { diff --git a/MUON/AliMUONVClusterFinder.h b/MUON/AliMUONVClusterFinder.h index 9d0aeab61d3..7e4f7db007d 100644 --- a/MUON/AliMUONVClusterFinder.h +++ b/MUON/AliMUONVClusterFinder.h @@ -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]); -- 2.43.5