]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpVSegmentation.h
Replacement of AliMpIntPair object with algoritmic
[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 "AliMpPad.h"
24 #include "AliMpPlaneType.h"
25 #include "AliMpStationType.h"
26
27 class AliMpVPadIterator;
28 class AliMpArea;
29 class AliMpMotifPosition;
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     //
42     // methods 
43     //
44
45     // factory methods
46     /// Create iterator over pads in the given area 
47     virtual AliMpVPadIterator* CreateIterator(const AliMpArea& area) const = 0;
48
49     /// Create a pad iterator over the whole area
50     virtual AliMpVPadIterator* CreateIterator() const = 0;
51     
52     /// Fill the array with the pads that are neighbours of pad. Returns
53     /// the number of neighbours.
54     virtual Int_t GetNeighbours(const AliMpPad& pad, TObjArray& neighbours,
55                                 Bool_t includeSelf=kFALSE,
56                                 Bool_t includeVoid=kFALSE) const = 0;
57
58             /// Find pad by location
59     virtual AliMpPad PadByLocation(Int_t manuId, Int_t manuChannel, 
60                                 Bool_t warning = true) const = 0;
61             /// Find pad by indices
62     virtual AliMpPad PadByIndices (Int_t ix, Int_t iy,  
63                                Bool_t warning = true) const = 0;
64             /// Find pad by position
65     virtual AliMpPad PadByPosition(const TVector2& position,
66                                Bool_t warning = true) const = 0;
67             /// Return true if the pad with given indices exists.
68             /// Compared with the PadByIndices method, this one can generally be implemented
69             /// faster, as one does not have to create an AliMpPad object... 
70     virtual Bool_t HasPadByIndices(Int_t ix, Int_t iy) const;
71   
72             /// Return true if the pad with given location exists
73     virtual Bool_t HasPadByLocation(Int_t manuId, Int_t manuChannel) const;
74   
75             /// Return maximum pad index in X direction
76     virtual Int_t  MaxPadIndexX() const = 0;
77             /// Return maximum pad index in Y direction
78     virtual Int_t  MaxPadIndexY() const = 0;
79             /// Return the number of pads in the detection element
80     virtual Int_t  NofPads() const = 0;
81
82             /// Fill the given array with the electronic card IDs
83     virtual void GetAllElectronicCardIDs(TArrayI& ecn) const = 0;
84
85             /// Get the number of electronic card IDs 
86     virtual Int_t GetNofElectronicCards() const = 0;
87     
88             /// Whether or not we have a given manu
89     virtual Bool_t HasMotifPosition(Int_t manuId) const = 0;
90   
91             /// Return the position of a given manu (aka motifPosition)
92     virtual AliMpMotifPosition* MotifPosition(Int_t manuId) const = 0;
93
94             /// Return the plane type
95     virtual AliMp::PlaneType PlaneType() const = 0;
96     
97             /// Return the station type
98     virtual AliMp::StationType StationType() const = 0;
99
100             /// Return the half-sizes of the detection element
101     virtual TVector2 Dimensions() const = 0;
102     
103             /// Return the position of the origine of the detection element
104     virtual TVector2 Position() const = 0;
105
106   
107   ClassDef(AliMpVSegmentation,1)  // Segmentation
108 };
109
110 #endif //ALI_MP_V_SEGMENTATION_H
111