AliRoot Core  3abf5b4 (3abf5b4)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMpMotifPosition.cxx
Go to the documentation of this file.
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 
16 // $Id$
17 // $MpId: AliMpMotifPosition.cxx,v 1.9 2006/05/24 13:58:41 ivana Exp $
18 
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 //-----------------------------------------------------------------------------
26 
27 #include "AliMpMotifPosition.h"
29 #include "AliMpMotifType.h"
30 #include <Riostream.h>
31 
32 using std::cout;
36 
37 //______________________________________________________________________________
39  Double_t x, Double_t y)
40  : AliMpVIndexed(),
41  fID(id),
42  fMotif(motif),
43  fPositionX(x),
44  fPositionY(y)
45 {
47 }
48 
49 //______________________________________________________________________________
51  : AliMpVIndexed(),
52  fID(0),
53  fMotif(0),
54  fPositionX(0.),
55  fPositionY(0.)
56 {
58 }
59 
60 //______________________________________________________________________________
62 {
64 }
65 
66 //______________________________________________________________________________
68 {
70 
71  return new AliMpMotifPositionPadIterator(this);
72 }
73 
74 //______________________________________________________________________________
76 {
79 
80  if ( ! HasIndices(indices) ) return kFALSE;
81 
82  if (fMotif->GetMotifType()->IsFull()) return kTRUE;
83 
85  indices - GetLowIndicesLimit());
86 }
87 
88 //______________________________________________________________________________
89 Bool_t AliMpMotifPosition::HasPadByManuChannel(Int_t manuChannel) const
90 {
93 
94  return fMotif->GetMotifType()->HasPadByManuChannel(manuChannel);
95 }
96 
97 //_____________________________________________________________________________
98 void
100 {
102 
103  fID = id;
104 }
105 
106 //_____________________________________________________________________________
107 void
108 AliMpMotifPosition::SetPosition(Double_t x, Double_t y)
109 {
111 
112  fPositionX = x;
113  fPositionY = y;
114 }
115 
116 //_____________________________________________________________________________
117 void
118 AliMpMotifPosition::Print(Option_t* option) const
119 {
121 
122  cout << "MOTIFPOSITION " << GetID() << " MOTIF "
123  << GetMotif()->GetID()
124  << " at (" << GetPositionX() << ","
125  << GetPositionY() << ") "
126  << " iMin=(" << GetLowLimitIx()
127  << "," << GetLowLimitIy()
128  << ") iMax=(" << GetHighLimitIx()
129  << "," << GetHighLimitIy()
130  << ")" << std::endl;
131 
132  if ( option && option[0] == 'M' )
133  {
134  GetMotif()->Print(option+1);
135  }
136 }
Double_t GetPositionY() const
Return y position.
Double_t fPositionY
y position
Int_t GetLowLimitIx() const
Bool_t HasIndices(MpPair_t indices) const
Int_t GetLowLimitIy() const
Int_t GetHighLimitIy() const
Bool_t HasPadByIndices(MpPair_t indices) const
AliMpMotifType * GetMotifType() const
Return the motif type.
Definition: AliMpVMotif.h:87
void SetPosition(Double_t x, Double_t y)
Base class that defines the limits of global pad indices.
Definition: AliMpVIndexed.h:22
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Int_t GetID() const
Return motif position ID = manu id.
TString GetID() const
Return the motif identifier.
Definition: AliMpVMotif.h:90
A placed motif.
Bool_t HasPadByLocalIndices(MpPair_t localIndices) const
Bool_t HasPadByManuChannel(Int_t manuChannel) const
An interface for an iterator over pads.
MpPair_t GetLowIndicesLimit() const
AliMpVMotif * GetMotif() const
Return motif.
virtual AliMpVPadIterator * CreateIterator() const
Create iterator over this element.
Int_t fID
identifier=manu id
An iterator over the pads of a given motif position.
Abstract base class for a motif with its unique ID and the motif type.
Definition: AliMpVMotif.h:24
Int_t MpPair_t
void Print(Option_t *option="") const
Double_t GetPositionX() const
Return x position.
AliMpVMotif * fMotif
motif
Int_t GetHighLimitIx() const
Bool_t IsFull() const
Return true if the motif conatins all pads.
Bool_t HasPadByManuChannel(Int_t manuChannel) const
virtual void Print(Option_t *option) const
Definition: AliMpVMotif.cxx:85
Double_t fPositionX
x position