#include "AliLog.h"
#include <Riostream.h>
-#include <TClonesArray.h>
+#include <TObjArray.h>
#include <TVector2.h>
//-----------------------------------------------------------------------------
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;
}
//_____________________________________________________________________________
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
return;
}
- cluster.AddPad(*pad);
+ AliMUONPad* addedPad = 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 !
- padArray.Remove(pad);
- // TObject* o = padArray.Remove(pad);
+ TObject* o = padArray.Remove(pad);
// if (!o)
// {
// AliFatal("Oups. Could not remove pad from pads to consider. Aborting as anyway "
// " we'll get an infinite loop. Please check the AliMUONPad::IsEqual method"
// " as the first suspect for failed remove");
// }
+ delete o;
+
TIter next(&padArray);
AliMUONPad* testPad;
while ( ( testPad = static_cast<AliMUONPad*>(next())))
{
- if ( AliMUONPad::AreNeighbours(*testPad,*pad) )
+ if ( AliMUONPad::AreNeighbours(*testPad,*addedPad) )
{
AddPad(cluster,testPad);
}
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;