]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpMotifPosition.cxx
- Reordering includes from most specific to more general ones
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpMotifPosition.cxx
CommitLineData
dee1d5f1 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
5f91c9e8 16// $Id$
2c605e66 17// $MpId: AliMpMotifPosition.cxx,v 1.8 2006/03/17 11:38:06 ivana Exp $
5f91c9e8 18//
dbe945cc 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
5f91c9e8 24
25#include "AliMpMotifPosition.h"
26#include "AliMpMotifPositionPadIterator.h"
27#include "AliMpMotifType.h"
2c605e66 28
29#include <Riostream.h>
5f91c9e8 30
31ClassImp(AliMpMotifPosition)
32
33//______________________________________________________________________________
34AliMpMotifPosition::AliMpMotifPosition(Int_t id, AliMpVMotif* motif,
35 TVector2 position)
36 : AliMpVIndexed(),
37 fID(id),
38 fMotif(motif),
dee1d5f1 39 fPosition(position)
40{
41/// Standard constructor
5f91c9e8 42}
43
44//______________________________________________________________________________
45AliMpMotifPosition::AliMpMotifPosition()
46 : AliMpVIndexed(),
47 fID(0),
48 fMotif(0),
dee1d5f1 49 fPosition(TVector2(0.,0.))
50{
51/// Default constructor
5f91c9e8 52}
53
fb1bf5c0 54//_____________________________________________________________________________
55AliMpMotifPosition::AliMpMotifPosition(const AliMpMotifPosition& right)
dee1d5f1 56 : AliMpVIndexed(right)
57{
58/// Protected copy constructor (not provided)
59
fb1bf5c0 60 Fatal("AliMpMotifPosition", "Copy constructor not provided.");
61}
62
5f91c9e8 63//______________________________________________________________________________
dee1d5f1 64AliMpMotifPosition::~AliMpMotifPosition()\
65{
66/// Destructor
5f91c9e8 67}
68
fb1bf5c0 69// operators
70
71//_____________________________________________________________________________
72AliMpMotifPosition&
73AliMpMotifPosition::operator=(const AliMpMotifPosition& right)
74{
dee1d5f1 75/// Protected assignment operator (not provided)
76
77 // check assignment to self
fb1bf5c0 78 if (this == &right) return *this;
79
dee1d5f1 80 Fatal("operator =", "Assignment operator not provided.");
fb1bf5c0 81
82 return *this;
83}
84
5f91c9e8 85//______________________________________________________________________________
86AliMpVPadIterator* AliMpMotifPosition::CreateIterator() const
87{
dee1d5f1 88/// Return motif position iterator
5f91c9e8 89
90 return new AliMpMotifPositionPadIterator(this);
91}
92
93//______________________________________________________________________________
94Bool_t AliMpMotifPosition::HasPad(const AliMpIntPair& indices) const
95{
dee1d5f1 96/// Return true if pad with the specified indices exists in
97/// this motif position.
5f91c9e8 98
99 if (!HasIndices(indices)) return kFALSE;
100
101 if (fMotif->GetMotifType()->IsFull()) return kTRUE;
102
103 return fMotif->GetMotifType()->HasPad(indices-GetLowIndicesLimit());
104}
105
dee1d5f1 106//_____________________________________________________________________________
107void
108AliMpMotifPosition::SetID(Int_t id)
109{
110/// Set ID
111
112 fID = id;
113}
114
115//_____________________________________________________________________________
116void
117AliMpMotifPosition::SetPosition(const TVector2& pos)
118{
119/// Set position
120
121 fPosition = pos;
122}
123
124//_____________________________________________________________________________
125void
126AliMpMotifPosition::Print(Option_t* option) const
127{
128/// Printing
129
2c605e66 130 cout << "MOTIFPOSITION " << GetID() << " MOTIF "
131 << GetMotif()->GetID()
132 << " at (" << Position().X() << ","
133 << Position().Y() << ") "
134 << " iMin=(" << GetLowIndicesLimit().GetFirst()
135 << "," << GetLowIndicesLimit().GetSecond()
136 << ") iMax=(" << GetHighIndicesLimit().GetFirst()
137 << "," << GetHighIndicesLimit().GetSecond()
138 << ")" << std::endl;
dee1d5f1 139
140 if ( option && option[0] == 'M' )
141 {
142 GetMotif()->Print(option+1);
143 }
144}