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>
33 ClassImp(AliMpMotifPosition)
36 //______________________________________________________________________________
37 AliMpMotifPosition::AliMpMotifPosition(Int_t id, AliMpVMotif* motif,
38 Double_t x, Double_t y)
45 /// Standard constructor
48 //______________________________________________________________________________
49 AliMpMotifPosition::AliMpMotifPosition()
56 /// Default constructor
59 //______________________________________________________________________________
60 AliMpMotifPosition::~AliMpMotifPosition()
65 //______________________________________________________________________________
66 AliMpVPadIterator* AliMpMotifPosition::CreateIterator() const
68 /// Return motif position iterator
70 return new AliMpMotifPositionPadIterator(this);
73 //______________________________________________________________________________
74 Bool_t AliMpMotifPosition::HasPadByIndices(MpPair_t indices) const
76 /// Return true if pad with the specified indices exists in
77 /// this motif position.
79 if ( ! HasIndices(indices) ) return kFALSE;
81 if (fMotif->GetMotifType()->IsFull()) return kTRUE;
83 return fMotif->GetMotifType()->HasPadByLocalIndices(
84 indices - GetLowIndicesLimit());
87 //______________________________________________________________________________
88 Bool_t AliMpMotifPosition::HasPadByManuChannel(Int_t manuChannel) const
90 /// Return true if pad with the specified manuChannel exists in
91 /// this motif position.
93 return fMotif->GetMotifType()->HasPadByManuChannel(manuChannel);
96 //_____________________________________________________________________________
98 AliMpMotifPosition::SetID(Int_t id)
105 //_____________________________________________________________________________
107 AliMpMotifPosition::SetPosition(Double_t x, Double_t y)
115 //_____________________________________________________________________________
117 AliMpMotifPosition::Print(Option_t* option) const
121 cout << "MOTIFPOSITION " << GetID() << " MOTIF "
122 << GetMotif()->GetID()
123 << " at (" << GetPositionX() << ","
124 << GetPositionY() << ") "
125 << " iMin=(" << GetLowLimitIx()
126 << "," << GetLowLimitIy()
127 << ") iMax=(" << GetHighLimitIx()
128 << "," << GetHighLimitIy()
131 if ( option && option[0] == 'M' )
133 GetMotif()->Print(option+1);