X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONPreClusterFinderV2.cxx;h=e3d42f48bd974bf7dee0498f998f3bb7435dd780;hb=540787c48b8a4ff4297cce6635381d07987ca0f5;hp=c0fc9ea1be4546ba7637d435b0daaff762031d65;hpb=94bf739cea9ebace9338a41abff9fcb4dde0b628;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONPreClusterFinderV2.cxx b/MUON/AliMUONPreClusterFinderV2.cxx index c0fc9ea1be4..e3d42f48bd9 100644 --- a/MUON/AliMUONPreClusterFinderV2.cxx +++ b/MUON/AliMUONPreClusterFinderV2.cxx @@ -20,7 +20,8 @@ #include "AliLog.h" #include "AliMUONCluster.h" #include "AliMpVSegmentation.h" -#include "TClonesArray.h" +#include "AliMpPad.h" +#include "TObjArray.h" #include "TVector2.h" #include "AliMUONPad.h" #include "AliMUONVDigit.h" @@ -42,7 +43,7 @@ ClassImp(AliMUONPreClusterFinderV2) AliMUONPreClusterFinderV2::AliMUONPreClusterFinderV2() : AliMUONVClusterFinder(), fClusters(0x0), - fSegmentations(0x0), + fkSegmentations(0x0), fPads(0x0), fDetElemId(0) { @@ -68,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; } @@ -76,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]) { @@ -91,7 +92,7 @@ AliMUONPreClusterFinderV2::Prepare(Int_t detElemId, fClusters = new TClonesArray("AliMUONCluster"); fPads = pads; - fSegmentations = seg; + fkSegmentations = seg; fDetElemId = detElemId; @@ -110,18 +111,16 @@ AliMUONPreClusterFinderV2::AddPad(AliMUONCluster& cluster, AliMUONPad* pad) { /// Add a pad to a cluster - cluster.AddPad(*pad); - pad->SetClusterId(cluster.GetUniqueID()); + AliMUONPad* addedPad = cluster.AddPad(*pad); Int_t cathode = pad->Cathode(); - TClonesArray& padArray = *fPads[cathode]; - padArray.Remove(pad); - TIter next(&padArray); + TObjArray& padArray = *fPads[cathode]; + delete padArray.Remove(pad); // Check neighbours TObjArray neighbours; - AliMpPad p = fSegmentations[pad->Cathode()]->PadByIndices(AliMpIntPair(pad->Ix(),pad->Iy()),kTRUE); - Int_t nn = fSegmentations[pad->Cathode()]->GetNeighbours(p,neighbours); + AliMpPad p = fkSegmentations[cathode]->PadByIndices(addedPad->Ix(),addedPad->Iy(),kTRUE); + Int_t nn = fkSegmentations[cathode]->GetNeighbours(p,neighbours); for (Int_t in = 0; in < nn; ++in) { AliMpPad* p1 = static_cast(neighbours.At(in)); @@ -131,9 +130,9 @@ AliMUONPreClusterFinderV2::AddPad(AliMUONCluster& cluster, AliMUONPad* pad) while ( ( p2 = static_cast(next2()) ) ) { - if ( !p2->IsUsed() && p2->Ix()==p1->GetIndices().GetFirst() - && p2->Iy() == p1->GetIndices().GetSecond() && - p2->Cathode() == pad->Cathode() ) + if ( !p2->IsUsed() && p2->Ix()==p1->GetIx() + && p2->Iy() == p1->GetIy() && + p2->Cathode() == cathode ) { AddPad(cluster,p2); }