Coding conventions (F.Carminati)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALClusterizerv1.h
CommitLineData
483b0559 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)
05a92d59 16// Modif:
17// August 2002 Yves Schutz: clone PHOS as closely as possible and intoduction
18// of new IO (à la PHOS)
483b0559 19
20// --- ROOT system ---
21
22// --- Standard library ---
23
24// --- AliRoot header files ---
25
26#include "AliEMCALClusterizer.h"
70a93198 27class AliEMCALRecPoint ;
483b0559 28class AliEMCALDigit ;
29class AliEMCALDigitizer ;
30class AliEMCALGeometry ;
31
32
33class AliEMCALClusterizerv1 : public AliEMCALClusterizer {
34
35public:
36
37 AliEMCALClusterizerv1() ;
e191bb57 38 AliEMCALClusterizerv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName());
483b0559 39 virtual ~AliEMCALClusterizerv1() ;
40
41 virtual Int_t AreNeighbours(AliEMCALDigit * d1, AliEMCALDigit * d2)const ;
42 // Checks if digits are in neighbour cells
43
fdebddeb 44 virtual Float_t Calibrate(Int_t amp)const ; // Tranforms Amp to energy
ed611565 45
fdebddeb 46 virtual void GetNumberOfClustersFound(int numb )const{ numb = fNumberOfECAClusters ;}
47 virtual Float_t GetECAClusteringThreshold()const{ return fECAClusteringThreshold;}
88cb7938 48 virtual Float_t GetECALocalMaxCut()const { return fECALocMaxCut;}
fdebddeb 49 virtual Float_t GetECALogWeight()const { return fECAW0;}
ed611565 50
51 virtual Float_t GetTimeGate() const { return fTimeGate ; }
05a92d59 52 virtual const char * GetRecPointsBranch() const{ return GetName() ;}
53 virtual const Int_t GetRecPointsInRun() const {return fRecPointsInRun ;}
483b0559 54
55 void Exec(Option_t *option); // Does the job
56
57 virtual void Print(Option_t * option)const ;
58
88cb7938 59 virtual void SetECAClusteringThreshold(Float_t cluth) { fECAClusteringThreshold = cluth ; }
60 virtual void SetECALocalMaxCut(Float_t cut) { fECALocMaxCut = cut ; }
61 virtual void SetECALogWeight(Float_t w) { fECAW0 = w ; }
88cb7938 62 virtual void SetTimeGate(Float_t gate) { fTimeGate = gate ;}
88cb7938 63 virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) {fToUnfold = toUnfold ;}
483b0559 64 static Double_t ShowerShape(Double_t r) ; // Shape of EM shower used in unfolding;
65 //class member function (not object member function)
66 static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag) ;
67 // Chi^2 of the fit. Should be static to be passes to MINUIT
88cb7938 68 void Unload() ;
483b0559 69 virtual const char * Version() const { return "clu-v1" ; }
70
71protected:
72
9e5d2067 73 void WriteRecPoints() ;
483b0559 74 virtual void MakeClusters( ) ;
483b0559 75
76private:
77
05a92d59 78 const TString BranchName() const ;
483b0559 79 void GetCalibrationParameters(void) ;
80
70a93198 81 Bool_t FindFit(AliEMCALRecPoint * emcRP, AliEMCALDigit ** MaxAt, Float_t * maxAtEnergy,
483b0559 82 Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
83 void Init() ;
839828a6 84 void InitParameters() ;
483b0559 85
fdebddeb 86 virtual void MakeUnfolding() const;
70a93198 87 void UnfoldCluster(AliEMCALRecPoint * /*iniEmc*/, Int_t /*Nmax*/,
9e5d2067 88 AliEMCALDigit ** /*maxAt*/,
fdebddeb 89 Float_t * /*maxAtEnergy*/ ) const; //Unfolds cluster using TMinuit package
90 void PrintRecPoints(Option_t * option) ;
483b0559 91
92private:
93
ef305168 94 Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
483b0559 95
96 Int_t fNTowers ; // number of Towers in EMCAL
97
98 Bool_t fToUnfold ; // To perform unfolding
88cb7938 99 Int_t fNumberOfECAClusters ; // number of clusters found in EC section
ed611565 100
05a92d59 101 //Calibration parameters... to be replaced by database
88cb7938 102 Float_t fADCchannelECA ; // width of one ADC channel for EC section (GeV)
103 Float_t fADCpedestalECA ; // pedestal of ADC for EC section (GeV)
ed611565 104
88cb7938 105 Float_t fECAClusteringThreshold ; // minimum energy to include a EC digit in a cluster
88cb7938 106 Float_t fECALocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
107 Float_t fECAW0 ; // logarithmic weight for the cluster center of gravity calculation
88cb7938 108 Int_t fRecPointsInRun ; //! Total number of recpoints in one run
109 Float_t fTimeGate ; // Maximum time difference between the digits in ont EMC cluster
483b0559 110
9cd3f997 111 ClassDef(AliEMCALClusterizerv1,3) // Clusterizer implementation version 1
483b0559 112
113};
114
115#endif // AliEMCALCLUSTERIZERV1_H