]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONCluster.h
Adding AliMUONQAIndices in base
[u/mrichter/AliRoot.git] / MUON / AliMUONCluster.h
CommitLineData
99ccb7f7 1#ifndef ALIMUONCLUSTER_H
2#define ALIMUONCLUSTER_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 AliMUONCluster
11/// \brief A group of adjacent pads
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
00de388f 21#ifndef ROOT_TString
22# include "TString.h"
23#endif
99ccb7f7 24#ifndef ALI_MP_AREA_H
25# include "AliMpArea.h"
26#endif
27#ifndef ALI_MP_DIRECTION_H
28# include "AliMpDirection.h"
29#endif
168e9c4d 30#ifndef ALI_MP_ENCODE_PAIR_H
31# include "AliMpEncodePair.h"
99ccb7f7 32#endif
33
e0de1dd9 34#ifndef ROOT_TObjArray
35# include "TObjArray.h"
36#endif
37
99ccb7f7 38class AliMUONPad;
99ccb7f7 39
40class AliMUONCluster : public TObject
41{
42public:
43 AliMUONCluster();
44 AliMUONCluster(const AliMUONCluster& rhs);
45 AliMUONCluster& operator=(const AliMUONCluster& rhs);
46
47 virtual ~AliMUONCluster();
00de388f 48
49 Bool_t Contains(const AliMUONPad& pad) const;
50
51 TString AsString() const;
52
53 static Bool_t AreOverlapping(const AliMUONCluster& c1, const AliMUONCluster& c2);
54
55 AliMUONPad* AddPad(const AliMUONPad& pad);
99ccb7f7 56
00de388f 57 /// Area that contains all the pads (whatever the cathode)
99ccb7f7 58 AliMpArea Area() const;
00de388f 59
60 /// Area that contains all the pads of a given cathode
61 AliMpArea Area(Int_t cathode) const;
62
99ccb7f7 63 Float_t Charge() const;
64 Float_t Charge(Int_t cathode) const;
65
66 /// Return the cathode's charges asymmetry
67 Float_t ChargeAsymmetry() const;
68
71a2d3aa 69 /// Return chi2 of the RawCharge fit (if any)
99ccb7f7 70 Float_t Chi2() const { return fChi2; }
71
72 virtual void Copy(TObject& obj) const;
73
71a2d3aa 74 /// Return false for pre-cluster
99ccb7f7 75 Bool_t HasPosition() const { return fHasPosition; }
76
77 /// Whether we have at least one saturated pad in a given cathode
78 Bool_t IsSaturated(Int_t cathode) const { return fIsSaturated[cathode]; }
79
80 /// Whether we have one saturated pad on *each* cathode
81 Bool_t IsSaturated() const { return IsSaturated(0) && IsSaturated(1); }
82
71a2d3aa 83 /// Return the max charge on the chathod
99ccb7f7 84 Int_t MaxChargeCathode() const { return Charge(0) > Charge(1) ? 0:1; }
85
71a2d3aa 86 /// Return the max raw charge on the chathod
99ccb7f7 87 Int_t MaxRawChargeCathode() const { return RawCharge(0) > RawCharge(1) ? 0:1; }
88
00de388f 89 /// Return the biggest pad dimensions for a given cathode
90 TVector2 MaxPadDimensions(Int_t cathode, Int_t statusMask, Bool_t matchMask) const;
91
92 /// Return the biggest pad dimensions
93 TVector2 MaxPadDimensions(Int_t statusMask, Bool_t matchMask) const;
94
99ccb7f7 95 /// Return the smallest pad dimensions for a given cathode
96 TVector2 MinPadDimensions(Int_t cathode, Int_t statusMask, Bool_t matchMask) const;
97
98 /// Return the smallest pad dimensions
00de388f 99 TVector2 MinPadDimensions(Int_t statusMask, Bool_t matchMask) const;
99ccb7f7 100
101 Int_t Multiplicity() const;
102 Int_t Multiplicity(Int_t cathode) const;
103
104 /// Compute number of pads in X and Y direction for a given cathode.
168e9c4d 105 Long_t NofPads(Int_t cathode, Int_t statusMask, Bool_t matchMask) const;
99ccb7f7 106
107 /// Number of pads in (X,Y) direction, whatever the cathode.
168e9c4d 108 Long_t NofPads(Int_t statusMask, Bool_t matchMask=kTRUE) const;
99ccb7f7 109
00de388f 110 /// Return true as the function Compare is implemented
111 Bool_t IsSortable() const { return kTRUE; }
112
113// Bool_t IsEqual(const TObject* obj) const;
114
115 virtual Int_t Compare(const TObject* obj) const;
116
99ccb7f7 117 AliMUONPad* Pad(Int_t index) const;
118
119 virtual void Paint(Option_t* opt="");
120
71a2d3aa 121 /// Return (x,y) of that cluster
99ccb7f7 122 TVector2 Position() const { return fPosition; }
71a2d3aa 123 /// Return errors on (x,y)
99ccb7f7 124 TVector2 PositionError() const { return fPositionError; }
125
126 virtual void Print(Option_t* opt="") const;
127
128 /// By default, return the average of both cathode RawCharges.
129 Float_t RawCharge() const;
130
131 /// Returns the RawCharge on the given cathode.
132 Float_t RawCharge(Int_t cathode) const;
133
134 /// Return the cathode's raw charges asymmetry
135 Float_t RawChargeAsymmetry() const;
136
137 void RemovePad(AliMUONPad* pad);
71a2d3aa 138
139 /// Set cathode (re)computed charges
99ccb7f7 140 void SetCharge(Float_t chargeCath0, Float_t chargeCath1)
141 { fHasCharge = kTRUE; fCharge[0]=chargeCath0; fCharge[1]=chargeCath1; }
71a2d3aa 142
143 /// Set chi2 of the RawCharge fit
99ccb7f7 144 void SetChi2(Float_t chi2) { fChi2 = chi2; }
145
71a2d3aa 146 /// Set (x,y) of that cluster and errors
99ccb7f7 147 void SetPosition(const TVector2& pos, const TVector2& errorOnPos)
148 { fHasPosition = kTRUE; fPosition = pos; fPositionError = errorOnPos; }
149
00de388f 150 Int_t Cathode() const;
151
152 void AddCluster(const AliMUONCluster& cluster);
153
154 void Clear(Option_t* opt="");
155
156private:
157 void DumpMe() const;
99ccb7f7 158
159private:
e0de1dd9 160 TObjArray fPads; ///< AliMUONPad(s) composing this cluster
99ccb7f7 161 Bool_t fHasPosition; ///< false for pre-cluster (i.e. not yet computed)
162 TVector2 fPosition; ///< (x,y) of that cluster (only valid if fHasPosition is kTRUE)
163 TVector2 fPositionError; ///< errors on (x,y)
164 Int_t fMultiplicity[2]; ///< number of pads in each cathode
165 Float_t fRawCharge[2]; ///< cathode RawCharges
166 Bool_t fHasCharge; ///< false if SetCharge has not been called
167 Float_t fCharge[2]; ///< cathode (re)computed charges
168 Float_t fChi2; ///< chi2 of the RawCharge fit (if any)
169 Bool_t fIsSaturated[2]; ///< saturation status of cathodes
00de388f 170
e0de1dd9 171 ClassDef(AliMUONCluster,3) // A cluster of AliMUONPad
99ccb7f7 172};
173
174#endif