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