]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONClusterFinderMLEM.h
Removed an unnecessary method (Laurent)
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterFinderMLEM.h
1 #ifndef ALIMUONCLUSTERFINDERMLEM_H
2 #define ALIMUONCLUSTERFINDERMLEM_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 AliMUONClusterFinderMLEM
10 /// \brief Cluster finder in MUON arm of ALICE
11 ///
12 //  Author Alexander Zinchenko, JINR Dubna; Laurent Aphecetche, SUBATECH
13 //
14
15 class TH2D;
16 class TClonesArray;
17 class TMinuit;
18
19 #ifndef ROOT_TObjArray
20 #  include "TObjArray.h"
21 #endif
22 #ifndef ROOT_TVector2
23 #  include "TVector2.h"
24 #endif
25
26 class AliMUONPad;
27
28 #include "AliMUONVClusterFinder.h"
29
30 class AliMUONClusterSplitterMLEM;
31
32 class AliMUONClusterFinderMLEM : public AliMUONVClusterFinder
33 {
34 public:
35   AliMUONClusterFinderMLEM(Bool_t plot, AliMUONVClusterFinder* clusterFinder); // Constructor
36   virtual ~AliMUONClusterFinderMLEM(); // Destructor
37
38   virtual Bool_t Prepare(const AliMpVSegmentation* segmentations[2],
39                          const AliMUONVDigitStore& digitStore);
40   
41   virtual AliMUONCluster* NextCluster();
42   
43   virtual void Print(Option_t* opt="") const;
44
45   virtual void Paint(Option_t* opt="");
46
47 private:
48   /// Not implemented
49   AliMUONClusterFinderMLEM(const AliMUONClusterFinderMLEM& rhs);
50   /// Not implemented
51   AliMUONClusterFinderMLEM& operator=(const AliMUONClusterFinderMLEM& rhs);
52
53   Bool_t WorkOnPreCluster();
54
55   /// Check precluster to simplify it (if possible), and return the simplified cluster
56   AliMUONCluster* CheckPrecluster(const AliMUONCluster& cluster); 
57   AliMUONCluster* CheckPreclusterTwoCathodes(AliMUONCluster* cluster); 
58   
59   /// Checks whether a pad and a pixel have an overlapping area.
60   Bool_t Overlap(const AliMUONPad& pad, const AliMUONPad& pixel); 
61   
62   /// build array of pixels
63   void BuildPixArray(AliMUONCluster& cluster); 
64   void BuildPixArrayOneCathode(AliMUONCluster& cluster); 
65   void BuildPixArrayTwoCathodes(AliMUONCluster& cluster); 
66
67   void RemovePixel(Int_t i);
68   
69   AliMUONPad* Pixel(Int_t i) const;
70   
71   void   AdjustPixel(AliMUONCluster& cluster, Float_t width, Int_t ixy); // adjust size of small pixels
72   void   AdjustPixel(Double_t wxmin, Double_t wymin); // adjust size of large pixels
73
74   Bool_t MainLoop(AliMUONCluster& cluster, Int_t iSimple); // repeat MLEM algorithm until pixels become sufficiently small
75   
76   void   Mlem(AliMUONCluster& cluster, Double_t *coef, Double_t *probi, Int_t nIter); // use MLEM for cluster finding
77   
78   void   FindCOG(TH2D *mlem, Double_t *xyc); // find COG position around maximum bin
79   Int_t  FindNearest(AliMUONPad *pixPtr0); // find nearest neighbouring pixel to the given one
80
81   Int_t FindLocalMaxima(TObjArray *pixArray, Int_t *localMax, Double_t *maxVal); // find local maxima 
82   void  FlagLocalMax(TH2D *hist, Int_t i, Int_t j, Int_t *isLocalMax); // flag local max
83   void  FindCluster(AliMUONCluster& cluster, Int_t *localMax, Int_t iMax); // find cluster around local max
84   void  AddVirtualPad(AliMUONCluster& cluster); // add virtual pads for some clusters (if necessary)
85   
86   void  PadsInXandY(AliMUONCluster& cluster, Int_t &nInX, Int_t &nInY) const; // get number of pads in X and Y
87
88   /// Process simple cluster
89   void Simple(AliMUONCluster& cluster); 
90   
91   void Neighbours(Int_t cath, Int_t ix0, Int_t iy0, 
92                   Int_t& nn,
93                   Int_t* xList, Int_t* yList);
94
95   void Plot(const char* outputfile);
96     
97   void ComputeCoefficients(AliMUONCluster& cluster, 
98                            Double_t* coef, Double_t* probi);
99   
100   void CheckOverlaps();
101   
102 private:
103     
104   // Some constants
105   static const Int_t fgkDim = 10000; ///< array size
106   static const Double_t fgkZeroSuppression; ///< average zero suppression value
107   static const Double_t fgkSaturation; ///< average saturation level
108   static const Double_t fgkDistancePrecision; ///< used to check overlaps and so on
109   static const TVector2 fgkIncreaseSize; ///< idem
110   static const TVector2 fgkDecreaseSize; ///< idem
111   
112   AliMUONVClusterFinder* fPreClusterFinder; //!< the pre-clustering worker
113   AliMUONCluster* fPreCluster; //!< current pre-cluster
114   TObjArray fClusterList; //!< clusters corresponding to the current pre-cluster
115   
116   Int_t fEventNumber; //!< current event being processed
117   Int_t fDetElemId; //!< current DE being processed
118   Int_t fClusterNumber; //!< current cluster number
119   
120   const AliMpVSegmentation *fSegmentation[2]; //!< new segmentation
121   
122   Float_t    fZpad;             //!< z-coordinate of the hit
123   Int_t      fReco;             //!< !=0 if run reco with writing of reconstructed clusters 
124   Int_t fCathBeg;               //!< starting cathode (for combined cluster / track reco)
125   Int_t fPadBeg[2];             //!< starting pads (for combined cluster / track reco)
126   
127   static     TMinuit* fgMinuit; //!< Fitter
128   
129   TObjArray* fPixArray; //!< collection of pixels
130   Int_t fDebug; //!< debug level
131   Bool_t fPlot; //!< whether we should plot thing (for debug only, quite slow!)
132   
133   AliMUONClusterSplitterMLEM* fSplitter; //!< helper class to go from pixel arrays to clusters
134   Int_t fNClusters; //!< total number of clusters
135   Int_t fNAddVirtualPads; //!< number of clusters for which we added virtual pads
136   
137   ClassDef(AliMUONClusterFinderMLEM,0) // cluster finder in MUON arm of ALICE
138 };
139
140 #endif