AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMpVMotif.cxx
Go to the documentation of this file.
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: AliMpVMotif.cxx,v 1.9 2006/05/24 13:58:41 ivana Exp $
18 // Category: motif
19 
20 //-----------------------------------------------------------------------------
21 // Class AliMpVMotif
22 // -----------------
23 // Class that defines a motif with its unique ID
24 // and the motif type.
25 // Included in AliRoot: 2003/05/02
26 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
27 //-----------------------------------------------------------------------------
28 
29 #include "AliMpVMotif.h"
30 #include "AliMpMotifType.h"
31 #include "AliMpEncodePair.h"
32 #include "AliMpConnection.h"
33 
34 #include <Riostream.h>
35 
36 #include <iomanip>
37 
38 using std::cout;
39 using std::endl;
40 using std::setw;
44 
45 //_____________________________________________________________________________
47  fID(""),
48  fMotifType(0)
49 {
51 }
52 
53 //_____________________________________________________________________________
54 AliMpVMotif::AliMpVMotif(const TString &id, AliMpMotifType *motifType):
55  fID(id),
56  fMotifType(motifType)
57 {
61 
62 }
63 
64 //_____________________________________________________________________________
66 {
68 }
69 
70 //_____________________________________________________________________________
72 AliMpVMotif::FindConnectionByLocalPos(Double_t localPosX, Double_t localPosY) const
73 {
76 
77  MpPair_t padIndices = PadIndicesLocal(localPosX, localPosY);
78  if ( padIndices > 0 )
79  return fMotifType->FindConnectionByLocalIndices(padIndices);
80  else
81  return 0;
82 }
83 
84 //_____________________________________________________________________________
85 void AliMpVMotif::Print(Option_t *option) const
86 {
97 
98  if (option[0]=='X') {
99 
100  cout<<"(X,Y) mapping";
101  cout<<" in the motif "<<fID<<endl;
102  cout<<"-----------------------------------"<<endl;
103  for (Int_t j=fMotifType->GetNofPadsY()-1;j>=0;j--){
104  for (Int_t i=0;i<fMotifType->GetNofPadsX();i++){
106  Double_t posx, posy;
107  PadPositionLocal(i,j, posx, posy);
108  cout<<setw(11)<<Form("(%.1f,%.1f)",posx,posy);
109  }
110  }
111  cout<<endl;
112  }
113  } else fMotifType->Print(option);
114 }
A connection properties.
TString fID
identifier
Definition: AliMpVMotif.h:78
virtual ~AliMpVMotif()
Definition: AliMpVMotif.cxx:65
AliMpConnection * FindConnectionByLocalIndices(MpPair_t localIndices) const
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Int_t GetNofPadsX() const
Return number of pads in x direction.
Int_t GetNofPadsY() const
Return number of pads in y direction.
virtual MpPair_t PadIndicesLocal(Double_t localPosX, Double_t localPosY) const =0
Return local indices of the pad specified by local position.
virtual void PadPositionLocal(MpPair_t localIndices, Double_t &posx, Double_t &posy) const =0
Fill local position of the pad specified by local indices.
virtual void Print(Option_t *option="") const
Abstract base class for a motif with its unique ID and the motif type.
Definition: AliMpVMotif.h:24
Int_t MpPair_t
AliMpConnection * FindConnectionByLocalPos(Double_t localPosX, Double_t localPosY) const
Definition: AliMpVMotif.cxx:72
virtual void Print(Option_t *option) const
Definition: AliMpVMotif.cxx:85
AliMpMotifType * fMotifType
the motif type
Definition: AliMpVMotif.h:79
Class that defines the motif properties.