]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpPad.h
- Added new functions:
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpPad.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: AliMpPad.h,v 1.11 2006/05/24 13:58:07 ivana Exp $
6
7 /// \ingroup basic
8 /// \class AliMpPad
9 /// \brief Class which encapsuate all information about a pad
10 ///
11 /// \author David Guez, Ivana Hrivnacova; IPN Orsay
12
13 #ifndef ALI_MP_PAD_H
14 #define ALI_MP_PAD_H
15
16 #include <TObject.h>
17
18 #include "AliMpContainers.h"
19 #include "AliMpIntPair.h"
20
21 #include <TVector2.h>
22 #ifdef WITH_ROOT
23 #include <TClonesArray.h>
24 #endif
25
26 #ifdef WITH_STL
27 #include <vector>
28 #endif
29
30 class AliMpPad : public TObject
31 {
32  public:
33 #ifdef WITH_STL
34   typedef std::vector<AliMpIntPair> IntPairVector;
35 #endif
36 #ifdef WITH_ROOT
37   typedef TClonesArray  IntPairVector;
38 #endif
39
40  public:
41   AliMpPad(const AliMpIntPair& location, const AliMpIntPair& indices,
42            const TVector2& position, const TVector2& dimensions,
43            Bool_t validity = true);
44   AliMpPad();
45   AliMpPad(const AliMpPad& src);
46   virtual ~AliMpPad();
47
48   // operators  
49   Bool_t operator == (const AliMpPad& pos2) const;
50   Bool_t operator != (const AliMpPad& pos2) const;
51   AliMpPad& operator = (const AliMpPad& src) ;
52   
53   // methods
54           void PrintOn(ostream& out) const;
55   virtual void Print(const char* /*option*/ = "") const;
56
57   // static get methods
58   static AliMpPad Invalid() {return AliMpPad();}
59
60   // set methods
61   Bool_t  AddLocation(const AliMpIntPair& location, Bool_t warn = true);
62
63   // get methods
64   AliMpIntPair GetLocation() const {return fLocation;}
65   AliMpIntPair GetIndices()  const {return fIndices;}
66   TVector2     Position()    const {return fPosition  ;}
67   TVector2     Dimensions()  const {return fDimensions;}
68   Bool_t       IsValid()     const {return fValidity  ;}
69   
70   Int_t        GetNofLocations() const;
71   AliMpIntPair GetLocation(Int_t i) const;
72   Bool_t       HasLocation(const AliMpIntPair& location) const; 
73
74  private:
75   // static data members
76   static const Int_t  fgkMaxNofLocations; ///< \brief maximum number of pad locations
77                                           /// in the collection
78   // data members
79   IntPairVector*  fLocations;      ///<  collection of pad locations 
80   AliMpIntPair    fLocation;       ///<  pad location
81   AliMpIntPair    fIndices;        ///<  pad indices
82   TVector2        fPosition;       ///<  the pad position (in cm)
83   TVector2        fDimensions;     ///<  the pad dimensions (in cm)
84   Bool_t          fValidity;       ///<  validity
85
86   ClassDef(AliMpPad,1) //utility class for the motif type
87 };
88
89 ostream& operator << (ostream &out, const AliMpPad& op);
90 Bool_t operator < (const AliMpPad& left, const AliMpPad& right);
91
92 #endif //ALI_MP_PAD_H