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