]>
Commit | Line | Data |
---|---|---|
5f91c9e8 | 1 | // $Id$ |
2 | // Category: basic | |
3 | // | |
4 | // Class AliMpVIndexed | |
5 | // ------------------- | |
6 | // Class that defines the limits of global pad indices. | |
dbe945cc | 7 | // Included in AliRoot: 2003/05/02 |
5f91c9e8 | 8 | // Authors: David Guez, Ivana Hrivnacova; IPN Orsay |
9 | ||
10 | #include "AliMpVIndexed.h" | |
11 | ||
12 | ClassImp(AliMpVIndexed) | |
13 | ||
14 | //_____________________________________________________________________________ | |
d1d8330f | 15 | AliMpVIndexed::AliMpVIndexed(const AliMpIntPair& lowLimit, |
16 | const AliMpIntPair& highLimit) | |
5f91c9e8 | 17 | : TObject(), |
18 | fLowIndicesLimit(lowLimit), | |
19 | fHighIndicesLimit(highLimit) { | |
20 | // | |
21 | } | |
22 | ||
23 | //_____________________________________________________________________________ | |
24 | AliMpVIndexed::AliMpVIndexed() | |
25 | : TObject(), | |
26 | fLowIndicesLimit(AliMpIntPair::Invalid()), | |
27 | fHighIndicesLimit(AliMpIntPair::Invalid()) { | |
28 | // | |
29 | } | |
30 | ||
31 | //_____________________________________________________________________________ | |
32 | AliMpVIndexed::~AliMpVIndexed(){ | |
33 | // | |
34 | } | |
35 | ||
36 | ||
37 | //_____________________________________________________________________________ | |
38 | AliMpIntPair AliMpVIndexed::GlobalIndices(const AliMpIntPair& localIndices) const | |
39 | { | |
40 | // Returns the global indices corresponding to the given local indices. | |
41 | // --- | |
42 | ||
43 | return GetLowIndicesLimit()+localIndices; | |
44 | ||
45 | } | |
46 | ||
47 | //_____________________________________________________________________________ | |
48 | Bool_t AliMpVIndexed::HasIndices(const AliMpIntPair& indices) const | |
49 | { | |
50 | // Returns true in the specified indices are within the limits. | |
51 | // --- | |
52 | ||
53 | return (indices.GetFirst() >= fLowIndicesLimit.GetFirst() && | |
54 | indices.GetSecond() >= fLowIndicesLimit.GetSecond() && | |
55 | indices.GetFirst() <= fHighIndicesLimit.GetFirst() && | |
56 | indices.GetSecond() <= fHighIndicesLimit.GetSecond() ); | |
57 | } | |
58 | ||
59 | //_____________________________________________________________________________ | |
60 | Bool_t AliMpVIndexed::HasValidIndices() const | |
61 | { | |
62 | // Returns true if both indices limits have valid values. | |
63 | // --- | |
64 | ||
65 | return (fLowIndicesLimit.IsValid() && fHighIndicesLimit.IsValid() ); | |
66 | } | |
67 | ||
68 | ||
69 |