]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpVIndexed.cxx
ab63706d732cf9b668dd7a798d66a8035f62a5b3
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpVIndexed.cxx
1 // $Id$
2 // Category: basic
3 //
4 // Class AliMpVIndexed
5 // -------------------
6 // Class that defines the limits of global pad indices.
7 //
8 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
9
10 #include "AliMpVIndexed.h"
11
12 ClassImp(AliMpVIndexed)
13
14 //_____________________________________________________________________________
15 AliMpVIndexed::AliMpVIndexed(const AliMpIntPair& lowLimit, 
16                              const AliMpIntPair& highLimit)
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