]>
Commit | Line | Data |
---|---|---|
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: AliMpVMotif.cxx,v 1.9 2006/05/24 13:58:41 ivana Exp $ |
5f91c9e8 | 18 | // Category: motif |
19 | /// | |
20 | // Class AliMpVMotif | |
21 | // ----------------- | |
22 | // Class that defines a motif with its unique ID | |
23 | // and the motif type. | |
dbe945cc | 24 | // Included in AliRoot: 2003/05/02 |
5f91c9e8 | 25 | // Authors: David Guez, Ivana Hrivnacova; IPN Orsay |
26 | ||
5f91c9e8 | 27 | #include "AliMpVMotif.h" |
28 | #include "AliMpMotifType.h" | |
29 | #include "AliMpIntPair.h" | |
30 | #include "AliMpConnection.h" | |
31 | ||
2c605e66 | 32 | #include <Riostream.h> |
33 | ||
34 | #include <iomanip> | |
35 | ||
13985652 | 36 | /// \cond CLASSIMP |
5f91c9e8 | 37 | ClassImp(AliMpVMotif) |
13985652 | 38 | /// \endcond |
5f91c9e8 | 39 | |
40 | //_____________________________________________________________________________ | |
41 | AliMpVMotif::AliMpVMotif(): | |
42 | fID(""), | |
43 | fMotifType(0) | |
44 | { | |
dee1d5f1 | 45 | /// Default constructor |
5f91c9e8 | 46 | } |
47 | ||
48 | //_____________________________________________________________________________ | |
49 | AliMpVMotif::AliMpVMotif(const TString &id, AliMpMotifType *motifType): | |
50 | fID(id), | |
51 | fMotifType(motifType) | |
52 | { | |
dee1d5f1 | 53 | /// Standard constructor. |
54 | /// The dimension in a given direction is calculated by | |
55 | /// multiplying the total dimension by the number of pads | |
5f91c9e8 | 56 | |
57 | } | |
58 | ||
2998a151 | 59 | //_____________________________________________________________________________ |
60 | AliMpVMotif::~AliMpVMotif() | |
61 | { | |
dee1d5f1 | 62 | /// Destructor |
2998a151 | 63 | } |
64 | ||
5f91c9e8 | 65 | //_____________________________________________________________________________ |
66 | AliMpConnection* | |
67 | AliMpVMotif::FindConnectionByLocalPos(const TVector2& localPos) const | |
68 | { | |
dee1d5f1 | 69 | /// Return the local indices from the local |
70 | /// (x,y) position | |
5f91c9e8 | 71 | |
72 | AliMpIntPair padIndices=PadIndicesLocal(localPos); | |
73 | if (padIndices.GetFirst()>=0) | |
74 | return fMotifType->FindConnectionByLocalIndices(padIndices); | |
75 | else | |
76 | return 0; | |
77 | } | |
78 | //_____________________________________________________________________________ | |
79 | void AliMpVMotif::Print(Option_t *option) const | |
80 | { | |
dee1d5f1 | 81 | /// Print the map of the motif. In each cel, the value |
82 | /// printed depends of option, as the following: | |
83 | /// - option="N" the "name" of the pad is written | |
84 | /// - option="K" the Kapton connect. number attached to the pad is written | |
85 | /// - option="B" the Berg connect. number attached to the pad is written | |
86 | /// - option="X" the (X,Y) position, in cm, of the center of the pad is written | |
87 | /// otherwise the number of the pad is written | |
88 | /// | |
89 | /// NOTE : this method is really not optimized, in case 'N' or '', | |
90 | /// but the Print() this should not be very important in a Print() method | |
5f91c9e8 | 91 | |
92 | if (option[0]=='X') { | |
93 | ||
94 | cout<<"(X,Y) mapping"; | |
95 | cout<<" in the motif "<<fID<<endl; | |
96 | cout<<"-----------------------------------"<<endl; | |
97 | for (Int_t j=fMotifType->GetNofPadsY()-1;j>=0;j--){ | |
98 | for (Int_t i=0;i<fMotifType->GetNofPadsX();i++){ | |
99 | AliMpIntPair indices = AliMpIntPair(i,j); | |
100 | if (fMotifType->FindConnectionByLocalIndices(indices)){ | |
101 | TVector2 pos = PadPositionLocal(indices); | |
102 | cout<<setw(11)<<Form("(%.1f,%.1f)",pos.X(),pos.Y()); | |
103 | } | |
104 | } | |
105 | cout<<endl; | |
106 | } | |
107 | } else fMotifType->Print(option); | |
108 | } | |
109 | ||
110 |