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