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.7 2006/03/17 11:38:43 ivana Exp $
22 // Class describing a zone segment composed of the
23 // line segments with the same motif type.
24 // Included in AliRoot: 2003/05/02
25 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
27 #include "AliMpSubZone.h"
28 #include "AliMpVRowSegment.h"
29 #include "AliMpVMotif.h"
33 #include <Riostream.h>
35 ClassImp(AliMpSubZone)
37 //_____________________________________________________________________________
38 AliMpSubZone::AliMpSubZone(AliMpVMotif* motif)
42 /// Standard constructor
45 //_____________________________________________________________________________
46 AliMpSubZone::AliMpSubZone()
50 /// Default constructor
53 //_____________________________________________________________________________
54 AliMpSubZone::AliMpSubZone(const AliMpSubZone& right)
57 /// Protected copy constructor (not provided)
59 Fatal("AliMpSubZone", "Copy constructor not provided.");
62 //_____________________________________________________________________________
63 AliMpSubZone::~AliMpSubZone()
72 //_____________________________________________________________________________
73 AliMpSubZone& AliMpSubZone::operator=(const AliMpSubZone& right)
75 /// Protected assignment operator (not provided)
77 // check assignment to self
78 if (this == &right) return *this;
80 Fatal("operator =", "Assignment operator not provided.");
89 //_____________________________________________________________________________
90 void AliMpSubZone::AddRowSegment(AliMpVRowSegment* rowSegment)
95 fSegments.push_back(rowSegment);
99 fSegments.Add(rowSegment);
104 //_____________________________________________________________________________
105 void AliMpSubZone::Print(const char* /*option*/) const
107 /// Print motif position Ids for all row segments.
109 for (Int_t i=0; i<GetNofRowSegments(); i++) {
110 AliMpVRowSegment* rowSegment = GetRowSegment(i);
112 cout << rowSegment->GetNofMotifs() << " ";
114 for (Int_t j=0; j<rowSegment->GetNofMotifs(); j++)
115 cout << rowSegment->GetMotifPositionId(j) << " ";
121 //_____________________________________________________________________________
122 Int_t AliMpSubZone::GetNofRowSegments() const
124 /// Return number of row segments.
127 return fSegments.size();
131 return fSegments.GetSize();
135 //_____________________________________________________________________________
136 AliMpVRowSegment* AliMpSubZone::GetRowSegment(Int_t i) const
138 /// Return i-th row segment.
140 if (i<0 || i>=GetNofRowSegments()) {
141 AliErrorStream() << "Index outside range" << endl;
150 return (AliMpVRowSegment*)fSegments.At(i);
154 //_____________________________________________________________________________
155 AliMpVMotif* AliMpSubZone:: GetMotif() const
157 /// Return the motif.