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