6 // Class that defines a motif with its unique ID
9 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
13 #include <Riostream.h>
15 #include "AliMpVMotif.h"
16 #include "AliMpMotifType.h"
17 #include "AliMpIntPair.h"
18 #include "AliMpConnection.h"
23 //_____________________________________________________________________________
24 AliMpVMotif::AliMpVMotif():
28 //default dummy constructor
31 //_____________________________________________________________________________
32 AliMpVMotif::AliMpVMotif(const TString &id, AliMpMotifType *motifType):
36 // Normal constructor.
37 // The dimension in a given direction is calculated by
38 // multiplying the total dimension by the number of pads
42 //_____________________________________________________________________________
44 AliMpVMotif::FindConnectionByLocalPos(const TVector2& localPos) const
46 // Return the local indices from the local
49 AliMpIntPair padIndices=PadIndicesLocal(localPos);
50 if (padIndices.GetFirst()>=0)
51 return fMotifType->FindConnectionByLocalIndices(padIndices);
55 //_____________________________________________________________________________
56 void AliMpVMotif::Print(Option_t *option) const
58 // Print the map of the motif. In each cel, the value
59 // printed depends of option, as the following:
60 // option="N" the "name" of the pad is written
61 // option="K" the Kapton connect. number attached to the pad is written
62 // option="B" the Berg connect. number attached to the pad is written
63 // option="X" the (X,Y) position, in cm, of the center of the pad is written
64 // otherwise the number of the pad is written
66 // NOTE : this method is really not optimized, in case 'N' or '',
67 // but the Print() this should not be very important in a Print() method
71 cout<<"(X,Y) mapping";
72 cout<<" in the motif "<<fID<<endl;
73 cout<<"-----------------------------------"<<endl;
74 for (Int_t j=fMotifType->GetNofPadsY()-1;j>=0;j--){
75 for (Int_t i=0;i<fMotifType->GetNofPadsX();i++){
76 AliMpIntPair indices = AliMpIntPair(i,j);
77 if (fMotifType->FindConnectionByLocalIndices(indices)){
78 TVector2 pos = PadPositionLocal(indices);
79 cout<<setw(11)<<Form("(%.1f,%.1f)",pos.X(),pos.Y());
84 } else fMotifType->Print(option);