]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONPad.h
Temporary disable the raw version, it will be taken from FEE
[u/mrichter/AliRoot.git] / MUON / AliMUONPad.h
CommitLineData
4b6f2cee 1#ifndef ALIMUONPAD_H
2#define ALIMUONPAD_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5* See cxx source for full Copyright notice */
6
7// $Id$
8
9/// \ingroup rec
10/// \class AliMUONPad
11/// \brief Combination of digit and mppad informations.
12///
13// Author Laurent Aphecetche
14
15#ifndef ROOT_TObject
16# include "TObject.h"
17#endif
18#ifndef ROOT_TVector2
19# include "TVector2.h"
20#endif
21#ifndef ALI_MP_AREA_H
22# include "AliMpArea.h"
23#endif
24
25class AliMUONPad : public TObject
26{
27public:
28 AliMUONPad();
29 AliMUONPad(Double_t x, Double_t y,
30 Double_t dx, Double_t dy, Double_t charge);
31 AliMUONPad(const TVector2& position, const TVector2& dimensions,
32 Double_t charge);
33 AliMUONPad(Int_t detElemId, Int_t cathode,
34 Int_t ix, Int_t iy, Double_t x, Double_t y,
35 Double_t dx, Double_t dy, Double_t charge);
71a2d3aa 36 virtual ~AliMUONPad();
4b6f2cee 37
71a2d3aa 38 /// \brief Backup charge
39 /// Usefull if clustering somehow plays with the charge, this one is the "original" one
4b6f2cee 40 void BackupCharge() { fChargeBackup = fCharge; }
41
71a2d3aa 42 /// Return cathode number
4b6f2cee 43 Int_t Cathode() const { return fCathode; }
44
45 Double_t Coord(Int_t ixy) const;
46
71a2d3aa 47 /// Return pad charge
4b6f2cee 48 Double_t Charge() const { return fCharge; }
71a2d3aa 49 /// Return backup charge
4b6f2cee 50 Double_t ChargeBackup() const { return fChargeBackup; }
51
71a2d3aa 52 /// Return detection element id
4b6f2cee 53 Int_t DetElemId() const { return fDetElemId; }
54
71a2d3aa 55 /// \brief Return corresponding digit index
56 /// To get back the digit from which this pad was constructed, if needed
4b6f2cee 57 Int_t DigitIndex() const { return fDigitIndex; }
58
71a2d3aa 59 /// Return half dimensions in x and y (cm)
4b6f2cee 60 TVector2 Dimensions() const { return fDimensions; }
61
71a2d3aa 62 /// Return half dimensions in x (cm)
4b6f2cee 63 Double_t DX() const { return fDimensions.X(); }
71a2d3aa 64 /// Return half dimensions in y (cm)
4b6f2cee 65 Double_t DY() const { return fDimensions.Y(); }
66
71a2d3aa 67 /// Return info whether this is a real pad or a virtual one
4b6f2cee 68 Bool_t IsReal() const { return fIsReal; }
69
71a2d3aa 70 /// Return info whether this pad is saturated or not
4b6f2cee 71 Bool_t IsSaturated() const { return fIsSaturated; }
72
8f473fdb 73 /// Return true as the function Compare is implemented
4b6f2cee 74 Bool_t IsSortable() const { return kTRUE; }
75
8f473fdb 76 virtual Int_t Compare(const TObject* obj) const;
77
71a2d3aa 78 /// Return true if is used
4b6f2cee 79 Bool_t IsUsed() const { return fClusterId >= 0; }
80
71a2d3aa 81 /// Return x-index
4b6f2cee 82 Int_t Ix() const { return fIx; }
71a2d3aa 83 /// Return y-index
4b6f2cee 84 Int_t Iy() const { return fIy; }
85
86 virtual void Paint(Option_t* opt="");
87
71a2d3aa 88 /// Return positions in x and y (cm)
4b6f2cee 89 TVector2 Position() const { return fPosition; }
90
91 void Print(Option_t* opt = "") const;
92
71a2d3aa 93 /// Detach this pad from a cluster
4b6f2cee 94 void Release() { fClusterId = -1; }
95
71a2d3aa 96 /// Set charge to value in backup charge
4b6f2cee 97 void RevertCharge() { fCharge = fChargeBackup; }
98
71a2d3aa 99 /// Set charge
4b6f2cee 100 void SetCharge(Double_t charge) { fCharge = charge; }
101
71a2d3aa 102 /// Set charge backup
4b6f2cee 103 void SetChargeBackup(Double_t charge) { fChargeBackup = charge; }
104
105 void SetCoord(Int_t ixy, Double_t Coord);
106
71a2d3aa 107 /// \brief Set corresponding digit index
108 /// To get back the digit from which this pad was constructed, if needed
4b6f2cee 109 void SetDigitIndex(Int_t digitIndex) { fDigitIndex = digitIndex; }
110
71a2d3aa 111 /// Set status word
4b6f2cee 112 void SetStatus(Int_t status) { fStatus = status; }
113
71a2d3aa 114 /// \brief Set cluster id this pad belongs to
115 /// -1 if not attached to a cluster
4b6f2cee 116 void SetClusterId(Int_t id) { fClusterId = id; }
117
71a2d3aa 118 /// Set info whether this pad is saturated or not
4b6f2cee 119 void SetSaturated(Bool_t val) { fIsSaturated = val; }
120
121 void SetSize(Int_t ixy, Double_t Size);
122
71a2d3aa 123 /// Set info whether this is a real pad or a virtual one
4b6f2cee 124 void SetReal(Bool_t val) { fIsReal = val; }
125
126 void Shift(Int_t ixy, Double_t shift);
127
128 Double_t Size(Int_t ixy) const;
129
71a2d3aa 130 /// Return status word
4b6f2cee 131 Int_t Status() const { return fStatus; }
132
71a2d3aa 133 /// Return position in x (cm)
4b6f2cee 134 Double_t X() const { return fPosition.X(); }
71a2d3aa 135 /// Return position in y (cm)
4b6f2cee 136 Double_t Y() const { return fPosition.Y(); }
137
138 static AliMpArea Overlap(const AliMUONPad& d1, const AliMUONPad& d2);
139
140 static Bool_t AreOverlapping(const AliMUONPad& d1, const AliMUONPad& d2,
141 const TVector2& precision,
142 AliMpArea& overlapArea);
143
144 static Bool_t AreOverlapping(const AliMUONPad& d1, const AliMUONPad& d2,
145 const TVector2& precision);
146
147 static Bool_t AreNeighbours(const AliMUONPad& d1, const AliMUONPad& d2);
148
149
150private:
151 void Init(Int_t detElemId, Int_t cathode,
152 Int_t ix, Int_t iy,
153 const TVector2& position,
154 const TVector2& dimensions,
155 Double_t charge);
156
157private:
71a2d3aa 158 Bool_t fIsSaturated; ///< whether this pad is saturated or not
159 Bool_t fIsReal; ///< whether this is a real pad or a virtual one
160 Int_t fClusterId; ///< cluster id this pad belongs to (-1 if not attached to a cluster)
161 Int_t fCathode; ///< cathode number
162 Int_t fDetElemId; ///< detection element id
163 Int_t fDigitIndex; ///< corresponding digit index (to get back the digit from which this pad was constructed, if needed)
164 Int_t fIx; ///< x-index
165 Int_t fIy; ///< y-index
166 Int_t fStatus; ///< status word
167 TVector2 fDimensions; ///< half dimensions in x and y (cm)
168 TVector2 fPosition; ///< positions in x and y (cm)
169 Double_t fCharge; ///< pad charge
170 Double_t fChargeBackup; ///< backup charge (usefull if clustering somehow plays with the charge, this one is the "original" one)
4b6f2cee 171
172 ClassDef(AliMUONPad,1) // A full grown pad
173};
174
175#endif