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