]>
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: AliMpSubZone.cxx,v 1.8 2006/05/24 13:58:46 ivana Exp $ |
5f91c9e8 | 18 | // Category: sector |
3d1463c8 | 19 | |
20 | //----------------------------------------------------------------------------- | |
5f91c9e8 | 21 | // Class AliMpSubZone |
22 | // ------------------ | |
23 | // Class describing a zone segment composed of the | |
24 | // line segments with the same motif type. | |
dbe945cc | 25 | // Included in AliRoot: 2003/05/02 |
5f91c9e8 | 26 | // Authors: David Guez, Ivana Hrivnacova; IPN Orsay |
3d1463c8 | 27 | //----------------------------------------------------------------------------- |
5f91c9e8 | 28 | |
5f91c9e8 | 29 | #include "AliMpSubZone.h" |
30 | #include "AliMpVRowSegment.h" | |
31 | #include "AliMpVMotif.h" | |
32 | ||
2c605e66 | 33 | #include "AliLog.h" |
34 | ||
35 | #include <Riostream.h> | |
36 | ||
b80faac0 | 37 | using std::cout; |
38 | using std::endl; | |
13985652 | 39 | /// \cond CLASSIMP |
5f91c9e8 | 40 | ClassImp(AliMpSubZone) |
13985652 | 41 | /// \endcond |
5f91c9e8 | 42 | |
43 | //_____________________________________________________________________________ | |
44 | AliMpSubZone::AliMpSubZone(AliMpVMotif* motif) | |
45 | : TObject(), | |
13e7956b | 46 | fMotif(motif), |
47 | fSegments() | |
5f91c9e8 | 48 | { |
dee1d5f1 | 49 | /// Standard constructor |
5f91c9e8 | 50 | } |
51 | ||
52 | //_____________________________________________________________________________ | |
53 | AliMpSubZone::AliMpSubZone() | |
54 | : TObject(), | |
13e7956b | 55 | fMotif(0), |
56 | fSegments() | |
5f91c9e8 | 57 | { |
dee1d5f1 | 58 | /// Default constructor |
5f91c9e8 | 59 | } |
60 | ||
61 | //_____________________________________________________________________________ | |
dee1d5f1 | 62 | AliMpSubZone::~AliMpSubZone() |
63 | { | |
f5671fc3 | 64 | /// Destructor |
5f91c9e8 | 65 | } |
66 | ||
fb1bf5c0 | 67 | // |
68 | // public methods | |
69 | // | |
70 | ||
5f91c9e8 | 71 | //_____________________________________________________________________________ |
72 | void AliMpSubZone::AddRowSegment(AliMpVRowSegment* rowSegment) | |
73 | { | |
dee1d5f1 | 74 | /// Add row segment. |
5f91c9e8 | 75 | |
f79c58a5 | 76 | fSegments.Add(rowSegment); |
5f91c9e8 | 77 | } |
78 | ||
79 | ||
80 | //_____________________________________________________________________________ | |
2998a151 | 81 | void AliMpSubZone::Print(const char* /*option*/) const |
5f91c9e8 | 82 | { |
dee1d5f1 | 83 | /// Print motif position Ids for all row segments. |
5f91c9e8 | 84 | |
85 | for (Int_t i=0; i<GetNofRowSegments(); i++) { | |
86 | AliMpVRowSegment* rowSegment = GetRowSegment(i); | |
87 | ||
88 | cout << rowSegment->GetNofMotifs() << " "; | |
89 | ||
90 | for (Int_t j=0; j<rowSegment->GetNofMotifs(); j++) | |
91 | cout << rowSegment->GetMotifPositionId(j) << " "; | |
92 | ||
93 | cout << endl; | |
94 | } | |
95 | } | |
96 | ||
97 | //_____________________________________________________________________________ | |
98 | Int_t AliMpSubZone::GetNofRowSegments() const | |
99 | { | |
dee1d5f1 | 100 | /// Return number of row segments. |
5f91c9e8 | 101 | |
f79c58a5 | 102 | return fSegments.GetSize(); |
5f91c9e8 | 103 | } |
104 | ||
105 | //_____________________________________________________________________________ | |
106 | AliMpVRowSegment* AliMpSubZone::GetRowSegment(Int_t i) const | |
107 | { | |
dee1d5f1 | 108 | /// Return i-th row segment. |
fb1bf5c0 | 109 | |
5f91c9e8 | 110 | if (i<0 || i>=GetNofRowSegments()) { |
2c605e66 | 111 | AliErrorStream() << "Index outside range" << endl; |
5f91c9e8 | 112 | return 0; |
113 | } | |
114 | ||
f79c58a5 | 115 | return (AliMpVRowSegment*)fSegments.At(i); |
5f91c9e8 | 116 | } |
117 | ||
118 | //_____________________________________________________________________________ | |
119 | AliMpVMotif* AliMpSubZone:: GetMotif() const | |
120 | { | |
dee1d5f1 | 121 | /// Return the motif. |
5f91c9e8 | 122 | |
123 | return fMotif; | |
124 | } |