]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALClusterizerv1.h
Adding comments
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALClusterizerv1.h
1 #ifndef ALIEMCALCLUSTERIZERV1_H
2 #define ALIEMCALCLUSTERIZERV1_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 //  Implementation version 1 of the clusterization algorithm                     
10 //  Performs clusterization (collects neighbouring active cells) and 
11 //  unfolding of the clusters with several local maxima.  
12 //  results are stored in TreeR#, branches PHOSEmcRP (EMC recPoints),
13 //  PHOSCpvRP (CPV RecPoints) and AliPHOSClusterizer
14 //
15 //*-- Author: Yves Schutz (SUBATECH)
16 // Modif: 
17 //  August 2002 Yves Schutz: clone PHOS as closely as possible and intoduction
18 //                           of new  IO (à la PHOS)
19
20 // --- ROOT system ---
21
22 // --- Standard library ---
23
24 // --- AliRoot header files ---
25
26 #include "AliEMCALClusterizer.h"
27 class TH1F;
28 class AliEMCALRecPoint ; 
29 class AliEMCALDigit ;
30 class AliEMCALDigitizer ;
31 class AliEMCALGeometry ;
32 class AliEMCALCalibData ;
33
34 class AliEMCALClusterizerv1 : public AliEMCALClusterizer {
35   
36 public:
37   
38   AliEMCALClusterizerv1() ;         
39   AliEMCALClusterizerv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName());
40   virtual ~AliEMCALClusterizerv1()  ;
41   virtual void Browse(TBrowser* b);
42   
43   virtual Int_t   AreNeighbours(AliEMCALDigit * d1, AliEMCALDigit * d2)const ; 
44                                // Checks if digits are in neighbour cells 
45
46   virtual Float_t Calibrate(Int_t amp)const ;  // Tranforms Amp to energy 
47
48   virtual void    GetNumberOfClustersFound(int numb )const{ numb = fNumberOfECAClusters ;} 
49   virtual Float_t GetECAClusteringThreshold()const{ return fECAClusteringThreshold;}  
50   virtual Float_t GetECALocalMaxCut()const       { return fECALocMaxCut;} 
51   virtual Float_t GetECALogWeight()const         { return fECAW0;}
52   virtual Float_t GetMinECut()const              { return fMinECut;}
53
54   virtual Float_t GetTimeGate() const            { return fTimeGate ; }
55   virtual const char *  GetRecPointsBranch() const{ return GetName() ;}
56   virtual Int_t GetRecPointsInRun() const   {return fRecPointsInRun ;} 
57
58   void    Exec(Option_t *option);                // Does the job
59
60   virtual void Print(Option_t * option)const ;
61
62   virtual void SetECAClusteringThreshold(Float_t cluth)  { fECAClusteringThreshold = cluth ; }
63   virtual void SetMinECut(Float_t mine)                  { fMinECut = mine; }
64   virtual void SetECALocalMaxCut(Float_t cut)            { fECALocMaxCut = cut ; }
65   virtual void SetECALogWeight(Float_t w)                { fECAW0 = w ; }
66   virtual void SetTimeGate(Float_t gate)                 { fTimeGate = gate ;}
67   virtual void SetUnfolding(Bool_t toUnfold = kTRUE )    {fToUnfold = toUnfold ;}  
68   static Double_t ShowerShape(Double_t r) ; // Shape of EM shower used in unfolding; 
69                                             //class member function (not object member function)
70   static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag)  ;
71                                             // Chi^2 of the fit. Should be static to be passes to MINUIT
72   void Unload() ; 
73   virtual const char * Version() const { return "clu-v1" ; }  
74  
75   TList* BookHists();
76   void   SaveHists(const char *fn="reco.root");  //*MENU*
77 protected:
78
79   void           WriteRecPoints() ;
80   virtual void   MakeClusters( ) ;            
81 ///////////////////// 
82    TList  *fHists;   //!
83    TH1F* pointE;
84    TH1F* pointL1;
85    TH1F* pointL2;
86    TH1F* pointDis;
87    TH1F* pointMult;
88    TH1F* digitAmp;
89    TH1F* MaxE;
90    TH1F* MaxL1;
91    TH1F* MaxL2;
92    TH1F* MaxDis;
93 ///////////////////////
94
95
96 private:
97
98   const TString BranchName() const ; 
99   void    GetCalibrationParameters(void) ;
100   
101   Bool_t  FindFit(AliEMCALRecPoint * emcRP, AliEMCALDigit ** MaxAt, Float_t * maxAtEnergy, 
102                   Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
103   void Init() ;
104   void InitParameters() ;
105
106   virtual void   MakeUnfolding() const;
107   void           UnfoldCluster(AliEMCALRecPoint * /*iniEmc*/, Int_t /*Nmax*/, 
108                                AliEMCALDigit ** /*maxAt*/,
109                                Float_t * /*maxAtEnergy*/ ) const; //Unfolds cluster using TMinuit package
110   void           PrintRecPoints(Option_t * option) ;
111   //  TFile* recofile;
112 private:
113
114   Bool_t  fDefaultInit;              //! Says if the task was created by defaut ctor (only parameters are initialized)
115
116   Int_t   fNTowers ;                 // number of Towers in EMCAL
117
118   Bool_t  fToUnfold ;                // To perform unfolding 
119   Int_t   fNumberOfECAClusters ;     // number of clusters found in EC section
120   
121   //Calibration parameters... to be replaced by database 
122
123   AliEMCALCalibData * fCalibData  ;   //! Calibration database if aval
124   Float_t fADCchannelECA ;          // width of one ADC channel for EC section (GeV)
125   Float_t fADCpedestalECA ;         // pedestal of ADC for EC section (GeV) 
126  
127   Float_t fECAClusteringThreshold ;  // minimum energy to seed a EC digit in a cluster
128   Float_t fECALocMaxCut ;            // minimum energy difference to distinguish local maxima in a cluster
129   Float_t fECAW0 ;                   // logarithmic weight for the cluster center of gravity calculation
130   Int_t fRecPointsInRun ;            //! Total number of recpoints in one run
131   Float_t fTimeGate ;                // Maximum time difference between the digits in ont EMC cluster
132   Float_t fMinECut;                  // Minimum energy for a digit to be a member of a cluster
133
134   ClassDef(AliEMCALClusterizerv1,4)   // Clusterizer implementation version 1
135
136 };
137
138 #endif // AliEMCALCLUSTERIZERV1_H