]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpVSegmentation.h
In mapping:
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpVSegmentation.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 // $Id$
5 // $MpId: AliMpVSegmentation.h,v 1.12 2006/05/24 13:58:07 ivana Exp $
6
7 /// \ingroup basic
8 /// \class AliMpVSegmentation
9 /// \brief The abstract base class for the segmentation.
10 ///
11 /// Provides methods related to pads:
12 /// conversion between pad indices, pad location, pad position;
13 /// finding pad neighbour.
14 ///
15 /// \author David Guez, Ivana Hrivnacova, IPN Orsay;
16 ///         Laurent Aphecetche, SUBATECH
17
18 #ifndef ALI_MP_V_SEGMENTATION_H
19 #define ALI_MP_V_SEGMENTATION_H
20
21 #include <TObject.h>
22
23 #include "AliMpPadPair.h"
24 #include "AliMpPad.h"
25 #include "AliMpPlaneType.h"
26 #include "AliMpStationType.h"
27
28 class AliMpVPadIterator;
29 class AliMpIntPair;
30 class AliMpArea;
31
32 class TArrayI;
33 class TVector2;
34 class TObjArray;
35
36 class AliMpVSegmentation : public TObject
37 {
38   public:
39     AliMpVSegmentation();
40     virtual ~AliMpVSegmentation();
41   
42     // factory methods
43     /// Create iterator over pads in the given area 
44     virtual AliMpVPadIterator* CreateIterator(const AliMpArea& area) const = 0;
45
46     /// Create a pad iterator over the whole area
47     virtual AliMpVPadIterator* CreateIterator() const = 0;
48     
49     /// Fill the array with the pads that are neighbours of pad. Returns
50     /// the number of neighbours.
51     virtual Int_t GetNeighbours(const AliMpPad& pad, TObjArray& neighbours,
52                                 Bool_t includeSelf=kFALSE,
53                                 Bool_t includeVoid=kFALSE) const = 0;
54
55     // methods 
56     //
57             /// Find pad by location
58     virtual AliMpPad PadByLocation(const AliMpIntPair& location, 
59                                Bool_t warning = true) const = 0;
60             /// Find pad by indices
61     virtual AliMpPad PadByIndices (const AliMpIntPair& indices,  
62                                Bool_t warning = true) const = 0;
63             /// Find pad by position
64     virtual AliMpPad PadByPosition(const TVector2& position,
65                                Bool_t warning = true) const = 0;
66
67     virtual AliMpPadPair PadsUp(const AliMpPad& pad) const;
68     virtual AliMpPadPair PadsDown(const AliMpPad& pad) const;
69     virtual AliMpPadPair PadsLeft(const AliMpPad& pad) const;
70     virtual AliMpPadPair PadsRight(const AliMpPad& pad) const;
71
72             /// Return maximum pad index in X direction
73     virtual Int_t  MaxPadIndexX() const = 0;
74             /// Return maximum pad index in Y direction
75     virtual Int_t  MaxPadIndexY() const = 0;
76             /// Return the number of pads in the detection element
77     virtual Int_t  NofPads() const = 0;
78
79             /// Return true if the pad with given indices exists
80     virtual Bool_t HasPad(const AliMpIntPair& indices) const = 0;
81     
82             /// Fill the given array with the electronic card IDs
83     virtual void GetAllElectronicCardIDs(TArrayI& ecn) const = 0;
84
85             /// Return the plane type
86     virtual AliMp::PlaneType PlaneType() const = 0;
87     
88             /// Return the station type
89     virtual AliMp::StationType StationType() const = 0;
90
91             /// Return the half-sizes of the detection element
92     virtual TVector2 Dimensions() const = 0;
93     
94   private:  
95     // methods
96     AliMpPadPair FindPads(const TVector2& position1, 
97                           const TVector2& position2) const;
98
99   ClassDef(AliMpVSegmentation,1)  // Segmentation
100 };
101
102 #endif //ALI_MP_V_SEGMENTATION_H
103