1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 // $MpId: AliMpSubZone.cxx,v 1.8 2006/05/24 13:58:46 ivana Exp $
20 //-----------------------------------------------------------------------------
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 //-----------------------------------------------------------------------------
29 #include "AliMpSubZone.h"
30 #include "AliMpVRowSegment.h"
31 #include "AliMpVMotif.h"
35 #include <Riostream.h>
38 ClassImp(AliMpSubZone)
41 //_____________________________________________________________________________
42 AliMpSubZone::AliMpSubZone(AliMpVMotif* motif)
47 /// Standard constructor
50 //_____________________________________________________________________________
51 AliMpSubZone::AliMpSubZone()
56 /// Default constructor
59 //_____________________________________________________________________________
60 AliMpSubZone::~AliMpSubZone()
69 //_____________________________________________________________________________
70 void AliMpSubZone::AddRowSegment(AliMpVRowSegment* rowSegment)
74 fSegments.Add(rowSegment);
78 //_____________________________________________________________________________
79 void AliMpSubZone::Print(const char* /*option*/) const
81 /// Print motif position Ids for all row segments.
83 for (Int_t i=0; i<GetNofRowSegments(); i++) {
84 AliMpVRowSegment* rowSegment = GetRowSegment(i);
86 cout << rowSegment->GetNofMotifs() << " ";
88 for (Int_t j=0; j<rowSegment->GetNofMotifs(); j++)
89 cout << rowSegment->GetMotifPositionId(j) << " ";
95 //_____________________________________________________________________________
96 Int_t AliMpSubZone::GetNofRowSegments() const
98 /// Return number of row segments.
100 return fSegments.GetSize();
103 //_____________________________________________________________________________
104 AliMpVRowSegment* AliMpSubZone::GetRowSegment(Int_t i) const
106 /// Return i-th row segment.
108 if (i<0 || i>=GetNofRowSegments()) {
109 AliErrorStream() << "Index outside range" << endl;
113 return (AliMpVRowSegment*)fSegments.At(i);
116 //_____________________________________________________________________________
117 AliMpVMotif* AliMpSubZone:: GetMotif() const
119 /// Return the motif.