]>
Commit | Line | Data |
---|---|---|
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$ |
13985652 | 17 | // $MpId: AliMpZone.cxx,v 1.7 2006/05/24 13:58:46 ivana Exp $ |
5f91c9e8 | 18 | // Category: sector |
3d1463c8 | 19 | |
20 | //----------------------------------------------------------------------------- | |
5f91c9e8 | 21 | // Class AliMpZone |
22 | // --------------- | |
23 | // Class describing a zone composed of the zone segments. | |
24 | // The zone contains pads of the same dimensions. | |
dbe945cc | 25 | // Included in AliRoot: 2003/05/02 |
5f91c9e8 | 26 | // Authors: David Guez, Ivana Hrivnacova; IPN Orsay |
3d1463c8 | 27 | //----------------------------------------------------------------------------- |
5f91c9e8 | 28 | |
29 | #include "AliMpZone.h" | |
2998a151 | 30 | #include "AliMpSubZone.h" |
5f91c9e8 | 31 | |
13985652 | 32 | /// \cond CLASSIMP |
5f91c9e8 | 33 | ClassImp(AliMpZone) |
13985652 | 34 | /// \endcond |
5f91c9e8 | 35 | |
36 | //_____________________________________________________________________________ | |
37 | AliMpZone::AliMpZone(Int_t id) | |
38 | : TObject(), | |
39 | fID(id), | |
0471c97b | 40 | fSubZones(), |
6e97fbb8 | 41 | fPadDimensionX(0.), |
42 | fPadDimensionY(0.) | |
5f91c9e8 | 43 | { |
dee1d5f1 | 44 | /// Standard constructor |
5f91c9e8 | 45 | } |
46 | ||
47 | //_____________________________________________________________________________ | |
48 | AliMpZone::AliMpZone() | |
49 | : TObject(), | |
50 | fID(0), | |
0471c97b | 51 | fSubZones(), |
6e97fbb8 | 52 | fPadDimensionX(0.), |
53 | fPadDimensionY(0.) | |
5f91c9e8 | 54 | { |
dee1d5f1 | 55 | /// Default constructor |
5f91c9e8 | 56 | } |
57 | ||
58 | //_____________________________________________________________________________ | |
dee1d5f1 | 59 | AliMpZone::~AliMpZone() |
60 | { | |
61 | /// Destructor | |
5f91c9e8 | 62 | |
63 | for (Int_t i=0; i<GetNofSubZones(); i++) | |
64 | delete fSubZones[i]; | |
65 | } | |
66 | ||
67 | // | |
68 | // public methods | |
69 | // | |
70 | ||
71 | //_____________________________________________________________________________ | |
72 | void AliMpZone::AddSubZone(AliMpSubZone* subZone) | |
73 | { | |
dee1d5f1 | 74 | /// Add row segment. |
5f91c9e8 | 75 | |
f79c58a5 | 76 | fSubZones.Add(subZone); |
5f91c9e8 | 77 | } |
78 | ||
79 | //_____________________________________________________________________________ | |
57e2ad1a | 80 | AliMpSubZone* AliMpZone::FindSubZone(const AliMpVMotif* motif) const |
5f91c9e8 | 81 | { |
dee1d5f1 | 82 | /// Find a subzone with a specified motif; |
83 | /// return 0 if not found. | |
5f91c9e8 | 84 | |
85 | for (Int_t i=0; i<GetNofSubZones(); i++) { | |
86 | AliMpSubZone* subZone = GetSubZone(i); | |
87 | if (subZone->GetMotif() == motif) return subZone; | |
88 | } | |
89 | ||
90 | return 0; | |
91 | } | |
92 | ||
6e97fbb8 | 93 | //_____________________________________________________________________________ |
94 | void AliMpZone::SetPadDimensions(Double_t dx, Double_t dy) | |
95 | { | |
96 | /// Set pad dimensions | |
97 | ||
98 | fPadDimensionX = dx; | |
99 | fPadDimensionY = dy; | |
100 | } | |
101 | ||
5f91c9e8 | 102 | //_____________________________________________________________________________ |
103 | Int_t AliMpZone::GetNofSubZones() const | |
104 | { | |
dee1d5f1 | 105 | /// Return number of row segments. |
5f91c9e8 | 106 | |
f79c58a5 | 107 | return fSubZones.GetEntriesFast(); |
5f91c9e8 | 108 | } |
109 | ||
110 | //_____________________________________________________________________________ | |
111 | AliMpSubZone* AliMpZone::GetSubZone(Int_t i) const | |
112 | { | |
dee1d5f1 | 113 | /// Return i-th sub zone. |
31e62cbe | 114 | |
5f91c9e8 | 115 | if (i<0 || i>=GetNofSubZones()) { |
116 | Warning("GetSubZone", "Index outside range"); | |
117 | return 0; | |
118 | } | |
119 | ||
f79c58a5 | 120 | return (AliMpSubZone*)fSubZones[i]; |
5f91c9e8 | 121 | } |