]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpMotifPosition.cxx
Work around for CINT bug in root 5.10/00, with gcc4.0.2
[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.7 2005/08/26 15:43:36 ivana Exp $
18 //
19 // Class AliMpMotifPosition
20 // ------------------------
21 // Class that represents a placed motif.
22 // Included in AliRoot: 2003/05/02
23 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
24
25 #include <TError.h>
26
27 #include "AliMpMotifPosition.h"
28 #include "AliMpMotifPositionPadIterator.h"
29 #include "AliMpMotifType.h"
30 #include <iostream>
31
32 ClassImp(AliMpMotifPosition)
33
34 //______________________________________________________________________________
35 AliMpMotifPosition::AliMpMotifPosition(Int_t id, AliMpVMotif* motif, 
36                                        TVector2 position)
37   : AliMpVIndexed(),
38     fID(id),
39     fMotif(motif),
40     fPosition(position) 
41 {
42 /// Standard constructor
43 }
44
45 //______________________________________________________________________________
46 AliMpMotifPosition::AliMpMotifPosition()
47   : AliMpVIndexed(), 
48     fID(0),
49     fMotif(0),
50     fPosition(TVector2(0.,0.)) 
51 {
52 /// Default constructor
53 }
54
55 //_____________________________________________________________________________
56 AliMpMotifPosition::AliMpMotifPosition(const AliMpMotifPosition& right) 
57   : AliMpVIndexed(right) 
58 {
59 /// Protected copy constructor (not provided)
60
61   Fatal("AliMpMotifPosition", "Copy constructor not provided.");
62 }
63
64 //______________________________________________________________________________
65 AliMpMotifPosition::~AliMpMotifPosition()\
66 {
67 /// Destructor 
68 }
69
70 // operators
71
72 //_____________________________________________________________________________
73 AliMpMotifPosition& 
74 AliMpMotifPosition::operator=(const AliMpMotifPosition& right)
75 {
76 /// Protected assignment operator (not provided)
77
78   // check assignment to self
79   if (this == &right) return *this;
80
81   Fatal("operator =", "Assignment operator not provided.");
82     
83   return *this;  
84 }    
85
86 //______________________________________________________________________________
87 AliMpVPadIterator* AliMpMotifPosition::CreateIterator() const
88 {
89 /// Return motif position iterator
90
91   return new AliMpMotifPositionPadIterator(this);
92 }  
93
94 //______________________________________________________________________________
95 Bool_t AliMpMotifPosition::HasPad(const AliMpIntPair& indices) const
96 {
97 /// Return true if pad with the specified indices exists in 
98 /// this motif position.
99
100   if (!HasIndices(indices)) return kFALSE;
101   
102   if (fMotif->GetMotifType()->IsFull()) return kTRUE;
103   
104   return fMotif->GetMotifType()->HasPad(indices-GetLowIndicesLimit());
105 }
106
107 //_____________________________________________________________________________
108 void
109 AliMpMotifPosition::SetID(Int_t id)
110 {
111 /// Set ID
112
113   fID = id;
114 }
115
116 //_____________________________________________________________________________
117 void
118 AliMpMotifPosition::SetPosition(const TVector2& pos)
119 {
120 /// Set position
121
122   fPosition = pos;
123 }
124
125 //_____________________________________________________________________________
126 void
127 AliMpMotifPosition::Print(Option_t* option) const
128 {
129 /// Printing
130
131   std::cout << "MOTIFPOSITION " << GetID() << " MOTIF " 
132             << GetMotif()->GetID()
133             << " at (" << Position().X() << "," 
134             << Position().Y() << ") "
135             << " iMin=(" << GetLowIndicesLimit().GetFirst()
136             << "," << GetLowIndicesLimit().GetSecond()
137             << ") iMax=(" << GetHighIndicesLimit().GetFirst()
138             << "," << GetHighIndicesLimit().GetSecond()
139             << ")" << std::endl;
140
141   if ( option && option[0] == 'M' )
142     {
143       GetMotif()->Print(option+1);
144     }
145 }