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: AliMpMotifPosition.cxx,v 1.9 2006/05/24 13:58:41 ivana Exp $
19 //-----------------------------------------------------------------------------
20 // Class AliMpMotifPosition
21 // ------------------------
22 // Class that represents a placed motif.
23 // Included in AliRoot: 2003/05/02
24 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
25 //-----------------------------------------------------------------------------
27 #include "AliMpMotifPosition.h"
28 #include "AliMpMotifPositionPadIterator.h"
29 #include "AliMpMotifType.h"
31 #include <Riostream.h>
34 ClassImp(AliMpMotifPosition)
37 //______________________________________________________________________________
38 AliMpMotifPosition::AliMpMotifPosition(Int_t id, AliMpVMotif* motif,
45 /// Standard constructor
48 //______________________________________________________________________________
49 AliMpMotifPosition::AliMpMotifPosition()
53 fPosition(TVector2(0.,0.))
55 /// Default constructor
58 //______________________________________________________________________________
59 AliMpMotifPosition::~AliMpMotifPosition()
64 //______________________________________________________________________________
65 AliMpVPadIterator* AliMpMotifPosition::CreateIterator() const
67 /// Return motif position iterator
69 return new AliMpMotifPositionPadIterator(this);
72 //______________________________________________________________________________
73 Bool_t AliMpMotifPosition::HasPad(const AliMpIntPair& indices) const
75 /// Return true if pad with the specified indices exists in
76 /// this motif position.
78 if (!HasIndices(indices)) return kFALSE;
80 if (fMotif->GetMotifType()->IsFull()) return kTRUE;
82 return fMotif->GetMotifType()->HasPad(indices-GetLowIndicesLimit());
85 //_____________________________________________________________________________
87 AliMpMotifPosition::SetID(Int_t id)
94 //_____________________________________________________________________________
96 AliMpMotifPosition::SetPosition(const TVector2& pos)
103 //_____________________________________________________________________________
105 AliMpMotifPosition::Print(Option_t* option) const
109 cout << "MOTIFPOSITION " << GetID() << " MOTIF "
110 << GetMotif()->GetID()
111 << " at (" << Position().X() << ","
112 << Position().Y() << ") "
113 << " iMin=(" << GetLowIndicesLimit().GetFirst()
114 << "," << GetLowIndicesLimit().GetSecond()
115 << ") iMax=(" << GetHighIndicesLimit().GetFirst()
116 << "," << GetHighIndicesLimit().GetSecond()
119 if ( option && option[0] == 'M' )
121 GetMotif()->Print(option+1);