1 #ifndef ALIMUONCLUSTERFINDERPEAKCOG_H
2 #define ALIMUONCLUSTERFINDERPEAKCOG_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
9 /// \class AliMUONClusterFinderPeakCOG
10 /// \brief Cluster finder in MUON arm of ALICE
12 // Author Alexander Zinchenko, JINR Dubna; Laurent Aphecetche, SUBATECH
15 #include "AliMUONVClusterFinder.h"
17 #ifndef ROOT_TObjArray
18 # include "TObjArray.h"
21 # include "TVector2.h"
28 class AliMUONClusterFinderPeakCOG : public AliMUONVClusterFinder
31 AliMUONClusterFinderPeakCOG(Bool_t plot, AliMUONVClusterFinder* clusterFinder); // Constructor
32 virtual ~AliMUONClusterFinderPeakCOG(); // Destructor
34 /// It needs segmentation
35 virtual Bool_t NeedSegmentation() const { return kTRUE; }
37 using AliMUONVClusterFinder::Prepare;
39 virtual Bool_t Prepare(Int_t detElemId, TObjArray* pads[2],
40 const AliMpArea& area, const AliMpVSegmentation* seg[2]);
42 virtual AliMUONCluster* NextCluster();
44 virtual void Print(Option_t* opt="") const;
48 AliMUONClusterFinderPeakCOG(const AliMUONClusterFinderPeakCOG& rhs);
50 AliMUONClusterFinderPeakCOG& operator=(const AliMUONClusterFinderPeakCOG& rhs);
52 Bool_t WorkOnPreCluster();
54 /// Check precluster to simplify it (if possible), and return the simplified cluster
55 AliMUONCluster* CheckPrecluster(const AliMUONCluster& cluster);
56 AliMUONCluster* CheckPreclusterTwoCathodes(AliMUONCluster* cluster);
58 /// Checks whether a pad and a pixel have an overlapping area.
59 Bool_t Overlap(const AliMUONPad& pad, const AliMUONPad& pixel);
61 /// build array of pixels
62 void BuildPixArray(AliMUONCluster& cluster);
63 void BuildPixArrayOneCathode(AliMUONCluster& cluster);
64 void PadOverHist(Int_t idir, Int_t ix0, Int_t iy0, AliMUONPad *pad, TH2D *h1, TH2D *h2);
66 void RemovePixel(Int_t i);
68 AliMUONPad* Pixel(Int_t i) const;
70 Int_t FindLocalMaxima(TObjArray *pixArray, Int_t *localMax, Double_t *maxVal); // find local maxima
71 void FlagLocalMax(TH2D *hist, Int_t i, Int_t j, Int_t *isLocalMax); // flag local max
72 void FindCluster(AliMUONCluster& cluster, const Int_t *localMax, Int_t iMax); // find cluster around local max
73 void PadsInXandY(AliMUONCluster& cluster, Int_t &nInX, Int_t &nInY) const; // get number of pads in X and Y
78 // Status flags for pads
79 static const Int_t fgkZero; ///< pad "basic" state
80 static const Int_t fgkMustKeep; ///< do not kill (for pixels)
81 static const Int_t fgkUseForFit; ///< should be used for fit
82 static const Int_t fgkOver; ///< processing is over
83 static const Int_t fgkModified; ///< modified pad charge
84 static const Int_t fgkCoupled; ///< coupled pad
88 static const Double_t fgkZeroSuppression; ///< average zero suppression value
89 static const Double_t fgkDistancePrecision; ///< used to check overlaps and so on
90 static const TVector2 fgkIncreaseSize; ///< idem
91 static const TVector2 fgkDecreaseSize; ///< idem
93 AliMUONVClusterFinder* fPreClusterFinder; //!< the pre-clustering worker
94 AliMUONCluster* fPreCluster; //!< current pre-cluster
95 TObjArray fClusterList; //!< clusters corresponding to the current pre-cluster
97 Int_t fEventNumber; //!< current event being processed
98 Int_t fDetElemId; //!< current DE being processed
99 Int_t fClusterNumber; //!< current cluster number
101 const AliMpVSegmentation *fkSegmentation[2]; //!< new segmentation
103 TH2D *fHistAnode; //!< histo for peak search
104 TObjArray* fPixArray; //!< collection of pixels
105 Int_t fDebug; //!< debug level
106 Bool_t fPlot; //!< whether we should plot thing (for debug only, quite slow!)
108 Int_t fNClusters; //!< total number of clusters
109 Int_t fNAddVirtualPads; //!< number of clusters for which we added virtual pads
111 ClassDef(AliMUONClusterFinderPeakCOG,0) // cluster finder in MUON arm of ALICE