ROOT logo
#ifndef ALIEMCALUNFOLDING_H 
#define ALIEMCALUNFOLDING_H 
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * 
 * See cxx source for full Copyright notice                               */ 
      
//_________________________________________________________________________ 
//  Base class for the cluster unfolding algorithm  
//*-- Author: Adam Matyja (SUBATECH) 
 
// --- ROOT system --- 
//#include "AliLog.h" 
#include "TObject.h"  
//class TTree; 
class AliLog ; 

 
// --- Standard library --- 
 
// --- AliRoot header files --- 
class AliEMCALGeometry ; 
//class AliEMCALCalibData ; 
//class AliCaloCalibPedestal ; 
class AliEMCALRecPoint ;  
class AliEMCALDigit ; 
 
 
class AliEMCALUnfolding : public TObject { 
 
public: 
 
  AliEMCALUnfolding() ;        // default ctor 
  virtual ~AliEMCALUnfolding() ; // dtorEM 
  AliEMCALUnfolding(AliEMCALGeometry* geometry);// constructor 
  AliEMCALUnfolding(AliEMCALGeometry* geometry,Float_t ECALocMaxCut,Double_t *SSPars,Double_t *Par5,Double_t *Par6);// constructor 
 
  virtual void Init() ; 
  virtual void SetInput(Int_t numberOfECAClusters,TObjArray *recPoints,TClonesArray *digitsArr); 
 
  //setters and getters 
  virtual void SetNumberOfECAClusters(Int_t n) { fNumberOfECAClusters = n; } 
  virtual Int_t GetNumberOfECAClusters() const { return fNumberOfECAClusters; } 
  virtual void SetRecPoints(TObjArray *rec) { fRecPoints = rec; } 
  virtual TObjArray * GetRecPoints() const { return fRecPoints; } 
  virtual void SetDigitsArr(TClonesArray *digit) { fDigitsArr = digit; } 
  virtual TClonesArray * GetDigitsArr() const { return fDigitsArr; } 
  virtual void SetECALocalMaxCut(Float_t cut) { fECALocMaxCut = cut ; } 
  virtual Float_t GetECALocalMaxCut() const { return fECALocMaxCut; } 
  virtual void SetThreshold(Float_t energy) { fThreshold = energy; } 
  virtual Float_t GetThreshold() const { return fThreshold; } 
  virtual void SetRejectBelowThreshold(Bool_t reject) { fRejectBelowThreshold = reject; }
  virtual Bool_t GetRejectBelowThreshold() const { return fRejectBelowThreshold; }

  //unfolding main methods 
  virtual void   MakeUnfolding(); 
  static Double_t ShowerShapeV2(Double_t x, Double_t y) ; // Shape of EM shower used in unfolding;  
                                              //class member function (not object member function) 
  static void UnfoldingChiSquareV2(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag)  ; 
                                              // Chi^2 of the fit. Should be static to be passes to MINUIT 
  virtual void SetShowerShapeParams(Double_t *pars) ; 
  virtual Double_t* GetShowerShapeParams() const { return fgSSPars ; } 
  virtual void SetPar5(Double_t *pars) ; 
  virtual Double_t* GetPar5() const { return fgPar5 ; } 
  virtual void SetPar6(Double_t *pars) ; 
  virtual Double_t* GetPar6() const { return fgPar6 ; } 

  virtual Int_t UnfoldOneCluster(AliEMCALRecPoint * iniTower, 
				 Int_t nMax, 
				 AliEMCALDigit ** maxAt, 
				 Float_t * maxAtEnergy,
				 TObjArray *list);//input one cluster -> output list
 
protected:
  Int_t              fNumberOfECAClusters ;   // number of clusters found in EC section
  Float_t            fECALocMaxCut ;          // minimum energy difference to distinguish local maxima in a cluster
  Float_t            fThreshold ;             // minimum energy for cell to be joined to a cluster
  Bool_t             fRejectBelowThreshold ;  // split (false) or reject (true) cell energy below threshold after UF
  AliEMCALGeometry * fGeom;                   //! pointer to geometry for utilities
  TObjArray        * fRecPoints;              // Array with EMCAL clusters
  TClonesArray     * fDigitsArr;              // Array with EMCAL digits
  
private:
  AliEMCALUnfolding(const AliEMCALUnfolding &); //copy ctor
  AliEMCALUnfolding & operator = (const AliEMCALUnfolding &);
  
  Bool_t  UnfoldClusterV2(AliEMCALRecPoint * iniEmc, Int_t Nmax,
                          AliEMCALDigit ** maxAt,
                          Float_t * maxAtEnergy ); //Unfolds cluster using TMinuit package
  Bool_t  UnfoldClusterV2old(AliEMCALRecPoint * iniEmc, Int_t Nmax,
                             AliEMCALDigit ** maxAt,
                             Float_t * maxAtEnergy ); //Unfolds cluster using TMinuit package
  Bool_t  FindFitV2(AliEMCALRecPoint * emcRP, AliEMCALDigit ** MaxAt, const Float_t * maxAtEnergy,
                    Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit 
  
  static Double_t fgSSPars[8];//! Unfolding shower shape parameters 
  // function: 
  // f(r)=exp(-(p0*r)^p1 * (1/(p2+p3*(p0*r)^p1)+p4/(1+p6*(p0*r)^p5) ) ) 
  // p0,p1,p2,p3,p4 are fixed 
  // params p5 and p6 are phi-dependent and set in ShowerShapeV2 
  static Double_t fgPar5[3];//! UF SSPar nr 5 = p0 + phi*p1 + phi^2 *p2 
  static Double_t fgPar6[3];//! UF SSPar nr 6 = p0 + phi*p1 + phi^2 *p2 
  static void EvalPar5(Double_t phi); 
  static void EvalPar6(Double_t phi); 
  static void EvalParsPhiDependence(Int_t absId, const AliEMCALGeometry *geom); 
 
  ClassDef(AliEMCALUnfolding,3)  // Unfolding algorithm class
} ; 
 
#endif // AliEMCALUNFOLDING_H 
 AliEMCALUnfolding.h:1
 AliEMCALUnfolding.h:2
 AliEMCALUnfolding.h:3
 AliEMCALUnfolding.h:4
 AliEMCALUnfolding.h:5
 AliEMCALUnfolding.h:6
 AliEMCALUnfolding.h:7
 AliEMCALUnfolding.h:8
 AliEMCALUnfolding.h:9
 AliEMCALUnfolding.h:10
 AliEMCALUnfolding.h:11
 AliEMCALUnfolding.h:12
 AliEMCALUnfolding.h:13
 AliEMCALUnfolding.h:14
 AliEMCALUnfolding.h:15
 AliEMCALUnfolding.h:16
 AliEMCALUnfolding.h:17
 AliEMCALUnfolding.h:18
 AliEMCALUnfolding.h:19
 AliEMCALUnfolding.h:20
 AliEMCALUnfolding.h:21
 AliEMCALUnfolding.h:22
 AliEMCALUnfolding.h:23
 AliEMCALUnfolding.h:24
 AliEMCALUnfolding.h:25
 AliEMCALUnfolding.h:26
 AliEMCALUnfolding.h:27
 AliEMCALUnfolding.h:28
 AliEMCALUnfolding.h:29
 AliEMCALUnfolding.h:30
 AliEMCALUnfolding.h:31
 AliEMCALUnfolding.h:32
 AliEMCALUnfolding.h:33
 AliEMCALUnfolding.h:34
 AliEMCALUnfolding.h:35
 AliEMCALUnfolding.h:36
 AliEMCALUnfolding.h:37
 AliEMCALUnfolding.h:38
 AliEMCALUnfolding.h:39
 AliEMCALUnfolding.h:40
 AliEMCALUnfolding.h:41
 AliEMCALUnfolding.h:42
 AliEMCALUnfolding.h:43
 AliEMCALUnfolding.h:44
 AliEMCALUnfolding.h:45
 AliEMCALUnfolding.h:46
 AliEMCALUnfolding.h:47
 AliEMCALUnfolding.h:48
 AliEMCALUnfolding.h:49
 AliEMCALUnfolding.h:50
 AliEMCALUnfolding.h:51
 AliEMCALUnfolding.h:52
 AliEMCALUnfolding.h:53
 AliEMCALUnfolding.h:54
 AliEMCALUnfolding.h:55
 AliEMCALUnfolding.h:56
 AliEMCALUnfolding.h:57
 AliEMCALUnfolding.h:58
 AliEMCALUnfolding.h:59
 AliEMCALUnfolding.h:60
 AliEMCALUnfolding.h:61
 AliEMCALUnfolding.h:62
 AliEMCALUnfolding.h:63
 AliEMCALUnfolding.h:64
 AliEMCALUnfolding.h:65
 AliEMCALUnfolding.h:66
 AliEMCALUnfolding.h:67
 AliEMCALUnfolding.h:68
 AliEMCALUnfolding.h:69
 AliEMCALUnfolding.h:70
 AliEMCALUnfolding.h:71
 AliEMCALUnfolding.h:72
 AliEMCALUnfolding.h:73
 AliEMCALUnfolding.h:74
 AliEMCALUnfolding.h:75
 AliEMCALUnfolding.h:76
 AliEMCALUnfolding.h:77
 AliEMCALUnfolding.h:78
 AliEMCALUnfolding.h:79
 AliEMCALUnfolding.h:80
 AliEMCALUnfolding.h:81
 AliEMCALUnfolding.h:82
 AliEMCALUnfolding.h:83
 AliEMCALUnfolding.h:84
 AliEMCALUnfolding.h:85
 AliEMCALUnfolding.h:86
 AliEMCALUnfolding.h:87
 AliEMCALUnfolding.h:88
 AliEMCALUnfolding.h:89
 AliEMCALUnfolding.h:90
 AliEMCALUnfolding.h:91
 AliEMCALUnfolding.h:92
 AliEMCALUnfolding.h:93
 AliEMCALUnfolding.h:94
 AliEMCALUnfolding.h:95
 AliEMCALUnfolding.h:96
 AliEMCALUnfolding.h:97
 AliEMCALUnfolding.h:98
 AliEMCALUnfolding.h:99
 AliEMCALUnfolding.h:100
 AliEMCALUnfolding.h:101
 AliEMCALUnfolding.h:102
 AliEMCALUnfolding.h:103
 AliEMCALUnfolding.h:104
 AliEMCALUnfolding.h:105
 AliEMCALUnfolding.h:106
 AliEMCALUnfolding.h:107
 AliEMCALUnfolding.h:108