]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONClusterFinderAZ.h
Removing obsolete files from build system
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterFinderAZ.h
CommitLineData
0df3ca52 1#ifndef ALIMUONCLUSTERFINDERAZ_H
2#define ALIMUONCLUSTERFINDERAZ_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
30178c30 6/* $Id$ */
30178c30 7
692de412 8/// \ingroup rec
9/// \class AliMUONClusterFinderAZ
10/// \brief Cluster finder in MUON arm of ALICE
585d648a 11///
12/// \author Alexander Zinchenko, JINR Dubna
692de412 13
45c72492 14#ifndef ALIMUONVCLUSTERFINDER_H
15# include "AliMUONVClusterFinder.h"
16#endif
17
0df3ca52 18class TH2D;
19class TClonesArray;
0df3ca52 20class TMinuit;
0df3ca52 21
45c72492 22class AliMpVSegmentation;
30178c30 23class AliMUONPixel;
45c72492 24//class AliMUONClusterDrawAZ;
e785d2ac 25#include "TMatrixDfwd.h"
45c72492 26class AliMUONVDigit;
27class AliMUONRawCluster;
28class AliMUONVDigitStore;
29class AliMUONMathieson;
30class AliMpVSegmentation;
0df3ca52 31
45c72492 32class AliMUONClusterFinderAZ : public AliMUONVClusterFinder
30178c30 33{
34public:
1af223d7 35 AliMUONClusterFinderAZ(Bool_t draw = 0); // Constructor
0df3ca52 36 virtual ~AliMUONClusterFinderAZ(); // Destructor
37
45c72492 38 virtual AliMUONCluster* NextCluster();
39
40 virtual Bool_t Prepare(const AliMpVSegmentation* segmentations[2],
41 const AliMUONVDigitStore& digitStore);
42
43 void FindRawClusters(Int_t ch); // the same interface as for old cluster finder
44 void EventLoop(Int_t ch = 0);
30178c30 45 Bool_t TestTrack(Int_t t) const; // test if track was selected
c4ee792d 46
47 /// Return the number of pads in the cluster on the given cathode
1af223d7 48 Int_t GetNPads(Int_t cath) const { return fnPads[cath]; }
c4ee792d 49 /// Return pad information \todo add more details
1af223d7 50 Int_t GetIJ(Int_t indx, Int_t iPad) const { return fPadIJ[indx][iPad]; }
c4ee792d 51 /// Return pad information \todo add more details
1af223d7 52 Float_t GetXyq(Int_t indx, Int_t iPad) const { return fXyq[indx][iPad]; }
c4ee792d 53 /// Return the flag for used pads
cc87ebcd 54 Bool_t GetUsed(Int_t cath, Int_t dig) const { return fUsed[cath][dig]; }
c4ee792d 55
56 /// Mark used digits
57 void SetUsed(Int_t cath, Int_t dig) { fUsed[cath][dig] = kTRUE; }
58 /// Unmark digits
59 void SetUnused(Int_t cath, Int_t dig) { fUsed[cath][dig] = kFALSE; }
60 /// Set reco flag
61 void SetReco(Int_t iReco) { fReco = iReco; }
62 /// Start \todo add more details
63 void SetStart(Int_t iCath, Int_t iPad) { fCathBeg = iCath; fPadBeg[0] = fPadBeg[1] = 0; fPadBeg[fCathBeg] = iPad; }
64
45c72492 65 void ResetRawClusters();
66
67 Float_t ChargeIntegration(Double_t x, Double_t y,
68 Double_t padX, Double_t padY,
69 Double_t padDX, Double_t padDY);
70
54d7ba50 71private:
343146bf 72 // Some constants
829425a5 73 static const Int_t fgkDim = 10000; ///< array size
74 static const Double_t fgkCouplMin; ///< threshold on coupling
75 static const Double_t fgkZeroSuppression; ///< average zero suppression value
76 static const Double_t fgkSaturation; ///< average saturation level
343146bf 77
829425a5 78 static AliMUONClusterFinderAZ* fgClusterFinder; ///< the ClusterFinderAZ instance
9e993f2a 79
829425a5 80 Int_t fnPads[2]; //!< number of pads in the cluster on 2 cathodes
c4ee792d 81 Float_t fXyq[7][fgkDim]; //!< pad information \todo add more details
45c72492 82 UInt_t fDigitId[fgkDim]; //!< digit id of the pads (to find back the digit using the digitstore)
c4ee792d 83 Int_t fPadIJ[4][fgkDim]; //!< pad information \todo add more details
45c72492 84 const AliMpVSegmentation *fSegmentation[2]; //!< new segmentation
829425a5 85 Int_t fNpar; //!< number of fit parameters
86 Double_t fQtot; //!< total cluster charge
87 Int_t fReco; //!< !=0 if run reco with writing of reconstructed clusters
88 Int_t fCathBeg; //!< starting cathode (for combined cluster / track reco)
89 Int_t fPadBeg[2]; //!< starting pads (for combined cluster / track reco)
9e993f2a 90
829425a5 91 static TMinuit* fgMinuit; //!< Fitter
92 Bool_t fUsed[2][fgkDim]; //!< flags for used pads
45c72492 93// AliMUONClusterDrawAZ *fDraw; //!< drawing object
829425a5 94 TObjArray* fPixArray; //!< collection of pixels
95 Int_t fnCoupled; //!< number of coupled clusters in precluster
96 Int_t fDebug; //!< debug level
0df3ca52 97
45c72492 98 TClonesArray* fRawClusters; //!< array of cluster per ch.
99
100 const AliMUONVDigitStore* fDigitStore; //!< digit store we're working on
101
102 Int_t fDetElemId; //!< detection element id we're currently working on
103 Int_t fChamberId; //!< chamber corresponding the fDetElemId
104
105 AliMUONMathieson* fMathieson; //!< mathieson function to be used
106
107 Int_t fCurrentCluster; //!< current cluster
108
0df3ca52 109 // Functions
110
c4ee792d 111 /// Not implemented
54d7ba50 112 AliMUONClusterFinderAZ(const AliMUONClusterFinderAZ& rhs);
c4ee792d 113 /// Not implemented
54d7ba50 114 AliMUONClusterFinderAZ& operator=(const AliMUONClusterFinderAZ& rhs);
c4ee792d 115
45c72492 116 void AddPad(Int_t cath, AliMUONVDigit& digit); // add a pad to the cluster
117 Bool_t Overlap(Int_t cath, const AliMUONVDigit& dig); // check if the pad from one cathode overlaps with a pad in the cluster on the other cathode
0df3ca52 118 Bool_t Overlap(Float_t *xy1, Int_t iPad, Float_t *xy12, Int_t iSkip); // check if pads xy1 and iPad overlap and return overlap area
119 Bool_t CheckPrecluster(Int_t *nShown); // check precluster to simplify it (if possible)
9e993f2a 120 void BuildPixArray(); // build array of pixels
2b1e4f0e 121 void AdjustPixel(Float_t width, Int_t ixy); // adjust size of small pixels
122 void AdjustPixel(Float_t wxmin, Float_t wymin); // adjust size of large pixels
123 Bool_t MainLoop(Int_t iSimple); // repeat MLEM algorithm until pixels become sufficiently small
124 void Mlem(Double_t *coef, Double_t *probi, Int_t nIter); // use MLEM for cluster finding
9e993f2a 125 void FindCOG(TH2D *mlem, Double_t *xyc); // find COG position around maximum bin
126 Int_t FindNearest(AliMUONPixel *pixPtr0); // find nearest neighbouring pixel to the given one
127 void Split(TH2D *mlem, Double_t *coef); // steering function for pixels
128 void AddBin(TH2D *mlem, Int_t ic, Int_t jc, Int_t mode, Bool_t* used, TObjArray *pix); // add a bin to the cluster
0df3ca52 129 TObject* BinToPix(TH2D *mlem, Int_t jc, Int_t ic); // hist. bin-to-pixel
9e993f2a 130 void AddCluster(Int_t ic, Int_t nclust, TMatrixD *aijcluclu, Bool_t *used, Int_t *clustNumb, Int_t &nCoupled); // add a cluster to the group of coupled clusters
c1aed84f 131 Double_t MinGroupCoupl(Int_t nCoupled, Int_t *clustNumb, TMatrixD *aijcluclu, Int_t *minGroup); // find group of cluster with min. coupling to others
9e993f2a 132 Int_t SelectPad(Int_t nCoupled, Int_t nForFit, Int_t *clustNumb, Int_t *clustFit, TMatrixD *aijcluclu); //select pads for fit
133 void Merge(Int_t nForFit, Int_t nCoupled, Int_t *clustNumb, Int_t *clustFit, TObjArray **clusters, TMatrixD *aijcluclu, TMatrixD *aijclupad); // merge clusters
0627f609 134 Int_t Fit(Int_t iSimple, Int_t nfit, Int_t *clustFit, TObjArray **clusters, Double_t *parOk); // do the fitting
9e993f2a 135 void UpdatePads(Int_t nfit, Double_t *par); // subtract fitted charges from pads
2b1e4f0e 136 void AddRawCluster(Double_t x, Double_t y, Double_t qTot, Double_t fmin, Int_t nfit, Int_t *tracks, Double_t sigx, Double_t sigy, Double_t dist); // add new reconstructed cluster
0627f609 137 Int_t FindLocalMaxima(TObjArray *pixArray, Int_t *localMax, Double_t *maxVal); // find local maxima
9e993f2a 138 void FlagLocalMax(TH2D *hist, Int_t i, Int_t j, Int_t *isLocalMax); // flag local max
139 void FindCluster(Int_t *localMax, Int_t iMax); // find cluster around local max
2b1e4f0e 140 void AddVirtualPad(); // add virtual pads for some clusters (if necessary)
141 void PadsInXandY(Int_t &nInX, Int_t &nInY); // get number of pads in X and Y
142 // This function is used for fitting
143 void Fcn1(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
144 void Simple(); // process simple cluster
145
146 void Errors(AliMUONRawCluster *clus); // correct coordinates and eval. errors
147 void Errors(Int_t ny, Int_t nx, Int_t iby, Int_t ibx, Double_t fmin,
148 Double_t wy, Double_t wx, Int_t iover,
149 Double_t dyc, Double_t dxc, Double_t qtot,
150 Double_t &yrec, Double_t &xrec, Double_t &erry, Double_t &errx);
f161a467 151
45c72492 152 virtual void Print(Option_t* opt="") const;
153 void PrintPixel(Int_t i) const;
154 void PrintPad(Int_t i) const;
155
156 void Used(Int_t indx, Bool_t value);
157
c4ee792d 158 /// Dummy method for overloading warnings
f161a467 159 void FindCluster(int, int, int, AliMUONRawCluster&) {return;}
c4ee792d 160 /// Dummy method for overloading warnings
f161a467 161 void FindLocalMaxima(AliMUONRawCluster*) {return;}
c4ee792d 162 /// Dummy method for overloading warnings
f161a467 163 void Split(AliMUONRawCluster*) {return;}
c4ee792d 164 /// Dummy method for overloading warnings
9a8c01b2 165 void AddRawCluster(AliMUONRawCluster&) {return;}
f161a467 166
2b1e4f0e 167ClassDef(AliMUONClusterFinderAZ,0) // cluster finder in MUON arm of ALICE
74f7bbc5 168};
169
0df3ca52 170#endif