]>
Commit | Line | Data |
---|---|---|
dee1d5f1 | 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 | ||
5f91c9e8 | 16 | // $Id$ |
13985652 | 17 | // $MpId: AliMpMotifPosition.cxx,v 1.9 2006/05/24 13:58:41 ivana Exp $ |
5f91c9e8 | 18 | // |
dbe945cc | 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 | |
5f91c9e8 | 24 | |
25 | #include "AliMpMotifPosition.h" | |
26 | #include "AliMpMotifPositionPadIterator.h" | |
27 | #include "AliMpMotifType.h" | |
2c605e66 | 28 | |
29 | #include <Riostream.h> | |
5f91c9e8 | 30 | |
13985652 | 31 | /// \cond CLASSIMP |
5f91c9e8 | 32 | ClassImp(AliMpMotifPosition) |
13985652 | 33 | /// \endcond |
5f91c9e8 | 34 | |
35 | //______________________________________________________________________________ | |
36 | AliMpMotifPosition::AliMpMotifPosition(Int_t id, AliMpVMotif* motif, | |
37 | TVector2 position) | |
38 | : AliMpVIndexed(), | |
39 | fID(id), | |
40 | fMotif(motif), | |
dee1d5f1 | 41 | fPosition(position) |
42 | { | |
43 | /// Standard constructor | |
5f91c9e8 | 44 | } |
45 | ||
46 | //______________________________________________________________________________ | |
47 | AliMpMotifPosition::AliMpMotifPosition() | |
48 | : AliMpVIndexed(), | |
49 | fID(0), | |
50 | fMotif(0), | |
dee1d5f1 | 51 | fPosition(TVector2(0.,0.)) |
52 | { | |
53 | /// Default constructor | |
5f91c9e8 | 54 | } |
55 | ||
56 | //______________________________________________________________________________ | |
586e5d9a | 57 | AliMpMotifPosition::~AliMpMotifPosition() |
dee1d5f1 | 58 | { |
59 | /// Destructor | |
5f91c9e8 | 60 | } |
61 | ||
62 | //______________________________________________________________________________ | |
63 | AliMpVPadIterator* AliMpMotifPosition::CreateIterator() const | |
64 | { | |
dee1d5f1 | 65 | /// Return motif position iterator |
5f91c9e8 | 66 | |
67 | return new AliMpMotifPositionPadIterator(this); | |
68 | } | |
69 | ||
70 | //______________________________________________________________________________ | |
71 | Bool_t AliMpMotifPosition::HasPad(const AliMpIntPair& indices) const | |
72 | { | |
dee1d5f1 | 73 | /// Return true if pad with the specified indices exists in |
74 | /// this motif position. | |
5f91c9e8 | 75 | |
76 | if (!HasIndices(indices)) return kFALSE; | |
77 | ||
78 | if (fMotif->GetMotifType()->IsFull()) return kTRUE; | |
79 | ||
80 | return fMotif->GetMotifType()->HasPad(indices-GetLowIndicesLimit()); | |
81 | } | |
82 | ||
dee1d5f1 | 83 | //_____________________________________________________________________________ |
84 | void | |
85 | AliMpMotifPosition::SetID(Int_t id) | |
86 | { | |
87 | /// Set ID | |
88 | ||
89 | fID = id; | |
90 | } | |
91 | ||
92 | //_____________________________________________________________________________ | |
93 | void | |
94 | AliMpMotifPosition::SetPosition(const TVector2& pos) | |
95 | { | |
96 | /// Set position | |
97 | ||
98 | fPosition = pos; | |
99 | } | |
100 | ||
101 | //_____________________________________________________________________________ | |
102 | void | |
103 | AliMpMotifPosition::Print(Option_t* option) const | |
104 | { | |
105 | /// Printing | |
106 | ||
2c605e66 | 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() | |
115 | << ")" << std::endl; | |
dee1d5f1 | 116 | |
117 | if ( option && option[0] == 'M' ) | |
118 | { | |
119 | GetMotif()->Print(option+1); | |
120 | } | |
121 | } |