From f0195aa5ac47b102ac348c4e4c8b1f2a5d45570d Mon Sep 17 00:00:00 2001 From: ivana Date: Wed, 17 Oct 2007 12:58:52 +0000 Subject: [PATCH] Make it independent from (loading the) mapping --- MUON/AliMUON2DMap.cxx | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/MUON/AliMUON2DMap.cxx b/MUON/AliMUON2DMap.cxx index f7779dadc71..bfb129c2cb0 100644 --- a/MUON/AliMUON2DMap.cxx +++ b/MUON/AliMUON2DMap.cxx @@ -21,9 +21,6 @@ #include "AliMUON2DMapIterator.h" #include "AliMUON2DMapIteratorByI.h" #include "AliMpExMap.h" -#include "AliMpManuList.h" -#include "AliMpDEManager.h" -#include "AliMpConstants.h" //----------------------------------------------------------------------------- /// \class AliMUON2DMap @@ -142,7 +139,7 @@ AliMUON2DMap::CreateIterator() const // Returned iterator must be deleted by user. if ( fMap ) { - return new AliMUON2DMapIterator(*fMap); + return new AliMUON2DMapIterator(fMap); } return 0x0; } @@ -171,12 +168,9 @@ AliMUON2DMap::Clear(Option_t*) if ( fOptimizeForDEManu ) { - Int_t nDEs(0); - for ( Int_t i = 0; i < AliMpConstants::NofChambers(); ++i ) - { - nDEs += AliMpDEManager::GetNofDEInChamber(i); - } - fMap->SetSize(nDEs); + fMap->SetSize(228); // hard-coded constant in order not to depend on mapping + // if this number ever change, it will not break the code, simply the + // automatic resizing will give a warning... } } @@ -224,23 +218,12 @@ AliMUON2DMap::Set(Int_t i, Int_t j, TObject* object, Bool_t replace) AliMpExMap* m = new AliMpExMap(true); if ( fOptimizeForDEManu ) { - Int_t n(AliMpManuList::NumberOfManus(i)); - if (!n) - { - AliError(Form("This does not look right : i = %d is supposed to " - "be a DetElemId with n = %d manus!",i,n)); - } - else - { - m->SetSize(n); - } + m->SetSize(451); // same remark as for the SetSize in ctor... } fMap->Add(i,m); o = fMap->GetValue(i); } AliMpExMap* m = static_cast(o); -// AliMpExMap* m = dynamic_cast(o); -// if (!m) AliFatal(Form("fMap[%d] not of the expected type",i)); o = m->GetValue(j); -- 2.39.3