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
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
15 //*-- Author: Dmitri Peressounko (SUBATECH)
17 // --- ROOT system ---
19 // --- Standard library ---
21 // --- AliRoot header files ---
23 #include "AliPHOSClusterizer.h"
24 class AliPHOSEmcRecPoint ;
26 class AliPHOSDigitizer ;
27 class AliPHOSGeometry ;
28 class AliPHOSCalibrationData ;
30 class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
34 AliPHOSClusterizerv1() ;
35 AliPHOSClusterizerv1(const char * headerFile, const char * name = "Default", const Bool_t toSplit=kFALSE);
36 virtual ~AliPHOSClusterizerv1() ;
38 virtual Int_t AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ;
39 // Checks if digits are in neighbour cells
41 virtual Float_t Calibrate(Int_t amp, Int_t absId)const ; // Tranforms Amp to energy
43 virtual void GetNumberOfClustersFound(int * numb )const{ numb[0] = fNumberOfEmcClusters ;
44 numb[1] = fNumberOfCpvClusters ; }
46 virtual Float_t GetEmcClusteringThreshold()const{ return fEmcClusteringThreshold;}
47 virtual Float_t GetEmcLocalMaxCut()const { return fEmcLocMaxCut;}
48 virtual Float_t GetEmcLogWeight()const { return fW0;}
49 virtual Float_t GetEmcTimeGate() const { return fEmcTimeGate ; }
50 virtual Float_t GetCpvClusteringThreshold()const{ return fCpvClusteringThreshold; }
51 virtual Float_t GetCpvLocalMaxCut()const { return fCpvLocMaxCut;}
52 virtual Float_t GetCpvLogWeight()const { return fW0CPV;}
53 virtual Float_t GetPurifyThreshold()const {return fPurifyThreshold; }
54 virtual const char * GetRecPointsBranch() const{ return GetName() ;}
55 virtual const Int_t GetRecPointsInRun() const {return fRecPointsInRun ;}
57 void Exec(Option_t *option); // Does the job
59 virtual void Print(Option_t * option)const ;
61 virtual void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
62 virtual void SetEmcLocalMaxCut(Float_t cut) { fEmcLocMaxCut = cut ; }
63 virtual void SetEmcLogWeight(Float_t w) { fW0 = w ; }
64 virtual void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate ;}
65 virtual void SetCpvClusteringThreshold(Float_t cluth) { fCpvClusteringThreshold = cluth ; }
66 virtual void SetCpvLocalMaxCut(Float_t cut) { fCpvLocMaxCut = cut ; }
67 virtual void SetCpvLogWeight(Float_t w) { fW0CPV = w ; }
68 virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) { fToUnfold = toUnfold ;}
69 virtual void SetPirifyThreshold(Float_t threshold) {fPurifyThreshold = threshold ;}
70 void SetCalibrVersion(const char* version = "v1",Int_t run=1) //Provides specification of calibrationData
71 {fCalibrVersion = version ; fCalibrRun = run ;}
72 void SetPatterns(TArrayS * pats){if(fPatterns) delete fPatterns ;
73 fPatterns = new TArrayS(*pats) ;}
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 virtual const char * Version() const { return "clu-v1" ; }
82 void WriteRecPoints(Int_t event) ;
83 virtual void MakeClusters( ) ;
84 virtual Bool_t IsInEmc (AliPHOSDigit * digit)const ; // Tells if id digit is in EMC
85 virtual Bool_t IsInCpv (AliPHOSDigit * digit)const ; // Tells if id digit is in CPV
90 const TString BranchName() const ;
91 void GetCalibrationParameters(void) ;
93 Bool_t FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy,
94 Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
96 void InitParameters() ;
98 virtual void MakeUnfolding() ;
99 void UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax,
100 AliPHOSDigit ** maxAt,Float_t * maxAtEnergy ) ; //Unfolds cluster using TMinuit package
101 void PrintRecPoints(Option_t * option) ;
105 Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
107 Int_t fEmcCrystals ; // number of EMC cristalls in PHOS
109 Bool_t fToUnfold ; // To perform unfolding
111 Int_t fNumberOfEmcClusters ; // number of EMC clusters found
112 Int_t fNumberOfCpvClusters ; // number of CPV clusters found
114 //Calibration parameters
115 AliPHOSCalibrationData * fPedestals ; //!
116 AliPHOSCalibrationData * fGains ; //!
117 TArrayS * fPatterns ;// Array of trigger patterns of events to handle
118 TString fCalibrVersion ; //Version of calibration Data
119 Int_t fCalibrRun ; //Specification of Calibration data
120 Float_t fADCchanelEmc ; // width of one ADC channel in GeV
121 Float_t fADCpedestalEmc ; //
122 Float_t fADCchanelCpv ; // width of one ADC channel in CPV 'popugais'
123 Float_t fADCpedestalCpv ; //
125 Float_t fPurifyThreshold ; // threshold for cell energies after unfolding
126 Float_t fEmcClusteringThreshold ; // minimum energy to include a EMC digit in a cluster
127 Float_t fCpvClusteringThreshold ; // minimum energy to include a CPV digit in a cluster
128 Float_t fEmcLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
129 Float_t fW0 ; // logarithmic weight for the cluster center of gravity calculation
130 Float_t fCpvLocMaxCut ; // minimum energy difference to distinguish local maxima in a CPV cluster
131 Float_t fW0CPV ; // logarithmic weight for the CPV cluster center of gravity calculation
132 Int_t fRecPointsInRun ; //! Total number of recpoints in one run
133 Float_t fEmcTimeGate ; // Maximum time difference between the digits in ont EMC cluster
135 ClassDef(AliPHOSClusterizerv1,2) // Clusterizer implementation version 1
139 #endif // AliPHOSCLUSTERIZERV1_H