]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/html/AliPHOSClusterizerv1.h
Logics of high gain adding to digits has changed
[u/mrichter/AliRoot.git] / PHOS / html / AliPHOSClusterizerv1.h
1 #ifndef ALIPHOSCLUSTERIZERV1_H
2 #define ALIPHOSCLUSTERIZERV1_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 //_________________________________________________________________________
9 //  Implementation version 1 of the clusterization algorithm                     
10 //
11 //*-- Author: Yves Schutz (SUBATECH)
12
13 // --- ROOT system ---
14
15 // --- Standard library ---
16
17 // --- AliRoot header files ---
18
19 #include "AliPHOSClusterizer.h"
20 class AliPHOSEmcRecPoint ; 
21 class AliPHOSDigit ;
22 class AliPHOSDigitizer ;
23 class AliPHOSGeometry ;
24
25
26 class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
27   
28 public:
29   
30   AliPHOSClusterizerv1() ;             // ctor            
31   AliPHOSClusterizerv1(const char * HeaderFile,const char *DigitsBrancheFile=0);
32   virtual ~AliPHOSClusterizerv1(){}    // dtor
33   
34   Int_t           AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ; 
35                                // Checks if digits are in neighbour cells 
36   virtual void    GetNumberOfClustersFound(int * numb ){  numb[0] = fNumberOfEmcClusters ; 
37                                                           numb[1] = fNumberOfCpvClusters ; }
38
39   virtual Float_t GetEmcClusteringThreshold()const{ return fEmcClusteringThreshold;}
40   virtual Float_t GetEmcLocalMaxCut()const        { return fEmcLocMaxCut;} 
41   virtual Float_t GetEmcLogWeight()const          { return fW0;}  
42   virtual Float_t GetCpvClusteringThreshold()const{ return fCpvClusteringThreshold;  } 
43   virtual Float_t GetCpvLocalMaxCut()const        { return fCpvLocMaxCut;} 
44   virtual Float_t GetCpvLogWeight()const          { return fW0CPV;}  
45   virtual Float_t GetPpsdClusteringThreshold()const{ return fPpsdClusteringThreshold;  } 
46   virtual char *  GetRecPointsBranch() const      { return (char*) fRecPointsBranchFileName.Data() ;}
47   virtual char *  GetDigitsBranch() const         { return (char*) fDigitsBranchFileName.Data() ;}
48
49   void    Exec(Option_t *option);                // Does the job
50
51   virtual void Print(Option_t * option)const ;
52
53   virtual void SetEmcClusteringThreshold(Float_t cluth)  { fEmcClusteringThreshold = cluth ; }
54   virtual void SetEmcLocalMaxCut(Float_t cut)            { fEmcLocMaxCut = cut ; }
55   virtual void SetEmcLogWeight(Float_t w)                { fW0 = w ; }
56   virtual void SetCpvClusteringThreshold(Float_t cluth)  { fCpvClusteringThreshold = cluth ; }
57   virtual void SetCpvLocalMaxCut(Float_t cut)            { fCpvLocMaxCut = cut ; }
58   virtual void SetCpvLogWeight(Float_t w)                { fW0CPV = w ; }
59   virtual void SetPpsdClusteringThreshold(Float_t cluth) { fPpsdClusteringThreshold = cluth ; }
60
61   virtual void SetDigitsBranch(const char * file) ; 
62   virtual void SetRecPointsBranch(const char *file) ;
63
64   virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) {fToUnfold = toUnfold ;}  
65
66   static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag)  ;
67                                             // Chi^2 of the fit. Should be static to be passes to MINUIT
68   static Double_t ShowerShape(Double_t r) ; // Shape of EM shower used in unfolding; 
69                                             //class member function (not object member function)
70
71 private:
72   virtual Float_t Calibrate(Int_t amp)const {  return (amp-fPedestal)/fSlope ;}  // Tranforms Amp to energy 
73   Bool_t  FindFit(AliPHOSEmcRecPoint * emcRP, int * MaxAt, Float_t * maxAtEnergy, 
74                   Int_t NPar, Float_t * FitParametres) ; //Used in UnfoldClusters, calls TMinuit
75   void Init() ;
76
77   virtual Bool_t IsInEmc (AliPHOSDigit * digit)const ;     // Tells if id digit is in EMC
78   virtual Bool_t IsInPpsd(AliPHOSDigit * digit)const ;     // Tells if id digit is in PPSD
79   virtual Bool_t IsInCpv (AliPHOSDigit * digit)const ;     // Tells if id digit is in CPV
80
81   virtual void   MakeClusters( ) ;            
82   virtual void   MakeUnfolding() ;
83   Bool_t         ReadDigits() ;
84   void           UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax, 
85                        int * maxAt,Float_t * maxAtEnergy ) ; //Unfolds cluster using TMinuit package
86   void           WriteRecPoints() ;
87   void           PrintRecPoints(Option_t * option) ;
88
89 private:
90
91   TString fHeaderFileName ;          // name of the file which contains gAlice, Tree headers etc.
92   TString fDigitsBranchFileName ;    // name of the file, where digits branch is stored
93   TString fRecPointsBranchFileName ; // name of the file, where RecPoints branchs are stored
94
95   Int_t   fEvent ;                   // Number of event currently processed 
96   Bool_t  fToUnfold ;                // To perform unfolding 
97
98   Bool_t  fIsInitialized ;
99
100   AliPHOSGeometry * fGeom ;          // !pointer to PHOS geometry
101
102   AliPHOSDigitizer * fDigitizer ;    // !digitizer which produced Digits we treat
103
104   Int_t   fNumberOfEmcClusters ;     // number of EMC clusters found 
105   Int_t   fNumberOfCpvClusters ;     // number of CPV+PPSD clusters found
106   TClonesArray * fDigits ;           // ! Initial list of digits
107   TObjArray    * fEmcRecPoints ;     // ! Final list of EMC Rec Points
108   TObjArray    * fCpvRecPoints ;     // ! Final list of CPV/PPSD recPoints
109
110   Float_t fPedestal ;                // Calibration parameters 
111   Float_t fSlope ;                   // read from Digitizer
112
113   Float_t fEmcClusteringThreshold ;  // minimum energy to include a EMC digit in a cluster
114   Float_t fPpsdClusteringThreshold ; // minimum energy to include a PPSD digit in a cluster
115   Float_t fCpvClusteringThreshold ;  // minimum energy to include a CPV digit in a cluster
116   Float_t fEmcLocMaxCut ;            // minimum energy difference to distinguish local maxima in a cluster
117   Float_t fW0 ;                      // logarithmic weight for the cluster center of gravity calculation
118   Float_t fCpvLocMaxCut ;            // minimum energy difference to distinguish local maxima in a CPV cluster
119   Float_t fW0CPV ;                   // logarithmic weight for the CPV cluster center of gravity calculation
120     
121   ClassDef(AliPHOSClusterizerv1,1)   // Clusterizer implementation version 1
122
123 };
124
125 #endif // AliPHOSCLUSTERIZERV1_H