]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALClusterizerv1.h
add some missing copy ctors and progress toward code convention compliance
[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   //cpy ctor required by coding convention
40   AliEMCALClusterizerv1(const AliEMCALClusterizerv1& clus);
41
42   AliEMCALClusterizerv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName());
43   virtual ~AliEMCALClusterizerv1()  ;
44   virtual void Browse(TBrowser* b);
45   
46   virtual Int_t   AreNeighbours(AliEMCALDigit * d1, AliEMCALDigit * d2)const ; 
47                                // Checks if digits are in neighbour cells 
48
49   // Checks if digits are in a tower group; for pseudoclusters 
50   virtual Int_t   AreInGroup(AliEMCALDigit * d1, AliEMCALDigit * d2)const ; 
51
52   virtual Float_t Calibrate(Int_t amp, Int_t cellId) ;  // Tranforms Amp to energy 
53
54   virtual void    GetNumberOfClustersFound(int numb )const{ numb = fNumberOfECAClusters ;} 
55   virtual Float_t GetECAClusteringThreshold()const{ return fECAClusteringThreshold;}  
56   virtual Float_t GetECALocalMaxCut()const       { return fECALocMaxCut;} 
57   virtual Float_t GetECALogWeight()const         { return fECAW0;}
58   virtual Float_t GetMinECut()const              { return fMinECut;}
59
60   virtual Float_t GetTimeGate() const            { return fTimeGate ; }
61   virtual const char *  GetRecPointsBranch() const{ return GetName() ;}
62   virtual Int_t GetRecPointsInRun() const   {return fRecPointsInRun ;} 
63
64   void    Exec(Option_t *option);                // Does the job
65
66   virtual void Print(Option_t * option)const ;
67
68   virtual void SetECAClusteringThreshold(Float_t cluth)  { fECAClusteringThreshold = cluth ; }
69   virtual void SetMinECut(Float_t mine)                  { fMinECut = mine; }
70   virtual void SetECALocalMaxCut(Float_t cut)            { fECALocMaxCut = cut ; }
71   virtual void SetECALogWeight(Float_t w)                { fECAW0 = w ; }
72   virtual void SetTimeGate(Float_t gate)                 { fTimeGate = gate ;}
73   virtual void SetUnfolding(Bool_t toUnfold = kTRUE )    {fToUnfold = toUnfold ;}  
74   static Double_t ShowerShape(Double_t r) ; // Shape of EM shower used in unfolding; 
75                                             //class member function (not object member function)
76   static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag)  ;
77                                             // Chi^2 of the fit. Should be static to be passes to MINUIT
78   void Unload() ; 
79   virtual const char * Version() const { return "clu-v1" ; }  
80  
81   TList* BookHists();
82   void   SaveHists(const char *fn="reco.root");  //*MENU*
83 protected:
84
85   void           WriteRecPoints() ;
86   virtual void   MakeClusters(char* opt ) ;            
87   virtual void   MakeClusters() { Fatal("MakeClusters","not implemented"); }
88             
89 ///////////////////// 
90    TList  *fHists;   //!
91    TH1F* fPointE;    //histogram of point energy
92    TH1F* fPointL1;   //histogram of point L1
93    TH1F* fPointL2;   //histogram of point L2
94    TH1F* fPointDis;  //histogram of point dispersion
95    TH1F* fPointMult; //histogram of point multiplicity
96    TH1F* fDigitAmp;  //histogram of digit ADC Amplitude
97    TH1F* fMaxE;      //histogram of maximum point energy
98    TH1F* fMaxL1;     //histogram of maximum point L1
99    TH1F* fMaxL2;     //histogram of maximum point L2
100    TH1F* fMaxDis;    //histogram of maximum point dispersion
101 ///////////////////////
102
103
104 private:
105
106   const TString BranchName() const ; 
107   void    GetCalibrationParameters(void) ;
108   
109   Bool_t  FindFit(AliEMCALRecPoint * emcRP, AliEMCALDigit ** MaxAt, Float_t * maxAtEnergy, 
110                   Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
111   void Init() ;
112   void InitParameters() ;
113
114   virtual void   MakeUnfolding() const;
115   void           UnfoldCluster(AliEMCALRecPoint * /*iniEmc*/, Int_t /*Nmax*/, 
116                                AliEMCALDigit ** /*maxAt*/,
117                                Float_t * /*maxAtEnergy*/ ) const; //Unfolds cluster using TMinuit package
118   void           PrintRecPoints(Option_t * option) ;
119
120 private:
121   AliEMCALGeometry* fGeom;           //! pointer to geometry for utilities
122
123   Bool_t  fDefaultInit;              //! Says if the task was created by defaut ctor (only parameters are initialized)
124   Bool_t  fToUnfold ;                // To perform unfolding 
125   Int_t   fNumberOfECAClusters ;     // number of clusters found in EC section
126
127   Int_t   fNTowerInGroup;            // number of towers to group for pseudoclusters
128
129   //Calibration parameters... to be replaced by database 
130
131   AliEMCALCalibData * fCalibData  ;   //! Calibration database if aval
132   Float_t fADCchannelECA ;          // width of one ADC channel for EC section (GeV)
133   Float_t fADCpedestalECA ;         // pedestal of ADC for EC section (GeV) 
134  
135   Float_t fECAClusteringThreshold ;  // minimum energy to seed a EC digit in a cluster
136   Float_t fECALocMaxCut ;            // minimum energy difference to distinguish local maxima in a cluster
137   Float_t fECAW0 ;                   // logarithmic weight for the cluster center of gravity calculation
138   Int_t fRecPointsInRun ;            //! Total number of recpoints in one run
139   Float_t fTimeGate ;                // Maximum time difference between the digits in ont EMC cluster
140   Float_t fMinECut;                  // Minimum energy for a digit to be a member of a cluster
141
142   ClassDef(AliEMCALClusterizerv1,4)   // Clusterizer implementation version 1
143
144 };
145
146 #endif // AliEMCALCLUSTERIZERV1_H