Moving kNoAliases setting in Process() to the right place
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpSubZone.cxx
CommitLineData
dee1d5f1 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
5f91c9e8 16// $Id$
13985652 17// $MpId: AliMpSubZone.cxx,v 1.8 2006/05/24 13:58:46 ivana Exp $
5f91c9e8 18// Category: sector
19//
20// Class AliMpSubZone
21// ------------------
22// Class describing a zone segment composed of the
23// line segments with the same motif type.
dbe945cc 24// Included in AliRoot: 2003/05/02
5f91c9e8 25// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
26
5f91c9e8 27#include "AliMpSubZone.h"
28#include "AliMpVRowSegment.h"
29#include "AliMpVMotif.h"
30
2c605e66 31#include "AliLog.h"
32
33#include <Riostream.h>
34
13985652 35/// \cond CLASSIMP
5f91c9e8 36ClassImp(AliMpSubZone)
13985652 37/// \endcond
5f91c9e8 38
39//_____________________________________________________________________________
40AliMpSubZone::AliMpSubZone(AliMpVMotif* motif)
41 : TObject(),
13e7956b 42 fMotif(motif),
43 fSegments()
5f91c9e8 44{
dee1d5f1 45/// Standard constructor
5f91c9e8 46}
47
48//_____________________________________________________________________________
49AliMpSubZone::AliMpSubZone()
50 : TObject(),
13e7956b 51 fMotif(0),
52 fSegments()
5f91c9e8 53{
dee1d5f1 54/// Default constructor
5f91c9e8 55}
56
57//_____________________________________________________________________________
dee1d5f1 58AliMpSubZone::~AliMpSubZone()
59{
60// Destructor
5f91c9e8 61}
62
fb1bf5c0 63//
fb1bf5c0 64// public methods
65//
66
5f91c9e8 67//_____________________________________________________________________________
68void AliMpSubZone::AddRowSegment(AliMpVRowSegment* rowSegment)
69{
dee1d5f1 70/// Add row segment.
5f91c9e8 71
f79c58a5 72#ifdef WITH_STL
5f91c9e8 73 fSegments.push_back(rowSegment);
f79c58a5 74#endif
75
76#ifdef WITH_ROOT
77 fSegments.Add(rowSegment);
78#endif
5f91c9e8 79}
80
81
82//_____________________________________________________________________________
2998a151 83void AliMpSubZone::Print(const char* /*option*/) const
5f91c9e8 84{
dee1d5f1 85/// Print motif position Ids for all row segments.
5f91c9e8 86
87 for (Int_t i=0; i<GetNofRowSegments(); i++) {
88 AliMpVRowSegment* rowSegment = GetRowSegment(i);
89
90 cout << rowSegment->GetNofMotifs() << " ";
91
92 for (Int_t j=0; j<rowSegment->GetNofMotifs(); j++)
93 cout << rowSegment->GetMotifPositionId(j) << " ";
94
95 cout << endl;
96 }
97}
98
99//_____________________________________________________________________________
100Int_t AliMpSubZone::GetNofRowSegments() const
101{
dee1d5f1 102/// Return number of row segments.
5f91c9e8 103
f79c58a5 104#ifdef WITH_STL
5f91c9e8 105 return fSegments.size();
f79c58a5 106#endif
107
108#ifdef WITH_ROOT
109 return fSegments.GetSize();
110#endif
5f91c9e8 111}
112
113//_____________________________________________________________________________
114AliMpVRowSegment* AliMpSubZone::GetRowSegment(Int_t i) const
115{
dee1d5f1 116/// Return i-th row segment.
fb1bf5c0 117
5f91c9e8 118 if (i<0 || i>=GetNofRowSegments()) {
2c605e66 119 AliErrorStream() << "Index outside range" << endl;
5f91c9e8 120 return 0;
121 }
122
f79c58a5 123#ifdef WITH_STL
5f91c9e8 124 return fSegments[i];
f79c58a5 125#endif
126
127#ifdef WITH_ROOT
128 return (AliMpVRowSegment*)fSegments.At(i);
129#endif
5f91c9e8 130}
131
132//_____________________________________________________________________________
133AliMpVMotif* AliMpSubZone:: GetMotif() const
134{
dee1d5f1 135/// Return the motif.
5f91c9e8 136
137 return fMotif;
138}