]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpSubZone.cxx
Mapping test macros (D. Guez, I. Hrivnacova)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpSubZone.cxx
CommitLineData
5f91c9e8 1// $Id$
2// Category: sector
3//
4// Class AliMpSubZone
5// ------------------
6// Class describing a zone segment composed of the
7// line segments with the same motif type.
dbe945cc 8// Included in AliRoot: 2003/05/02
5f91c9e8 9// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
10
11#include <Riostream.h>
fb1bf5c0 12#include <TError.h>
5f91c9e8 13
14#include "AliMpSubZone.h"
15#include "AliMpVRowSegment.h"
16#include "AliMpVMotif.h"
17
18ClassImp(AliMpSubZone)
19
20//_____________________________________________________________________________
21AliMpSubZone::AliMpSubZone(AliMpVMotif* motif)
22 : TObject(),
23 fMotif(motif)
24{
25//
26}
27
28//_____________________________________________________________________________
29AliMpSubZone::AliMpSubZone()
30 : TObject(),
31 fMotif(0)
32{
33//
34}
35
fb1bf5c0 36//_____________________________________________________________________________
37AliMpSubZone::AliMpSubZone(const AliMpSubZone& right)
38 : TObject(right) {
39//
40 Fatal("AliMpSubZone", "Copy constructor not provided.");
41}
42
5f91c9e8 43//_____________________________________________________________________________
44AliMpSubZone::~AliMpSubZone() {
45//
46}
47
fb1bf5c0 48//
49// operators
50//
51
52//_____________________________________________________________________________
53AliMpSubZone& AliMpSubZone::operator=(const AliMpSubZone& right)
54{
55 // check assignement to self
56 if (this == &right) return *this;
57
58 Fatal("operator =", "Assignement operator not provided.");
59
60 return *this;
61}
62
63//
64// public methods
65//
66
5f91c9e8 67//_____________________________________________________________________________
68void AliMpSubZone::AddRowSegment(AliMpVRowSegment* rowSegment)
69{
70// Adds row segment.
71// ---
72
f79c58a5 73#ifdef WITH_STL
5f91c9e8 74 fSegments.push_back(rowSegment);
f79c58a5 75#endif
76
77#ifdef WITH_ROOT
78 fSegments.Add(rowSegment);
79#endif
5f91c9e8 80}
81
82
83//_____________________________________________________________________________
2998a151 84void AliMpSubZone::Print(const char* /*option*/) const
5f91c9e8 85{
86// Prints motif position Ids for all row segments.
87// --
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{
104// Returns number of row segments.
fb1bf5c0 105// ---
5f91c9e8 106
f79c58a5 107#ifdef WITH_STL
5f91c9e8 108 return fSegments.size();
f79c58a5 109#endif
110
111#ifdef WITH_ROOT
112 return fSegments.GetSize();
113#endif
5f91c9e8 114}
115
116//_____________________________________________________________________________
117AliMpVRowSegment* AliMpSubZone::GetRowSegment(Int_t i) const
118{
fb1bf5c0 119// Returns i-th row segment.
120// ---
121
5f91c9e8 122 if (i<0 || i>=GetNofRowSegments()) {
123 Warning("GetRowSegment", "Index outside range");
124 return 0;
125 }
126
f79c58a5 127#ifdef WITH_STL
5f91c9e8 128 return fSegments[i];
f79c58a5 129#endif
130
131#ifdef WITH_ROOT
132 return (AliMpVRowSegment*)fSegments.At(i);
133#endif
5f91c9e8 134}
135
136//_____________________________________________________________________________
137AliMpVMotif* AliMpSubZone:: GetMotif() const
138{
139// Returns the motif.
140// ---
141
142 return fMotif;
143}