]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpVIndexed.cxx
Code for MUON Station1 (I.Hrivnacova)
[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(AliMpIntPair lowLimit, AliMpIntPair highLimit)
16   : TObject(),
17     fLowIndicesLimit(lowLimit),
18     fHighIndicesLimit(highLimit) {
19 //
20 }
21
22 //_____________________________________________________________________________
23 AliMpVIndexed::AliMpVIndexed()
24   : TObject(),
25     fLowIndicesLimit(AliMpIntPair::Invalid()),
26     fHighIndicesLimit(AliMpIntPair::Invalid()) {
27 //
28 }
29
30 //_____________________________________________________________________________
31 AliMpVIndexed::~AliMpVIndexed(){
32 // 
33 }
34
35
36 //_____________________________________________________________________________
37 AliMpIntPair AliMpVIndexed::GlobalIndices(const AliMpIntPair& localIndices) const
38 {
39 // Returns the global indices corresponding to the given local indices.
40 // ---
41
42   return GetLowIndicesLimit()+localIndices;
43
44 }
45
46 //_____________________________________________________________________________
47 Bool_t AliMpVIndexed::HasIndices(const AliMpIntPair& indices) const
48 {
49 // Returns true in the specified indices are within the limits.
50 // ---
51   
52   return (indices.GetFirst()  >= fLowIndicesLimit.GetFirst() && 
53           indices.GetSecond() >= fLowIndicesLimit.GetSecond() && 
54           indices.GetFirst()  <= fHighIndicesLimit.GetFirst() && 
55           indices.GetSecond() <= fHighIndicesLimit.GetSecond() );
56 }  
57
58 //_____________________________________________________________________________
59 Bool_t AliMpVIndexed::HasValidIndices() const
60 {
61 // Returns true if both indices limits have valid values.
62 // ---
63   
64   return (fLowIndicesLimit.IsValid() && fHighIndicesLimit.IsValid() );
65 }          
66
67
68