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 //_____________________________________________________________________________
43 AliMpVMotif::~AliMpVMotif()
48 //_____________________________________________________________________________
50 AliMpVMotif::FindConnectionByLocalPos(const TVector2& localPos) const
52 // Return the local indices from the local
55 AliMpIntPair padIndices=PadIndicesLocal(localPos);
56 if (padIndices.GetFirst()>=0)
57 return fMotifType->FindConnectionByLocalIndices(padIndices);
61 //_____________________________________________________________________________
62 void AliMpVMotif::Print(Option_t *option) const
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
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
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());
90 } else fMotifType->Print(option);