]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpZone.cxx
In mapping:
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpZone.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: AliMpZone.cxx,v 1.7 2006/05/24 13:58:46 ivana Exp $
5f91c9e8 18// Category: sector
3d1463c8 19
20//-----------------------------------------------------------------------------
5f91c9e8 21// Class AliMpZone
22// ---------------
23// Class describing a zone composed of the zone segments.
24// The zone contains pads of the same dimensions.
dbe945cc 25// Included in AliRoot: 2003/05/02
5f91c9e8 26// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
3d1463c8 27//-----------------------------------------------------------------------------
5f91c9e8 28
29#include "AliMpZone.h"
2998a151 30#include "AliMpSubZone.h"
5f91c9e8 31
13985652 32/// \cond CLASSIMP
5f91c9e8 33ClassImp(AliMpZone)
13985652 34/// \endcond
5f91c9e8 35
36//_____________________________________________________________________________
37AliMpZone::AliMpZone(Int_t id)
38 : TObject(),
39 fID(id),
0471c97b 40 fSubZones(),
5f91c9e8 41 fPadDimensions(TVector2())
42{
dee1d5f1 43/// Standard constructor
5f91c9e8 44}
45
46//_____________________________________________________________________________
47AliMpZone::AliMpZone()
48 : TObject(),
49 fID(0),
0471c97b 50 fSubZones(),
5f91c9e8 51 fPadDimensions(TVector2())
52{
dee1d5f1 53/// Default constructor
5f91c9e8 54}
55
56//_____________________________________________________________________________
dee1d5f1 57AliMpZone::~AliMpZone()
58{
59/// Destructor
5f91c9e8 60
61 for (Int_t i=0; i<GetNofSubZones(); i++)
62 delete fSubZones[i];
63}
64
65//
66// public methods
67//
68
69//_____________________________________________________________________________
70void AliMpZone::AddSubZone(AliMpSubZone* subZone)
71{
dee1d5f1 72/// Add row segment.
5f91c9e8 73
f79c58a5 74 fSubZones.Add(subZone);
5f91c9e8 75}
76
77//_____________________________________________________________________________
78AliMpSubZone* AliMpZone::FindSubZone(AliMpVMotif* motif) const
79{
dee1d5f1 80/// Find a subzone with a specified motif;
81/// return 0 if not found.
5f91c9e8 82
83 for (Int_t i=0; i<GetNofSubZones(); i++) {
84 AliMpSubZone* subZone = GetSubZone(i);
85 if (subZone->GetMotif() == motif) return subZone;
86 }
87
88 return 0;
89}
90
91//_____________________________________________________________________________
92Int_t AliMpZone::GetNofSubZones() const
93{
dee1d5f1 94/// Return number of row segments.
5f91c9e8 95
f79c58a5 96 return fSubZones.GetEntriesFast();
5f91c9e8 97}
98
99//_____________________________________________________________________________
100AliMpSubZone* AliMpZone::GetSubZone(Int_t i) const
101{
dee1d5f1 102/// Return i-th sub zone.
31e62cbe 103
5f91c9e8 104 if (i<0 || i>=GetNofSubZones()) {
105 Warning("GetSubZone", "Index outside range");
106 return 0;
107 }
108
f79c58a5 109 return (AliMpSubZone*)fSubZones[i];
5f91c9e8 110}