AliRoot Core  da88d91 (da88d91)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONClusterFinderMLEM.h
Go to the documentation of this file.
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 
12 // Author Alexander Zinchenko, JINR Dubna; Laurent Aphecetche, SUBATECH
13 //
14 
15 class TH2D;
16 class TMinuit;
17 
18 #ifndef ROOT_TObjArray
19 # include "TObjArray.h"
20 #endif
21 #ifndef ROOT_TVector2
22 # include "TVector2.h"
23 #endif
24 
25 class AliMUONPad;
26 
27 #include "AliMUONVClusterFinder.h"
28 
30 
32 {
33 public:
35  virtual ~AliMUONClusterFinderMLEM(); // Destructor
36 
37  virtual Bool_t NeedSegmentation() const { return kTRUE; }
38 
40 
41  virtual Bool_t Prepare(Int_t detElemId,
42  TObjArray* pads[2],
43  const AliMpArea& area,
44  const AliMpVSegmentation* segmentations[2]);
45 
46  virtual AliMUONCluster* NextCluster();
47 
48  virtual void SetChargeHints(Double_t lowestPadCharge, Double_t lowestClusterCharge);
49 
50  virtual void Print(Option_t* opt="") const;
51 
52  virtual void Paint(Option_t* opt="");
53 
54  // Status flags for pads
55 
57  static Int_t GetZeroFlag() { return fgkZero; }
59  static Int_t GetMustKeepFlag() { return fgkMustKeep; }
61  static Int_t GetUseForFitFlag() { return fgkUseForFit; }
63  static Int_t GetOverFlag() { return fgkOver; }
65  static Int_t GetModifiedFlag() { return fgkModified; }
67  static Int_t GetCoupledFlag() { return fgkCoupled; }
68 
69 private:
74 
75  Bool_t WorkOnPreCluster();
76 
80 
82  Bool_t Overlap(const AliMUONPad& pad, const AliMUONPad& pixel);
83 
85  void BuildPixArray(AliMUONCluster& cluster);
87  void PadOverHist(Int_t idir, Int_t ix0, Int_t iy0, AliMUONPad *pad,
88  TH2D *hist1, TH2D *hist2);
89 
90  void RemovePixel(Int_t i);
91 
92  AliMUONPad* Pixel(Int_t i) const;
93 
94  Bool_t MainLoop(AliMUONCluster& cluster, Int_t iSimple); // repeat MLEM algorithm until pixels become sufficiently small
95 
96  void Mlem(AliMUONCluster& cluster, const Double_t *coef, Double_t *probi, Int_t nIter); // use MLEM for cluster finding
97 
98  void FindCOG(Double_t *xyc); // find COG position around maximum bin
99  Int_t FindNearest(const AliMUONPad *pixPtr0); // find nearest neighbouring pixel to the given one
100 
101  Int_t FindLocalMaxima(TObjArray *pixArray, Int_t *localMax, Double_t *maxVal); // find local maxima
102  void FlagLocalMax(TH2D *hist, Int_t i, Int_t j, Int_t *isLocalMax); // flag local max
103  void FindCluster(AliMUONCluster& cluster, const Int_t *localMax, Int_t iMax); // find cluster around local max
104  void AddVirtualPad(AliMUONCluster& cluster); // add virtual pads for some clusters (if necessary)
105 
106  void PadsInXandY(AliMUONCluster& cluster, Int_t &nInX, Int_t &nInY) const; // get number of pads in X and Y
107 
109  void Simple(AliMUONCluster& cluster);
110 
111  void Plot(const char* outputfile);
112 
113  void ComputeCoefficients(AliMUONCluster& cluster,
114  Double_t* coef, Double_t* probi);
115 
116  void CheckOverlaps();
117  void AddBinSimple(TH2D *mlem, Int_t ic, Int_t jc);
118  void MaskPeaks(Int_t mask);
119 
120 private:
121  // Status flags for pads
122  static const Int_t fgkZero;
123  static const Int_t fgkMustKeep;
124  static const Int_t fgkUseForFit;
125  static const Int_t fgkOver;
126  static const Int_t fgkModified;
127  static const Int_t fgkCoupled;
128 
129  // Some constants
130  static const Double_t fgkDistancePrecision;
131  static const TVector2 fgkIncreaseSize;
132  static const TVector2 fgkDecreaseSize;
133 
137 
138  Int_t fEventNumber;
139  Int_t fDetElemId;
141 
143 
144  //Int_t fCathBeg; //!<! starting cathode (for combined cluster / track reco)
145  //Int_t fPadBeg[2]; //!<! starting pads (for combined cluster / track reco)
146 
147  //static TMinuit* fgMinuit; //!<! Fitter
148  TH2D *fHistMlem;
149  TH2D *fHistAnode;
150 
152  Int_t fDebug;
153  Bool_t fPlot;
154 
156  Int_t fNClusters;
158 
160  Double_t fLowestPadCharge;
162 
163  ClassDef(AliMUONClusterFinderMLEM,0) // cluster finder in MUON arm of ALICE
164 };
165 
166 #endif
AliMUONVClusterFinder * fPreClusterFinder
! the pre-clustering worker
Int_t FindNearest(const AliMUONPad *pixPtr0)
Int_t fNClusters
! total number of clusters
void BuildPixArrayOneCathode(AliMUONCluster &cluster)
Interface of a cluster finder.
virtual Bool_t NeedSegmentation() const
Double_t fLowestPixelCharge
! see AliMUONRecoParam
AliMUONPad * Pixel(Int_t i) const
#define TObjArray
static Int_t GetCoupledFlag()
Return coupled pad flag.
Int_t FindLocalMaxima(TObjArray *pixArray, Int_t *localMax, Double_t *maxVal)
A group of adjacent pads.
static Int_t GetUseForFitFlag()
Return should be used for fit flag.
Splitter class for the MLEM algorithm.
A rectangle area positioned in plane..
Definition: AliMpArea.h:20
void PadsInXandY(AliMUONCluster &cluster, Int_t &nInX, Int_t &nInY) const
virtual Bool_t Prepare(Int_t detElemId, TObjArray *pads[2], const AliMpArea &area, const AliMpVSegmentation *segmentations[2])
Bool_t MainLoop(AliMUONCluster &cluster, Int_t iSimple)
Bool_t fPlot
! whether we should plot thing (for debug only, quite slow!)
virtual Bool_t Prepare(Int_t detElemId, TObjArray *pads[2], const AliMpArea &area)
TH2D * fHistMlem
! histogram for MLEM procedure
void AddBinSimple(TH2D *mlem, Int_t ic, Int_t jc)
void BuildPixArray(AliMUONCluster &cluster)
build array of pixels
AliMUONCluster * fPreCluster
! current pre-cluster
AliMUONCluster * CheckPrecluster(const AliMUONCluster &cluster)
Check precluster to simplify it (if possible), and return the simplified cluster. ...
static const Int_t fgkMustKeep
do not kill (for pixels)
void ComputeCoefficients(AliMUONCluster &cluster, Double_t *coef, Double_t *probi)
Int_t fClusterNumber
! current cluster number
Bool_t Overlap(const AliMUONPad &pad, const AliMUONPad &pixel)
Checks whether a pad and a pixel have an overlapping area.
static Int_t GetOverFlag()
Return processing is over flag.
void FlagLocalMax(TH2D *hist, Int_t i, Int_t j, Int_t *isLocalMax)
static Int_t GetMustKeepFlag()
Return do not kill flag.
return clusterFinder
static Int_t GetZeroFlag()
Return pad "basic" state flag.
static const TVector2 fgkDecreaseSize
idem
static const Int_t fgkZero
pad "basic" state
TObjArray fClusterList
! clusters corresponding to the current pre-cluster
void Simple(AliMUONCluster &cluster)
Process simple cluster.
static const TVector2 fgkIncreaseSize
idem
virtual void Print(Option_t *opt="") const
static const Int_t fgkModified
modified pad charge
void AddVirtualPad(AliMUONCluster &cluster)
AliMUONClusterFinderMLEM & operator=(const AliMUONClusterFinderMLEM &rhs)
Not implemented.
AliMUONClusterFinderMLEM(Bool_t plot, AliMUONVClusterFinder *clusterFinder)
AliMUONCluster * CheckPreclusterTwoCathodes(AliMUONCluster *cluster)
void plot(const std::vector< TH1 * > &v, Double_t min, Double_t max, Double_t factor)
Int_t fDetElemId
! current DE being processed
static Int_t GetModifiedFlag()
Return modified pad charge flag.
Int_t fEventNumber
! current event being processed
TObjArray * fPixArray
! collection of pixels
static const Int_t fgkOver
processing is over
static const Int_t fgkUseForFit
should be used for fit
void Plot(const char *outputfile)
void Mlem(AliMUONCluster &cluster, const Double_t *coef, Double_t *probi, Int_t nIter)
The abstract base class for the segmentation.
static const Int_t fgkCoupled
coupled pad
virtual AliMUONCluster * NextCluster()
Int_t fNAddVirtualPads
! number of clusters for which we added virtual pads
Double_t fLowestClusterCharge
! see AliMUONRecoParam
void FindCluster(AliMUONCluster &cluster, const Int_t *localMax, Int_t iMax)
AliMUONClusterSplitterMLEM * fSplitter
! helper class to go from pixel arrays to clusters
virtual void Paint(Option_t *opt="")
virtual void SetChargeHints(Double_t lowestPadCharge, Double_t lowestClusterCharge)
TH2D * fHistAnode
! histogram for local maxima search
Double_t fLowestPadCharge
! see AliMUONRecoParam
static const Double_t fgkDistancePrecision
used to check overlaps and so on
Cluster finder in MUON arm of ALICE.
Combination of digit and mppad informations.
Definition: AliMUONPad.h:25
void PadOverHist(Int_t idir, Int_t ix0, Int_t iy0, AliMUONPad *pad, TH2D *hist1, TH2D *hist2)
return kTRUE
Definition: AliFMDv1.cxx:97
const AliMpVSegmentation * fkSegmentation[2]
! new segmentation