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