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