]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpPadRowRSegment.cxx
- Reordering includes and/or
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpPadRowRSegment.cxx
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
16 // $Id$
17 // $MpId: AliMpPadRowRSegment.cxx,v 1.4 2005/08/26 15:43:36 ivana Exp $
18 // Category: sector
19 //
20 // Class AliMpPadRowRSegment
21 // -------------------------
22 // Class describing a pad row segment composed of the 
23 // the identic pads;
24 // the pads are placed from the offset (defined in the base class)
25 // to the right.
26 //
27 // Included in AliRoot: 2003/05/02
28 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
29
30 #include <TError.h>
31
32 #include "AliMpPadRowRSegment.h"
33 #include "AliMpPadRow.h"
34 #include "AliMpMotif.h"
35 #include "AliMpMotifType.h"
36
37 ClassImp(AliMpPadRowRSegment)
38
39 //______________________________________________________________________________
40 AliMpPadRowRSegment::AliMpPadRowRSegment(AliMpPadRow* padRow, AliMpMotif* motif, 
41                                          Int_t motifPositionId, Int_t nofPads)
42   : AliMpVPadRowSegment(padRow, motif, motifPositionId, nofPads)
43 {
44 /// Standard constructor 
45 }
46
47 //______________________________________________________________________________
48 AliMpPadRowRSegment::AliMpPadRowRSegment() 
49   : AliMpVPadRowSegment()
50 {
51 /// Default constructor
52 }
53
54 //______________________________________________________________________________
55 AliMpPadRowRSegment::~AliMpPadRowRSegment() 
56 {
57 /// Destructor  
58 }
59
60 //
61 // private methods  
62 //
63
64 //______________________________________________________________________________
65 Double_t AliMpPadRowRSegment::FirstPadCenterX() const
66 {
67 /// Return the x coordinate of the first (the most left) pad center
68 /// in the global coordinate system.
69
70   return GetOffsetX() + GetMotif()->GetPadDimensions().X();
71 }  
72
73 //______________________________________________________________________________
74 Double_t AliMpPadRowRSegment::LastPadCenterX() const
75 {
76 /// Return the x coordinate of the last (the most right) pad center
77 /// in the global coordinate system.                                             \n
78 /// !! numbering of pads is in (-x) direction
79
80   return GetOffsetX() + (2.*GetNofPads() - 1)*GetMotif()->GetPadDimensions().X();
81 }
82
83 //______________________________________________________________________________
84 Double_t AliMpPadRowRSegment::FirstPadBorderX() const
85 {
86 /// Return the x coordinate of the left border of the first (the most left) 
87 /// pad in the global coordinate system.
88
89   return GetOffsetX();
90          // Also could be
91          // return FirstPadCenterX() + GetMotif()->GetPadDimensions().X();
92 }  
93
94 //______________________________________________________________________________
95 Double_t AliMpPadRowRSegment::LastPadBorderX() const
96 {
97 /// Return the x coordinate of the right border of the last (the most right)
98 /// pad in the global coordinate system.
99
100   return LastPadCenterX() + GetMotif()->GetPadDimensions().X();
101 }  
102
103 //
104 // public methods  
105 //
106
107 //______________________________________________________________________________
108 Double_t  AliMpPadRowRSegment::LeftBorderX() const
109 {
110 /// Return the x coordinate of the left row segment border
111 /// in the global coordinate system.
112
113   return FirstPadBorderX();
114 }
115
116 //______________________________________________________________________________
117 Double_t  AliMpPadRowRSegment::RightBorderX() const
118 {
119 /// Return the x coordinate of the right row segment border
120 /// in the global coordinate system.
121
122   return LastPadBorderX();
123 }
124