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 */
8 //_________________________________________________________________________
9 // Implementation version 1 of the clusterization algorithm
11 //*-- Author: Yves Schutz (SUBATECH)
13 // --- ROOT system ---
15 // --- Standard library ---
17 // --- AliRoot header files ---
19 #include "AliPHOSClusterizer.h"
20 class AliPHOSEmcRecPoint ;
22 class AliPHOSDigitizer ;
23 class AliPHOSGeometry ;
26 class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
30 AliPHOSClusterizerv1() ; // ctor
31 AliPHOSClusterizerv1(const char * HeaderFile,const char *DigitsBrancheFile=0);
32 virtual ~AliPHOSClusterizerv1(){} // dtor
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 ; }
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*) fRecPointsBranchFileName.Data() ;}
47 virtual char * GetDigitsBranch() const { return (char*) fDigitsBranchFileName.Data() ;}
49 void Exec(Option_t *option); // Does the job
51 virtual void Print(Option_t * option)const ;
53 virtual void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
54 virtual void SetEmcLocalMaxCut(Float_t cut) { fEmcLocMaxCut = cut ; }
55 virtual void SetEmcLogWeight(Float_t w) { fW0 = w ; }
56 virtual void SetCpvClusteringThreshold(Float_t cluth) { fCpvClusteringThreshold = cluth ; }
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 ; }
61 virtual void SetDigitsBranch(const char * file) ;
62 virtual void SetRecPointsBranch(const char *file) ;
64 virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) {fToUnfold = toUnfold ;}
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)
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
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
81 virtual void MakeClusters( ) ;
82 virtual void MakeUnfolding() ;
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) ;
91 TString fHeaderFileName ; // name of the file which contains gAlice, Tree headers etc.
92 TString fDigitsBranchFileName ; // name of the file, where digits branch is stored
93 TString fRecPointsBranchFileName ; // name of the file, where RecPoints branchs are stored
95 Int_t fEvent ; // Number of event currently processed
96 Bool_t fToUnfold ; // To perform unfolding
98 Bool_t fIsInitialized ;
100 AliPHOSGeometry * fGeom ; // !pointer to PHOS geometry
102 AliPHOSDigitizer * fDigitizer ; // !digitizer which produced Digits we treat
104 Int_t fNumberOfEmcClusters ; // number of EMC clusters found
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
110 Float_t fPedestal ; // Calibration parameters
111 Float_t fSlope ; // read from Digitizer
113 Float_t fEmcClusteringThreshold ; // minimum energy to include a EMC digit in a cluster
114 Float_t fPpsdClusteringThreshold ; // minimum energy to include a PPSD digit in a cluster
115 Float_t fCpvClusteringThreshold ; // minimum energy to include a CPV digit in a cluster
116 Float_t fEmcLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
117 Float_t fW0 ; // logarithmic weight for the cluster center of gravity calculation
118 Float_t fCpvLocMaxCut ; // minimum energy difference to distinguish local maxima in a CPV cluster
119 Float_t fW0CPV ; // logarithmic weight for the CPV cluster center of gravity calculation
121 ClassDef(AliPHOSClusterizerv1,1) // Clusterizer implementation version 1
125 #endif // AliPHOSCLUSTERIZERV1_H