]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALClusterizerv1.h
Redefinition of macro to avoid warnings
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALClusterizerv1.h
1 #ifndef ALIEMCALCLUSTERIZERV1_H
2 #define ALIEMCALCLUSTERIZERV1_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 // Modif: 
17 //  August 2002 Yves Schutz: clone PHOS as closely as possible and intoduction
18 //                           of new  IO (à la PHOS)
19
20 // --- ROOT system ---
21
22 // --- Standard library ---
23
24 // --- AliRoot header files ---
25
26 #include "AliEMCALClusterizer.h"
27 class TH1F;
28 class AliEMCALRecPoint ; 
29 class AliEMCALDigit ;
30 class AliEMCALDigitizer ;
31 class AliEMCALGeometry ;
32 class AliEMCALCalibData ;
33
34 class AliEMCALClusterizerv1 : public AliEMCALClusterizer {
35   
36 public:
37   
38   AliEMCALClusterizerv1() ;         
39   AliEMCALClusterizerv1(AliEMCALGeometry* geometry);
40   AliEMCALClusterizerv1(AliEMCALGeometry* geometry, AliEMCALCalibData * calib);
41         
42   virtual ~AliEMCALClusterizerv1()  ;
43
44   virtual Int_t   AreNeighbours(AliEMCALDigit * d1, AliEMCALDigit * d2)const ; 
45                                // Checks if digits are in neighbour cells 
46
47   virtual Float_t Calibrate(Int_t amp, Int_t cellId) ;  // Tranforms Amp to energy 
48
49   virtual void    GetNumberOfClustersFound(int numb )const{ numb = fNumberOfECAClusters ;} 
50   virtual Float_t GetECAClusteringThreshold()const{ return fECAClusteringThreshold;}  
51   virtual Float_t GetECALocalMaxCut()const       { return fECALocMaxCut;} 
52   virtual Float_t GetECALogWeight()const         { return fECAW0;}
53   virtual Float_t GetMinECut()const              { return fMinECut;}
54
55   virtual Float_t GetTimeCut() const            { return fTimeCut ; }
56
57   virtual void    Digits2Clusters(Option_t *option);                // Does the job
58
59   virtual void Print(Option_t * option)const ;
60
61   virtual void SetECAClusteringThreshold(Float_t cluth)  { fECAClusteringThreshold = cluth ; }
62   virtual void SetMinECut(Float_t mine)                  { fMinECut = mine; }
63   virtual void SetECALocalMaxCut(Float_t cut)            { fECALocMaxCut = cut ; }
64   virtual void SetECALogWeight(Float_t w)                { fECAW0 = w ; }
65   virtual void SetTimeCut(Float_t gate)                  { fTimeCut = gate ;}
66   virtual void SetUnfolding(Bool_t toUnfold = kTRUE )    {fToUnfold = toUnfold ;}  
67   static Double_t ShowerShape(Double_t x, Double_t y) ; // Shape of EM shower used in unfolding; 
68                                             //class member function (not object member function)
69   static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag)  ;
70                                             // Chi^2 of the fit. Should be static to be passes to MINUIT
71   virtual const char * Version() const { return "clu-v1" ; }  
72
73   void   PrintRecoInfo();                        //*MENU*
74   void   SetCalibrationParameters(AliEMCALCalibData * calib) { fCalibData = calib ; }
75         
76 protected:
77
78   virtual void   MakeClusters();            
79
80 private:
81   AliEMCALClusterizerv1(const AliEMCALClusterizerv1 &); //copy ctor
82   AliEMCALClusterizerv1 & operator = (const AliEMCALClusterizerv1 &);
83
84   void    GetCalibrationParameters(void) ;
85   
86   Bool_t  FindFit(AliEMCALRecPoint * emcRP, AliEMCALDigit ** MaxAt, const Float_t * maxAtEnergy, 
87                   Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
88   void Init() ;
89   void InitParameters();
90
91   virtual void   MakeUnfolding();
92   void           UnfoldCluster(AliEMCALRecPoint * iniEmc, Int_t Nmax, 
93                                AliEMCALDigit ** maxAt,
94                                Float_t * maxAtEnergy ); //Unfolds cluster using TMinuit package
95   void           PrintRecPoints(Option_t * option) ;
96
97 private:
98   AliEMCALGeometry* fGeom;           //! pointer to geometry for utilities
99
100   Bool_t  fDefaultInit;              //! Says if the task was created by defaut ctor (only parameters are initialized)
101   Bool_t  fToUnfold ;                // To perform unfolding 
102   Int_t   fNumberOfECAClusters ;     // number of clusters found in EC section
103
104   //Calibration parameters... to be replaced by database 
105
106   AliEMCALCalibData * fCalibData  ;   //! Calibration database if aval
107   Float_t fADCchannelECA ;          // width of one ADC channel for EC section (GeV)
108   Float_t fADCpedestalECA ;         // pedestal of ADC for EC section (GeV) 
109  
110   Float_t fECAClusteringThreshold ;  // minimum energy to seed a EC digit in a cluster
111   Float_t fECALocMaxCut ;            // minimum energy difference to distinguish local maxima in a cluster
112   Float_t fECAW0 ;                   // logarithmic weight for the cluster center of gravity calculation
113   Float_t fTimeCut ;                // Maximum time difference between the digits in ont EMC cluster
114   Float_t fMinECut;                  // Minimum energy for a digit to be a member of a cluster
115
116   ClassDef(AliEMCALClusterizerv1,7)   // Clusterizer implementation version 1
117
118 };
119
120 #endif // AliEMCALCLUSTERIZERV1_H