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 $
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>
36 ClassImp(AliMpSubZone)
39 //_____________________________________________________________________________
40 AliMpSubZone::AliMpSubZone(AliMpVMotif* motif)
44 /// Standard constructor
47 //_____________________________________________________________________________
48 AliMpSubZone::AliMpSubZone()
52 /// Default constructor
55 //_____________________________________________________________________________
56 AliMpSubZone::AliMpSubZone(const AliMpSubZone& right)
59 /// Protected copy constructor (not provided)
61 Fatal("AliMpSubZone", "Copy constructor not provided.");
64 //_____________________________________________________________________________
65 AliMpSubZone::~AliMpSubZone()
74 //_____________________________________________________________________________
75 AliMpSubZone& AliMpSubZone::operator=(const AliMpSubZone& right)
77 /// Protected assignment operator (not provided)
79 // check assignment to self
80 if (this == &right) return *this;
82 Fatal("operator =", "Assignment operator not provided.");
91 //_____________________________________________________________________________
92 void AliMpSubZone::AddRowSegment(AliMpVRowSegment* rowSegment)
97 fSegments.push_back(rowSegment);
101 fSegments.Add(rowSegment);
106 //_____________________________________________________________________________
107 void AliMpSubZone::Print(const char* /*option*/) const
109 /// Print motif position Ids for all row segments.
111 for (Int_t i=0; i<GetNofRowSegments(); i++) {
112 AliMpVRowSegment* rowSegment = GetRowSegment(i);
114 cout << rowSegment->GetNofMotifs() << " ";
116 for (Int_t j=0; j<rowSegment->GetNofMotifs(); j++)
117 cout << rowSegment->GetMotifPositionId(j) << " ";
123 //_____________________________________________________________________________
124 Int_t AliMpSubZone::GetNofRowSegments() const
126 /// Return number of row segments.
129 return fSegments.size();
133 return fSegments.GetSize();
137 //_____________________________________________________________________________
138 AliMpVRowSegment* AliMpSubZone::GetRowSegment(Int_t i) const
140 /// Return i-th row segment.
142 if (i<0 || i>=GetNofRowSegments()) {
143 AliErrorStream() << "Index outside range" << endl;
152 return (AliMpVRowSegment*)fSegments.At(i);
156 //_____________________________________________________________________________
157 AliMpVMotif* AliMpSubZone:: GetMotif() const
159 /// Return the motif.