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 // Class AliMpMotifPosition
20 // ------------------------
21 // Class that represents a placed motif.
22 // Included in AliRoot: 2003/05/02
23 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
25 #include "AliMpMotifPosition.h"
26 #include "AliMpMotifPositionPadIterator.h"
27 #include "AliMpMotifType.h"
29 #include <Riostream.h>
32 ClassImp(AliMpMotifPosition)
35 //______________________________________________________________________________
36 AliMpMotifPosition::AliMpMotifPosition(Int_t id, AliMpVMotif* motif,
43 /// Standard constructor
46 //______________________________________________________________________________
47 AliMpMotifPosition::AliMpMotifPosition()
51 fPosition(TVector2(0.,0.))
53 /// Default constructor
56 //______________________________________________________________________________
57 AliMpMotifPosition::~AliMpMotifPosition()\
62 //______________________________________________________________________________
63 AliMpVPadIterator* AliMpMotifPosition::CreateIterator() const
65 /// Return motif position iterator
67 return new AliMpMotifPositionPadIterator(this);
70 //______________________________________________________________________________
71 Bool_t AliMpMotifPosition::HasPad(const AliMpIntPair& indices) const
73 /// Return true if pad with the specified indices exists in
74 /// this motif position.
76 if (!HasIndices(indices)) return kFALSE;
78 if (fMotif->GetMotifType()->IsFull()) return kTRUE;
80 return fMotif->GetMotifType()->HasPad(indices-GetLowIndicesLimit());
83 //_____________________________________________________________________________
85 AliMpMotifPosition::SetID(Int_t id)
92 //_____________________________________________________________________________
94 AliMpMotifPosition::SetPosition(const TVector2& pos)
101 //_____________________________________________________________________________
103 AliMpMotifPosition::Print(Option_t* option) const
107 cout << "MOTIFPOSITION " << GetID() << " MOTIF "
108 << GetMotif()->GetID()
109 << " at (" << Position().X() << ","
110 << Position().Y() << ") "
111 << " iMin=(" << GetLowIndicesLimit().GetFirst()
112 << "," << GetLowIndicesLimit().GetSecond()
113 << ") iMax=(" << GetHighIndicesLimit().GetFirst()
114 << "," << GetHighIndicesLimit().GetSecond()
117 if ( option && option[0] == 'M' )
119 GetMotif()->Print(option+1);