Fix Coverity
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALUnfolding.h
CommitLineData
1186cd2b 1#ifndef ALIEMCALUNFOLDING_H
2#define ALIEMCALUNFOLDING_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6//_________________________________________________________________________
7// Base class for the cluster unfolding algorithm
8//*-- Author: Adam Matyja (SUBATECH)
9
10// --- ROOT system ---
11//#include "AliLog.h"
12#include "TObject.h"
13//class TTree;
14class AliLog ;
15
16
17// --- Standard library ---
18
19// --- AliRoot header files ---
20class AliEMCALGeometry ;
21//class AliEMCALCalibData ;
22//class AliCaloCalibPedestal ;
23class AliEMCALRecPoint ;
24class AliEMCALDigit ;
25
26
27class AliEMCALUnfolding : public TObject {
28
29public:
30
31 AliEMCALUnfolding() ; // default ctor
32 virtual ~AliEMCALUnfolding() ; // dtorEM
33 AliEMCALUnfolding(AliEMCALGeometry* geometry);// constructor
34 AliEMCALUnfolding(AliEMCALGeometry* geometry,Float_t ECALocMaxCut,Double_t *SSPars,Double_t *Par5,Double_t *Par6);// constructor
35
36 virtual void Init() ;
37 virtual void SetInput(Int_t numberOfECAClusters,TObjArray *recPoints,TClonesArray *digitsArr);
38
39 //setters and getters
40 virtual void SetNumberOfECAClusters(Int_t n) { fNumberOfECAClusters = n; }
41 virtual Int_t GetNumberOfECAClusters() const { return fNumberOfECAClusters; }
42 virtual void SetRecPoints(TObjArray *rec) { fRecPoints = rec; }
43 virtual TObjArray * GetRecPoints() const { return fRecPoints; }
44 virtual void SetDigitsArr(TClonesArray *digit) { fDigitsArr = digit; }
45 virtual TClonesArray * GetDigitsArr() const { return fDigitsArr; }
46 virtual void SetECALocalMaxCut(Float_t cut) { fECALocMaxCut = cut ; }
47 virtual Float_t GetECALocalMaxCut() const { return fECALocMaxCut; }
48 virtual void SetThreshold(Float_t energy) { fThreshold = energy; }
49 virtual Float_t GetThreshold() const { return fThreshold; }
50
51 //unfolding main methods
52 virtual void MakeUnfolding();
53 static Double_t ShowerShapeV2(Double_t x, Double_t y) ; // Shape of EM shower used in unfolding;
54 //class member function (not object member function)
55 static void UnfoldingChiSquareV2(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag) ;
56 // Chi^2 of the fit. Should be static to be passes to MINUIT
57 virtual void SetShowerShapeParams(Double_t *pars) ;
58 virtual Double_t* GetShowerShapeParams() const { return fgSSPars ; }
59 virtual void SetPar5(Double_t *pars) ;
60 virtual Double_t* GetPar5() const { return fgPar5 ; }
61 virtual void SetPar6(Double_t *pars) ;
62 virtual Double_t* GetPar6() const { return fgPar6 ; }
63
64protected:
65 Int_t fNumberOfECAClusters ; // number of clusters found in EC section
66 Float_t fECALocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
67 Float_t fThreshold ; //minimum energy for cell to be joined to a cluster
68 AliEMCALGeometry * fGeom; //! pointer to geometry for utilities
69 TObjArray *fRecPoints; // Array with EMCAL clusters
70 TClonesArray *fDigitsArr; // Array with EMCAL digits
71
72private:
73 AliEMCALUnfolding(const AliEMCALUnfolding &); //copy ctor
74 AliEMCALUnfolding & operator = (const AliEMCALUnfolding &);
75
76 Bool_t UnfoldClusterV2(AliEMCALRecPoint * iniEmc, Int_t Nmax,
77 AliEMCALDigit ** maxAt,
78 Float_t * maxAtEnergy ); //Unfolds cluster using TMinuit package
79 Bool_t UnfoldClusterV2old(AliEMCALRecPoint * iniEmc, Int_t Nmax,
80 AliEMCALDigit ** maxAt,
81 Float_t * maxAtEnergy ); //Unfolds cluster using TMinuit package
82 Bool_t FindFitV2(AliEMCALRecPoint * emcRP, AliEMCALDigit ** MaxAt, const Float_t * maxAtEnergy,
83 Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
84
85 static Double_t fgSSPars[8];//! Unfolding shower shape parameters
86 // function:
87 // f(r)=exp(-(p0*r)^p1 * (1/(p2+p3*(p0*r)^p1)+p4/(1+p6*(p0*r)^p5) ) )
88 // p0,p1,p2,p3,p4 are fixed
89 // params p5 and p6 are phi-dependent and set in ShowerShapeV2
90 static Double_t fgPar5[3];//! UF SSPar nr 5 = p0 + phi*p1 + phi^2 *p2
91 static Double_t fgPar6[3];//! UF SSPar nr 6 = p0 + phi*p1 + phi^2 *p2
92 static void EvalPar5(Double_t phi);
93 static void EvalPar6(Double_t phi);
94 static void EvalParsPhiDependence(Int_t absId, const AliEMCALGeometry *geom);
95
96 ClassDef(AliEMCALUnfolding,2) // Unfolding algorithm class
97} ;
98
99#endif // AliEMCALUNFOLDING_H