]>
Commit | Line | Data |
---|---|---|
dee1d5f1 | 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 | ||
5f91c9e8 | 16 | // $Id$ |
13985652 | 17 | // $MpId: AliMpVIndexed.cxx,v 1.7 2006/05/24 13:58:29 ivana Exp $ |
5f91c9e8 | 18 | // Category: basic |
3d1463c8 | 19 | |
20 | //----------------------------------------------------------------------------- | |
5f91c9e8 | 21 | // Class AliMpVIndexed |
22 | // ------------------- | |
23 | // Class that defines the limits of global pad indices. | |
dbe945cc | 24 | // Included in AliRoot: 2003/05/02 |
5f91c9e8 | 25 | // Authors: David Guez, Ivana Hrivnacova; IPN Orsay |
3d1463c8 | 26 | //----------------------------------------------------------------------------- |
5f91c9e8 | 27 | |
28 | #include "AliMpVIndexed.h" | |
29 | ||
13985652 | 30 | /// \cond CLASSIMP |
5f91c9e8 | 31 | ClassImp(AliMpVIndexed) |
13985652 | 32 | /// \endcond |
5f91c9e8 | 33 | |
34 | //_____________________________________________________________________________ | |
d1d8330f | 35 | AliMpVIndexed::AliMpVIndexed(const AliMpIntPair& lowLimit, |
36 | const AliMpIntPair& highLimit) | |
5f91c9e8 | 37 | : TObject(), |
38 | fLowIndicesLimit(lowLimit), | |
dee1d5f1 | 39 | fHighIndicesLimit(highLimit) |
40 | { | |
41 | /// Standard constructor | |
5f91c9e8 | 42 | } |
43 | ||
44 | //_____________________________________________________________________________ | |
45 | AliMpVIndexed::AliMpVIndexed() | |
46 | : TObject(), | |
47 | fLowIndicesLimit(AliMpIntPair::Invalid()), | |
dee1d5f1 | 48 | fHighIndicesLimit(AliMpIntPair::Invalid()) |
49 | { | |
50 | /// Default constructor | |
5f91c9e8 | 51 | } |
52 | ||
53 | //_____________________________________________________________________________ | |
dee1d5f1 | 54 | AliMpVIndexed::~AliMpVIndexed() |
55 | { | |
56 | /// Destructor | |
5f91c9e8 | 57 | } |
58 | ||
59 | ||
60 | //_____________________________________________________________________________ | |
61 | AliMpIntPair AliMpVIndexed::GlobalIndices(const AliMpIntPair& localIndices) const | |
62 | { | |
dee1d5f1 | 63 | /// Return the global indices corresponding to the given local indices. |
5f91c9e8 | 64 | |
65 | return GetLowIndicesLimit()+localIndices; | |
66 | ||
67 | } | |
68 | ||
69 | //_____________________________________________________________________________ | |
70 | Bool_t AliMpVIndexed::HasIndices(const AliMpIntPair& indices) const | |
71 | { | |
dee1d5f1 | 72 | /// Return true in the specified indices are within the limits. |
5f91c9e8 | 73 | |
74 | return (indices.GetFirst() >= fLowIndicesLimit.GetFirst() && | |
75 | indices.GetSecond() >= fLowIndicesLimit.GetSecond() && | |
76 | indices.GetFirst() <= fHighIndicesLimit.GetFirst() && | |
77 | indices.GetSecond() <= fHighIndicesLimit.GetSecond() ); | |
78 | } | |
79 | ||
80 | //_____________________________________________________________________________ | |
81 | Bool_t AliMpVIndexed::HasValidIndices() const | |
82 | { | |
dee1d5f1 | 83 | /// Returns true if both indices limits have valid values. |
5f91c9e8 | 84 | |
85 | return (fLowIndicesLimit.IsValid() && fHighIndicesLimit.IsValid() ); | |
86 | } | |
87 | ||
88 | ||
89 |