1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 #include "AliMUON2DMap.h"
21 #include "AliMpExMap.h"
25 ClassImp(AliMUON2DMap)
27 //_____________________________________________________________________________
28 AliMUON2DMap::AliMUON2DMap() : AliMUONV2DStore(), fMap(new AliMpExMap(true))
35 //______________________________________________________________________________
36 AliMUON2DMap::AliMUON2DMap(const AliMUON2DMap& right)
37 : AliMUONV2DStore(right)
39 /// Protected copy constructor (not implemented)
41 AliFatal("Copy constructor not provided.");
44 //_____________________________________________________________________________
45 AliMUON2DMap::~AliMUON2DMap()
48 // dtor. we delete the map, which will delete the objects, as we're owner.
53 //______________________________________________________________________________
55 AliMUON2DMap::operator=(const AliMUON2DMap& right)
57 /// Protected assignement operator (not implemented)
59 // check assignement to self
60 if (this == &right) return *this;
62 AliFatal("Assignement operator not provided.");
67 //_____________________________________________________________________________
69 AliMUON2DMap::Get(Int_t i, Int_t j) const
72 // Return the value at position (i,j).
74 TObject* o = fMap->GetValue(i);
77 AliMpExMap* m = dynamic_cast<AliMpExMap*>(o);
78 if (!m) AliFatal(Form("fMap[%d] not of the expected type",i));
79 return m->GetValue(j);
84 //_____________________________________________________________________________
86 AliMUON2DMap::Print(Option_t*) const
89 // Not implemented (yet?)
93 //_____________________________________________________________________________
95 AliMUON2DMap::Set(Int_t i, Int_t j, TObject* object, Bool_t replace)
98 // Set the object at position (i,j).
99 // If replace==kTRUE, we don't care if there's an object there already,
100 // otherwise we might refuse to set if the (i,j) location is already
101 // filled (in which case we return kFALSE).
103 TObject* o = fMap->GetValue(i);
106 AliMpExMap* m = new AliMpExMap(true);
108 o = fMap->GetValue(i);
111 AliMpExMap* m = dynamic_cast<AliMpExMap*>(o);
112 if (!m) AliFatal(Form("fMap[%d] not of the expected type",i));
114 if ( !o || ( o && replace ) )
122 else if ( o && !replace )
124 AliError(Form("Object %p is already there for (i,j)=(%d,%d)",o,i,j));