]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpMotifPosition.cxx
Be explicit with the kind of manus we are counting (Laurent)
[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$
13985652 17// $MpId: AliMpMotifPosition.cxx,v 1.9 2006/05/24 13:58:41 ivana Exp $
3d1463c8 18
19//-----------------------------------------------------------------------------
dbe945cc 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
3d1463c8 25//-----------------------------------------------------------------------------
5f91c9e8 26
27#include "AliMpMotifPosition.h"
28#include "AliMpMotifPositionPadIterator.h"
29#include "AliMpMotifType.h"
2c605e66 30
31#include <Riostream.h>
5f91c9e8 32
13985652 33/// \cond CLASSIMP
5f91c9e8 34ClassImp(AliMpMotifPosition)
13985652 35/// \endcond
5f91c9e8 36
37//______________________________________________________________________________
38AliMpMotifPosition::AliMpMotifPosition(Int_t id, AliMpVMotif* motif,
39 TVector2 position)
40 : AliMpVIndexed(),
41 fID(id),
42 fMotif(motif),
dee1d5f1 43 fPosition(position)
44{
45/// Standard constructor
5f91c9e8 46}
47
48//______________________________________________________________________________
49AliMpMotifPosition::AliMpMotifPosition()
50 : AliMpVIndexed(),
51 fID(0),
52 fMotif(0),
dee1d5f1 53 fPosition(TVector2(0.,0.))
54{
55/// Default constructor
5f91c9e8 56}
57
58//______________________________________________________________________________
586e5d9a 59AliMpMotifPosition::~AliMpMotifPosition()
dee1d5f1 60{
61/// Destructor
5f91c9e8 62}
63
64//______________________________________________________________________________
65AliMpVPadIterator* AliMpMotifPosition::CreateIterator() const
66{
dee1d5f1 67/// Return motif position iterator
5f91c9e8 68
69 return new AliMpMotifPositionPadIterator(this);
70}
71
72//______________________________________________________________________________
73Bool_t AliMpMotifPosition::HasPad(const AliMpIntPair& indices) const
74{
dee1d5f1 75/// Return true if pad with the specified indices exists in
76/// this motif position.
5f91c9e8 77
78 if (!HasIndices(indices)) return kFALSE;
79
80 if (fMotif->GetMotifType()->IsFull()) return kTRUE;
81
82 return fMotif->GetMotifType()->HasPad(indices-GetLowIndicesLimit());
83}
84
dee1d5f1 85//_____________________________________________________________________________
86void
87AliMpMotifPosition::SetID(Int_t id)
88{
89/// Set ID
90
91 fID = id;
92}
93
94//_____________________________________________________________________________
95void
96AliMpMotifPosition::SetPosition(const TVector2& pos)
97{
98/// Set position
99
100 fPosition = pos;
101}
102
103//_____________________________________________________________________________
104void
105AliMpMotifPosition::Print(Option_t* option) const
106{
107/// Printing
108
2c605e66 109 cout << "MOTIFPOSITION " << GetID() << " MOTIF "
110 << GetMotif()->GetID()
111 << " at (" << Position().X() << ","
112 << Position().Y() << ") "
113 << " iMin=(" << GetLowIndicesLimit().GetFirst()
114 << "," << GetLowIndicesLimit().GetSecond()
115 << ") iMax=(" << GetHighIndicesLimit().GetFirst()
116 << "," << GetHighIndicesLimit().GetSecond()
117 << ")" << std::endl;
dee1d5f1 118
119 if ( option && option[0] == 'M' )
120 {
121 GetMotif()->Print(option+1);
122 }
123}