]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALClusterizer.h
added option of etacut to parameters instead of hard coded in addtask.c
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALClusterizer.h
1 #ifndef ALIEMCALCLUSTERIZER_H
2 #define ALIEMCALCLUSTERIZER_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 //  Base class for the clusterization algorithm (pure abstract)
10 //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (SUBATECH & Kurchatov Institute)
11 //
12 //   Clusterization mother class. Contains common methods/data members of different 
13 //   clusterizers. GCB 2010
14 //_________________________________________________________________________
15
16 // --- ROOT system ---
17 #include <TObject.h>
18 #include <TClonesArray.h>
19 class TTree;
20
21 // --- AliRoot header files ---
22 #include "AliLog.h"
23 class AliEMCALGeometry;
24 class AliEMCALCalibData;
25 class AliCaloCalibPedestal;
26 class AliEMCALRecParam;
27 #include "AliEMCALUnfolding.h"
28
29 class AliEMCALClusterizer : public TObject {
30
31 public:
32
33   AliEMCALClusterizer();
34   AliEMCALClusterizer(AliEMCALGeometry *geometry);
35   AliEMCALClusterizer(AliEMCALGeometry *geometry, AliEMCALCalibData *calib, AliCaloCalibPedestal *pedestal);
36   virtual ~AliEMCALClusterizer();
37
38   // main methods
39
40   virtual void    DeleteDigits();
41   virtual void    DeleteRecPoints();
42
43   virtual void    Digits2Clusters(Option_t *option) = 0;
44
45   virtual void    Calibrate(Float_t & amp, Float_t & time, const Int_t cellId);
46   virtual void    Init();
47   virtual void    InitParameters();
48   virtual void    InitParameters(const AliEMCALRecParam* recParam);
49
50   virtual void    Print         (Option_t *option)   const ;
51   virtual void    PrintRecPoints(Option_t *option);
52   virtual void    PrintRecoInfo();
53
54   virtual const char *Version()                      const { Warning("Version", "Not Defined"); 
55                                                              return 0 ;                        } 
56
57   //Getters-Setters
58
59   virtual void    SetInput (TTree *digitsTree  );
60   virtual void    SetOutput(TTree *clustersTree);
61
62   virtual void    GetCalibrationParameters(void);
63   virtual void    GetCaloCalibPedestal(void);
64   virtual void    SetCalibrationParameters(AliEMCALCalibData *calib)   { fCalibData = calib;   }
65   virtual void    SetCaloCalibPedestal(AliCaloCalibPedestal  *caped)   { fCaloPed   = caped;   }
66   
67   virtual Float_t GetTimeMin()                        const { return fTimeMin;                 }
68   virtual Float_t GetTimeMax()                        const { return fTimeMax;                 }
69   virtual Float_t GetTimeCut()                        const { return fTimeCut;                 }
70   virtual Float_t GetECAClusteringThreshold()         const { return fECAClusteringThreshold;  }  
71   virtual Float_t GetECALocalMaxCut()                 const { return fECALocMaxCut;            } 
72   virtual Float_t GetECALogWeight()                   const { return fECAW0;                   }
73   virtual Float_t GetMinECut()                        const { return fMinECut;                 } 
74
75   virtual void    SetTimeMin(Float_t t)                           { fTimeMin = t;                    }
76   virtual void    SetTimeMax(Float_t t)                           { fTimeMax = t;                    }
77   virtual void    SetTimeCut(Float_t t)                           { fTimeCut = t;                    }
78   virtual void    SetECAClusteringThreshold(Float_t th)     { fECAClusteringThreshold = th;    }
79   virtual void    SetMinECut(Float_t mine)                  { fMinECut      = mine;            }
80   virtual void    SetECALocalMaxCut(Float_t cut)            { fECALocMaxCut = cut;             }
81   virtual void    SetECALogWeight(Float_t w)                { fECAW0        = w;               }
82   
83   //Unfolding
84
85   virtual void    SetUnfolding(Bool_t toUnfold = kTRUE )    { fToUnfold = toUnfold;            }  
86   virtual void    SetSSPars   (Int_t ipar, Double_t par)    { fSSPars[ipar] = par;             }
87   virtual void    SetPar5     (Int_t ipar, Double_t par)    { fPar5  [ipar] = par;             }
88   virtual void    SetPar6     (Int_t ipar, Double_t par)    { fPar6  [ipar] = par;             }
89   virtual void    InitClusterUnfolding()                    {
90     fClusterUnfolding=new AliEMCALUnfolding(fGeom,fECALocMaxCut,fSSPars,fPar5,fPar6); 
91     fClusterUnfolding->SetThreshold(fMinECut);                                                 }
92
93   //NxN (only used in NxN clusterizer)
94   
95   virtual void    SetNRowDiff(Int_t )                       { ; }
96   virtual void    SetNColDiff(Int_t )                       { ; }
97   virtual void    SetEnergyGrad(Bool_t )                    { ; }
98
99   virtual Int_t   GetNRowDiff()                       const { return -1 ; }
100   virtual Int_t   GetNColDiff()                       const { return -1 ; } 
101   virtual Bool_t  GetEnergyGrad()                     const { return -1 ; }
102
103   // add for clusterizing task
104
105   virtual void                SetDigitsArr(TClonesArray *arr) { fDigitsArr = arr  ;            }
106   virtual TClonesArray *GetDigits()                           { if (!fDigitsArr)
107                                                                   fDigitsArr = new TClonesArray("AliEMCALDigit",12000);
108                                                                 return fDigitsArr ;            }
109   virtual const TObjArray    *GetRecPoints()            const { return fRecPoints ;            }
110   void                        SetInputCalibrated(Bool_t val);
111   void                        SetJustClusters   (Bool_t val);
112   
113
114 protected:
115
116   virtual void MakeClusters() = 0;
117   
118   Bool_t   fIsInputCalibrated;          // to enable reclusterization from ESD cells
119   Bool_t   fJustClusters;               // false for standard reco  
120   TClonesArray         *fDigitsArr;     // array with EMCAL digits
121   TTree                *fTreeR;         // tree with output clusters
122   TObjArray            *fRecPoints;     // array with EMCAL clusters
123   
124   AliEMCALGeometry     *fGeom;          //!pointer to geometry for utilities
125   AliEMCALCalibData    *fCalibData;     //!calibration database if aval
126   AliCaloCalibPedestal *fCaloPed;       //!tower status map if aval
127   
128   Float_t  fADCchannelECA;              // width of one ADC channel for EC section (GeV)
129   Float_t  fADCpedestalECA;             // pedestal of ADC for EC section (GeV) 
130   Float_t  fTimeECA;                    // calibration parameter for channels time
131   
132   Float_t  fTimeMin;                    // minimum time of physical signal in a cell/digit
133   Float_t  fTimeMax;                    // maximum time of physical signal in a cell/digit
134   Float_t  fTimeCut;                    // maximum time difference between the digits inside EMC cluster
135
136   Bool_t   fDefaultInit;                //!says if the task was created by defaut ctor (only parameters are initialized)
137   Bool_t   fToUnfold;                   // says if unfolding should be performed 
138   Int_t    fNumberOfECAClusters;        // number of clusters found in EC section
139   
140   Float_t  fECAClusteringThreshold;     // minimum energy to seed a EC digit in a cluster
141   Float_t  fECALocMaxCut;               // minimum energy difference to distinguish local maxima in a cluster
142   Float_t  fECAW0;                      // logarithmic weight for the cluster center of gravity calculation
143   Float_t  fMinECut;                    // minimum energy for a digit to be a member of a cluster
144   
145   AliEMCALUnfolding *fClusterUnfolding; //!pointer to unfolding object
146   Double_t fSSPars[8];                  // shower shape parameters 
147   Double_t fPar5[3];                    // shower shape parameter 5
148   Double_t fPar6[3];                    // shower shape parameter 6
149
150  private:
151   AliEMCALClusterizer(              const AliEMCALClusterizer &);
152   AliEMCALClusterizer & operator = (const AliEMCALClusterizer &);
153   
154   ClassDef(AliEMCALClusterizer,7)  // Clusterization algorithm class 
155   
156 };
157 #endif // AliEMCALCLUSTERIZER_H