Coding convention obeyed
[u/mrichter/AliRoot.git] / PHOS / AliPHOSClusterizerv1.h
CommitLineData
e9a88722 1#ifndef ALIPHOSCLUSTERIZERV1_H
d15a28e7 2#define ALIPHOSCLUSTERIZERV1_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6ad0bfa0 6/* $Id$ */
7
b2a60966 8//_________________________________________________________________________
9// Implementation version 1 of the clusterization algorithm
baef0810 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
b2a60966 14//
bed9e3fb 15//*-- Author: Dmitri Peressounko (SUBATECH)
d15a28e7 16
17// --- ROOT system ---
bed9e3fb 18#include "TArrayS.h"
d15a28e7 19// --- Standard library ---
20
21// --- AliRoot header files ---
22
23#include "AliPHOSClusterizer.h"
9a1398dd 24class AliPHOSEmcRecPoint ;
25class AliPHOSDigit ;
26class AliPHOSDigitizer ;
27class AliPHOSGeometry ;
bed9e3fb 28class AliPHOSCalibrationData ;
d15a28e7 29
30class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
31
32public:
33
9688c1dd 34 AliPHOSClusterizerv1() ;
fbf811ec 35 AliPHOSClusterizerv1(const char * headerFile, const char * name = "Default", const Bool_t toSplit=kFALSE);
0bc3b8ed 36 AliPHOSClusterizerv1(const AliPHOSClusterizerv1 & clusterizer) {
37 // copy ctor: no implementation yet
38 Fatal("cpy ctor", "not implemented") ;
39 }
9688c1dd 40 virtual ~AliPHOSClusterizerv1() ;
d15a28e7 41
1f96ab2a 42 virtual Int_t AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ;
9a1398dd 43 // Checks if digits are in neighbour cells
3758d9fc 44
45 virtual Float_t Calibrate(Int_t amp, Int_t absId)const ; // Tranforms Amp to energy
46
baef0810 47 virtual void GetNumberOfClustersFound(int * numb )const{ numb[0] = fNumberOfEmcClusters ;
48 numb[1] = fNumberOfCpvClusters ; }
9a1398dd 49
50 virtual Float_t GetEmcClusteringThreshold()const{ return fEmcClusteringThreshold;}
51 virtual Float_t GetEmcLocalMaxCut()const { return fEmcLocMaxCut;}
52 virtual Float_t GetEmcLogWeight()const { return fW0;}
9688c1dd 53 virtual Float_t GetEmcTimeGate() const { return fEmcTimeGate ; }
9a1398dd 54 virtual Float_t GetCpvClusteringThreshold()const{ return fCpvClusteringThreshold; }
55 virtual Float_t GetCpvLocalMaxCut()const { return fCpvLocMaxCut;}
56 virtual Float_t GetCpvLogWeight()const { return fW0CPV;}
092b50ba 57 virtual Float_t GetPurifyThreshold()const {return fPurifyThreshold; }
fbf811ec 58 virtual const char * GetRecPointsBranch() const{ return GetName() ;}
59 virtual const Int_t GetRecPointsInRun() const {return fRecPointsInRun ;}
9a1398dd 60
61 void Exec(Option_t *option); // Does the job
62
63 virtual void Print(Option_t * option)const ;
64
d72dfbc3 65 virtual void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
9a1398dd 66 virtual void SetEmcLocalMaxCut(Float_t cut) { fEmcLocMaxCut = cut ; }
67 virtual void SetEmcLogWeight(Float_t w) { fW0 = w ; }
fbf811ec 68 virtual void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate ;}
ed4205d8 69 virtual void SetCpvClusteringThreshold(Float_t cluth) { fCpvClusteringThreshold = cluth ; }
9a1398dd 70 virtual void SetCpvLocalMaxCut(Float_t cut) { fCpvLocMaxCut = cut ; }
71 virtual void SetCpvLogWeight(Float_t w) { fW0CPV = w ; }
092b50ba 72 virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) { fToUnfold = toUnfold ;}
73 virtual void SetPirifyThreshold(Float_t threshold) {fPurifyThreshold = threshold ;}
bed9e3fb 74 void SetCalibrVersion(const char* version = "v1",Int_t run=1) //Provides specification of calibrationData
75 {fCalibrVersion = version ; fCalibrRun = run ;}
76 void SetPatterns(TArrayS * pats){if(fPatterns) delete fPatterns ;
77 fPatterns = new TArrayS(*pats) ;}
9a1398dd 78 static Double_t ShowerShape(Double_t r) ; // Shape of EM shower used in unfolding;
79 //class member function (not object member function)
7b7c1533 80 static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag) ;
81 // Chi^2 of the fit. Should be static to be passes to MINUIT
0bc3b8ed 82 AliPHOSClusterizerv1 & operator = (const AliPHOSClusterizerv1 & rvalue) {
83 // assignement operator requested by coding convention but not needed
84 Fatal("operator =", "not implemented") ; return *this ;
85 }
86
7b7c1533 87 virtual const char * Version() const { return "clu-v1" ; }
9a1398dd 88
1f96ab2a 89protected:
90
91 void WriteRecPoints(Int_t event) ;
92 virtual void MakeClusters( ) ;
93 virtual Bool_t IsInEmc (AliPHOSDigit * digit)const ; // Tells if id digit is in EMC
94 virtual Bool_t IsInCpv (AliPHOSDigit * digit)const ; // Tells if id digit is in CPV
95
7b7c1533 96
d15a28e7 97private:
7b7c1533 98
fbf811ec 99 const TString BranchName() const ;
3758d9fc 100 void GetCalibrationParameters(void) ;
101
a0636361 102 Bool_t FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy,
baef0810 103 Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
fbf811ec 104 void Init() ;
105 void InitParameters() ;
9a1398dd 106
9a1398dd 107 virtual void MakeUnfolding() ;
9a1398dd 108 void UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax,
a0636361 109 AliPHOSDigit ** maxAt,Float_t * maxAtEnergy ) ; //Unfolds cluster using TMinuit package
9a1398dd 110 void PrintRecPoints(Option_t * option) ;
111
112private:
113
92f521a9 114 Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
9a1398dd 115
3758d9fc 116 Int_t fEmcCrystals ; // number of EMC cristalls in PHOS
117
9a1398dd 118 Bool_t fToUnfold ; // To perform unfolding
119
ed4205d8 120 Int_t fNumberOfEmcClusters ; // number of EMC clusters found
9688c1dd 121 Int_t fNumberOfCpvClusters ; // number of CPV clusters found
7b7c1533 122
c2cd5471 123 //Calibration parameters
bed9e3fb 124 AliPHOSCalibrationData * fPedestals ; //!
125 AliPHOSCalibrationData * fGains ; //!
126 TArrayS * fPatterns ;// Array of trigger patterns of events to handle
0bc3b8ed 127 TString fCalibrVersion ; // Version of calibration Data
128 Int_t fCalibrRun ; // Specification of Calibration data
3758d9fc 129 Float_t fADCchanelEmc ; // width of one ADC channel in GeV
0bc3b8ed 130 Float_t fADCpedestalEmc ; // value of the EMC ADC pedestal
3758d9fc 131 Float_t fADCchanelCpv ; // width of one ADC channel in CPV 'popugais'
0bc3b8ed 132 Float_t fADCpedestalCpv ; // value of the CPV ADC pedestal
092b50ba 133
134 Float_t fPurifyThreshold ; // threshold for cell energies after unfolding
b2a60966 135 Float_t fEmcClusteringThreshold ; // minimum energy to include a EMC digit in a cluster
ed4205d8 136 Float_t fCpvClusteringThreshold ; // minimum energy to include a CPV digit in a cluster
9a1398dd 137 Float_t fEmcLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
b2a60966 138 Float_t fW0 ; // logarithmic weight for the cluster center of gravity calculation
9a1398dd 139 Float_t fCpvLocMaxCut ; // minimum energy difference to distinguish local maxima in a CPV cluster
d72dfbc3 140 Float_t fW0CPV ; // logarithmic weight for the CPV cluster center of gravity calculation
2b60655b 141 Int_t fRecPointsInRun ; //! Total number of recpoints in one run
9688c1dd 142 Float_t fEmcTimeGate ; // Maximum time difference between the digits in ont EMC cluster
143
fc12304f 144 ClassDef(AliPHOSClusterizerv1,2) // Clusterizer implementation version 1
d15a28e7 145
146};
147
148#endif // AliPHOSCLUSTERIZERV1_H