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