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