1 #ifndef ALIMUONCLUSTER_H
2 #define ALIMUONCLUSTER_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 /// \class AliMUONCluster
11 /// \brief A group of adjacent pads
13 // Author Laurent Aphecetche
19 # include "TVector2.h"
22 # include "AliMpArea.h"
24 #ifndef ALI_MP_DIRECTION_H
25 # include "AliMpDirection.h"
27 #ifndef ALI_MP_INT_PAIR_H
28 # include "AliMpIntPair.h"
34 class AliMUONCluster : public TObject
38 AliMUONCluster(const AliMUONCluster& rhs);
39 AliMUONCluster& operator=(const AliMUONCluster& rhs);
41 virtual ~AliMUONCluster();
43 void AddPad(const AliMUONPad& pad);
45 /// Area that contains all the pads.
46 AliMpArea Area() const;
48 Float_t Charge() const;
49 Float_t Charge(Int_t cathode) const;
51 /// Return the cathode's charges asymmetry
52 Float_t ChargeAsymmetry() const;
54 Float_t Chi2() const { return fChi2; }
56 virtual void Copy(TObject& obj) const;
58 Bool_t HasPosition() const { return fHasPosition; }
60 /// Whether we have at least one saturated pad in a given cathode
61 Bool_t IsSaturated(Int_t cathode) const { return fIsSaturated[cathode]; }
63 /// Whether we have one saturated pad on *each* cathode
64 Bool_t IsSaturated() const { return IsSaturated(0) && IsSaturated(1); }
66 Int_t MaxChargeCathode() const { return Charge(0) > Charge(1) ? 0:1; }
68 Int_t MaxRawChargeCathode() const { return RawCharge(0) > RawCharge(1) ? 0:1; }
70 /// Return the smallest pad dimensions for a given cathode
71 TVector2 MinPadDimensions(Int_t cathode, Int_t statusMask, Bool_t matchMask) const;
73 /// Return the smallest pad dimensions
74 TVector2 MinPadDimensions( Int_t statusMask, Bool_t matchMask) const;
76 Int_t Multiplicity() const;
77 Int_t Multiplicity(Int_t cathode) const;
79 /// Compute number of pads in X and Y direction for a given cathode.
80 AliMpIntPair NofPads(Int_t cathode, Int_t statusMask, Bool_t matchMask) const;
82 /// Number of pads in (X,Y) direction, whatever the cathode.
83 AliMpIntPair NofPads(Int_t statusMask, Bool_t matchMask=kTRUE) const;
85 AliMUONPad* Pad(Int_t index) const;
87 virtual void Paint(Option_t* opt="");
89 TVector2 Position() const { return fPosition; }
90 TVector2 PositionError() const { return fPositionError; }
92 virtual void Print(Option_t* opt="") const;
94 /// By default, return the average of both cathode RawCharges.
95 Float_t RawCharge() const;
97 /// Returns the RawCharge on the given cathode.
98 Float_t RawCharge(Int_t cathode) const;
100 /// Return the cathode's raw charges asymmetry
101 Float_t RawChargeAsymmetry() const;
103 void RemovePad(AliMUONPad* pad);
105 void SetCharge(Float_t chargeCath0, Float_t chargeCath1)
106 { fHasCharge = kTRUE; fCharge[0]=chargeCath0; fCharge[1]=chargeCath1; }
108 void SetChi2(Float_t chi2) { fChi2 = chi2; }
110 void SetPosition(const TVector2& pos, const TVector2& errorOnPos)
111 { fHasPosition = kTRUE; fPosition = pos; fPositionError = errorOnPos; }
116 TObjArray* fPads; ///< AliMUONPad(s) composing this cluster
117 Bool_t fHasPosition; ///< false for pre-cluster (i.e. not yet computed)
118 TVector2 fPosition; ///< (x,y) of that cluster (only valid if fHasPosition is kTRUE)
119 TVector2 fPositionError; ///< errors on (x,y)
120 Int_t fMultiplicity[2]; ///< number of pads in each cathode
121 Float_t fRawCharge[2]; ///< cathode RawCharges
122 Bool_t fHasCharge; ///< false if SetCharge has not been called
123 Float_t fCharge[2]; ///< cathode (re)computed charges
124 Float_t fChi2; ///< chi2 of the RawCharge fit (if any)
125 Bool_t fIsSaturated[2]; ///< saturation status of cathodes
126 Bool_t fIsSorted; ///< whether pads are sorted or not
127 ClassDef(AliMUONCluster,1) // A cluster of AliMUONPad