]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpVMotif.cxx
Work around for CINT bug in root 5.10/00, with gcc4.0.2
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpVMotif.cxx
CommitLineData
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$
dee1d5f1 17// $MpId: AliMpVMotif.cxx,v 1.7 2005/08/26 15:43:36 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
27#include <iomanip>
28
fb1bf5c0 29#include <TError.h>
5f91c9e8 30#include <Riostream.h>
31
32#include "AliMpVMotif.h"
33#include "AliMpMotifType.h"
34#include "AliMpIntPair.h"
35#include "AliMpConnection.h"
36
37
38ClassImp(AliMpVMotif)
39
40//_____________________________________________________________________________
41AliMpVMotif::AliMpVMotif():
42 fID(""),
43 fMotifType(0)
44{
dee1d5f1 45/// Default constructor
5f91c9e8 46}
47
48//_____________________________________________________________________________
49AliMpVMotif::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
fb1bf5c0 59//_____________________________________________________________________________
60AliMpVMotif::AliMpVMotif(const AliMpVMotif& right)
dee1d5f1 61 : TObject(right)
62{
63 /// Protected copy constructor (not provided)
64
fb1bf5c0 65 Fatal("AliMpVMotif", "Copy constructor not provided.");
66}
67
2998a151 68//_____________________________________________________________________________
69AliMpVMotif::~AliMpVMotif()
70{
dee1d5f1 71 /// Destructor
2998a151 72}
73
fb1bf5c0 74// operators
75
76//_____________________________________________________________________________
77AliMpVMotif& AliMpVMotif::operator=(const AliMpVMotif& right)
78{
dee1d5f1 79 /// Protected assignment operator (not provided)
80
81 // check assignment to self
fb1bf5c0 82 if (this == &right) return *this;
83
dee1d5f1 84 Fatal("operator =", "Assignment operator not provided.");
fb1bf5c0 85
86 return *this;
87}
88
5f91c9e8 89//_____________________________________________________________________________
90AliMpConnection*
91AliMpVMotif::FindConnectionByLocalPos(const TVector2& localPos) const
92{
dee1d5f1 93 /// Return the local indices from the local
94 /// (x,y) position
5f91c9e8 95
96 AliMpIntPair padIndices=PadIndicesLocal(localPos);
97 if (padIndices.GetFirst()>=0)
98 return fMotifType->FindConnectionByLocalIndices(padIndices);
99 else
100 return 0;
101}
102//_____________________________________________________________________________
103void AliMpVMotif::Print(Option_t *option) const
104{
dee1d5f1 105 /// Print the map of the motif. In each cel, the value
106 /// printed depends of option, as the following:
107 /// - option="N" the "name" of the pad is written
108 /// - option="K" the Kapton connect. number attached to the pad is written
109 /// - option="B" the Berg connect. number attached to the pad is written
110 /// - option="X" the (X,Y) position, in cm, of the center of the pad is written
111 /// otherwise the number of the pad is written
112 ///
113 /// NOTE : this method is really not optimized, in case 'N' or '',
114 /// but the Print() this should not be very important in a Print() method
5f91c9e8 115
116 if (option[0]=='X') {
117
118 cout<<"(X,Y) mapping";
119 cout<<" in the motif "<<fID<<endl;
120 cout<<"-----------------------------------"<<endl;
121 for (Int_t j=fMotifType->GetNofPadsY()-1;j>=0;j--){
122 for (Int_t i=0;i<fMotifType->GetNofPadsX();i++){
123 AliMpIntPair indices = AliMpIntPair(i,j);
124 if (fMotifType->FindConnectionByLocalIndices(indices)){
125 TVector2 pos = PadPositionLocal(indices);
126 cout<<setw(11)<<Form("(%.1f,%.1f)",pos.X(),pos.Y());
127 }
128 }
129 cout<<endl;
130 }
131 } else fMotifType->Print(option);
132}
133
134