]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpSubZone.cxx
a3171b2bade256450b696167054986b81072209f
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpSubZone.cxx
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.
8 //
9 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
10
11 #include <Riostream.h>
12
13 #include "AliMpSubZone.h"
14 #include "AliMpVRowSegment.h"
15 #include "AliMpVMotif.h"
16
17 ClassImp(AliMpSubZone)
18
19 //_____________________________________________________________________________
20 AliMpSubZone::AliMpSubZone(AliMpVMotif* motif) 
21   : TObject(),
22     fMotif(motif)
23 {
24 //
25 }
26
27 //_____________________________________________________________________________
28 AliMpSubZone::AliMpSubZone() 
29   : TObject(),
30     fMotif(0)
31 {
32 //
33 }
34
35 //_____________________________________________________________________________
36 AliMpSubZone::~AliMpSubZone() {
37 //  
38 }
39
40 //_____________________________________________________________________________
41 void AliMpSubZone::AddRowSegment(AliMpVRowSegment* rowSegment)
42 {
43 // Adds row segment.
44 // ---
45
46   fSegments.push_back(rowSegment);
47
48
49
50 //_____________________________________________________________________________
51 void AliMpSubZone::Print() const
52 {
53 // Prints motif position Ids for all row segments.
54 // --
55  
56   for (Int_t i=0; i<GetNofRowSegments(); i++) {
57     AliMpVRowSegment* rowSegment = GetRowSegment(i);
58     
59     cout << rowSegment->GetNofMotifs() << " ";
60
61     for (Int_t j=0; j<rowSegment->GetNofMotifs(); j++)
62       cout << rowSegment->GetMotifPositionId(j) << " ";
63     
64     cout << endl;    
65   }    
66 }
67   
68 //_____________________________________________________________________________
69 Int_t AliMpSubZone::GetNofRowSegments() const 
70 {
71 // Returns number of row segments.
72
73   return fSegments.size();
74 }  
75
76 //_____________________________________________________________________________
77 AliMpVRowSegment* AliMpSubZone::GetRowSegment(Int_t i) const 
78 {
79   if (i<0 || i>=GetNofRowSegments()) {
80     Warning("GetRowSegment", "Index outside range");
81     return 0;
82   }
83   
84   return fSegments[i];  
85 }
86
87 //_____________________________________________________________________________
88 AliMpVMotif*  AliMpSubZone:: GetMotif() const
89 {
90 // Returns the motif.
91 // ---
92
93   return fMotif;
94 }