]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONPad.h
Using AliITSgeomTGeo
[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);
36 virtual ~AliMUONPad() {}
37
38 void BackupCharge() { fChargeBackup = fCharge; }
39
40 Int_t Cathode() const { return fCathode; }
41
42 Double_t Coord(Int_t ixy) const;
43
44 Double_t Charge() const { return fCharge; }
45 Double_t ChargeBackup() const { return fChargeBackup; }
46
47 virtual Int_t Compare(const TObject* obj) const;
48
49 Int_t DetElemId() const { return fDetElemId; }
50
51 Int_t DigitIndex() const { return fDigitIndex; }
52
53 TVector2 Dimensions() const { return fDimensions; }
54
55 Double_t DX() const { return fDimensions.X(); }
56 Double_t DY() const { return fDimensions.Y(); }
57
58 Bool_t IsReal() const { return fIsReal; }
59
60 Bool_t IsSaturated() const { return fIsSaturated; }
61
62 Bool_t IsSortable() const { return kTRUE; }
63
64 Bool_t IsUsed() const { return fClusterId >= 0; }
65
66 Int_t Ix() const { return fIx; }
67 Int_t Iy() const { return fIy; }
68
69 virtual void Paint(Option_t* opt="");
70
71 TVector2 Position() const { return fPosition; }
72
73 void Print(Option_t* opt = "") const;
74
75 // Detach this pad from a cluster
76 void Release() { fClusterId = -1; }
77
78 void RevertCharge() { fCharge = fChargeBackup; }
79
80 void SetCharge(Double_t charge) { fCharge = charge; }
81
82 void SetChargeBackup(Double_t charge) { fChargeBackup = charge; }
83
84 void SetCoord(Int_t ixy, Double_t Coord);
85
86 void SetDigitIndex(Int_t digitIndex) { fDigitIndex = digitIndex; }
87
88 void SetStatus(Int_t status) { fStatus = status; }
89
90 void SetClusterId(Int_t id) { fClusterId = id; }
91
92 void SetSaturated(Bool_t val) { fIsSaturated = val; }
93
94 void SetSize(Int_t ixy, Double_t Size);
95
96 void SetReal(Bool_t val) { fIsReal = val; }
97
98 void Shift(Int_t ixy, Double_t shift);
99
100 Double_t Size(Int_t ixy) const;
101
102 Int_t Status() const { return fStatus; }
103
104 Double_t X() const { return fPosition.X(); }
105 Double_t Y() const { return fPosition.Y(); }
106
107 static AliMpArea Overlap(const AliMUONPad& d1, const AliMUONPad& d2);
108
109 static Bool_t AreOverlapping(const AliMUONPad& d1, const AliMUONPad& d2,
110 const TVector2& precision,
111 AliMpArea& overlapArea);
112
113 static Bool_t AreOverlapping(const AliMUONPad& d1, const AliMUONPad& d2,
114 const TVector2& precision);
115
116 static Bool_t AreNeighbours(const AliMUONPad& d1, const AliMUONPad& d2);
117
118
119private:
120 void Init(Int_t detElemId, Int_t cathode,
121 Int_t ix, Int_t iy,
122 const TVector2& position,
123 const TVector2& dimensions,
124 Double_t charge);
125
126private:
127 Bool_t fIsSaturated; /// whether this pad is saturated or not
128 Bool_t fIsReal; /// whether this is a real pad or a virtual one
129 Int_t fClusterId; /// cluster id this pad belongs to (-1 if not attached to a cluster)
130 Int_t fCathode; /// cathode number
131 Int_t fDetElemId; /// detection element id
132 Int_t fDigitIndex; /// corresponding digit index (to get back the digit from which this pad was constructed, if needed)
133 Int_t fIx; /// x-index
134 Int_t fIy; /// y-index
135 Int_t fStatus; /// status word
136 TVector2 fDimensions; /// half dimensions in x and y (cm)
137 TVector2 fPosition; /// positions in x and y (cm)
138 Double_t fCharge; /// pad charge
139 Double_t fChargeBackup; /// backup charge (usefull if clustering somehow plays with the charge, this one is the "original" one)
140
141 ClassDef(AliMUONPad,1) // A full grown pad
142};
143
144#endif