]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpSubZone.cxx
- Reordering includes from most specific to more general ones
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpSubZone.cxx
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
16 // $Id$
17 // $MpId: AliMpSubZone.cxx,v 1.7 2006/03/17 11:38:43 ivana Exp $
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.
24 // Included in AliRoot: 2003/05/02
25 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
26
27 #include "AliMpSubZone.h"
28 #include "AliMpVRowSegment.h"
29 #include "AliMpVMotif.h"
30
31 #include "AliLog.h"
32
33 #include <Riostream.h>
34
35 ClassImp(AliMpSubZone)
36
37 //_____________________________________________________________________________
38 AliMpSubZone::AliMpSubZone(AliMpVMotif* motif) 
39   : TObject(),
40     fMotif(motif)
41 {
42 /// Standard constructor
43 }
44
45 //_____________________________________________________________________________
46 AliMpSubZone::AliMpSubZone() 
47   : TObject(),
48     fMotif(0)
49 {
50 /// Default constructor
51 }
52
53 //_____________________________________________________________________________
54 AliMpSubZone::AliMpSubZone(const AliMpSubZone& right) 
55   : TObject(right) 
56 {
57 /// Protected copy constructor (not provided) 
58
59   Fatal("AliMpSubZone", "Copy constructor not provided.");
60 }
61
62 //_____________________________________________________________________________
63 AliMpSubZone::~AliMpSubZone() 
64 {
65 // Destructor 
66 }
67
68 //
69 // operators
70 //
71
72 //_____________________________________________________________________________
73 AliMpSubZone& AliMpSubZone::operator=(const AliMpSubZone& right)
74 {
75 /// Protected assignment operator (not provided)
76
77   // check assignment to self
78   if (this == &right) return *this;
79
80   Fatal("operator =", "Assignment operator not provided.");
81     
82   return *this;  
83 }    
84
85 //
86 // public methods
87 //
88
89 //_____________________________________________________________________________
90 void AliMpSubZone::AddRowSegment(AliMpVRowSegment* rowSegment)
91 {
92 /// Add row segment.
93
94 #ifdef WITH_STL
95   fSegments.push_back(rowSegment);
96 #endif
97
98 #ifdef WITH_ROOT
99   fSegments.Add(rowSegment);
100 #endif
101
102
103
104 //_____________________________________________________________________________
105 void AliMpSubZone::Print(const char* /*option*/) const
106 {
107 /// Print motif position Ids for all row segments.
108  
109   for (Int_t i=0; i<GetNofRowSegments(); i++) {
110     AliMpVRowSegment* rowSegment = GetRowSegment(i);
111     
112     cout << rowSegment->GetNofMotifs() << " ";
113
114     for (Int_t j=0; j<rowSegment->GetNofMotifs(); j++)
115       cout << rowSegment->GetMotifPositionId(j) << " ";
116     
117     cout << endl;    
118   }    
119 }
120   
121 //_____________________________________________________________________________
122 Int_t AliMpSubZone::GetNofRowSegments() const 
123 {
124 /// Return number of row segments.
125
126 #ifdef WITH_STL
127   return fSegments.size();
128 #endif
129
130 #ifdef WITH_ROOT
131   return fSegments.GetSize();
132 #endif
133 }  
134
135 //_____________________________________________________________________________
136 AliMpVRowSegment* AliMpSubZone::GetRowSegment(Int_t i) const 
137 {
138 /// Return i-th row segment.
139
140   if (i<0 || i>=GetNofRowSegments()) {
141     AliErrorStream() << "Index outside range" << endl;
142     return 0;
143   }
144   
145 #ifdef WITH_STL
146   return fSegments[i];  
147 #endif
148
149 #ifdef WITH_ROOT
150   return (AliMpVRowSegment*)fSegments.At(i);  
151 #endif
152 }
153
154 //_____________________________________________________________________________
155 AliMpVMotif*  AliMpSubZone:: GetMotif() const
156 {
157 /// Return the motif.
158
159   return fMotif;
160 }