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