]>
Commit | Line | Data |
---|---|---|
f6e5d0e9 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
16 | // $Id$ | |
17 | ||
18 | #include "AliMUON1DMap.h" | |
19 | ||
20 | #include "AliLog.h" | |
21 | #include "AliMpExMap.h" | |
22 | ||
23 | ClassImp(AliMUON1DMap) | |
24 | ||
25 | //_____________________________________________________________________________ | |
26 | AliMUON1DMap::AliMUON1DMap() : AliMUONV1DStore(), fMap(new AliMpExMap(true)) | |
27 | { | |
28 | } | |
29 | ||
30 | //_____________________________________________________________________________ | |
31 | AliMUON1DMap::~AliMUON1DMap() | |
32 | { | |
33 | delete fMap; | |
34 | } | |
35 | ||
36 | //_____________________________________________________________________________ | |
37 | TObject* | |
38 | AliMUON1DMap::Get(Int_t detElemId) const | |
39 | { | |
40 | return fMap->GetValue(detElemId); | |
41 | } | |
42 | ||
43 | //_____________________________________________________________________________ | |
44 | Bool_t | |
45 | AliMUON1DMap::IsOwner() const | |
46 | { | |
47 | return kTRUE; | |
48 | } | |
49 | ||
50 | //_____________________________________________________________________________ | |
51 | Bool_t | |
52 | AliMUON1DMap::Set(Int_t detElemId, TObject* object, Bool_t replace) | |
53 | { | |
54 | TObject* o = Get(detElemId); | |
55 | if ( o && !replace ) | |
56 | { | |
57 | AliError(Form("Object %p is already there for detElemId %d",o,detElemId)); | |
58 | return kFALSE; | |
59 | } | |
60 | if ( o && IsOwner() ) | |
61 | { | |
62 | delete o; | |
63 | } | |
64 | fMap->Add(detElemId,object); | |
65 | return kTRUE; | |
66 | } | |
67 | ||
68 | ||
69 | ||
70 | ||
71 |