1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 // $MpId: AliMpVIndexed.cxx,v 1.6 2005/08/26 15:43:36 ivana Exp $
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
26 #include "AliMpVIndexed.h"
28 ClassImp(AliMpVIndexed)
30 //_____________________________________________________________________________
31 AliMpVIndexed::AliMpVIndexed(const AliMpIntPair& lowLimit,
32 const AliMpIntPair& highLimit)
34 fLowIndicesLimit(lowLimit),
35 fHighIndicesLimit(highLimit)
37 /// Standard constructor
40 //_____________________________________________________________________________
41 AliMpVIndexed::AliMpVIndexed()
43 fLowIndicesLimit(AliMpIntPair::Invalid()),
44 fHighIndicesLimit(AliMpIntPair::Invalid())
46 /// Default constructor
49 //_____________________________________________________________________________
50 AliMpVIndexed::~AliMpVIndexed()
56 //_____________________________________________________________________________
57 AliMpIntPair AliMpVIndexed::GlobalIndices(const AliMpIntPair& localIndices) const
59 /// Return the global indices corresponding to the given local indices.
61 return GetLowIndicesLimit()+localIndices;
65 //_____________________________________________________________________________
66 Bool_t AliMpVIndexed::HasIndices(const AliMpIntPair& indices) const
68 /// Return true in the specified indices are within the limits.
70 return (indices.GetFirst() >= fLowIndicesLimit.GetFirst() &&
71 indices.GetSecond() >= fLowIndicesLimit.GetSecond() &&
72 indices.GetFirst() <= fHighIndicesLimit.GetFirst() &&
73 indices.GetSecond() <= fHighIndicesLimit.GetSecond() );
76 //_____________________________________________________________________________
77 Bool_t AliMpVIndexed::HasValidIndices() const
79 /// Returns true if both indices limits have valid values.
81 return (fLowIndicesLimit.IsValid() && fHighIndicesLimit.IsValid() );