]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONClusterFinderPeakCOG.h
more secure string operations
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterFinderPeakCOG.h
CommitLineData
edb8c962 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 */
5
6/* $Id$ */
7
8/// \ingroup rec
9/// \class AliMUONClusterFinderPeakCOG
10/// \brief Cluster finder in MUON arm of ALICE
11///
12// Author Alexander Zinchenko, JINR Dubna; Laurent Aphecetche, SUBATECH
13//
14
15#include "AliMUONVClusterFinder.h"
16
17#ifndef ROOT_TObjArray
18# include "TObjArray.h"
19#endif
20#ifndef ROOT_TVector2
21# include "TVector2.h"
22#endif
23
24class AliMUONPad;
25
26class TH2D;
edb8c962 27
28class AliMUONClusterFinderPeakCOG : public AliMUONVClusterFinder
29{
30public:
31 AliMUONClusterFinderPeakCOG(Bool_t plot, AliMUONVClusterFinder* clusterFinder); // Constructor
32 virtual ~AliMUONClusterFinderPeakCOG(); // Destructor
33
34 /// It needs segmentation
35 virtual Bool_t NeedSegmentation() const { return kTRUE; }
36
37 using AliMUONVClusterFinder::Prepare;
38
9e41a340 39 virtual Bool_t Prepare(Int_t detElemId, TObjArray* pads[2],
edb8c962 40 const AliMpArea& area, const AliMpVSegmentation* seg[2]);
41
42 virtual AliMUONCluster* NextCluster();
43
44 virtual void Print(Option_t* opt="") const;
45
46private:
47 /// Not implemented
48 AliMUONClusterFinderPeakCOG(const AliMUONClusterFinderPeakCOG& rhs);
49 /// Not implemented
50 AliMUONClusterFinderPeakCOG& operator=(const AliMUONClusterFinderPeakCOG& rhs);
51
52 Bool_t WorkOnPreCluster();
53
54 /// Check precluster to simplify it (if possible), and return the simplified cluster
55 AliMUONCluster* CheckPrecluster(const AliMUONCluster& cluster);
56 AliMUONCluster* CheckPreclusterTwoCathodes(AliMUONCluster* cluster);
57
58 /// Checks whether a pad and a pixel have an overlapping area.
59 Bool_t Overlap(const AliMUONPad& pad, const AliMUONPad& pixel);
60
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);
65
66 void RemovePixel(Int_t i);
67
68 AliMUONPad* Pixel(Int_t i) const;
69
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
72dae9ff 72 void FindCluster(AliMUONCluster& cluster, const Int_t *localMax, Int_t iMax); // find cluster around local max
edb8c962 73 void PadsInXandY(AliMUONCluster& cluster, Int_t &nInX, Int_t &nInY) const; // get number of pads in X and Y
74
75 void CheckOverlaps();
76
77private:
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
85
86
87 // Some constants
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
92
93 AliMUONVClusterFinder* fPreClusterFinder; //!< the pre-clustering worker
94 AliMUONCluster* fPreCluster; //!< current pre-cluster
95 TObjArray fClusterList; //!< clusters corresponding to the current pre-cluster
96
97 Int_t fEventNumber; //!< current event being processed
98 Int_t fDetElemId; //!< current DE being processed
99 Int_t fClusterNumber; //!< current cluster number
100
72dae9ff 101 const AliMpVSegmentation *fkSegmentation[2]; //!< new segmentation
edb8c962 102
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!)
107
108 Int_t fNClusters; //!< total number of clusters
109 Int_t fNAddVirtualPads; //!< number of clusters for which we added virtual pads
110
111 ClassDef(AliMUONClusterFinderPeakCOG,0) // cluster finder in MUON arm of ALICE
112};
113
114#endif