]>
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$ |
dee1d5f1 | 17 | // $MpId: AliMpSubZone.cxx,v 1.6 2005/08/26 15:43:36 ivana Exp $ |
5f91c9e8 | 18 | // Category: sector |
19 | // | |
20 | // Class AliMpSubZone | |
21 | // ------------------ | |
22 | // Class describing a zone segment composed of the | |
23 | // line segments with the same motif type. | |
dbe945cc | 24 | // Included in AliRoot: 2003/05/02 |
5f91c9e8 | 25 | // Authors: David Guez, Ivana Hrivnacova; IPN Orsay |
26 | ||
27 | #include <Riostream.h> | |
fb1bf5c0 | 28 | #include <TError.h> |
5f91c9e8 | 29 | |
30 | #include "AliMpSubZone.h" | |
31 | #include "AliMpVRowSegment.h" | |
32 | #include "AliMpVMotif.h" | |
33 | ||
34 | ClassImp(AliMpSubZone) | |
35 | ||
36 | //_____________________________________________________________________________ | |
37 | AliMpSubZone::AliMpSubZone(AliMpVMotif* motif) | |
38 | : TObject(), | |
39 | fMotif(motif) | |
40 | { | |
dee1d5f1 | 41 | /// Standard constructor |
5f91c9e8 | 42 | } |
43 | ||
44 | //_____________________________________________________________________________ | |
45 | AliMpSubZone::AliMpSubZone() | |
46 | : TObject(), | |
47 | fMotif(0) | |
48 | { | |
dee1d5f1 | 49 | /// Default constructor |
5f91c9e8 | 50 | } |
51 | ||
fb1bf5c0 | 52 | //_____________________________________________________________________________ |
53 | AliMpSubZone::AliMpSubZone(const AliMpSubZone& right) | |
dee1d5f1 | 54 | : TObject(right) |
55 | { | |
56 | /// Protected copy constructor (not provided) | |
57 | ||
fb1bf5c0 | 58 | Fatal("AliMpSubZone", "Copy constructor not provided."); |
59 | } | |
60 | ||
5f91c9e8 | 61 | //_____________________________________________________________________________ |
dee1d5f1 | 62 | AliMpSubZone::~AliMpSubZone() |
63 | { | |
64 | // Destructor | |
5f91c9e8 | 65 | } |
66 | ||
fb1bf5c0 | 67 | // |
68 | // operators | |
69 | // | |
70 | ||
71 | //_____________________________________________________________________________ | |
72 | AliMpSubZone& AliMpSubZone::operator=(const AliMpSubZone& right) | |
73 | { | |
dee1d5f1 | 74 | /// Protected assignment operator (not provided) |
75 | ||
76 | // check assignment to self | |
fb1bf5c0 | 77 | if (this == &right) return *this; |
78 | ||
dee1d5f1 | 79 | Fatal("operator =", "Assignment operator not provided."); |
fb1bf5c0 | 80 | |
81 | return *this; | |
82 | } | |
83 | ||
84 | // | |
85 | // public methods | |
86 | // | |
87 | ||
5f91c9e8 | 88 | //_____________________________________________________________________________ |
89 | void AliMpSubZone::AddRowSegment(AliMpVRowSegment* rowSegment) | |
90 | { | |
dee1d5f1 | 91 | /// Add row segment. |
5f91c9e8 | 92 | |
f79c58a5 | 93 | #ifdef WITH_STL |
5f91c9e8 | 94 | fSegments.push_back(rowSegment); |
f79c58a5 | 95 | #endif |
96 | ||
97 | #ifdef WITH_ROOT | |
98 | fSegments.Add(rowSegment); | |
99 | #endif | |
5f91c9e8 | 100 | } |
101 | ||
102 | ||
103 | //_____________________________________________________________________________ | |
2998a151 | 104 | void AliMpSubZone::Print(const char* /*option*/) const |
5f91c9e8 | 105 | { |
dee1d5f1 | 106 | /// Print motif position Ids for all row segments. |
5f91c9e8 | 107 | |
108 | for (Int_t i=0; i<GetNofRowSegments(); i++) { | |
109 | AliMpVRowSegment* rowSegment = GetRowSegment(i); | |
110 | ||
111 | cout << rowSegment->GetNofMotifs() << " "; | |
112 | ||
113 | for (Int_t j=0; j<rowSegment->GetNofMotifs(); j++) | |
114 | cout << rowSegment->GetMotifPositionId(j) << " "; | |
115 | ||
116 | cout << endl; | |
117 | } | |
118 | } | |
119 | ||
120 | //_____________________________________________________________________________ | |
121 | Int_t AliMpSubZone::GetNofRowSegments() const | |
122 | { | |
dee1d5f1 | 123 | /// Return number of row segments. |
5f91c9e8 | 124 | |
f79c58a5 | 125 | #ifdef WITH_STL |
5f91c9e8 | 126 | return fSegments.size(); |
f79c58a5 | 127 | #endif |
128 | ||
129 | #ifdef WITH_ROOT | |
130 | return fSegments.GetSize(); | |
131 | #endif | |
5f91c9e8 | 132 | } |
133 | ||
134 | //_____________________________________________________________________________ | |
135 | AliMpVRowSegment* AliMpSubZone::GetRowSegment(Int_t i) const | |
136 | { | |
dee1d5f1 | 137 | /// Return i-th row segment. |
fb1bf5c0 | 138 | |
5f91c9e8 | 139 | if (i<0 || i>=GetNofRowSegments()) { |
140 | Warning("GetRowSegment", "Index outside range"); | |
141 | return 0; | |
142 | } | |
143 | ||
f79c58a5 | 144 | #ifdef WITH_STL |
5f91c9e8 | 145 | return fSegments[i]; |
f79c58a5 | 146 | #endif |
147 | ||
148 | #ifdef WITH_ROOT | |
149 | return (AliMpVRowSegment*)fSegments.At(i); | |
150 | #endif | |
5f91c9e8 | 151 | } |
152 | ||
153 | //_____________________________________________________________________________ | |
154 | AliMpVMotif* AliMpSubZone:: GetMotif() const | |
155 | { | |
dee1d5f1 | 156 | /// Return the motif. |
5f91c9e8 | 157 | |
158 | return fMotif; | |
159 | } |