]>
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 $ |
3d1463c8 | 18 | |
19 | //----------------------------------------------------------------------------- | |
dbe945cc | 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 | |
3d1463c8 | 25 | //----------------------------------------------------------------------------- |
5f91c9e8 | 26 | |
27 | #include "AliMpMotifPosition.h" | |
28 | #include "AliMpMotifPositionPadIterator.h" | |
29 | #include "AliMpMotifType.h" | |
2c605e66 | 30 | #include <Riostream.h> |
5f91c9e8 | 31 | |
b80faac0 | 32 | using std::cout; |
13985652 | 33 | /// \cond CLASSIMP |
5f91c9e8 | 34 | ClassImp(AliMpMotifPosition) |
13985652 | 35 | /// \endcond |
5f91c9e8 | 36 | |
37 | //______________________________________________________________________________ | |
38 | AliMpMotifPosition::AliMpMotifPosition(Int_t id, AliMpVMotif* motif, | |
6e97fbb8 | 39 | Double_t x, Double_t y) |
5f91c9e8 | 40 | : AliMpVIndexed(), |
41 | fID(id), | |
42 | fMotif(motif), | |
6e97fbb8 | 43 | fPositionX(x), |
44 | fPositionY(y) | |
dee1d5f1 | 45 | { |
46 | /// Standard constructor | |
5f91c9e8 | 47 | } |
48 | ||
49 | //______________________________________________________________________________ | |
50 | AliMpMotifPosition::AliMpMotifPosition() | |
51 | : AliMpVIndexed(), | |
52 | fID(0), | |
53 | fMotif(0), | |
6e97fbb8 | 54 | fPositionX(0.), |
55 | fPositionY(0.) | |
dee1d5f1 | 56 | { |
57 | /// Default constructor | |
5f91c9e8 | 58 | } |
59 | ||
60 | //______________________________________________________________________________ | |
586e5d9a | 61 | AliMpMotifPosition::~AliMpMotifPosition() |
dee1d5f1 | 62 | { |
63 | /// Destructor | |
5f91c9e8 | 64 | } |
65 | ||
66 | //______________________________________________________________________________ | |
67 | AliMpVPadIterator* AliMpMotifPosition::CreateIterator() const | |
68 | { | |
dee1d5f1 | 69 | /// Return motif position iterator |
5f91c9e8 | 70 | |
71 | return new AliMpMotifPositionPadIterator(this); | |
72 | } | |
73 | ||
74 | //______________________________________________________________________________ | |
168e9c4d | 75 | Bool_t AliMpMotifPosition::HasPadByIndices(MpPair_t indices) const |
5f91c9e8 | 76 | { |
dee1d5f1 | 77 | /// Return true if pad with the specified indices exists in |
78 | /// this motif position. | |
5f91c9e8 | 79 | |
168e9c4d | 80 | if ( ! HasIndices(indices) ) return kFALSE; |
5f91c9e8 | 81 | |
82 | if (fMotif->GetMotifType()->IsFull()) return kTRUE; | |
83 | ||
168e9c4d | 84 | return fMotif->GetMotifType()->HasPadByLocalIndices( |
85 | indices - GetLowIndicesLimit()); | |
3635f34f | 86 | } |
87 | ||
88 | //______________________________________________________________________________ | |
89 | Bool_t AliMpMotifPosition::HasPadByManuChannel(Int_t manuChannel) const | |
90 | { | |
91 | /// Return true if pad with the specified manuChannel exists in | |
92 | /// this motif position. | |
93 | ||
94 | return fMotif->GetMotifType()->HasPadByManuChannel(manuChannel); | |
5f91c9e8 | 95 | } |
96 | ||
dee1d5f1 | 97 | //_____________________________________________________________________________ |
98 | void | |
99 | AliMpMotifPosition::SetID(Int_t id) | |
100 | { | |
101 | /// Set ID | |
102 | ||
103 | fID = id; | |
104 | } | |
105 | ||
106 | //_____________________________________________________________________________ | |
107 | void | |
6e97fbb8 | 108 | AliMpMotifPosition::SetPosition(Double_t x, Double_t y) |
dee1d5f1 | 109 | { |
110 | /// Set position | |
111 | ||
6e97fbb8 | 112 | fPositionX = x; |
113 | fPositionY = y; | |
dee1d5f1 | 114 | } |
115 | ||
116 | //_____________________________________________________________________________ | |
117 | void | |
118 | AliMpMotifPosition::Print(Option_t* option) const | |
119 | { | |
120 | /// Printing | |
121 | ||
2c605e66 | 122 | cout << "MOTIFPOSITION " << GetID() << " MOTIF " |
123 | << GetMotif()->GetID() | |
6e97fbb8 | 124 | << " at (" << GetPositionX() << "," |
125 | << GetPositionY() << ") " | |
168e9c4d | 126 | << " iMin=(" << GetLowLimitIx() |
127 | << "," << GetLowLimitIy() | |
128 | << ") iMax=(" << GetHighLimitIx() | |
129 | << "," << GetHighLimitIy() | |
2c605e66 | 130 | << ")" << std::endl; |
dee1d5f1 | 131 | |
132 | if ( option && option[0] == 'M' ) | |
133 | { | |
134 | GetMotif()->Print(option+1); | |
135 | } | |
136 | } |