AliRoot Core  edcc906 (edcc906)
AliMpSubZone.cxx
Go to the documentation of this file.
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;
40 ClassImp(AliMpSubZone)
42 
43 //_____________________________________________________________________________
45  : TObject(),
46  fMotif(motif),
47  fSegments()
48 {
50 }
51 
52 //_____________________________________________________________________________
54  : TObject(),
55  fMotif(0),
56  fSegments()
57 {
59 }
60 
61 //_____________________________________________________________________________
63 {
65 }
66 
67 //
68 // public methods
69 //
70 
71 //_____________________________________________________________________________
73 {
75 
76  fSegments.Add(rowSegment);
77 }
78 
79 
80 //_____________________________________________________________________________
81 void AliMpSubZone::Print(const char* /*option*/) const
82 {
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 //_____________________________________________________________________________
99 {
101 
102  return fSegments.GetSize();
103 }
104 
105 //_____________________________________________________________________________
107 {
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 //_____________________________________________________________________________
120 {
122 
123  return fMotif;
124 }
#define AliErrorStream()
Definition: AliLog.h:630
AliMpVMotif * GetMotif() const
Int_t GetNofRowSegments() const
An interface for a row segment.
virtual ~AliMpSubZone()
virtual void Print(const char *=0) const
TList fSegments
contained row segments
Definition: AliMpSubZone.h:47
virtual Int_t GetMotifPositionId(Int_t i) const =0
Return the i-th motif position Id of this row segment.
Abstract base class for a motif with its unique ID and the motif type.
Definition: AliMpVMotif.h:24
void AddRowSegment(AliMpVRowSegment *rowSegment)
AliMpVMotif * fMotif
the motif in this subzone
Definition: AliMpSubZone.h:46
virtual Int_t GetNofMotifs() const =0
Return the number of motifs in this this row segment.
AliMpVRowSegment * GetRowSegment(Int_t i) const
A region in zone composed of the row segments with the same motif type.
Definition: AliMpSubZone.h:23