]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpVSegmentation.h
6ec6a6bfaf4b8a2c136d660dbe8100827aff2643
[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
27 class AliMpVPadIterator;
28 class AliMpIntPair;
29 class AliMpArea;
30
31 class TArrayI;
32 class TVector2;
33 class TObjArray;
34
35 class AliMpVSegmentation : public TObject
36 {
37   public:
38     AliMpVSegmentation();
39     virtual ~AliMpVSegmentation();
40   
41     // factory methods
42     /// Create a pad iterator over the given area
43     virtual AliMpVPadIterator* CreateIterator(const AliMpArea& area) const = 0;
44     
45     /// Create a pad iterator over the whole area
46     virtual AliMpVPadIterator* CreateIterator() const = 0;
47     
48     /** Fills the array with the pads that are neighbours of pad. Returns
49         the number of neighbours. */
50     virtual Int_t GetNeighbours(const AliMpPad& pad, TObjArray& neighbours,
51                                 Bool_t includeSelf=kFALSE,
52                                 Bool_t includeVoid=kFALSE) const = 0;
53
54     // methods  
55     virtual AliMpPad PadByLocation(const AliMpIntPair& location, 
56                                Bool_t warning = true) const = 0;
57     virtual AliMpPad PadByIndices (const AliMpIntPair& indices,  
58                                Bool_t warning = true) const = 0;
59     virtual AliMpPad PadByPosition(const TVector2& position,
60                                Bool_t warning = true) const = 0;
61
62     virtual AliMpPadPair PadsUp(const AliMpPad& pad) const;
63     virtual AliMpPadPair PadsDown(const AliMpPad& pad) const;
64     virtual AliMpPadPair PadsLeft(const AliMpPad& pad) const;
65     virtual AliMpPadPair PadsRight(const AliMpPad& pad) const;
66
67     virtual Int_t  MaxPadIndexX() const = 0;
68     virtual Int_t  MaxPadIndexY() const = 0;
69     virtual Int_t  NofPads() const = 0;
70
71     virtual Bool_t HasPad(const AliMpIntPair& indices) const = 0;
72     
73     virtual void GetAllElectronicCardIDs(TArrayI& ecn) const = 0;
74
75     virtual AliMp::PlaneType PlaneType() const = 0;
76     
77     /// Gives the half-sizes (in cm) of the underlying detection element.
78     virtual TVector2 Dimensions() const = 0;
79     
80   private:  
81     // methods
82     AliMpPadPair FindPads(const TVector2& position1, 
83                           const TVector2& position2) const;
84
85   ClassDef(AliMpVSegmentation,1)  // Segmentation
86 };
87
88 #endif //ALI_MP_V_SEGMENTATION_H
89