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"
30 #include <Riostream.h>
34 ClassImp(AliMpMotifPosition)
37 //______________________________________________________________________________
38 AliMpMotifPosition::AliMpMotifPosition(Int_t id, AliMpVMotif* motif,
39 Double_t x, Double_t y)
46 /// Standard constructor
49 //______________________________________________________________________________
50 AliMpMotifPosition::AliMpMotifPosition()
57 /// Default constructor
60 //______________________________________________________________________________
61 AliMpMotifPosition::~AliMpMotifPosition()
66 //______________________________________________________________________________
67 AliMpVPadIterator* AliMpMotifPosition::CreateIterator() const
69 /// Return motif position iterator
71 return new AliMpMotifPositionPadIterator(this);
74 //______________________________________________________________________________
75 Bool_t AliMpMotifPosition::HasPadByIndices(MpPair_t indices) const
77 /// Return true if pad with the specified indices exists in
78 /// this motif position.
80 if ( ! HasIndices(indices) ) return kFALSE;
82 if (fMotif->GetMotifType()->IsFull()) return kTRUE;
84 return fMotif->GetMotifType()->HasPadByLocalIndices(
85 indices - GetLowIndicesLimit());
88 //______________________________________________________________________________
89 Bool_t AliMpMotifPosition::HasPadByManuChannel(Int_t manuChannel) const
91 /// Return true if pad with the specified manuChannel exists in
92 /// this motif position.
94 return fMotif->GetMotifType()->HasPadByManuChannel(manuChannel);
97 //_____________________________________________________________________________
99 AliMpMotifPosition::SetID(Int_t id)
106 //_____________________________________________________________________________
108 AliMpMotifPosition::SetPosition(Double_t x, Double_t y)
116 //_____________________________________________________________________________
118 AliMpMotifPosition::Print(Option_t* option) const
122 cout << "MOTIFPOSITION " << GetID() << " MOTIF "
123 << GetMotif()->GetID()
124 << " at (" << GetPositionX() << ","
125 << GetPositionY() << ") "
126 << " iMin=(" << GetLowLimitIx()
127 << "," << GetLowLimitIy()
128 << ") iMax=(" << GetHighLimitIx()
129 << "," << GetHighLimitIy()
132 if ( option && option[0] == 'M' )
134 GetMotif()->Print(option+1);