]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpVMotif.cxx
Extra comma and CtrlM removed (Sun,HP)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpVMotif.cxx
CommitLineData
5f91c9e8 1// $Id$
2// Category: motif
3///
4// Class AliMpVMotif
5// -----------------
6// Class that defines a motif with its unique ID
7// and the motif type.
8//
9// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
10
11#include <iomanip>
12
13#include <Riostream.h>
14
15#include "AliMpVMotif.h"
16#include "AliMpMotifType.h"
17#include "AliMpIntPair.h"
18#include "AliMpConnection.h"
19
20
21ClassImp(AliMpVMotif)
22
23//_____________________________________________________________________________
24AliMpVMotif::AliMpVMotif():
25 fID(""),
26 fMotifType(0)
27{
28 //default dummy constructor
29}
30
31//_____________________________________________________________________________
32AliMpVMotif::AliMpVMotif(const TString &id, AliMpMotifType *motifType):
33 fID(id),
34 fMotifType(motifType)
35{
36 // Normal constructor.
37 // The dimension in a given direction is calculated by
38 // multiplying the total dimension by the number of pads
39
40}
41
2998a151 42//_____________________________________________________________________________
43AliMpVMotif::~AliMpVMotif()
44{
45 // destructor
46}
47
5f91c9e8 48//_____________________________________________________________________________
49AliMpConnection*
50AliMpVMotif::FindConnectionByLocalPos(const TVector2& localPos) const
51{
52 // Return the local indices from the local
53 // (x,y) position
54
55 AliMpIntPair padIndices=PadIndicesLocal(localPos);
56 if (padIndices.GetFirst()>=0)
57 return fMotifType->FindConnectionByLocalIndices(padIndices);
58 else
59 return 0;
60}
61//_____________________________________________________________________________
62void AliMpVMotif::Print(Option_t *option) const
63{
64 // Print the map of the motif. In each cel, the value
65 // printed depends of option, as the following:
66 // option="N" the "name" of the pad is written
67 // option="K" the Kapton connect. number attached to the pad is written
68 // option="B" the Berg connect. number attached to the pad is written
69 // option="X" the (X,Y) position, in cm, of the center of the pad is written
70 // otherwise the number of the pad is written
71
72 // NOTE : this method is really not optimized, in case 'N' or '',
73 // but the Print() this should not be very important in a Print() method
74
75 if (option[0]=='X') {
76
77 cout<<"(X,Y) mapping";
78 cout<<" in the motif "<<fID<<endl;
79 cout<<"-----------------------------------"<<endl;
80 for (Int_t j=fMotifType->GetNofPadsY()-1;j>=0;j--){
81 for (Int_t i=0;i<fMotifType->GetNofPadsX();i++){
82 AliMpIntPair indices = AliMpIntPair(i,j);
83 if (fMotifType->FindConnectionByLocalIndices(indices)){
84 TVector2 pos = PadPositionLocal(indices);
85 cout<<setw(11)<<Form("(%.1f,%.1f)",pos.X(),pos.Y());
86 }
87 }
88 cout<<endl;
89 }
90 } else fMotifType->Print(option);
91}
92
93