6 // Class that defines a motif with its unique ID
8 // Included in AliRoot: 2003/05/02
9 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
14 #include <Riostream.h>
16 #include "AliMpVMotif.h"
17 #include "AliMpMotifType.h"
18 #include "AliMpIntPair.h"
19 #include "AliMpConnection.h"
24 //_____________________________________________________________________________
25 AliMpVMotif::AliMpVMotif():
29 //default dummy constructor
32 //_____________________________________________________________________________
33 AliMpVMotif::AliMpVMotif(const TString &id, AliMpMotifType *motifType):
37 // Normal constructor.
38 // The dimension in a given direction is calculated by
39 // multiplying the total dimension by the number of pads
43 //_____________________________________________________________________________
44 AliMpVMotif::AliMpVMotif(const AliMpVMotif& right)
47 Fatal("AliMpVMotif", "Copy constructor not provided.");
50 //_____________________________________________________________________________
51 AliMpVMotif::~AliMpVMotif()
58 //_____________________________________________________________________________
59 AliMpVMotif& AliMpVMotif::operator=(const AliMpVMotif& right)
61 // check assignement to self
62 if (this == &right) return *this;
64 Fatal("operator =", "Assignement operator not provided.");
69 //_____________________________________________________________________________
71 AliMpVMotif::FindConnectionByLocalPos(const TVector2& localPos) const
73 // Return the local indices from the local
76 AliMpIntPair padIndices=PadIndicesLocal(localPos);
77 if (padIndices.GetFirst()>=0)
78 return fMotifType->FindConnectionByLocalIndices(padIndices);
82 //_____________________________________________________________________________
83 void AliMpVMotif::Print(Option_t *option) const
85 // Print the map of the motif. In each cel, the value
86 // printed depends of option, as the following:
87 // option="N" the "name" of the pad is written
88 // option="K" the Kapton connect. number attached to the pad is written
89 // option="B" the Berg connect. number attached to the pad is written
90 // option="X" the (X,Y) position, in cm, of the center of the pad is written
91 // otherwise the number of the pad is written
93 // NOTE : this method is really not optimized, in case 'N' or '',
94 // but the Print() this should not be very important in a Print() method
98 cout<<"(X,Y) mapping";
99 cout<<" in the motif "<<fID<<endl;
100 cout<<"-----------------------------------"<<endl;
101 for (Int_t j=fMotifType->GetNofPadsY()-1;j>=0;j--){
102 for (Int_t i=0;i<fMotifType->GetNofPadsX();i++){
103 AliMpIntPair indices = AliMpIntPair(i,j);
104 if (fMotifType->FindConnectionByLocalIndices(indices)){
105 TVector2 pos = PadPositionLocal(indices);
106 cout<<setw(11)<<Form("(%.1f,%.1f)",pos.X(),pos.Y());
111 } else fMotifType->Print(option);