]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONCluster.h
#100372: Request to port code to allow for event selection from ZDC timing info at...
[u/mrichter/AliRoot.git] / MUON / AliMUONCluster.h
index 444090067256a0ecd59d8c179eb1e0c95303ae07..f96eade5d3e5d201651d7d4dca415a7d38ca37fd 100644 (file)
 #ifndef ROOT_TVector2
 #  include "TVector2.h"
 #endif
+#ifndef ROOT_TString
+#  include "TString.h"
+#endif
 #ifndef ALI_MP_AREA_H
 #  include "AliMpArea.h"
 #endif
 #ifndef ALI_MP_DIRECTION_H
 #  include "AliMpDirection.h"
 #endif
-#ifndef ALI_MP_INT_PAIR_H
-#  include "AliMpIntPair.h"
+#ifndef ALI_MP_ENCODE_PAIR_H
+#  include "AliMpEncodePair.h"
+#endif
+
+#ifndef ROOT_TObjArray
+#  include "TObjArray.h"
 #endif
 
 class AliMUONPad;
-class TObjArray;
 
 class AliMUONCluster : public TObject
 {
@@ -39,12 +45,21 @@ public:
   AliMUONCluster& operator=(const AliMUONCluster& rhs);
   
   virtual ~AliMUONCluster();
+  
+  Bool_t Contains(const AliMUONPad& pad) const;
+  
+  TString AsString() const;
+  
+  static Bool_t AreOverlapping(const AliMUONCluster& c1, const AliMUONCluster& c2);
+  
+  AliMUONPad* AddPad(const AliMUONPad& pad);
 
-  void AddPad(const AliMUONPad& pad);
-
-  /// Area that contains all the pads.
+  /// Area that contains all the pads (whatever the cathode)
   AliMpArea Area() const;
-    
+
+  /// Area that contains all the pads of a given cathode
+  AliMpArea Area(Int_t cathode) const;
+
   Float_t Charge() const;
   Float_t Charge(Int_t cathode) const;
 
@@ -71,20 +86,33 @@ public:
   /// Return the max raw charge on the chathod
   Int_t MaxRawChargeCathode() const { return RawCharge(0) > RawCharge(1) ? 0:1; }
 
+  /// Return the biggest pad dimensions for a given cathode
+  TVector2 MaxPadDimensions(Int_t cathode, Int_t statusMask, Bool_t matchMask) const;
+  
+  /// Return the biggest pad dimensions
+  TVector2 MaxPadDimensions(Int_t statusMask, Bool_t matchMask) const;
+  
   /// Return the smallest pad dimensions for a given cathode
   TVector2 MinPadDimensions(Int_t cathode, Int_t statusMask, Bool_t matchMask) const;
   
   /// Return the smallest pad dimensions
-  TVector2 MinPadDimensions( Int_t statusMask, Bool_t matchMask) const;
+  TVector2 MinPadDimensions(Int_t statusMask, Bool_t matchMask) const;
   
   Int_t Multiplicity() const;
   Int_t Multiplicity(Int_t cathode) const;
 
   /// Compute number of pads in X and Y direction for a given cathode.  
-  AliMpIntPair NofPads(Int_t cathode, Int_t statusMask, Bool_t matchMask) const;
+  Long_t NofPads(Int_t cathode, Int_t statusMask, Bool_t matchMask) const;
   
   /// Number of pads in (X,Y) direction, whatever the cathode.
-  AliMpIntPair NofPads(Int_t statusMask, Bool_t matchMask=kTRUE) const;
+  Long_t NofPads(Int_t statusMask, Bool_t matchMask=kTRUE) const;
+  
+  /// Return true as the function Compare is implemented
+  Bool_t IsSortable() const { return kTRUE; }
+  
+//  Bool_t IsEqual(const TObject* obj) const;
+  
+  virtual Int_t Compare(const TObject* obj) const;
   
   AliMUONPad* Pad(Int_t index) const;
   
@@ -119,10 +147,19 @@ public:
   void SetPosition(const TVector2& pos, const TVector2& errorOnPos) 
   { fHasPosition = kTRUE; fPosition = pos; fPositionError = errorOnPos; }
   
-  void Sort();
+  Int_t Cathode() const;
+  
+  void AddCluster(const AliMUONCluster& cluster);
+
+  void Clear(Option_t* opt="");
+  
+  Bool_t IsMonoCathode() const;
+
+//private:
+    void DumpMe() const;
   
 private:
-  TObjArray* fPads; ///< AliMUONPad(s) composing this cluster
+  TObjArray fPads; ///< AliMUONPad(s) composing this cluster
   Bool_t fHasPosition; ///< false for pre-cluster (i.e. not yet computed)
   TVector2 fPosition; ///< (x,y) of that cluster (only valid if fHasPosition is kTRUE)
   TVector2 fPositionError; ///< errors on (x,y)
@@ -132,8 +169,8 @@ private:
   Float_t fCharge[2]; ///< cathode (re)computed charges
   Float_t fChi2; ///< chi2 of the RawCharge fit (if any)
   Bool_t fIsSaturated[2]; ///< saturation status of cathodes
-  Bool_t fIsSorted; ///< whether pads are sorted or not
-  ClassDef(AliMUONCluster,1) // A cluster of AliMUONPad
+  
+  ClassDef(AliMUONCluster,3) // A cluster of AliMUONPad
 };
 
 #endif