can now read from HPSS
[u/mrichter/AliRoot.git] / PHOS / AliPHOSClusterizerv1.h
CommitLineData
d15a28e7 1#ifndef ALIPHOSCLUSTERIZERV1_H
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
10//
11//*-- Author: Yves Schutz (SUBATECH)
d15a28e7 12
13// --- ROOT system ---
14
15// --- Standard library ---
16
17// --- AliRoot header files ---
18
19#include "AliPHOSClusterizer.h"
9a1398dd 20class AliPHOSEmcRecPoint ;
21class AliPHOSDigit ;
22class AliPHOSDigitizer ;
23class AliPHOSGeometry ;
d15a28e7 24
25
26class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
27
28public:
29
30 AliPHOSClusterizerv1() ; // ctor
9a1398dd 31 AliPHOSClusterizerv1(const char * headerFile,const char *digitsBrancheTitle=0);
32 virtual ~AliPHOSClusterizerv1(){} // dtor
d15a28e7 33
9a1398dd 34 Int_t AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ;
35 // Checks if digits are in neighbour cells
36 virtual void GetNumberOfClustersFound(int * numb ){ numb[0] = fNumberOfEmcClusters ;
37 numb[1] = fNumberOfCpvClusters ; }
38
39 virtual Float_t GetEmcClusteringThreshold()const{ return fEmcClusteringThreshold;}
40 virtual Float_t GetEmcLocalMaxCut()const { return fEmcLocMaxCut;}
41 virtual Float_t GetEmcLogWeight()const { return fW0;}
42 virtual Float_t GetCpvClusteringThreshold()const{ return fCpvClusteringThreshold; }
43 virtual Float_t GetCpvLocalMaxCut()const { return fCpvLocMaxCut;}
44 virtual Float_t GetCpvLogWeight()const { return fW0CPV;}
45 virtual Float_t GetPpsdClusteringThreshold()const{ return fPpsdClusteringThreshold; }
46 virtual char * GetRecPointsBranch() const { return (char*) fRecPointsBranchTitle.Data() ;}
47 virtual char * GetDigitsBranch() const { return (char*) fDigitsBranchTitle.Data() ;}
48
49 void Exec(Option_t *option); // Does the job
50
51 virtual void Print(Option_t * option)const ;
52
d72dfbc3 53 virtual void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
9a1398dd 54 virtual void SetEmcLocalMaxCut(Float_t cut) { fEmcLocMaxCut = cut ; }
55 virtual void SetEmcLogWeight(Float_t w) { fW0 = w ; }
ed4205d8 56 virtual void SetCpvClusteringThreshold(Float_t cluth) { fCpvClusteringThreshold = cluth ; }
9a1398dd 57 virtual void SetCpvLocalMaxCut(Float_t cut) { fCpvLocMaxCut = cut ; }
58 virtual void SetCpvLogWeight(Float_t w) { fW0CPV = w ; }
59 virtual void SetPpsdClusteringThreshold(Float_t cluth) { fPpsdClusteringThreshold = cluth ; }
60
f035f6ce 61 virtual void SetDigitsBranch(const char * title) { fDigitsBranchTitle = title ;}
62 virtual void SetRecPointsBranch(const char *title){fRecPointsBranchTitle = title; }
9a1398dd 63
64 virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) {fToUnfold = toUnfold ;}
65
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
68 static Double_t ShowerShape(Double_t r) ; // Shape of EM shower used in unfolding;
69 //class member function (not object member function)
70
d15a28e7 71private:
9a1398dd 72 virtual Float_t Calibrate(Int_t amp)const { return (amp-fPedestal)/fSlope ;} // Tranforms Amp to energy
73 Bool_t FindFit(AliPHOSEmcRecPoint * emcRP, int * MaxAt, Float_t * maxAtEnergy,
74 Int_t NPar, Float_t * FitParametres) ; //Used in UnfoldClusters, calls TMinuit
75 void Init() ;
76
77 virtual Bool_t IsInEmc (AliPHOSDigit * digit)const ; // Tells if id digit is in EMC
78 virtual Bool_t IsInPpsd(AliPHOSDigit * digit)const ; // Tells if id digit is in PPSD
79 virtual Bool_t IsInCpv (AliPHOSDigit * digit)const ; // Tells if id digit is in CPV
80
81 virtual void MakeClusters( ) ;
82 virtual void MakeUnfolding() ;
83 Bool_t ReadDigits() ;
84 void UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax,
85 int * maxAt,Float_t * maxAtEnergy ) ; //Unfolds cluster using TMinuit package
86 void WriteRecPoints() ;
87 void PrintRecPoints(Option_t * option) ;
88
89private:
90
91 TString fHeaderFileName ; // name of the file which contains gAlice, Tree headers etc.
92 TString fDigitsBranchTitle ; // name of the file, where digits branch is stored
93 TString fRecPointsBranchTitle ; // name of the file, where RecPoints branchs are stored
94
95 Int_t fEvent ; // Number of event currently processed
96 Bool_t fToUnfold ; // To perform unfolding
97
98 Bool_t fIsInitialized ;
99
100 AliPHOSGeometry * fGeom ; // !pointer to PHOS geometry
101
102 AliPHOSDigitizer * fDigitizer ; // !digitizer which produced Digits we treat
103
ed4205d8 104 Int_t fNumberOfEmcClusters ; // number of EMC clusters found
9a1398dd 105 Int_t fNumberOfCpvClusters ; // number of CPV+PPSD clusters found
106 TClonesArray * fDigits ; // ! Initial list of digits
107 TObjArray * fEmcRecPoints ; // ! Final list of EMC Rec Points
108 TObjArray * fCpvRecPoints ; // ! Final list of CPV/PPSD recPoints
109
110 Float_t fPedestal ; // Calibration parameters
111 Float_t fSlope ; // read from Digitizer
112
b2a60966 113 Float_t fEmcClusteringThreshold ; // minimum energy to include a EMC digit in a cluster
b2a60966 114 Float_t fPpsdClusteringThreshold ; // minimum energy to include a PPSD digit in a cluster
ed4205d8 115 Float_t fCpvClusteringThreshold ; // minimum energy to include a CPV digit in a cluster
9a1398dd 116 Float_t fEmcLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
b2a60966 117 Float_t fW0 ; // logarithmic weight for the cluster center of gravity calculation
9a1398dd 118 Float_t fCpvLocMaxCut ; // minimum energy difference to distinguish local maxima in a CPV cluster
d72dfbc3 119 Float_t fW0CPV ; // logarithmic weight for the CPV cluster center of gravity calculation
92862013 120
ed4205d8 121 ClassDef(AliPHOSClusterizerv1,1) // Clusterizer implementation version 1
d15a28e7 122
123};
124
125#endif // AliPHOSCLUSTERIZERV1_H