]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpPad.h
Corrected the list of bus patches with reverted manus
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpPad.h
CommitLineData
dee1d5f1 1/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
3
5f91c9e8 4// $Id$
13985652 5// $MpId: AliMpPad.h,v 1.11 2006/05/24 13:58:07 ivana Exp $
dee1d5f1 6
7/// \ingroup basic
8/// \class AliMpPad
9/// \brief Class which encapsuate all information about a pad
10///
13985652 11/// \author David Guez, Ivana Hrivnacova; IPN Orsay
5f91c9e8 12
13#ifndef ALI_MP_PAD_H
14#define ALI_MP_PAD_H
15
2a7ea2e6 16#include <TObject.h>
2100f1c2 17
2a7ea2e6 18#include "AliMpContainers.h"
19#include "AliMpIntPair.h"
2100f1c2 20
2a7ea2e6 21#include <TVector2.h>
2100f1c2 22#ifdef WITH_ROOT
23#include <TClonesArray.h>
24#endif
25
2a7ea2e6 26#ifdef WITH_STL
27#include <vector>
28#endif
5f91c9e8 29
30class AliMpPad : public TObject
31{
2100f1c2 32 public:
33#ifdef WITH_STL
f5671fc3 34 /// Int pair vector type
2100f1c2 35 typedef std::vector<AliMpIntPair> IntPairVector;
36#endif
37#ifdef WITH_ROOT
f5671fc3 38 /// Int pair vector type
2100f1c2 39 typedef TClonesArray IntPairVector;
40#endif
41
5f91c9e8 42 public:
43 AliMpPad(const AliMpIntPair& location, const AliMpIntPair& indices,
44 const TVector2& position, const TVector2& dimensions,
2100f1c2 45 Bool_t validity = true);
5f91c9e8 46 AliMpPad();
47 AliMpPad(const AliMpPad& src);
48 virtual ~AliMpPad();
49
f5671fc3 50 //
5f91c9e8 51 // operators
f5671fc3 52 //
5f91c9e8 53 Bool_t operator == (const AliMpPad& pos2) const;
54 Bool_t operator != (const AliMpPad& pos2) const;
55 AliMpPad& operator = (const AliMpPad& src) ;
56
f5671fc3 57 //
5f91c9e8 58 // methods
f5671fc3 59 //
457cc786 60 void PrintOn(ostream& out) const;
2998a151 61 virtual void Print(const char* /*option*/ = "") const;
5f91c9e8 62
f5671fc3 63 //
5f91c9e8 64 // static get methods
f5671fc3 65 //
66 /// Return invalid pad
5f91c9e8 67 static AliMpPad Invalid() {return AliMpPad();}
68
f5671fc3 69 //
2100f1c2 70 // set methods
f5671fc3 71 //
2100f1c2 72 Bool_t AddLocation(const AliMpIntPair& location, Bool_t warn = true);
73
f5671fc3 74 //
5f91c9e8 75 // get methods
f5671fc3 76 //
77 /// Return pad location
2100f1c2 78 AliMpIntPair GetLocation() const {return fLocation;}
f5671fc3 79 /// Return pad indices
2100f1c2 80 AliMpIntPair GetIndices() const {return fIndices;}
f5671fc3 81 /// Return the pad position (in cm)
2100f1c2 82 TVector2 Position() const {return fPosition ;}
f5671fc3 83 /// Return the pad dimensions (in cm)
2100f1c2 84 TVector2 Dimensions() const {return fDimensions;}
f5671fc3 85 /// Return validity
2100f1c2 86 Bool_t IsValid() const {return fValidity ;}
87
88 Int_t GetNofLocations() const;
89 AliMpIntPair GetLocation(Int_t i) const;
90 Bool_t HasLocation(const AliMpIntPair& location) const;
5f91c9e8 91
92 private:
2100f1c2 93 // static data members
829425a5 94 static const Int_t fgkMaxNofLocations; ///< \brief maximum number of pad locations
95 /// in the collection
5f91c9e8 96 // data members
829425a5 97 IntPairVector* fLocations; ///< collection of pad locations
98 AliMpIntPair fLocation; ///< pad location
99 AliMpIntPair fIndices; ///< pad indices
100 TVector2 fPosition; ///< the pad position (in cm)
101 TVector2 fDimensions; ///< the pad dimensions (in cm)
102 Bool_t fValidity; ///< validity
5f91c9e8 103
104 ClassDef(AliMpPad,1) //utility class for the motif type
105};
106
107ostream& operator << (ostream &out, const AliMpPad& op);
108Bool_t operator < (const AliMpPad& left, const AliMpPad& right);
109
110#endif //ALI_MP_PAD_H