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.7 2005/08/26 15:43:36 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
27 #include "AliMpMotifPosition.h"
28 #include "AliMpMotifPositionPadIterator.h"
29 #include "AliMpMotifType.h"
32 ClassImp(AliMpMotifPosition)
34 //______________________________________________________________________________
35 AliMpMotifPosition::AliMpMotifPosition(Int_t id, AliMpVMotif* motif,
42 /// Standard constructor
45 //______________________________________________________________________________
46 AliMpMotifPosition::AliMpMotifPosition()
50 fPosition(TVector2(0.,0.))
52 /// Default constructor
55 //_____________________________________________________________________________
56 AliMpMotifPosition::AliMpMotifPosition(const AliMpMotifPosition& right)
57 : AliMpVIndexed(right)
59 /// Protected copy constructor (not provided)
61 Fatal("AliMpMotifPosition", "Copy constructor not provided.");
64 //______________________________________________________________________________
65 AliMpMotifPosition::~AliMpMotifPosition()\
72 //_____________________________________________________________________________
74 AliMpMotifPosition::operator=(const AliMpMotifPosition& right)
76 /// Protected assignment operator (not provided)
78 // check assignment to self
79 if (this == &right) return *this;
81 Fatal("operator =", "Assignment operator not provided.");
86 //______________________________________________________________________________
87 AliMpVPadIterator* AliMpMotifPosition::CreateIterator() const
89 /// Return motif position iterator
91 return new AliMpMotifPositionPadIterator(this);
94 //______________________________________________________________________________
95 Bool_t AliMpMotifPosition::HasPad(const AliMpIntPair& indices) const
97 /// Return true if pad with the specified indices exists in
98 /// this motif position.
100 if (!HasIndices(indices)) return kFALSE;
102 if (fMotif->GetMotifType()->IsFull()) return kTRUE;
104 return fMotif->GetMotifType()->HasPad(indices-GetLowIndicesLimit());
107 //_____________________________________________________________________________
109 AliMpMotifPosition::SetID(Int_t id)
116 //_____________________________________________________________________________
118 AliMpMotifPosition::SetPosition(const TVector2& pos)
125 //_____________________________________________________________________________
127 AliMpMotifPosition::Print(Option_t* option) const
131 std::cout << "MOTIFPOSITION " << GetID() << " MOTIF "
132 << GetMotif()->GetID()
133 << " at (" << Position().X() << ","
134 << Position().Y() << ") "
135 << " iMin=(" << GetLowIndicesLimit().GetFirst()
136 << "," << GetLowIndicesLimit().GetSecond()
137 << ") iMax=(" << GetHighIndicesLimit().GetFirst()
138 << "," << GetHighIndicesLimit().GetSecond()
141 if ( option && option[0] == 'M' )
143 GetMotif()->Print(option+1);