Update HFE v2 analyses
[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
168e9c4d 16#include "AliMpEncodePair.h"
2100f1c2 17
168e9c4d 18#include <TObject.h>
2100f1c2 19
2100f1c2 20#include <TClonesArray.h>
5f91c9e8 21
22class AliMpPad : public TObject
23{
24 public:
168e9c4d 25 AliMpPad(Int_t manuId, Int_t channel,
26 Int_t ix, Int_t iy,
6e97fbb8 27 Double_t x, Double_t y,
28 Double_t dx, Double_t dy,
2100f1c2 29 Bool_t validity = true);
168e9c4d 30 AliMpPad(Int_t manuId, Int_t channel,
31 MpPair_t indices,
6e97fbb8 32 Double_t positionX, Double_t positionY,
33 Double_t dx, Double_t dy,
168e9c4d 34 Bool_t validity = true);
35
5f91c9e8 36 AliMpPad();
37 AliMpPad(const AliMpPad& src);
6e97fbb8 38 ~AliMpPad();
5f91c9e8 39
f5671fc3 40 //
5f91c9e8 41 // operators
f5671fc3 42 //
5f91c9e8 43 Bool_t operator == (const AliMpPad& pos2) const;
44 Bool_t operator != (const AliMpPad& pos2) const;
45 AliMpPad& operator = (const AliMpPad& src) ;
46
f5671fc3 47 //
5f91c9e8 48 // methods
f5671fc3 49 //
6e97fbb8 50 void PrintOn(ostream& out) const;
51 void Print(const char* /*option*/ = "") const;
5f91c9e8 52
f5671fc3 53 //
5f91c9e8 54 // static get methods
f5671fc3 55 //
56 /// Return invalid pad
5f91c9e8 57 static AliMpPad Invalid() {return AliMpPad();}
58
f5671fc3 59 //
2100f1c2 60 // set methods
f5671fc3 61 //
168e9c4d 62 Bool_t AddLocation(Int_t localBoardId, Int_t localBoardChannel,
63 Bool_t warn = true);
2100f1c2 64
f5671fc3 65 //
5f91c9e8 66 // get methods
f5671fc3 67 //
168e9c4d 68 /// Return pad location as encoded pair (manuId, manuChannel)
69 MpPair_t GetLocation() const { return fLLocation; }
70 Int_t GetManuId() const;
71 Int_t GetManuChannel() const;
72
73 /// Return pad indices as encoded pair (ix, iy)
74 MpPair_t GetIndices() const { return fLIndices; }
75 Int_t GetIx() const;
76 Int_t GetIy() const;
77
6e97fbb8 78 /// Return the pad x position (in cm)
79 Double_t GetPositionX() const { return fPositionX; }
80 /// Return the pad x position (in cm)
81 Double_t GetPositionY() const { return fPositionY; }
82
83 /// Return the x pad dimension - half length (in cm)
84 Double_t GetDimensionX() const {return fDimensionX;}
85 /// Return the y pad dimension - half length (in cm)
86 Double_t GetDimensionY() const {return fDimensionY;}
87
f5671fc3 88 /// Return validity
2100f1c2 89 Bool_t IsValid() const {return fValidity ;}
90
91 Int_t GetNofLocations() const;
168e9c4d 92 MpPair_t GetLocation(Int_t i) const;
93 Int_t GetLocalBoardId(Int_t i) const;
94 Int_t GetLocalBoardChannel(Int_t i) const;
95
96 Bool_t HasLocation(Int_t localBoardId, Int_t localBoardChannel) const;
5f91c9e8 97
98 private:
168e9c4d 99
2100f1c2 100 // static data members
829425a5 101 static const Int_t fgkMaxNofLocations; ///< \brief maximum number of pad locations
102 /// in the collection
5f91c9e8 103 // data members
c9d734d4 104 UInt_t fNofLocations; ///< number of locations in fLocations
cddcc1f3 105 /// Collection of pad locations - encoded pair (localBoardId, localBoardChannel)
106 MpPair_t* fLLocations; //[fNofLocations]
168e9c4d 107 MpPair_t fLLocation; ///< pad location as encoded pair (manuId, manuChannel)
108 MpPair_t fLIndices; ///< pad indices as encoded pair (ix, iy)
6e97fbb8 109 Double_t fPositionX; ///< the pad x position (in cm)
110 Double_t fPositionY; ///< the pad y position (in cm)
111 Double_t fDimensionX; ///< the pad x dimension - half length (in cm)
112 Double_t fDimensionY; ///< the pad y dimension - half length(in cm)
829425a5 113 Bool_t fValidity; ///< validity
5f91c9e8 114
6e97fbb8 115 ClassDef(AliMpPad,4) //utility class for the motif type
5f91c9e8 116};
117
118ostream& operator << (ostream &out, const AliMpPad& op);
119Bool_t operator < (const AliMpPad& left, const AliMpPad& right);
120
121#endif //ALI_MP_PAD_H