6 // Class that defines the limits of global pad indices.
8 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
10 #include "AliMpVIndexed.h"
12 ClassImp(AliMpVIndexed)
14 //_____________________________________________________________________________
15 AliMpVIndexed::AliMpVIndexed(const AliMpIntPair& lowLimit,
16 const AliMpIntPair& highLimit)
18 fLowIndicesLimit(lowLimit),
19 fHighIndicesLimit(highLimit) {
23 //_____________________________________________________________________________
24 AliMpVIndexed::AliMpVIndexed()
26 fLowIndicesLimit(AliMpIntPair::Invalid()),
27 fHighIndicesLimit(AliMpIntPair::Invalid()) {
31 //_____________________________________________________________________________
32 AliMpVIndexed::~AliMpVIndexed(){
37 //_____________________________________________________________________________
38 AliMpIntPair AliMpVIndexed::GlobalIndices(const AliMpIntPair& localIndices) const
40 // Returns the global indices corresponding to the given local indices.
43 return GetLowIndicesLimit()+localIndices;
47 //_____________________________________________________________________________
48 Bool_t AliMpVIndexed::HasIndices(const AliMpIntPair& indices) const
50 // Returns true in the specified indices are within the limits.
53 return (indices.GetFirst() >= fLowIndicesLimit.GetFirst() &&
54 indices.GetSecond() >= fLowIndicesLimit.GetSecond() &&
55 indices.GetFirst() <= fHighIndicesLimit.GetFirst() &&
56 indices.GetSecond() <= fHighIndicesLimit.GetSecond() );
59 //_____________________________________________________________________________
60 Bool_t AliMpVIndexed::HasValidIndices() const
62 // Returns true if both indices limits have valid values.
65 return (fLowIndicesLimit.IsValid() && fHighIndicesLimit.IsValid() );