#include "AliMpTrigger.h"
#include "AliMpSlatSegmentation.h"
-
+#include "AliMpConstants.h"
#include "AliLog.h"
#include "AliMpSlat.h"
// default ctor
AliDebugStream(1) << "this = " << this << endl;
+
+ fSlats.SetOwner(kFALSE);
+ fSlatSegmentations.SetOwner(kTRUE);
}
//_____________________________________________________________________________
// normal ctor
AliDebugStream(1) << "this = " << this << endl;
+
+ fSlats.SetOwner(kFALSE);
+ fSlatSegmentations.SetOwner(kTRUE);
}
//_____________________________________________________________________________
// dtor
AliDebugStream(1) << "this = " << this << endl;
- fSlats.Delete();
fSlatSegmentations.Delete();
}
GetID(),slat->GetID()));
// Check that we keep our size constant.
-
- const Double_t kPrecision = 1E-3;
-
+
if ( GetSize() > 0 &&
- ( !::IsEqual(slat->DX(),fDX,kPrecision) ||
- !::IsEqual(slat->DY(),fDY,kPrecision) )
+ ( !::IsEqual(slat->DX(),fDX,AliMpConstants::LengthTolerance()) ||
+ !::IsEqual(slat->DY(),fDY,AliMpConstants::LengthTolerance()) )
)
{
- AliError(Form("In %s trying to add a layer (%e,%e) of a different size than "
- "mine (%e,%e)\n",GetID(),slat->DX(),slat->DY(),
+ AliError(Form("In %s trying to add a layer (%e,%e) (layer #%d) "
+ "of a different size than mine (%e,%e)",
+ GetID(),slat->DX(),slat->DY(),fSlats.GetEntries(),
fDX,fDY));
return kFALSE;
}
fSlats.Add(slat);
- fSlatSegmentations.Add(new AliMpSlatSegmentation(slat));
+ Bool_t owner(kTRUE);
+ // the slat segmentation will be the owner of the slat, and will delete
+ // it when it'll be deleted itself
+ fSlatSegmentations.Add(new AliMpSlatSegmentation(slat,owner));
fMaxNofPadsY = std::max(slat->GetMaxNofPadsY(),fMaxNofPadsY);
fDX = std::max(fDX,slat->DX());
fDY = std::max(fDY,slat->DY());