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"
29 class AliMUONClusterFinderPeakCOG : public AliMUONVClusterFinder
32 AliMUONClusterFinderPeakCOG(Bool_t plot, AliMUONVClusterFinder* clusterFinder); // Constructor
33 virtual ~AliMUONClusterFinderPeakCOG(); // Destructor
35 /// It needs segmentation
36 virtual Bool_t NeedSegmentation() const { return kTRUE; }
38 using AliMUONVClusterFinder::Prepare;
40 virtual Bool_t Prepare(Int_t detElemId, TClonesArray* pads[2],
41 const AliMpArea& area, const AliMpVSegmentation* seg[2]);
43 virtual AliMUONCluster* NextCluster();
45 virtual void Print(Option_t* opt="") const;
49 AliMUONClusterFinderPeakCOG(const AliMUONClusterFinderPeakCOG& rhs);
51 AliMUONClusterFinderPeakCOG& operator=(const AliMUONClusterFinderPeakCOG& rhs);
53 Bool_t WorkOnPreCluster();
55 /// Check precluster to simplify it (if possible), and return the simplified cluster
56 AliMUONCluster* CheckPrecluster(const AliMUONCluster& cluster);
57 AliMUONCluster* CheckPreclusterTwoCathodes(AliMUONCluster* cluster);
59 /// Checks whether a pad and a pixel have an overlapping area.
60 Bool_t Overlap(const AliMUONPad& pad, const AliMUONPad& pixel);
62 /// build array of pixels
63 void BuildPixArray(AliMUONCluster& cluster);
64 void BuildPixArrayOneCathode(AliMUONCluster& cluster);
65 void PadOverHist(Int_t idir, Int_t ix0, Int_t iy0, AliMUONPad *pad, TH2D *h1, TH2D *h2);
67 void RemovePixel(Int_t i);
69 AliMUONPad* Pixel(Int_t i) const;
71 Int_t FindLocalMaxima(TObjArray *pixArray, Int_t *localMax, Double_t *maxVal); // find local maxima
72 void FlagLocalMax(TH2D *hist, Int_t i, Int_t j, Int_t *isLocalMax); // flag local max
73 void FindCluster(AliMUONCluster& cluster, Int_t *localMax, Int_t iMax); // find cluster around local max
74 void PadsInXandY(AliMUONCluster& cluster, Int_t &nInX, Int_t &nInY) const; // get number of pads in X and Y
79 // Status flags for pads
80 static const Int_t fgkZero; ///< pad "basic" state
81 static const Int_t fgkMustKeep; ///< do not kill (for pixels)
82 static const Int_t fgkUseForFit; ///< should be used for fit
83 static const Int_t fgkOver; ///< processing is over
84 static const Int_t fgkModified; ///< modified pad charge
85 static const Int_t fgkCoupled; ///< coupled pad
89 static const Double_t fgkZeroSuppression; ///< average zero suppression value
90 static const Double_t fgkDistancePrecision; ///< used to check overlaps and so on
91 static const TVector2 fgkIncreaseSize; ///< idem
92 static const TVector2 fgkDecreaseSize; ///< idem
94 AliMUONVClusterFinder* fPreClusterFinder; //!< the pre-clustering worker
95 AliMUONCluster* fPreCluster; //!< current pre-cluster
96 TObjArray fClusterList; //!< clusters corresponding to the current pre-cluster
98 Int_t fEventNumber; //!< current event being processed
99 Int_t fDetElemId; //!< current DE being processed
100 Int_t fClusterNumber; //!< current cluster number
102 const AliMpVSegmentation *fSegmentation[2]; //!< new segmentation
104 TH2D *fHistAnode; //!< histo for peak search
105 TObjArray* fPixArray; //!< collection of pixels
106 Int_t fDebug; //!< debug level
107 Bool_t fPlot; //!< whether we should plot thing (for debug only, quite slow!)
109 Int_t fNClusters; //!< total number of clusters
110 Int_t fNAddVirtualPads; //!< number of clusters for which we added virtual pads
112 ClassDef(AliMUONClusterFinderPeakCOG,0) // cluster finder in MUON arm of ALICE